Extending Bounds For Polygons — Google Maps V3 Javascript API

前端 未结 1 336
轻奢々
轻奢々 2021-01-14 16:58

My goal is to detect if a marker is within an oddly shaped polygon object (think 25 different points). I have noticed that the LatLngBounds property, only contains two se

相关标签:
1条回答
  • 2021-01-14 17:58

    The bounds of a polygon is a rectangle. If you want to detect if a marker is in the polygon use the containsLocation function in google.maps.geometry.poly namespace, passing it the polygon and the position of the marker

    containsLocation(point:LatLng, polygon:Polygon) | boolean | Computes whether the given point lies inside the specified polygon.

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