UNPKG

@mint-ui/map

Version:

- React map library - Control various map with one interface - Google, Naver, Kakao map supported now - Typescript supported - Canvas marker supported

93 lines (69 loc) 1.78 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var tslib = require('tslib'); var polygon = require('../core/util/polygon.js'); var MapTypes = require('./MapTypes.js'); var Drawable = /** @class */ function () { function Drawable() {} return Drawable; }(); var Marker = /** @class */ function (_super) { tslib.__extends(Marker, _super); /** * 지도에 표시할 마커정보 */ function Marker(options) { var _this = _super.call(this) || this; _this.options = options; return _this; } return Marker; }(Drawable); var Polyline = /** @class */ function (_super) { tslib.__extends(Polyline, _super); /** * 지도에 표시할 폴리곤정보 */ function Polyline(options) { var _this = _super.call(this) || this; _this.options = options; return _this; } return Polyline; }(Drawable); var Polygon = /** @class */ function (_super) { tslib.__extends(Polygon, _super); /** * 지도에 표시할 폴리곤정보 */ function Polygon(options) { var _this = _super.call(this) || this; _this.options = options; return _this; } /** * 폴리곤의 중점을 구한다. */ Polygon.prototype.getCenter = function () { if (Array.isArray(this.options.position) && this.options.position.length > 0) { var paths = this.options.position.map(function (elem) { return elem instanceof MapTypes.Position ? elem : new MapTypes.Position(elem[0], elem[1]); }); return polygon.PolygonCalculator.getCenter(paths); } throw new Error('center 를 찾을 수 없습니다.'); }; return Polygon; }(Drawable); exports.Drawable = Drawable; exports.Marker = Marker; exports.Polygon = Polygon; exports.Polyline = Polyline;