On Feb 16, 10:08 am, jt <[email protected]> wrote:
> http://www.mexicoal.com/mymapstoolbar.html
>
> At the address above is a copy of the mymapstoolbar example, modified
> to support loading of polygons from external data. Click on the "load
> polygons" link to load two polys from a file.
>
> The loading part works ok, but deletion of vertices by clicking on
> them is not working as intended: Seems like the click event is being
> listened to by one poly, but a vertex is being deleted from the other
> poly.
>
> The goal is to have the click-vertex-to-delete behavior work normally
> for the polygons that are loaded, as it does for multiple polys drawn
> manually.
>
> Any ideas would be appreicated,

You are not getting function closure on the "poly" variable.  At the
end of the loop that adds polygons, it is left pointing to the last
one added.  The simplest change would be to add a function to hold the
closure, similar to what Mike Williams describes in this thread:
http://groups.google.com/group/Google-Maps-API/browse_frm/thread/96a7f7e3f43e3f18/47ba0423d2e9d3e7#47ba0423d2e9d3e7

But there are lots of ways to sove the problem.

  -- Larry
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" 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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to