When a map is created for the first time, the application freezes
(accepting no input and displaying no visual changes) until the map is
fully loaded. This problem seems more pronounced in larger projects
and especially in AIR projects. I have a project that displays a
progress bar, but the progress bar freezes (along with the rest of the
application) while loading a map.
Here is a sample application to illustrate the bug:
When I run this application the progress bar freezes at the 26% mark
for a few seconds. In a much larger AIR project, loading a map causes
the application to freeze for around 30 seconds.
<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication
xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:maps = "com.google.maps.*"
layout="vertical"
creationComplete="handleCreationComplete(event)">
<mx:Script>
<![CDATA[
import com.google.maps.Map;
protected function handleCreationComplete( event:Event
):void
{
progress.setProgress(0,50);
addEventListener(Event.ENTER_FRAME,onEnterFrame);
var timer:Timer = new Timer( 500 );
timer.addEventListener( TimerEvent.TIMER,
loadMap );
timer.start();
}
private function onEnterFrame(event:Event):void
{
progress.setProgress( progress.value + 1, 50);
if ( progress.value >= 50 )
{
removeEventListener(Event.ENTER_FRAME,onEnterFrame);
}
}
protected function loadMap(obj:*=null):void
{
var map:Map = new Map();
map.url = "your url";
map.key = "your key";
map.width = 500;
map.height = 500;
map.setStyle( 'verticalCenter', 0 );
map.setStyle( 'horizontalCenter', 0 );
addChild( map );
}
]]>
</mx:Script>
<mx:ProgressBar visible="true" id="progress" mode="manual"
width="300" top="10" horizontalCenter="0" fontWeight="normal"/>
</mx:WindowedApplication>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API For Flash" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-maps-api-for-flash?hl=en
-~----------~----~----~----~------~----~------~--~---