You attempt to load v2.81, but the oldest release now available is
v2.140.

In v2.81 it was legal to remove nonexistent overlays, but in v2.140 it
isn't.

What happens is that if the user creates a sand trap with 6 points, you
add a 7th point to the polygon and to your array, but there's still only
the six markers that the user has created. The code in addClosing()
attempts to remove 7 markers, one for each point in the array.

     for (var n = 0 ; n < routePoints[lineIx].length ; n++ ) {
       map.removeOverlay(routeMarkers[lineIx][n]);
     }

but the extra point that you added to close the polygon doesn't have a
marker, and the attempt to remove it crashes.

-- 
Mike Williams
http://econym.org.uk/gmap



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to Google-Maps-API@googlegroups.com
To unsubscribe from this group, send email to 
google-maps-api+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to