沿路线距起点特定距离的Google Maps API显示图标 [英] Google Maps API Display icon along route at a specific distance from start
问题描述
我想在Google地图上显示虚拟进度. 我想显示一条带有路线的地图,在那条路线上,我想从一开始就显示一个图标(该图标将根据数据进行计算).该距离可能会根据与虚拟路线的进度相关的数据而随时随地变化. 例如,在从洛杉矶到纽约的路线上,有一天我可能要在距起点772英里处显示一个图标.沿路线的距离可以以单位或百分比表示. 我已经看到了google.maps.IconSequence对象,但是看不到如何将其与DirectionsService一起使用.
I want to display virtual progress on a Google map. I want to display a map with a route and on that route I want to display an icon at some distance (that will be computed based on data) from the start. That distance could change from moment to moment or day to day depending on the data related to the progress along the virtual route. For instance on a route from LA to NY, one day I may want to display an icon at 772 miles from the start. The distance along the route can be in units or as a percentage. I have seen the google.maps.IconSequence object, but can't see how to use that with DirectionsService.
推荐答案
几个英里标记/公里标记"示例和一个动画标记:
A couple of "mile marker/kilometer marker" examples and an animated marker:
- every 2 km
- 2 markers at specific distances along a route
- An animated marker along a route
这篇关于沿路线距起点特定距离的Google Maps API显示图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!