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 link http://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.
Bryan map.addOverlay(new GPolygon([new GLatLng(42.396998,-71.020695),new GLatLng(42.401497,-71.011494),new GLatLng(42.400797,-71.010094),new GLatLng(42.399697,-71.011994),new GLatLng(42.399297,-71.015594),new GLatLng(42.398097,-71.017794),new GLatLng(42.394597,-71.019294),new GLatLng(42.393197,-71.017694),new GLatLng(42.389261,-71.019849),new GLatLng(42.386798,-71.022595),new GLatLng(42.385197,-71.025994),new GLatLng(42.384697,-71.029494),new GLatLng(42.385597,-71.029594),new GLatLng(42.386097,-71.031095),new GLatLng(42.386697,-71.037095),new GLatLng(42.3865,-71.03915),new GLatLng(42.38536,-71.039563),new GLatLng (42.383297,-71.043295),new GLatLng(42.383197,-71.044295),new GLatLng (42.385297,-71.047295),new GLatLng(42.386297,-71.046295),new GLatLng (42.386897,-71.046195),new GLatLng(42.387897,-71.049195),new GLatLng (42.387497,-71.049695),new GLatLng(42.388197,-71.053195),new GLatLng (42.389197,-71.053195),new GLatLng(42.393196,-71.048095),new GLatLng (42.393707,-71.049131),new GLatLng(42.393471,-71.050002),new GLatLng (42.393996,-71.050395),new GLatLng(42.394896,-71.052095),new GLatLng (42.396196,-71.052995),new GLatLng(42.396996,-71.052495),new GLatLng (42.397596,-71.050695),new GLatLng(42.396596,-71.048195),new GLatLng (42.397996,-71.046195),new GLatLng(42.398299,-71.045493),new GLatLng (42.398797,-71.044796),new GLatLng(42.401797,-71.040596),new GLatLng (42.402196,-71.039995),new GLatLng(42.401097,-71.036696),new GLatLng (42.400797,-71.037296),new GLatLng(42.398196,-71.034295),new GLatLng (42.399896,-71.031495),new GLatLng(42.402596,-71.035195),new GLatLng (42.403296,-71.032995),new GLatLng(42.403596,-71.028595),new GLatLng (42.404196,-71.029495),new GLatLng(42.404496,-71.029595),new GLatLng (42.406496,-71.027195),new GLatLng(42.405896,-71.024895),new GLatLng (42.404702,-71.021066),new GLatLng(42.403996,-71.021394),new GLatLng (42.403496,-71.020994),new GLatLng(42.403596,-71.018894),new GLatLng (42.402396,-71.020394),new GLatLng(42.401196,-71.021694),new GLatLng (42.400796,-71.020994),new GLatLng(42.398797,-71.023494),new GLatLng (42.398197,-71.022994),new GLatLng(42.397597,-71.023994),new GLatLng (42.396597,-71.023094),new GLatLng(42.397798,-71.020495),new GLatLng (42.396998,-71.020695)],"#000000",0,0.0,"#ff0000",0.3)); map.setCenter(new GLatLng (42.3948465,-71.0316445),map.getBoundsZoomLevel(new GLatLngBounds(new GLatLng(42.383197,-71.053195),new GLatLng(42.406496,-71.010094)))); On Apr 6, 3:17 am, rdefonseka <[email protected]> wrote: > Thank for very much for your quick response. > > I have tried the GGEOXML parser. > > My map is at: > > http://online.thewest.com.au/maps/kml/index2.html > > I have tried to get a handle on the polygon object via the overlay but > I can't seem to find the right syntax using the click handler. > > I have tried to use EGeoXML but I can't seem to get the overlays to > display using the same kml as in the above page. > > http://online.thewest.com.au/maps/kml/egeo/index3.html > When I call parse() the map reverts back to the global page. > > Thanks again. > > On Apr 6, 2:13 pm, "[email protected]" <[email protected]> > wrote: > > > On Apr 5, 6:39 pm, rdefonseka <[email protected]> wrote: > > > > I search for an address on the map, and via the Geocoder get a point. > > > Is it possible to check if the point exists within an overlay on the > > > map. > > > Yes. One possible way:http://econym.org.uk/gmap/epoly.htm > > .Contains(latlng) > > > > I have defined several polygons using kml. > > > Please provide a link to the map under discussion. How you are adding > > the polygons to the map matters. > > > -- 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 -~----------~----~----~----~------~----~------~--~---
