UNPKG

@enonic/mock-xp

Version:

Mock Enonic XP API JavaScript Library

30 lines (29 loc) 857 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.GeoPoint = void 0; var tslib_1 = require("tslib"); var GeoPoint = (function () { function GeoPoint(_a) { var lat = _a.lat, lon = _a.lon; this.lat = lat; this.lon = lon; } GeoPoint.fromString = function (v) { var _a = tslib_1.__read(v.split(','), 2), lat = _a[0], lon = _a[1]; return new GeoPoint({ lat: parseFloat(lat), lon: parseFloat(lon) }); }; GeoPoint.prototype.getLatitude = function () { return this.lat; }; GeoPoint.prototype.getLongitude = function () { return this.lon; }; GeoPoint.prototype.toString = function () { return "".concat(this.lat, ",").concat(this.lon); }; return GeoPoint; }()); exports.GeoPoint = GeoPoint;