I have been banging my head against the wall for the past few hours on
this one, hoping some of you with a little more experience may be able
to help me:

            private function setMarkers():void{

                        var count               :int = 0;
                        var loader              :SWFLoader;
                        var bounds              :LatLngBounds = new 
LatLngBounds();

                        map.clearOverlays();

                        for(var i:int = 0; i <  
Model.getInstance().spots.length; i++) {

                        loader = new SWFLoader();
                        
loader.load("http://localhost/Atmosphere_Frontsite/App_Common/SWF/
MapIconComponent.swf");

                        loader.addEventListener(Event.COMPLETE, function 
completeHandler
(event:Event):void{

                                        var spot                                
:SpotVO = Model.getInstance().spots[count];
                                        var timeline                    
:MovieClip = event.currentTarget.content;
                                        var markerOptions               
:MarkerOptions = new MarkerOptions;
                                        var latLon                              
:LatLng;

                                        timeline.arrowSpeed.direction.rotation 
= spot.dir;
                                        timeline.arrowSpeed.windSpeed.text = 
String(spot.avg);

                                        markerOptions.icon = 
timeline.arrowSpeed;
                                        markerOptions.hasShadow = false;

                                        latLon = new 
LatLng(Model.getInstance().spots[count].lat,
Model.getInstance().spots[count].lon);

                                        bounds.extend(latLon);

                                        var marker:Marker = new Marker(latLon, 
markerOptions);
                                        map.addOverlay(marker);

                                        count++;

                                });
                        }

                        map.setCenter(bounds.getCenter());
                        map.setZoom(map.getBoundsZoomLevel(bounds))

                }


Basicly, I need to zoom to the extents of the markers being added to
the map. From what I have read you have to add latLon to the bounds
object in a certain order? is this true?  Why wont this map center on
the bounds and set the zoom level properly? cant seem to figure out
why....

HELP!

Thanks
-Ryan
--~--~---------~--~----~------------~-------~--~----~
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