Standard JavaScript array methods/operations won't work on MVCArrays. Try:
while(points.getLength() > 0) points.pop(); Chad Killingsworth On Jun 15, 11:48 am, Nathan Raley <[email protected]> wrote: > Your second one is what I use to clear mine out. > > On Tue, Jun 15, 2010 at 11:44 AM, Jason Sanford <[email protected]>wrote: > > > > > Just a quick guess but would this work: > > > myMvcArray.forEach(function(item,index){ > > myMvcArray.removeAt(index); > > }); > > > If not how about: > > > for (i=0;i<myMvcArray.getLength();i++){ > > myMvcArray.removeAt(i); > > } > > > I don't know if these work but glancing at the docs ( > >http://code.google.com/apis/maps/documentation/javascript/reference.h...) > > that's what I would guess. > > > On Tue, Jun 15, 2010 at 12:29 PM, Pil <[email protected]> wrote: > > >> On Jun 15, 6:05 pm, Nathan Raley <[email protected]> wrote: > >> > Did you try points = [];? > > >> Yes, this doesn't work when I say > > >> poly.setPath(points); > > >> i.e. no polyline will appear. When I use a MVCArray all works well. > >> The MVCArray should be shared alternately between a Polyline and a > >> Polygon. This all works well - but I found no way to set the elements > >> of the MVCArray to 0. > > >> -- > >> 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%2B > >> [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]<google-maps-js-api-v3%2B > > [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.
