nativescript-mapbox-enduco
Version:
Native Maps, by Mapbox.
21 lines (20 loc) • 666 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.GeoUtils = void 0;
var GeoUtils = (function () {
function GeoUtils() {
}
GeoUtils.isLocationInCircle = function (lng, lat, circleLng, circleLat, circleRadius) {
var ky = 40000 / 360;
var kx = Math.cos(Math.PI * circleLat / 180.0) * ky;
var dx = Math.abs(circleLng - lng) * kx;
var dy = Math.abs(circleLat - lat) * ky;
var distance = Math.sqrt(dx * dx + dy * dy);
if (distance < circleRadius / 1000) {
return true;
}
return false;
};
return GeoUtils;
}());
exports.GeoUtils = GeoUtils;
;