Google Maps - Create a polygon around existing mar

2019-02-27 10:56发布

I dont know if this is possible but I use a google map to plot out positions of entities via markers on an overlay. I would like to be able to create a polygon or some other sort of overlay object around all the created markers, highlighting the extent of the markers, sort of a catchment area diagram. I wont know before all the markers are retrieved from the database and mapped what the extent is.

Anyone have any ideas how to approach this..?

Thanks

1条回答
对你真心纯属浪费
2楼-- · 2019-02-27 11:24

I think you are looking for the Convex Hull of the points

In mathematics, the convex hull or convex envelope of a set X of points in the Euclidean plane or Euclidean space is the smallest convex set that contains X. For instance, when X is a bounded subset of the plane, the convex hull may be visualized as the shape enclosed by a rubber band stretched around X.

Example using the Google Maps API v3 on a random set of points

查看更多
登录 后发表回答