On Jun 3, 7:01 pm, hypermod <[email protected]> wrote: > Your last paragraph makes a lot of sense but that is the whole point, > the marker somehow needs to know what polygon it is in in the first > place. That is the part I do not get. Perhaps you are assuming I > already knew how to determine this, which I do not. The polygon data > is geocoded. I do not want the user to have to manually type in what > polygon they think their marker is in when they add a marker (adding a > marker is on a seperate map). If I did not care about them having to > make this determination on their own then of course I would just > reference the db.
Oh: so users are adding markers? And their markers are added to the database? So: when the marker data reaches the server, find which polygon the point is in and add the polygon id to the marker record. Then it's easy to retrieve all markers for a polygon. Doing it that way round means that you have to loop through each polygon and ask "Is it in this one? Is it in this one?" so you need to store your polygons in an array instead of the markers. That can be done server-side, or it could be done client-side and the polygon id passed to the server with the marker data. In that case Mike's EPoly extension will be useful as that has a .contains() method and you don't need to write a server-side point-in-polygon analysis. http://www.econym.org.uk/gmap/epoly2.htm Andrew --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
