Highlight a area with Google Maps JavaScript API v3

后端 未结 2 1768
小蘑菇
小蘑菇 2021-01-15 17:31

I want to highlight a area like on the image below which is taken from Google Maps. Is this possible to accomplish with the current version of their API (v3)? If yes, how?

2条回答
  •  别那么骄傲
    2021-01-15 18:27

    You need to know the vertices of the area and create a polygon based on them.

    But dashed strokes currently are not supported by polygons, if you require to have a dashed stroke you must create a sequence of polylines with different stroke-colors based on the vertices.

    A built-in method to highlight an area currently doesn't exist.

提交回复
热议问题