all files / lib/ lng2lat.js

88.89% Statements 8/9
87.5% Branches 7/8
100% Functions 2/2
87.5% Lines 7/8
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18            287× 186×   101× 247×        
"use strict";
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 Eif (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