简体   繁体   English

Google Maps V3:仅在街道上标记?

[英]Google Maps V3: Markers only on streets?

User should be able to place markers on a google map but only on streets. 用户应该能够在Google地图上放置标记,但只能在街道上放置标记。 Is this possible? 这可能吗?

Google is your friend: Google是您的朋友:

http://econym.org.uk/gmap/snap.htm http://econym.org.uk/gmap/snap.htm

The basics of the solution is to ask for directions from the marker to itself. 解决方案的基础是要求从标记到自身的方向。 Google will return directions via streets, which will happen to be a single point on the nearest street. Google会通过街道返回路线,而该路线恰好是最近街道上的一个点。

Update the marker location accordingly. 相应地更新标记位置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM