Multple select "lasso tool" in Google maps API v3?

1,335 views
Skip to first unread message

RogerW

unread,
Oct 2, 2011, 8:53:43 AM10/2/11
to Google Maps JavaScript API v3
Hi
I'm kind of new to Google maps API v3. Quite easy to get yourself "on
the road", but i've run into a question i can't find any answers to.

Let's say i have a map with multiple geo locations.
I'd like to be able to select an number of these and get their
geolocations (Lat-long) when i close the "lasso" or whatever. These
locations are the used to create a text file conatning a "work-
order", so i have to have them in plain text.

Is this possible? If so: Can somebody give me a link on where do dig
deeper into this.

Best regards

Roger W, Sweden

xelawho

unread,
Oct 3, 2011, 2:18:20 AM10/3/11
to Google Maps JavaScript API v3
> Is this possible? If so: Can somebody give me a link on where do dig
> deeper into this.

definitely possible, and there may be someone who has done it already,
but I haven't seen it.

but it shouldn't be too hard to put together your own app, by cobbling
together the various bits from the examples:
http://code.google.com/apis/maps/documentation/javascript/examples/index.html

here's how I'd start:

- a click listener that collects clicked points on the map, pushes
them onto an array and then makes a polygon out of them (and then you
have to decide how to "close" the polygon)

- loop through the markers checking if each one is within the
boundaries of the polygon. this may be slightly trickier because the
only way the API can really do this is with rectangles, but assuming
you want the polygon to be whatever shape the user decides, there are
plenty of other point-in-polygon scripts out there. Searching this
group will lead to various posts on related topics.

Roger Waara

unread,
Oct 3, 2011, 4:44:53 AM10/3/11
to google-map...@googlegroups.com
Thank you for the hint. I'll look further into it.
As i wrote i'm a bit newbie fiddleing with maps, polygons and coordinates
 
Rgds Roger

2011/10/3 xelawho <xel...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
To post to this group, send email to google-map...@googlegroups.com.
To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.




--

=========================
Roger Waara
Reply all
Reply to author
Forward
0 new messages