Google maps directions and area near route

蹲街弑〆低调 提交于 2019-12-01 13:32:07

问题


How I can do something like here in image with google map, Is anybody know ho to do this.

So here is directions and area near route directions (green opacity area)


回答1:


I would approach this by using the Directions API and getting lat/lng of each step.

I would then use the Polygons API to draw circles of a chosen radius, every x meters along a straight path following the steps.

EDIT:

A better solution would be to use the steps with a Polyline, and give it a sufficiently thick strokeWidth



来源:https://stackoverflow.com/questions/18514190/google-maps-directions-and-area-near-route

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!