我想知道给定的坐标(纬度和经度)是否在给定的 4 个坐标内。
即,如果我有 A、B、C、D 和 E 的纬度、经度,并且我想检查 E 是否在 A、B、C 和 E 之内。
我怎样才能做到这一点 ?
我试图从Google Map Coordinates LatLngBound 类中查看这个示例 - 包含。
我可以看到的例子就像
var bounds = new google.maps.LatLngBounds(
new google.maps.LatLng(54.69726685890506,-2.7379201682812226),
new google.maps.LatLng(55.38942944437183, -1.2456105979687226)
);
var center = bounds.getCenter(); // still returns (55.04334815163844, -1.9917653831249726)
var x = bounds.contains(center); // now returns true
它只有 2 个坐标,如 A&B。没有C&D的坐标怎么可能?