Hi Jon-

The general concept looks correct.

Have you put a trace to make sure that your markerArray has a non-0
length and that the for loop actually iterates? Perhaps there was a
problem with scope of the array variable.

If you post a zip with all of the code, then I can try it out and
investigate further.

- pamela

On Mon, Sep 22, 2008 at 11:14 AM, Jon_Fuel <[EMAIL PROTECTED]> wrote:
>
> Hi All,
>
> I'm trying to add markers and remove them based on the zoom level of
> the map.
>
> Basically my code is as follows (within the class MyMap which extends
> Map)
>
>
> //This function adds a marker to the map and stores a reference to it
> in the markerArray which a class variable
> public function addMyMarker(_lat:String, _lon:String):void {
>
>        var latlng:LatLng = new LatLng(Number(_lat), Number(_lon));
>
>        var tMarker:MyMarker = new MyMarker(latlng);
>        addOverlay(tMarker);
>        markerArray.push(tMarker);
> }
>
> Then i have this function to remove the markers:
>
> //This function removes all markers that are in the array and then
> reinitializes the array
> public function removeMarkers():void {
>
>        for (var b in markerArray) {
>             removeOverlay(markerArray[b]);
>        }
>        markerArray = new Array();
> }
>
>
> When i call the removeMarkers function, nothing happens.
>
> Any ideas?
>
> Thanks,
> Jon
>
> >
>

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