Using AIR, any maps created after the first map loaded will only
function correctly if they are inside of the same window as the first
map loaded.  Any maps that are added to windows other than the first
window will not drag and the map controls do not work.  This is a bug
when using the map_flex_1_16.swc file.  When using the 1.9 flex swc
this works correctly.

To reproduce:
Create a window and add a map as a child of that window.
Create a second window and add a map as a child of the new window.
The child in the second window will not function properly.

If the unload() method is called on a map opened in the first window
and then a new map is added to a different window, only maps opened in
the most recent window will work correctly.

Here is a sample application to illustrate the bug.  Open the
application and click on 'Open'.  Once the second window has opened
and the map is loaded, click on 'Create' in the first window; the new
map in the original window will not function properly.  You can
reverse the process by clicking on 'Create' in the first window and
then clicking on 'Open'; the map in the new window will not function
properly.

<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication
        xmlns:mx="http://www.adobe.com/2006/mxml";
        xmlns:maps = "com.google.maps.*"
        layout="vertical" horizontalAlign="center"
        width="600" height="600">

        <mx:Script>
                <![CDATA[
                        import flash.events.TimerEvent;
                        import flash.utils.Timer;
                        import com.google.maps.Map;
                        import mx.core.Window;
                        import com.google.maps.controls.ControlPosition;
                        import com.google.maps.controls.MapTypeControl;
                        import com.google.maps.controls.ZoomControl;
                        import com.google.maps.controls.ZoomControlOptions;

                        private static const MAP_URL:String = "your url";
                        private static const MAP_KEY:String = "your key";

                        private var win2:Window;

                        private function doOpen():void
                        {
                                if ( win2 )
                                {
                                        doClose();
                                }

                                win2 = new Window();
                                win2.width = 200;
                                win2.height = 200;

                                        var map:Map = new Map();
                                        map.url = MAP_URL;
                                        map.key = MAP_KEY;
                                        win2.addChild( map );

                                win2.open();
                        }

                        private function doClose():void
                        {
                                if ( win2 )
                                {
                                        (win2.getChildAt(0) as Map).unload();
                                        win2.removeAllChildren();
                                        win2.close();
                                        win2 = null;
                                }
                        }

                        private function doCreate():void
                        {
                                var map:Map = new Map();
                                map.url = MAP_URL;
                                map.key = MAP_KEY;
                                this.addChildAt( map, 0 );
                        }
                ]]>
        </mx:Script>

        <mx:Button label="OPEN" click="doOpen()"/>
        <mx:Button label="CLOSE" click="doClose()"/>
        <mx:Button label="CREATE" click="doCreate()"/>

</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
-~----------~----~----~----~------~----~------~--~---

Reply via email to