Point in Polygon adventures

146 views
Skip to first unread message

PhilR8

unread,
Nov 12, 2010, 3:14:04 PM11/12/10
to Google Maps JavaScript API v3
Attempting to recreate functionality in v3 that I somehow got to work
in my v2 map: basically, clicking on a polygon would show all markers
located within that polygon.

I've been using this point-in-polygon code:

https://github.com/tparkin/Google-Maps-Point-in-Polygon

and have come up with this map:

http://pages.towson.edu/preese/campusmapv3/test/two_states_click.html

Right now, if you click on Alabama, the point for Arkansas will become
visible. If you click on Arkansas, it'll throw up an error. What I
want is when Arkansas is clicked, the Arkansas marker becomes visible,
and when Alabama is clicked, the marker for Alabama becomes visible.

The script from github doesn't have an example so I'm fumbling my way
through this. Any thoughts?

geoco...@gmail.com

unread,
Nov 12, 2010, 6:03:05 PM11/12/10
to Google Maps JavaScript API v3
Have you seen these examples?
http://www.geocodezip.com/geoxml3_test/v3_collection-map2e.html
http://www.geocodezip.com/geoxml3_test/votemap_sidebar.html

I use a version of Mike Williams' epoly library that I ported to v3.

-- Larrry

PhilR8

unread,
Nov 15, 2010, 10:00:10 AM11/15/10
to Google Maps JavaScript API v3
What I'm looking to do is: if the polygon is clicked, all markers in
the polygon become visible.

On Nov 12, 6:03 pm, "geocode...@gmail.com" <geocode...@gmail.com>
wrote:
> On Nov 12, 12:14 pm, PhilR8 <phi...@gmail.com> wrote:
>
>
>
>
>
>
>
>
>
> > Attempting to recreate functionality in v3 that I somehow got to work
> > in my v2 map: basically, clicking on a polygon would show all markers
> > located within that polygon.
>
> > I've been using this point-in-polygon code:
>
> >https://github.com/tparkin/Google-Maps-Point-in-Polygon
>
> > and have come up with this map:
>
> >http://pages.towson.edu/preese/campusmapv3/test/two_states_click.html
>
> > Right now, if you click on Alabama, the point for Arkansas will become
> > visible.  If you click on Arkansas, it'll throw up an error.  What I
> > want is when Arkansas is clicked, the Arkansas marker becomes visible,
> > and when Alabama is clicked, the marker for Alabama becomes visible.
>
> > The script from github doesn't have an example so I'm fumbling my way
> > through this.  Any thoughts?
>
> Have you seen these examples?http://www.geocodezip.com/geoxml3_test/v3_collection-map2e.htmlhttp://www.geocodezip.com/geoxml3_test/votemap_sidebar.html

PhilR8

unread,
Nov 18, 2010, 2:35:42 PM11/18/10
to Google Maps JavaScript API v3
I finally saw the light:

http://pages.towson.edu/preese/campusmapv3/test/two_states_click.html

On Nov 15, 10:00 am, PhilR8 <phi...@gmail.com> wrote:
> What I'm looking to do is: if the polygon is clicked, all markers in
> the polygon become visible.
>
> On Nov 12, 6:03 pm, "geocode...@gmail.com" <geocode...@gmail.com>
> wrote:
>
>
>
>
>
>
>
> > On Nov 12, 12:14 pm, PhilR8 <phi...@gmail.com> wrote:
>
> > > Attempting to recreate functionality in v3 that I somehow got to work
> > > in my v2 map: basically, clicking on a polygon would show all markers
> > > located within that polygon.
>
> > > I've been using this point-in-polygon code:
>
> > >https://github.com/tparkin/Google-Maps-Point-in-Polygon
>
> > > and have come up with this map:
>
> > >http://pages.towson.edu/preese/campusmapv3/test/two_states_click.html
>
> > > Right now, if you click on Alabama, the point for Arkansas will become
> > > visible.  If you click on Arkansas, it'll throw up an error.  What I
> > > want is when Arkansas is clicked, the Arkansas marker becomes visible,
> > > and when Alabama is clicked, the marker for Alabama becomes visible.
>
> > > The script from github doesn't have an example so I'm fumbling my way
> > > through this.  Any thoughts?
>
> > Have you seen these examples?http://www.geocodezip.com/geoxml3_test/v3_collection-map2e.htmlhttp:/...
Reply all
Reply to author
Forward
0 new messages