With Google Maps API V3, determine if a marker is inside a KML Layer boundary

后端 未结 4 977
情话喂你
情话喂你 2021-02-02 04:10

Is there a way to determine if a marker has entered an area covered by a KmlLayer? My .kml is mostly made up of a with a bunch of coordinates that

4条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-02 04:26

    There is no such function on KmlLayer. However, if you can extract the polygon boundaries, and create a polygon you can use the Geometry library of the Maps API to determine if the point lies inside the polygon: https://developers.google.com/maps/documentation/javascript/reference#poly

提交回复
热议问题