Thanks, Mike. I can handle the map.addOverlay line programatically. If
I need to reformat the data coming in for the shape, I can do it. I
just don't know what exactly to reformat and which coordinates to put
where.

(The reason is: I don't make calls to the API when a visitor clicks a
button. There's too much data. Instead, I process the addresses in
batches as they come in and tag addresses according to what political
districts they are in. Then when a visitor says, 'show me all the
points in Congressman X's district', it queries my database and plots
the points. There is no interaction with APIs at this step.)

Would anyone be willing to post some code, or be willing to use
coordinates from my earlier post, and show how they would be correctly
used in poly.Contains(latlng) from http://econym.org.uk/gmap/epoly.htm?

To state the obvious, I'm still pretty new to this. Thanks for your
help.

Again, my website is: http://mapsforamerica.com/ .

- Bryan


On Apr 14, 2:36 am, Mike Williams <[email protected]> wrote:
> Wasn't it bryan who wrote:
>
>
>
> >I have a similar question. I have a website with a bunch of geocoded
> >locations (mapsforamerica.com). I want to be able to check and see
> >whether a point is located in a polygon. The polygon comes from an API
> >I'm using that returns a shape like this (below). I looked at Larry's
> >linkhttp://econym.org.uk/gmap/epoly.htm. I think the answer is there.
> >But I couldn't figure out exactly how to make it work. Any suggestions
> >would be greatly appreciated.
>
> You need to persuade your "API" to separate the creation of the polygon
> from the addOverlay
>
> var poly = new GPolygon(...);
> map.addOverlay(polygon);
>
> Then you can use poly.Contains(latlng)
>
> The way your code works at the moment, you don't have a reference to the
> polygon, and there's no way to obtain such a reference from the Maps
> API.
>
> --http://econym.org.uk/gmap
> The Blackpool Community Church Javascript Team

--~--~---------~--~----~------------~-------~--~----~
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