开发者

How can I "preload" the Google Maps API in a FLEX 3.5 TabNavigator Tab?

I have a Flex 3.5 Air Application; The main window has, besides the header, a TabNavigator. In a Tab, I've put a Google Maps object. It works fine, except that it "loads" very slow and the whole application freezes ( not responding problem ).

Now I would like to fix that but don't really now how to implement one of these solutions: 1) Load the API before the whole application loads. 2) Load the API somehow async, when the tab is clicked. I don't really need a fancy preloader, it's enough that my app doesn't freeze.

Please note that I'm "110%" sure that it's the GoogleMaps's fault since the tab canvas is empty, and no other code is there [double checked that]. Also please note that the map only loads, then I call the setCenter method, so no other operations that could freeze it.

EDIT: I managed to determine that not the Api Object creation is slow, but the actual display of it on the GUI. Here's the line of code. ResellersMapClass only extends the Google Maps API class since I intend to add there extra functionality. But right now is clean.

this.map = new ResellersMapClass()开发者_如何转开发;
//between here
this.mapContainer.addChild( this.map  );
//and here

Now is there a way to preload this ? Or any other solution that will prevent the GUI from freezing.

Thanks, Gabriel


I had the same problem with the Yahoo! map API. I ended up just dropping it in a module and gave it a ProgressBar for the load. That should help with the async issues at least. If the problem is a heavy algorithm in the library, there is no way around that until flash rolls out true multi-threading (crosses fingers).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜