How to select a road on Google Map?

59 views
Skip to first unread message

linh vo thi thuy

unread,
Feb 6, 2012, 10:15:27 AM2/6/12
to google-map...@googlegroups.com
Hi all,
I have a problem with google map. Hope you guys can help me.
Is there any way to detect a position belongs to which road and draw that path/direction?

All I want is when I click on a position, the road contains that position will be hightlight.

It is the same as the method "Edit -> Select Roads Segment" in Goolge Map Maker.

Thanks,

Rossko

unread,
Feb 6, 2012, 2:56:12 PM2/6/12
to Google Maps JavaScript API v3
> I have a problem with google map. Hope you guys can help me.
> Is there any way to detect a position belongs to which road and draw that
> path/direction?

First, create a database of all the things you might call "roads" in
your area of interest.
(or find one, such as OpenStreetMap's). Google don't give you this
kind of access to their data via the API.

You can actually find the nearest road to click with reasonable ease
and accuracy. The technique is shown here
http://econym.org.uk/gmap/snap.htm
- but -
getting the extent of that road is not so easy.

Also bear in mind, it may not be possible for humans to agree on just
what constitutes the length of some 'road' - all of the Silk Road from
end to end, with all its branches? Or just the length from 'here' to
the next junction or dead end in either direction? You'll need to be
clear about what you want.
Reply all
Reply to author
Forward
0 new messages