Drawing manager - Snap to road option

1,643 views
Skip to first unread message

MymsMan

unread,
Dec 22, 2011, 9:46:57 AM12/22/11
to google-map...@googlegroups.com
In the web UI the line drawing tool has a Snap to road option which makes following the curves of a road a lot simpler than having to add a point at each bend.

Are there any plans to add this functionality to the API drawing manager for polylines?

It would also be a useful option for polygons which are bounded by roads.

Ideally it would also be nice to be able to Snap to footpaths, rivers, railroads, boundaries etc.

Marcelo

unread,
Dec 22, 2011, 1:28:00 PM12/22/11
to Google Maps JavaScript API v3
On Dec 22, 7:46 am, MymsMan <bobbux...@gmail.com> wrote:
> Are there any plans to add this functionality to the API drawing manager
> for polylines?

Google never announce their plans in advance, but I hope that the
answer is "No".
Snap to road is quite simple to implement by yourself and there's no
need to bloat the API code with a feature that only 1/1000 will use.
All you need to do is to get directions between that last two points
added and the routing engine will automatically return a point that is
on the nearest road, which you can then use to modify the position of
the marker and/or polyline.

--
Marcelo - http://maps.forum.nu
--

ora726

unread,
Dec 23, 2011, 3:55:47 AM12/23/11
to Google Maps JavaScript API v3
Hi Marcelo,

Contrary to you I hope they do add this feature, and Google has no
need to bloat the code as they have already started using libraries
that can be loaded on request, so if you don't need the code, you
don't load it.
MymsMan question is non trivial and has it's applications in some
scenarios, You can not really use the getdirection solution if you are
implementing a solution that follow the GPS coordinate for an extended
amount of time because doing so would lead to overuse of the
getdirection quota of google. So the solution would be somehow to
detect the nearest road once, somehow find the two extremity of the
nearest straight length of that road and stick to it until an other
road get nearer and do again a getdirection. First I don't even know
if this is possible, and second, talk about bloated code in the web
page.
Would you have a better solution to this problem ?
Cheers
-R


On Dec 22, 7:28 pm, Marcelo <marcelo...@hotmail.com> wrote:
> On Dec 22, 7:46 am, MymsMan <bobbux...@gmail.com> wrote:
>
> > Are there any plans to add this functionality to the API drawing manager
> > for polylines?
>
> Google never announce their plans in advance, but I hope that the
> answer is "No".
> Snap to road is quite simple to implement by yourself and there's no
> need to bloat the API code with a feature that only 1/1000 will use.
> All you need to do is to get directions between that last two points
> added and the routing engine will automatically return a point that is
> on the nearest road, which you can then use to modify the position of
> the marker and/or polyline.
>
> --
> Marcelo -http://maps.forum.nu

MymsMan

unread,
Dec 23, 2011, 6:03:02 PM12/23/11
to google-map...@googlegroups.com
I have raised feature request 3824 http://code.google.com/p/gmaps-api-issues/issues/detail?id=3824 including a link to this thread

Rossko

unread,
Dec 23, 2011, 6:24:08 PM12/23/11
to Google Maps JavaScript API v3
> So the solution would be somehow to
> detect the nearest road once, somehow find the two extremity of the
> nearest straight length of that road and stick to it until an other
> road get nearer and do again a getdirection.

Bear in mind that what you're asking for is "please change my GPS
track data and make some of it up" I agree that that can sometimes be
desireable for cosmetic reasons, but equally many folk won't want
doctored and made-up data on their maps purporting to be a GPS track
(which it isn't any more).

As you say, implementing this yourself is quite feasible but could
fall foul of Directions service limits and quotas.
If Google were to implement the enhancement suggestion, the behind the
scenes mechanism would have to be a very similar AJAX service - we
might foresee Google applying limits to that use of their resources
too, that would be reasonable for say a drawing tool given the speed
of drawing by hand.

'Abusing' such a service by using it to _automatically_ prettify a GPS
track log could then still fall foul of usage limits and not get you
anywhere in the end. Just saying, be careful what you wish for.
Reply all
Reply to author
Forward
0 new messages