How can I preload the Google Maps API in TabNavigator FLEX 3.5?
I have a Flex 3.5 Air Application; The main window contains, in addition to the title, a TabNavigator. In the tab I have placed the Google Maps object. It works fine, except that it "loads" very slowly and the whole application hangs (unresponsive to the problem).
Now I would like to fix this, but I don't know how to implement one of these solutions: 1) Load the API before loading the whole application. 2) Load the API somehow async when the tab is clicked. I don't really need a fancy preloader, just enough to keep my app from freezing.
Note that I am "110%" sure this is a GoogleMaps bug as the tab canvas is empty and no other code exists [double checked this]. Also note that the map is only being loaded, then I call the setCenter method, so there were no other operations that could freeze it.
EDIT: I was able to determine that it is not the creation of the Api object that is slow, but the actual display of it in the GUI. Here is a line of code. ResellersMapClass extends the Google Maps API class as I intend to add additional functionality there. But it's clean now.
this.map = new ResellersMapClass();
//between here
this.mapContainer.addChild( this.map );
//and here
Now is there a way to preset this? Or any other solution that will prevent the GUI from freezing.
Thanks, Gabriel
a source to share
I had the same problem with Yahoo! Map API. I ended up just dropping it into a module and giving it a ProgressBar to load. This should help at least for asynchronous problems. If the problem is a tricky algorithm in the library, there is no way around it until Flash outputs true multithreading (fingers crossed).
a source to share