like this should work

     function clearLocations() {
         for (i in markersArray)
              markersArray[i].setMap(null);
         markersArray = new Array()
       }

if you post your map code we can help you more

2010/8/6 morningstar <[email protected]>

> the map is still in my localhost not online yet.But I'm making
> arrangement to upload it.
> I think the markersArray is in scope, cause its  a global variable and
> works in other functions like the one to bring in initial markers on
> the map.
> I also tried the other suggestions still not working.
>
> On Aug 5, 4:22 pm, "[email protected]" <[email protected]>
> wrote:
> > On Aug 5, 5:00 am, morningstar <[email protected]> wrote:
> >
> > > I'm working on a small map app and when i try to remove markers on the
> > > map that i had placed earlier, with the following function;
> >
> > >         function clearLocations() {
> > >           for (i in markersArray) {
> > >           markersArray[i].setMap(null);
> > >           }
> > >         markersArray.length = 0;
> > >         }
> >
> > > I get the error markersArray[i].setMap is not a function and  the
> > > markers are still on the map.Help will be appreciated.
> >
> > More context please.  Preferably a link to your map that exhibits the
> > error.  The most likely cause of your problem is that the markersArray
> > is not in scope.
> >
> >   -- Larry
> >
> >
> >
> > > Thanks
>
> --
> 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