@jmarcelof/leaflet-ng2
Version:
Angular2 module for Leaflet
18 lines • 630 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Function to convert from Lng-Lat format from geoJSON to LatLng on Leaflet
*/
/* tslint:disable:max-line-length */
function lng2lat(position) {
/* tslint:enable */
if (position.length > 0 && typeof position[0] === "number") {
return [position[1], position[0]];
}
else if (position.length && Array.isArray(position)) {
return position.map(function (elem) { return lng2lat(elem); });
}
throw new Error("Can not convert the given coordinates");
}
exports.lng2lat = lng2lat;
//# sourceMappingURL=lng2lat.js.map