Hi, ptrk,
I have reproduced this problem and we will fix it in the next release
of the API (it is related to calling the setSize() method and
potentially addControl() as well).
For now, as a workaround, you could set the size of the map from
either the handler for the MAP_READY or MAP_PREINITIALIZE events.
That way you will avoid the problem.
Thanks.
Dmitri.
On Nov 26, 3:29 am, ptrk <[EMAIL PROTECTED]> wrote:
> hello,
>
> I used to have this issue with Flex too, but 1.7 was the cure.
> Now I'm stuck with Flash project, where after first successful
> instantiation of Map class and after MAP_READY, no subsequent
> instances would appear. To reproduce the problem you might try
> pasting the code below into a first frame of a clean Flash AS3
> project.
> You obviously need the GM component in the library. :)
> After you run it, each click will spawn a Map object. If you are
> quick, you may get quite a few of them. Otherwise, after the first one
> initializes, no more would follow. Any clues much appreciated.
>
> import com.google.maps.LatLng;
> import com.google.maps.Map;
> import com.google.maps.MapEvent;
> import com.google.maps.MapType;
> import flash.events.MouseEvent;
>
> var mapN:int = 0;
> stage.addEventListener(MouseEvent.CLICK, makeAnother);
> function makeAnother(e:MouseEvent):void
> {
> makeMap(mapN);
> mapN++;
>
> }
>
> functionmakeMap(n:int){
> var map:Map = new Map();
> map.key =
> "===yourkey====";
> map.setSize(new Point(stage.stageWidth * 0.3, stage.stageHeight));
> map.addEventListener(MapEvent.MAP_READY, onMapReady);
> this.addChild(map);
> map.x = stage.stageWidth * 0.3 * n;
>
> }
>
> function onMapReady(e:MapEvent):void {
> e.target.setCenter(new LatLng(50.736072,17.992062), 14,
> MapType.SATELLITE_MAP_TYPE);
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---