No you can have multiple arrays for markers.  It sounds like a scope issue
or that you didn't pass the marker to the array properly, but can't tell you
for sure since you haven't provided a link yet.

Check your code and make sure that your markers2 array is accessible in the
scope for which you are calling setMap(null) for the marker, that you pushed
the marker object into the array correctly, and finally check that you are
accessing the right position in the array when you are calling the setMap
function for the marker2 array.

On Tue, Sep 28, 2010 at 9:03 AM, Mr BoDangles <[email protected]>wrote:

> Hi there,
>
> I have three arrays which store my markers...
>
> I setMap(map) for all the markers then push into the corresponding
> array.
>
> Now. only the first array the marker[i].setMap(null); actually takes
> the marker away from the map
>
> when i try marker2[i].setMap(null) i get this...
>
> Uncaught TypeError: Cannot call method 'setMap' of undefined..
>
>
> and the marker doesnt dissapear from the screen...
>
> why is that? is only one array allowed to store all markers?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Maps JavaScript API v3" group.
> To post to this group, send email to
> [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-maps-js-api-v3%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-maps-js-api-v3?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" 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-js-api-v3?hl=en.

Reply via email to