Answers for "how to know if a lat/lng falls within another lat/lng"

0

how to know if a lat/lng falls within another lat/lng

function arePointsNear(point1, point2) {
    var sw = new google.maps.LatLng(point2.lat() - 0.005, point2.lng() - 0.005);
    var ne = new google.maps.LatLng(point2.lat() + 0.005, point2.lng() + 0.005);
    var bounds = new google.maps.LatLngBounds(sw, ne);
    if (bounds.contains (point1))
    	return true;


    return false;
}
Posted by: Guest on January-13-2021

Browse Popular Code Answers by Language