以下是我想要的结果

我想知道的是:
我使用中心点lat lang和它周围的半径创建了圆.现在我想知道,如果你可以在Javascript中给我代码示例,如何检查(计算)纬度和经度是否在该区域内部或外部我将不胜感激.我正在使用Google Maps API V3.
我找到了这个功能,但没有像我预期的那样工作:
function arePointsNear(checkPoint, centerPoint) {
var sw = new google.maps.LatLng(centerPoint.lat() - 0.005, centerPoint.lng() - 0.005);
var ne = new google.maps.LatLng(centerPoint.lat() + 0.005, centerPoint.lng() + 0.005);
var bounds = new google.maps.LatLngBounds(sw, ne);
if (bounds.contains (checkPoint)){
return true;
}
return false;
}
Run Code Online (Sandbox Code Playgroud)
任何帮助都会很棒..提前感谢!!