@mint-ui/map 0.1.1-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +110 -0
- package/LICENSE +21 -0
- package/README.md +15 -0
- package/dist/components/mint-map/MintMap.d.ts +81 -0
- package/dist/components/mint-map/MintMap.js +206 -0
- package/dist/components/mint-map/MintMap.module.scss.js +13 -0
- package/dist/components/mint-map/core/MintMapController.d.ts +32 -0
- package/dist/components/mint-map/core/MintMapController.js +56 -0
- package/dist/components/mint-map/core/MintMapCore.d.ts +3 -0
- package/dist/components/mint-map/core/MintMapCore.js +69 -0
- package/dist/components/mint-map/core/MintMapCore.module.scss.js +13 -0
- package/dist/components/mint-map/core/advanced/MapBuildingProjection.d.ts +15 -0
- package/dist/components/mint-map/core/advanced/MapBuildingProjection.js +173 -0
- package/dist/components/mint-map/core/hooks/MarkerMovingHook.d.ts +6 -0
- package/dist/components/mint-map/core/hooks/MarkerMovingHook.js +145 -0
- package/dist/components/mint-map/core/index.d.ts +7 -0
- package/dist/components/mint-map/core/provider/MintMapProvider.d.ts +8 -0
- package/dist/components/mint-map/core/provider/MintMapProvider.js +30 -0
- package/dist/components/mint-map/core/util/animation.d.ts +16 -0
- package/dist/components/mint-map/core/util/animation.js +70 -0
- package/dist/components/mint-map/core/util/calculate.d.ts +29 -0
- package/dist/components/mint-map/core/util/calculate.js +167 -0
- package/dist/components/mint-map/core/util/waiting.d.ts +1 -0
- package/dist/components/mint-map/core/wrapper/MapControlWrapper.d.ts +11 -0
- package/dist/components/mint-map/core/wrapper/MapControlWrapper.js +77 -0
- package/dist/components/mint-map/core/wrapper/MapMarkerWrapper.d.ts +23 -0
- package/dist/components/mint-map/core/wrapper/MapMarkerWrapper.js +163 -0
- package/dist/components/mint-map/core/wrapper/MapPolygonWrapper.d.ts +5 -0
- package/dist/components/mint-map/core/wrapper/MapPolygonWrapper.js +39 -0
- package/dist/components/mint-map/core/wrapper/MapPolylineWrapper.d.ts +5 -0
- package/dist/components/mint-map/core/wrapper/MapPolylineWrapper.js +39 -0
- package/dist/components/mint-map/core/wrapper/MintMapWrapper.module.scss.js +13 -0
- package/dist/components/mint-map/google/GoogleMintMapController.d.ts +34 -0
- package/dist/components/mint-map/index.d.ts +2 -0
- package/dist/components/mint-map/naver/NaverMintMapController.d.ts +33 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +1096 -0
- package/dist/index.js +23 -0
- package/dist/index.umd.js +1113 -0
- package/package.json +74 -0
- package/test.ts +7 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var classNames = require('classnames/bind');
|
|
5
|
+
var MintMapWrapper_module = require('./MintMapWrapper.module.scss.js');
|
|
6
|
+
|
|
7
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
|
+
|
|
9
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
10
|
+
var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
|
|
11
|
+
|
|
12
|
+
var cn = classNames__default["default"].bind(MintMapWrapper_module);
|
|
13
|
+
|
|
14
|
+
var getSizeString = function (size) {
|
|
15
|
+
return typeof size === 'string' ? size.replace(/ /g, '') : "".concat(size, "px");
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
var getAlignPosition = function (value, align) {
|
|
19
|
+
if (typeof value === 'string') {
|
|
20
|
+
var trimmed = value.replace(/ /g, '');
|
|
21
|
+
console.log('trimmed:', trimmed);
|
|
22
|
+
var isPercent = trimmed.endsWith('%');
|
|
23
|
+
|
|
24
|
+
if (!isPercent && !trimmed.endsWith('px')) {
|
|
25
|
+
throw new Error("Size [".concat(value, "] is not valid string value."));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
var numberPart = isPercent ? trimmed.substring(0, trimmed.length - 2) : trimmed.substring(0, trimmed.length - 3);
|
|
29
|
+
var unit = isPercent ? '%' : 'px';
|
|
30
|
+
var numberValue = Number(numberPart);
|
|
31
|
+
|
|
32
|
+
if (isNaN(numberValue)) {
|
|
33
|
+
throw new Error("Size [".concat(value, "] is not valid % or pixel number value."));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (align === 'center') {
|
|
37
|
+
return "calc(50% - ".concat(numberValue / 2).concat(unit, ")");
|
|
38
|
+
} else if (align === 'right' || align === 'bottom') {
|
|
39
|
+
return "calc(100% - ".concat(numberValue).concat(unit, ")");
|
|
40
|
+
} else {
|
|
41
|
+
return '0px';
|
|
42
|
+
}
|
|
43
|
+
} else if (typeof value === 'number') {
|
|
44
|
+
if (align === 'center') {
|
|
45
|
+
return "calc(50% - ".concat(value / 2, "px)");
|
|
46
|
+
} else if (align === 'right' || align === 'bottom') {
|
|
47
|
+
return "calc(100% - ".concat(value, "px)");
|
|
48
|
+
} else {
|
|
49
|
+
return '0px';
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
throw new Error("Size [".concat(value, "] is not valid. (Should be % or pixel number)"));
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
function MapControlWrapper(_a) {
|
|
57
|
+
var _b = _a.width,
|
|
58
|
+
width = _b === void 0 ? 100 : _b,
|
|
59
|
+
_c = _a.height,
|
|
60
|
+
height = _c === void 0 ? 40 : _c,
|
|
61
|
+
_d = _a.positionHorizontal,
|
|
62
|
+
positionHorizontal = _d === void 0 ? 'left' : _d,
|
|
63
|
+
_e = _a.positionVertical,
|
|
64
|
+
positionVertical = _e === void 0 ? 'top' : _e,
|
|
65
|
+
children = _a.children;
|
|
66
|
+
return React__default["default"].createElement("div", {
|
|
67
|
+
className: cn('mint-map-control-wrapper'),
|
|
68
|
+
style: {
|
|
69
|
+
width: getSizeString(width),
|
|
70
|
+
height: getSizeString(height),
|
|
71
|
+
left: getAlignPosition(width, positionHorizontal),
|
|
72
|
+
top: getAlignPosition(height, positionVertical)
|
|
73
|
+
}
|
|
74
|
+
}, children);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
module.exports = MapControlWrapper;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { PropsWithChildren } from "react";
|
|
2
|
+
import { MarkerOptions, Position } from "../../MintMap";
|
|
3
|
+
export declare type MovingEventFunciton = () => void;
|
|
4
|
+
export interface MapMarkerMoving {
|
|
5
|
+
positions?: Position[];
|
|
6
|
+
positionClosed?: boolean;
|
|
7
|
+
startPositionIndex?: number;
|
|
8
|
+
velocity?: number;
|
|
9
|
+
loop?: boolean;
|
|
10
|
+
delay?: number;
|
|
11
|
+
autoStart?: boolean;
|
|
12
|
+
fps?: number;
|
|
13
|
+
onMovingStart?: MovingEventFunciton;
|
|
14
|
+
onMovingEnd?: MovingEventFunciton;
|
|
15
|
+
}
|
|
16
|
+
export interface MapMarkerWrapperProps extends MarkerOptions {
|
|
17
|
+
topOnClick?: boolean;
|
|
18
|
+
topOnHover?: boolean;
|
|
19
|
+
startAnimationClassName?: string;
|
|
20
|
+
endAnimationClassName?: string;
|
|
21
|
+
movingAnimation?: MapMarkerMoving;
|
|
22
|
+
}
|
|
23
|
+
export default function MapMarkerWrapper({ startAnimationClassName, endAnimationClassName, topOnClick, topOnHover, movingAnimation, children, ...options }: PropsWithChildren<MapMarkerWrapperProps>): JSX.Element;
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var tslib = require('tslib');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var reactDom = require('react-dom');
|
|
6
|
+
var MintMapProvider = require('../provider/MintMapProvider.js');
|
|
7
|
+
var MintMap = require('../../MintMap.js');
|
|
8
|
+
var MarkerMovingHook = require('../hooks/MarkerMovingHook.js');
|
|
9
|
+
|
|
10
|
+
var offsetCalibration = function (mapType, divElement, options) {
|
|
11
|
+
if (mapType === 'google') {
|
|
12
|
+
divElement.style.transform = "translate(50%, 100%) translate(-".concat(options.anchor ? options.anchor.x : '0', "px, -").concat(options.anchor ? options.anchor.y : '0', "px)");
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
function MapMarkerWrapper(_a) {
|
|
17
|
+
var startAnimationClassName = _a.startAnimationClassName,
|
|
18
|
+
endAnimationClassName = _a.endAnimationClassName,
|
|
19
|
+
_b = _a.topOnClick,
|
|
20
|
+
topOnClick = _b === void 0 ? false : _b,
|
|
21
|
+
_c = _a.topOnHover,
|
|
22
|
+
topOnHover = _c === void 0 ? false : _c,
|
|
23
|
+
movingAnimation = _a.movingAnimation,
|
|
24
|
+
children = _a.children,
|
|
25
|
+
options = tslib.__rest(_a, ["startAnimationClassName", "endAnimationClassName", "topOnClick", "topOnHover", "movingAnimation", "children"]);
|
|
26
|
+
|
|
27
|
+
var controller = MintMapProvider.useMintMapController();
|
|
28
|
+
var divRef = React.useRef(document.createElement('div'));
|
|
29
|
+
var divElement = divRef.current;
|
|
30
|
+
var divCloneRef = React.useRef();
|
|
31
|
+
var markerRef = React.useRef();
|
|
32
|
+
|
|
33
|
+
var _d = React.useState({}),
|
|
34
|
+
movingState = _d[0],
|
|
35
|
+
setMovingState = _d[1];
|
|
36
|
+
|
|
37
|
+
React.useEffect(function () {
|
|
38
|
+
if (movingState.autoStart) {
|
|
39
|
+
setTimeout(function () {
|
|
40
|
+
start();
|
|
41
|
+
}, movingState.delay);
|
|
42
|
+
}
|
|
43
|
+
}, [movingState]);
|
|
44
|
+
React.useEffect(function () {
|
|
45
|
+
setMovingState(tslib.__assign(tslib.__assign({}, movingAnimation), {
|
|
46
|
+
marker: markerRef.current
|
|
47
|
+
}));
|
|
48
|
+
}, [movingAnimation]);
|
|
49
|
+
var start = MarkerMovingHook.useMarkerMoving(movingState)[0];
|
|
50
|
+
|
|
51
|
+
var onClickHandler = function (e) {
|
|
52
|
+
var _a;
|
|
53
|
+
|
|
54
|
+
var marker = markerRef.current;
|
|
55
|
+
|
|
56
|
+
if (marker) {
|
|
57
|
+
controller.setMapDragged(false);
|
|
58
|
+
var clickHandler = (_a = options === null || options === void 0 ? void 0 : options.event) === null || _a === void 0 ? void 0 : _a.get('click');
|
|
59
|
+
var next = true;
|
|
60
|
+
|
|
61
|
+
if (clickHandler) {
|
|
62
|
+
var hasNext = clickHandler(e);
|
|
63
|
+
hasNext !== undefined && (next = hasNext);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
next && !topOnHover && topOnClick && controller.markerToTheTop(marker);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
var onMouseOverHandler = function (e) {
|
|
71
|
+
var _a;
|
|
72
|
+
|
|
73
|
+
var marker = markerRef.current;
|
|
74
|
+
|
|
75
|
+
if (marker) {
|
|
76
|
+
var mouseOverHandler = (_a = options === null || options === void 0 ? void 0 : options.event) === null || _a === void 0 ? void 0 : _a.get('mouseover');
|
|
77
|
+
var next = true;
|
|
78
|
+
|
|
79
|
+
if (mouseOverHandler) {
|
|
80
|
+
var hasNext = mouseOverHandler(e);
|
|
81
|
+
hasNext !== undefined && (next = hasNext);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
next && topOnHover && controller.markerToTheTop(marker);
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
React.useEffect(function () {
|
|
89
|
+
divElement.addEventListener('click', onClickHandler);
|
|
90
|
+
divElement.addEventListener('mouseover', onMouseOverHandler);
|
|
91
|
+
return function () {
|
|
92
|
+
if (divCloneRef.current && endAnimationClassName) {
|
|
93
|
+
divCloneRef.current.classList.add(endAnimationClassName);
|
|
94
|
+
|
|
95
|
+
var aniListener_1 = function () {
|
|
96
|
+
divCloneRef.current && divCloneRef.current.removeEventListener('animationend', aniListener_1);
|
|
97
|
+
|
|
98
|
+
if (markerRef.current) {
|
|
99
|
+
console.log('drawable cleared', controller.clearDrawable(markerRef.current));
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
divCloneRef.current = undefined;
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
divCloneRef.current.addEventListener('animationend', aniListener_1);
|
|
106
|
+
divElement.append(divCloneRef.current);
|
|
107
|
+
} else {
|
|
108
|
+
divElement.removeEventListener('click', onClickHandler);
|
|
109
|
+
divElement.removeEventListener('mouseover', onMouseOverHandler);
|
|
110
|
+
|
|
111
|
+
if (markerRef.current) {
|
|
112
|
+
console.log('drawable cleared', controller.clearDrawable(markerRef.current));
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
}, []);
|
|
117
|
+
React.useEffect(function () {
|
|
118
|
+
if (options) {
|
|
119
|
+
if (markerRef.current) {
|
|
120
|
+
controller.updateMarker(markerRef.current, options);
|
|
121
|
+
offsetCalibration(controller.getMapType(), divElement, options);
|
|
122
|
+
} else {
|
|
123
|
+
markerRef.current = new MintMap.Marker(options);
|
|
124
|
+
markerRef.current.element = divElement;
|
|
125
|
+
controller.createMarker(markerRef.current);
|
|
126
|
+
offsetCalibration(controller.getMapType(), divElement, options);
|
|
127
|
+
|
|
128
|
+
if (movingAnimation) {
|
|
129
|
+
setMovingState(tslib.__assign(tslib.__assign({}, movingAnimation), {
|
|
130
|
+
marker: markerRef.current
|
|
131
|
+
}));
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
if (startAnimationClassName) {
|
|
135
|
+
divElement.style.visibility = 'hidden';
|
|
136
|
+
setTimeout(function () {
|
|
137
|
+
var _a, _b;
|
|
138
|
+
|
|
139
|
+
divCloneRef.current = divElement.firstElementChild;
|
|
140
|
+
divElement.style.visibility = 'visible';
|
|
141
|
+
(_a = divElement.firstElementChild) === null || _a === void 0 ? void 0 : _a.classList.add(startAnimationClassName);
|
|
142
|
+
|
|
143
|
+
var aniListener = function () {
|
|
144
|
+
var _a, _b;
|
|
145
|
+
|
|
146
|
+
(_a = divElement.firstElementChild) === null || _a === void 0 ? void 0 : _a.classList.remove(startAnimationClassName);
|
|
147
|
+
(_b = divElement.firstElementChild) === null || _b === void 0 ? void 0 : _b.removeEventListener('animationend', aniListener);
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
(_b = divElement.firstElementChild) === null || _b === void 0 ? void 0 : _b.addEventListener('animationend', aniListener);
|
|
151
|
+
});
|
|
152
|
+
} else {
|
|
153
|
+
setTimeout(function () {
|
|
154
|
+
divCloneRef.current = divElement.firstElementChild;
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}, [options]);
|
|
160
|
+
return reactDom.createPortal(children, divElement);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
module.exports = MapMarkerWrapper;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { PropsWithChildren } from "react";
|
|
2
|
+
import { PolygonOptions } from "../../MintMap";
|
|
3
|
+
export interface MapPolygonWrapperProps extends PolygonOptions {
|
|
4
|
+
}
|
|
5
|
+
export default function MapPolygonWrapper({ children, ...options }: PropsWithChildren<MapPolygonWrapperProps>): JSX.Element;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var tslib = require('tslib');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var MintMapProvider = require('../provider/MintMapProvider.js');
|
|
6
|
+
var MintMap = require('../../MintMap.js');
|
|
7
|
+
|
|
8
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
9
|
+
|
|
10
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
11
|
+
|
|
12
|
+
function MapPolygonWrapper(_a) {
|
|
13
|
+
var children = _a.children,
|
|
14
|
+
options = tslib.__rest(_a, ["children"]);
|
|
15
|
+
|
|
16
|
+
var controller = MintMapProvider.useMintMapController();
|
|
17
|
+
React.useEffect(function () {
|
|
18
|
+
return function () {
|
|
19
|
+
if (polygonRef.current) {
|
|
20
|
+
console.log('polygon cleared', controller.clearDrawable(polygonRef.current));
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
}, []);
|
|
24
|
+
var polygonRef = React.useRef();
|
|
25
|
+
React.useEffect(function () {
|
|
26
|
+
if (options) {
|
|
27
|
+
if (polygonRef.current) {
|
|
28
|
+
controller.updatePolygon(polygonRef.current, options);
|
|
29
|
+
} else {
|
|
30
|
+
var polygon = new MintMap.Polygon(options);
|
|
31
|
+
polygonRef.current = polygon;
|
|
32
|
+
controller.createPolygon(polygon);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}, [options]);
|
|
36
|
+
return React__default["default"].createElement(React__default["default"].Fragment, null, options && children);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
module.exports = MapPolygonWrapper;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { PropsWithChildren } from "react";
|
|
2
|
+
import { PolylineOptions } from "../../MintMap";
|
|
3
|
+
export interface MapPolylineWrapperProps extends PolylineOptions {
|
|
4
|
+
}
|
|
5
|
+
export default function MapPolylineWrapper({ children, ...options }: PropsWithChildren<MapPolylineWrapperProps>): JSX.Element;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var tslib = require('tslib');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var MintMapProvider = require('../provider/MintMapProvider.js');
|
|
6
|
+
var MintMap = require('../../MintMap.js');
|
|
7
|
+
|
|
8
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
9
|
+
|
|
10
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
11
|
+
|
|
12
|
+
function MapPolylineWrapper(_a) {
|
|
13
|
+
var children = _a.children,
|
|
14
|
+
options = tslib.__rest(_a, ["children"]);
|
|
15
|
+
|
|
16
|
+
var controller = MintMapProvider.useMintMapController();
|
|
17
|
+
React.useEffect(function () {
|
|
18
|
+
return function () {
|
|
19
|
+
if (polylineRef.current) {
|
|
20
|
+
console.log('polyline cleared', controller.clearDrawable(polylineRef.current));
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
}, []);
|
|
24
|
+
var polylineRef = React.useRef();
|
|
25
|
+
React.useEffect(function () {
|
|
26
|
+
if (options) {
|
|
27
|
+
if (polylineRef.current) {
|
|
28
|
+
controller.updatePolyline(polylineRef.current, options);
|
|
29
|
+
} else {
|
|
30
|
+
var polyline = new MintMap.Polyline(options);
|
|
31
|
+
polylineRef.current = polyline;
|
|
32
|
+
controller.createPolyline(polyline);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}, [options]);
|
|
36
|
+
return React__default["default"].createElement(React__default["default"].Fragment, null, options && children);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
module.exports = MapPolylineWrapper;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var styleInject = require('style-inject');
|
|
4
|
+
|
|
5
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
6
|
+
|
|
7
|
+
var styleInject__default = /*#__PURE__*/_interopDefaultLegacy(styleInject);
|
|
8
|
+
|
|
9
|
+
var css_248z = ".MintMapWrapper-module_mint-map-control-wrapper__DDb4y {\n position: absolute;\n z-index: 101;\n}\n\n.MintMapWrapper-module_mint-map-overlay-wrapper__Jn4wV {\n position: absolute;\n z-index: 1;\n}";
|
|
10
|
+
var styles = {"mint-map-control-wrapper":"MintMapWrapper-module_mint-map-control-wrapper__DDb4y","mint-map-overlay-wrapper":"MintMapWrapper-module_mint-map-overlay-wrapper__Jn4wV"};
|
|
11
|
+
styleInject__default["default"](css_248z);
|
|
12
|
+
|
|
13
|
+
module.exports = styles;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/// <reference types="google.maps" />
|
|
2
|
+
import MintMapController from "../core/MintMapController";
|
|
3
|
+
import { Bounds, Drawable, MapType, MapVendorType, Marker, MarkerOptions, MintMapProps, Polygon, PolygonOptions, Polyline, PolylineOptions, Position } from "../MintMap";
|
|
4
|
+
export default class GoogleMintMapController extends MintMapController {
|
|
5
|
+
type: MapType;
|
|
6
|
+
map: google.maps.Map | null;
|
|
7
|
+
scriptUrl: string;
|
|
8
|
+
scriptModules: string[];
|
|
9
|
+
constructor(props: MintMapProps);
|
|
10
|
+
polylineEvents: string[];
|
|
11
|
+
createPolyline(polyline: Polyline): void;
|
|
12
|
+
updatePolyline(polyline: Polyline, options: PolylineOptions): void;
|
|
13
|
+
polygonEvents: string[];
|
|
14
|
+
createPolygon(polygon: Polygon): void;
|
|
15
|
+
updatePolygon(polygon: Polygon, options: PolygonOptions): void;
|
|
16
|
+
private getValidOptions;
|
|
17
|
+
markerEvents: string[];
|
|
18
|
+
createMarker(marker: Marker): void;
|
|
19
|
+
updateMarker(marker: Marker, options: MarkerOptions): void;
|
|
20
|
+
private markerMaxZIndex;
|
|
21
|
+
private getMaxZIndex;
|
|
22
|
+
markerToTheTop(marker: Marker): void;
|
|
23
|
+
clearDrawable(drawable: Drawable): boolean;
|
|
24
|
+
private dragged;
|
|
25
|
+
isMapDragged(): boolean;
|
|
26
|
+
setMapDragged(value: boolean): void;
|
|
27
|
+
loadMapApi(): Promise<boolean>;
|
|
28
|
+
initializingMap(divElement: HTMLDivElement): Promise<MapVendorType>;
|
|
29
|
+
destroyMap: () => void;
|
|
30
|
+
private fromGoogleBounds;
|
|
31
|
+
getCurrBounds(): Bounds;
|
|
32
|
+
panningTo(targetCenter: Position): void;
|
|
33
|
+
getZoomLevel(): number;
|
|
34
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/// <reference types="navermaps" />
|
|
2
|
+
import MintMapController from "../core/MintMapController";
|
|
3
|
+
import { Bounds, Drawable, MapType, MapVendorType, Marker, MarkerOptions, MintMapProps, Polygon, PolygonOptions, Polyline, PolylineOptions, Position } from "../MintMap";
|
|
4
|
+
export default class NaverMintMapController extends MintMapController {
|
|
5
|
+
type: MapType;
|
|
6
|
+
map: naver.maps.Map | null;
|
|
7
|
+
scriptUrl: string;
|
|
8
|
+
scriptModules: string[];
|
|
9
|
+
constructor(props: MintMapProps);
|
|
10
|
+
polylineEvents: string[];
|
|
11
|
+
createPolyline(polyline: Polyline): void;
|
|
12
|
+
updatePolyline(polyline: Polyline, options: PolylineOptions): void;
|
|
13
|
+
polygonEvents: string[];
|
|
14
|
+
createPolygon(polygon: Polygon): void;
|
|
15
|
+
updatePolygon(polygon: Polygon, options: PolygonOptions): void;
|
|
16
|
+
markerEvents: string[];
|
|
17
|
+
createMarker(marker: Marker): void;
|
|
18
|
+
updateMarker(marker: Marker, options: MarkerOptions): void;
|
|
19
|
+
private markerMaxZIndex;
|
|
20
|
+
private getMaxZIndex;
|
|
21
|
+
markerToTheTop(marker: Marker): void;
|
|
22
|
+
clearDrawable(drawable: Drawable): boolean;
|
|
23
|
+
private dragStartPoint;
|
|
24
|
+
private dragged;
|
|
25
|
+
isMapDragged(): boolean;
|
|
26
|
+
setMapDragged(value: boolean): void;
|
|
27
|
+
loadMapApi(): Promise<boolean>;
|
|
28
|
+
initializingMap(divElement: HTMLDivElement): Promise<MapVendorType>;
|
|
29
|
+
destroyMap(): void;
|
|
30
|
+
getCurrBounds(): Bounds;
|
|
31
|
+
panningTo(targetCenter: Position): void;
|
|
32
|
+
getZoomLevel(): number;
|
|
33
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components/mint-map';
|