Google Maps API V3 -> Utilize MarkerCluster but have the clusters themselves be specific to a drawn polygon/region?

后端 未结 1 487
不思量自难忘°
不思量自难忘° 2021-01-07 15:15

Ok, let me preface this question with the fact that I have created a lot of google maps, but they have been strictly markers and polylines denoting routes and a couple with

相关标签:
1条回答
  • 2021-01-07 15:55

    It can be done, but will require a rewrite of the MarkerClusterer (probably will simplify it).

    You will need to determine how you are going to represent and load the cluster boundary polygons (KML, GeoJSON, native Google Maps API v3 polygons) and probably use the google.maps.geometry.poly.containsLocation(point:LatLng, polygon:Polygon) instead of LatLngBounds.contains to determine which cluster "owns" a marker.

    0 讨论(0)
提交回复
热议问题