@mint-ui/map 0.5.2-beta → 0.5.4-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 +109 -109
- package/LICENSE +21 -21
- package/README.md +73 -73
- package/dist/components/mint-map/MintMap.d.ts +10 -10
- package/dist/components/mint-map/MintMap.js +14 -21
- package/dist/components/mint-map/core/MintMapCanvasRenderer.d.ts +4 -4
- package/dist/components/mint-map/core/MintMapController.d.ts +64 -64
- package/dist/components/mint-map/core/MintMapController.js +9 -9
- package/dist/components/mint-map/core/MintMapCore.d.ts +3 -3
- package/dist/components/mint-map/core/MintMapCore.js +13 -11
- package/dist/components/mint-map/core/advanced/MapBuildingProjection.d.ts +15 -15
- package/dist/components/mint-map/core/advanced/MapBuildingProjection.js +2 -2
- package/dist/components/mint-map/core/advanced/MapLoadingComponents.d.ts +17 -17
- package/dist/components/mint-map/core/advanced/index.d.ts +3 -3
- package/dist/components/mint-map/core/advanced/shapes/CircleMarker.d.ts +20 -20
- package/dist/components/mint-map/core/advanced/shapes/CircleMarker.js +9 -8
- package/dist/components/mint-map/core/advanced/shapes/PolygonMarker.d.ts +23 -23
- package/dist/components/mint-map/core/advanced/shapes/PolygonMarker.js +45 -58
- package/dist/components/mint-map/core/advanced/shapes/base/SVGCircle.d.ts +8 -8
- package/dist/components/mint-map/core/advanced/shapes/base/SVGPolygon.d.ts +12 -12
- package/dist/components/mint-map/core/advanced/shapes/base/SVGPolygon.js +5 -5
- package/dist/components/mint-map/core/advanced/shapes/base/SVGRect.d.ts +10 -10
- package/dist/components/mint-map/core/advanced/shapes/base/index.d.ts +3 -3
- package/dist/components/mint-map/core/advanced/shapes/index.d.ts +3 -3
- package/dist/components/mint-map/core/hooks/MarkerMovingHook.d.ts +6 -6
- package/dist/components/mint-map/core/hooks/MarkerMovingHook.js +2 -2
- package/dist/components/mint-map/core/hooks/index.d.ts +1 -1
- package/dist/components/mint-map/core/index.d.ts +8 -8
- package/dist/components/mint-map/core/provider/MintMapProvider.d.ts +8 -8
- package/dist/components/mint-map/core/provider/index.d.ts +1 -1
- package/dist/components/mint-map/core/util/animation.d.ts +16 -16
- package/dist/components/mint-map/core/util/cluster.d.ts +18 -18
- package/dist/components/mint-map/core/util/{calculate.d.ts → geo.d.ts} +38 -66
- package/dist/components/mint-map/core/util/geo.js +159 -0
- package/dist/components/mint-map/core/util/index.d.ts +5 -4
- package/dist/components/mint-map/core/util/polygon.d.ts +40 -0
- package/dist/components/mint-map/core/util/{calculate.js → polygon.js} +13 -159
- package/dist/components/mint-map/core/util/waiting.d.ts +1 -1
- package/dist/components/mint-map/core/wrapper/MapCanvasMarkerWrapper.d.ts +27 -27
- package/dist/components/mint-map/core/wrapper/MapCanvasMarkerWrapper.js +6 -6
- package/dist/components/mint-map/core/wrapper/MapCanvasWrapper.d.ts +11 -11
- package/dist/components/mint-map/core/wrapper/MapCanvasWrapper.js +28 -12
- package/dist/components/mint-map/core/wrapper/MapControlWrapper.d.ts +18 -18
- package/dist/components/mint-map/core/wrapper/MapControlWrapper.js +6 -6
- package/dist/components/mint-map/core/wrapper/MapMarkerWrapper.d.ts +42 -32
- package/dist/components/mint-map/core/wrapper/MapMarkerWrapper.js +15 -62
- package/dist/components/mint-map/core/wrapper/MapPolygonWrapper.d.ts +12 -12
- package/dist/components/mint-map/core/wrapper/MapPolygonWrapper.js +7 -6
- package/dist/components/mint-map/core/wrapper/MapPolylineWrapper.d.ts +12 -12
- package/dist/components/mint-map/core/wrapper/MapPolylineWrapper.js +8 -7
- package/dist/components/mint-map/core/wrapper/index.d.ts +6 -6
- package/dist/components/mint-map/google/GoogleMintMapController.d.ts +51 -51
- package/dist/components/mint-map/google/GoogleMintMapController.js +1 -1
- package/dist/components/mint-map/index.d.ts +5 -5
- package/dist/components/mint-map/kakao/KakaoMintMapController.d.ts +56 -56
- package/dist/components/mint-map/kakao/KakaoMintMapController.js +9 -8
- package/dist/components/mint-map/naver/NaverMintMapController.d.ts +54 -53
- package/dist/components/mint-map/naver/NaverMintMapController.js +16 -6
- package/dist/components/mint-map/types/CommonTypes.d.ts +11 -11
- package/dist/components/mint-map/types/MapDrawables.d.ts +110 -110
- package/dist/components/mint-map/types/MapDrawables.js +10 -10
- package/dist/components/mint-map/types/MapEventTypes.d.ts +44 -44
- package/dist/components/mint-map/types/MapTypes.d.ts +60 -60
- package/dist/components/mint-map/types/MapTypes.js +15 -15
- package/dist/components/mint-map/types/MintMapEvents.d.ts +25 -25
- package/dist/components/mint-map/types/MintMapProps.d.ts +92 -92
- package/dist/components/mint-map/types/index.d.ts +6 -6
- package/dist/index.d.ts +7 -7
- package/dist/index.es.js +364 -394
- package/dist/index.js +4 -3
- package/dist/index.umd.js +364 -394
- package/package.json +77 -77
|
@@ -16,12 +16,12 @@ var console = {
|
|
|
16
16
|
log: function () {
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
|
-
/**
|
|
20
|
-
* Mint Map 컴포넌트
|
|
21
|
-
*
|
|
22
|
-
* @param {MapControlWrapperProps} MapControlWrapperProps
|
|
23
|
-
*
|
|
24
|
-
* @returns {JSX.Element} JSX
|
|
19
|
+
/**
|
|
20
|
+
* Mint Map 컴포넌트
|
|
21
|
+
*
|
|
22
|
+
* @param {MapControlWrapperProps} MapControlWrapperProps
|
|
23
|
+
*
|
|
24
|
+
* @returns {JSX.Element} JSX
|
|
25
25
|
*/
|
|
26
26
|
|
|
27
27
|
function MapCanvasWrapper(_a) {
|
|
@@ -130,7 +130,7 @@ function MapCanvasWrapper(_a) {
|
|
|
130
130
|
var pos = item.position; // console.log('canvas mouseevent check', pos.offset);
|
|
131
131
|
|
|
132
132
|
if (pos && !pos.offset) {
|
|
133
|
-
pos.offset =
|
|
133
|
+
pos.offset = positionToOffset(pos);
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
if (!pos || !pos.offset || !includes(clickedOffset, pos.offset, item.boxWidth, item.boxHeight)) {
|
|
@@ -163,7 +163,7 @@ function MapCanvasWrapper(_a) {
|
|
|
163
163
|
|
|
164
164
|
if (map) {
|
|
165
165
|
// const center = controller.getCenter()
|
|
166
|
-
// center.offset =
|
|
166
|
+
// center.offset = positionToOffset(center)
|
|
167
167
|
// if(center.offset){
|
|
168
168
|
// prevX.current = center.offset.x
|
|
169
169
|
// prevY.current = center.offset.y
|
|
@@ -183,7 +183,7 @@ function MapCanvasWrapper(_a) {
|
|
|
183
183
|
|
|
184
184
|
if (containerRef.current) {
|
|
185
185
|
// const pos = controller.getCenter()
|
|
186
|
-
// pos.offset =
|
|
186
|
+
// pos.offset = positionToOffset(pos)
|
|
187
187
|
// const deltaX = prevX.current - pos.offset.x
|
|
188
188
|
// const deltaY = prevY.current - pos.offset.y
|
|
189
189
|
// offsetProvider.current.x += deltaX
|
|
@@ -209,7 +209,7 @@ function MapCanvasWrapper(_a) {
|
|
|
209
209
|
|
|
210
210
|
map.addListener('mousemove', function (e) {
|
|
211
211
|
var clickPosition = parseClickParamToPosition(controller.getMapType(), e);
|
|
212
|
-
var clickedOffset =
|
|
212
|
+
var clickedOffset = positionToOffset(clickPosition); // console.log('canvas mousemove', clickedOffset);
|
|
213
213
|
|
|
214
214
|
var hitSet = processMouseEvent(clickedOffset, 'onMouseOver'); //mouse out 처리
|
|
215
215
|
|
|
@@ -223,7 +223,7 @@ function MapCanvasWrapper(_a) {
|
|
|
223
223
|
|
|
224
224
|
map.addListener('click', function (e) {
|
|
225
225
|
var clickPosition = parseClickParamToPosition(controller.getMapType(), e);
|
|
226
|
-
var clickedOffset =
|
|
226
|
+
var clickedOffset = positionToOffset(clickPosition);
|
|
227
227
|
processMouseEvent(clickedOffset, 'onClick');
|
|
228
228
|
});
|
|
229
229
|
}
|
|
@@ -294,7 +294,7 @@ function MapCanvasWrapper(_a) {
|
|
|
294
294
|
if (item.visible === undefined || item.visible) {
|
|
295
295
|
var pos = item.position; //위치 변환
|
|
296
296
|
|
|
297
|
-
pos.offset =
|
|
297
|
+
pos.offset = positionToOffset(pos);
|
|
298
298
|
|
|
299
299
|
if (item.anchor) {
|
|
300
300
|
pos.offset.x += item.anchor.x;
|
|
@@ -323,6 +323,22 @@ function MapCanvasWrapper(_a) {
|
|
|
323
323
|
}, []); //render!!!
|
|
324
324
|
|
|
325
325
|
renderMain();
|
|
326
|
+
|
|
327
|
+
var positionToOffset = React.useCallback(function (position) {
|
|
328
|
+
var div = controller.mapDivElement;
|
|
329
|
+
var w = div === null || div === void 0 ? void 0 : div.offsetWidth;
|
|
330
|
+
var h = div === null || div === void 0 ? void 0 : div.offsetHeight;
|
|
331
|
+
var bounds = controller.getCurrBounds();
|
|
332
|
+
var maxLng = bounds.ne.lng;
|
|
333
|
+
var minLng = bounds.sw.lng;
|
|
334
|
+
var lng = Math.abs(maxLng - minLng);
|
|
335
|
+
var x = w * (position.lng - minLng) / lng;
|
|
336
|
+
var maxLat = bounds.ne.lat;
|
|
337
|
+
var minLat = bounds.sw.lat;
|
|
338
|
+
var lat = Math.abs(maxLat - minLat);
|
|
339
|
+
var y = h * (maxLat - position.lat) / lat;
|
|
340
|
+
return new MapTypes.Offset(x, y);
|
|
341
|
+
}, []);
|
|
326
342
|
return React__default["default"].createElement("div", {
|
|
327
343
|
ref: containerRef,
|
|
328
344
|
style: {
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { PropsWithChildren } from "react";
|
|
2
|
-
declare type AlignHorizontal = 'left' | 'right' | 'center';
|
|
3
|
-
declare type AlignVertical = 'top' | 'bottom' | 'center';
|
|
4
|
-
export interface MapControlWrapperProps {
|
|
5
|
-
width?: number | string;
|
|
6
|
-
height?: number | string;
|
|
7
|
-
positionHorizontal?: AlignHorizontal;
|
|
8
|
-
positionVertical?: AlignVertical;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Mint Map 컴포넌트
|
|
12
|
-
*
|
|
13
|
-
* @param {MapControlWrapperProps} MapControlWrapperProps
|
|
14
|
-
*
|
|
15
|
-
* @returns {JSX.Element} JSX
|
|
16
|
-
*/
|
|
17
|
-
export declare function MapControlWrapper({ width, height, positionHorizontal, positionVertical, children }: PropsWithChildren<MapControlWrapperProps>): JSX.Element;
|
|
18
|
-
export {};
|
|
1
|
+
import { PropsWithChildren } from "react";
|
|
2
|
+
declare type AlignHorizontal = 'left' | 'right' | 'center';
|
|
3
|
+
declare type AlignVertical = 'top' | 'bottom' | 'center';
|
|
4
|
+
export interface MapControlWrapperProps {
|
|
5
|
+
width?: number | string;
|
|
6
|
+
height?: number | string;
|
|
7
|
+
positionHorizontal?: AlignHorizontal;
|
|
8
|
+
positionVertical?: AlignVertical;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Mint Map 컴포넌트
|
|
12
|
+
*
|
|
13
|
+
* @param {MapControlWrapperProps} MapControlWrapperProps
|
|
14
|
+
*
|
|
15
|
+
* @returns {JSX.Element} JSX
|
|
16
|
+
*/
|
|
17
|
+
export declare function MapControlWrapper({ width, height, positionHorizontal, positionVertical, children }: PropsWithChildren<MapControlWrapperProps>): JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -54,12 +54,12 @@ var getAlignPosition = function (value, align) {
|
|
|
54
54
|
|
|
55
55
|
throw new Error("Size [".concat(value, "] is not valid. (Should be % or pixel number)"));
|
|
56
56
|
};
|
|
57
|
-
/**
|
|
58
|
-
* Mint Map 컴포넌트
|
|
59
|
-
*
|
|
60
|
-
* @param {MapControlWrapperProps} MapControlWrapperProps
|
|
61
|
-
*
|
|
62
|
-
* @returns {JSX.Element} JSX
|
|
57
|
+
/**
|
|
58
|
+
* Mint Map 컴포넌트
|
|
59
|
+
*
|
|
60
|
+
* @param {MapControlWrapperProps} MapControlWrapperProps
|
|
61
|
+
*
|
|
62
|
+
* @returns {JSX.Element} JSX
|
|
63
63
|
*/
|
|
64
64
|
|
|
65
65
|
|
|
@@ -1,32 +1,42 @@
|
|
|
1
|
-
import { PropsWithChildren } from "react";
|
|
2
|
-
import { MarkerOptions } from "../../types/MapDrawables";
|
|
3
|
-
import { Position } from "../../types/MapTypes";
|
|
4
|
-
export declare type MovingEventFunciton = () => void;
|
|
5
|
-
export interface MapMarkerMoving {
|
|
6
|
-
positions?: Position[];
|
|
7
|
-
positionClosed?: boolean;
|
|
8
|
-
startPositionIndex?: number;
|
|
9
|
-
velocity?: number;
|
|
10
|
-
loop?: boolean;
|
|
11
|
-
delay?: number;
|
|
12
|
-
autoStart?: boolean;
|
|
13
|
-
fps?: number;
|
|
14
|
-
onMovingStart?: MovingEventFunciton;
|
|
15
|
-
onMovingEnd?: MovingEventFunciton;
|
|
16
|
-
}
|
|
17
|
-
export interface MapMarkerWrapperProps extends MarkerOptions {
|
|
18
|
-
topOnClick?: boolean;
|
|
19
|
-
topOnHover?: boolean;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
1
|
+
import { PropsWithChildren } from "react";
|
|
2
|
+
import { MarkerOptions } from "../../types/MapDrawables";
|
|
3
|
+
import { Position } from "../../types/MapTypes";
|
|
4
|
+
export declare type MovingEventFunciton = () => void;
|
|
5
|
+
export interface MapMarkerMoving {
|
|
6
|
+
positions?: Position[];
|
|
7
|
+
positionClosed?: boolean;
|
|
8
|
+
startPositionIndex?: number;
|
|
9
|
+
velocity?: number;
|
|
10
|
+
loop?: boolean;
|
|
11
|
+
delay?: number;
|
|
12
|
+
autoStart?: boolean;
|
|
13
|
+
fps?: number;
|
|
14
|
+
onMovingStart?: MovingEventFunciton;
|
|
15
|
+
onMovingEnd?: MovingEventFunciton;
|
|
16
|
+
}
|
|
17
|
+
export interface MapMarkerWrapperProps extends MarkerOptions {
|
|
18
|
+
topOnClick?: boolean;
|
|
19
|
+
topOnHover?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* 메모리 누수의 위험성이 존재하여 삭제될 예정
|
|
22
|
+
* animation 은 marker wrapper 의 children 레벨에서 구현하는것을 기본으로 한다.
|
|
23
|
+
* @deprecated
|
|
24
|
+
*/
|
|
25
|
+
startAnimationClassName?: string;
|
|
26
|
+
/**
|
|
27
|
+
* 메모리 누수의 위험성이 존재하여 삭제될 예정
|
|
28
|
+
* animation 은 marker wrapper 의 children 레벨에서 구현하는것을 기본으로 한다.
|
|
29
|
+
* @deprecated
|
|
30
|
+
*/
|
|
31
|
+
endAnimationClassName?: string;
|
|
32
|
+
movingAnimation?: MapMarkerMoving;
|
|
33
|
+
disablePointerEvent?: boolean;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Mint Map 컴포넌트
|
|
37
|
+
*
|
|
38
|
+
* @param {MapControlWrapperProps} MapControlWrapperProps
|
|
39
|
+
*
|
|
40
|
+
* @returns {JSX.Element} JSX
|
|
41
|
+
*/
|
|
42
|
+
export declare function MapMarkerWrapper({ startAnimationClassName, endAnimationClassName, topOnClick, topOnHover, movingAnimation, disablePointerEvent, children, ...options }: PropsWithChildren<MapMarkerWrapperProps>): JSX.Element;
|
|
@@ -17,19 +17,19 @@ var offsetCalibration = function (mapType, divElement, options) {
|
|
|
17
17
|
divElement.style.transform = "translate(-".concat(options.anchor ? options.anchor.x : '0', "px, -").concat(options.anchor ? options.anchor.y : '0', "px)");
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
-
/**
|
|
21
|
-
* Mint Map 컴포넌트
|
|
22
|
-
*
|
|
23
|
-
* @param {MapControlWrapperProps} MapControlWrapperProps
|
|
24
|
-
*
|
|
25
|
-
* @returns {JSX.Element} JSX
|
|
20
|
+
/**
|
|
21
|
+
* Mint Map 컴포넌트
|
|
22
|
+
*
|
|
23
|
+
* @param {MapControlWrapperProps} MapControlWrapperProps
|
|
24
|
+
*
|
|
25
|
+
* @returns {JSX.Element} JSX
|
|
26
26
|
*/
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
function MapMarkerWrapper(_a) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
_b = _a.topOnClick,
|
|
30
|
+
_a.startAnimationClassName;
|
|
31
|
+
_a.endAnimationClassName;
|
|
32
|
+
var _b = _a.topOnClick,
|
|
33
33
|
topOnClick = _b === void 0 ? false : _b,
|
|
34
34
|
_c = _a.topOnHover,
|
|
35
35
|
topOnHover = _c === void 0 ? false : _c,
|
|
@@ -43,9 +43,7 @@ function MapMarkerWrapper(_a) {
|
|
|
43
43
|
var controller = MintMapProvider.useMintMapController(); //element
|
|
44
44
|
|
|
45
45
|
var divRef = React.useRef(document.createElement('div'));
|
|
46
|
-
var divElement = divRef.current; //
|
|
47
|
-
|
|
48
|
-
var divCloneRef = React.useRef(); //marker
|
|
46
|
+
var divElement = divRef.current; //marker
|
|
49
47
|
|
|
50
48
|
var markerRef = React.useRef(); //moving animation
|
|
51
49
|
|
|
@@ -120,32 +118,12 @@ function MapMarkerWrapper(_a) {
|
|
|
120
118
|
divElement.addEventListener('click', onClickHandler);
|
|
121
119
|
divElement.addEventListener('mouseover', onMouseOverHandler);
|
|
122
120
|
return function () {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
//그래서 kakao 일때는 endAnimationClassName 영향을 받지 않도록 처리함
|
|
126
|
-
if (divCloneRef.current && endAnimationClassName && controller.getMapType() !== 'kakao') {
|
|
127
|
-
divCloneRef.current.classList.add(endAnimationClassName);
|
|
128
|
-
|
|
129
|
-
var aniListener_1 = function () {
|
|
130
|
-
//console.log('animationend!!!', divCloneRef.current);
|
|
131
|
-
divCloneRef.current && divCloneRef.current.removeEventListener('animationend', aniListener_1);
|
|
132
|
-
|
|
133
|
-
if (markerRef.current) {
|
|
134
|
-
controller.clearDrawable(markerRef.current); // console.log('drawable cleared')
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
divCloneRef.current = undefined;
|
|
138
|
-
};
|
|
121
|
+
divElement.removeEventListener('click', onClickHandler);
|
|
122
|
+
divElement.removeEventListener('mouseover', onMouseOverHandler);
|
|
139
123
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
divElement.removeEventListener('click', onClickHandler);
|
|
144
|
-
divElement.removeEventListener('mouseover', onMouseOverHandler);
|
|
145
|
-
|
|
146
|
-
if (markerRef.current) {
|
|
147
|
-
controller.clearDrawable(markerRef.current); // console.log('drawable cleared')
|
|
148
|
-
}
|
|
124
|
+
if (markerRef.current) {
|
|
125
|
+
controller.clearDrawable(markerRef.current);
|
|
126
|
+
markerRef.current = undefined; // console.log('drawable cleared')
|
|
149
127
|
}
|
|
150
128
|
};
|
|
151
129
|
}, []); //create / update object
|
|
@@ -190,31 +168,6 @@ function MapMarkerWrapper(_a) {
|
|
|
190
168
|
setMovingState(tslib.__assign(tslib.__assign({}, movingAnimation), {
|
|
191
169
|
marker: markerRef.current
|
|
192
170
|
}));
|
|
193
|
-
} //start animation
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
if (startAnimationClassName) {
|
|
197
|
-
divElement.style.visibility = 'hidden';
|
|
198
|
-
setTimeout(function () {
|
|
199
|
-
var _a, _b;
|
|
200
|
-
|
|
201
|
-
divCloneRef.current = divElement.firstElementChild;
|
|
202
|
-
divElement.style.visibility = 'visible';
|
|
203
|
-
(_a = divElement.firstElementChild) === null || _a === void 0 ? void 0 : _a.classList.add(startAnimationClassName);
|
|
204
|
-
|
|
205
|
-
var aniListener = function () {
|
|
206
|
-
var _a, _b;
|
|
207
|
-
|
|
208
|
-
(_a = divElement.firstElementChild) === null || _a === void 0 ? void 0 : _a.classList.remove(startAnimationClassName);
|
|
209
|
-
(_b = divElement.firstElementChild) === null || _b === void 0 ? void 0 : _b.removeEventListener('animationend', aniListener);
|
|
210
|
-
};
|
|
211
|
-
|
|
212
|
-
(_b = divElement.firstElementChild) === null || _b === void 0 ? void 0 : _b.addEventListener('animationend', aniListener);
|
|
213
|
-
});
|
|
214
|
-
} else {
|
|
215
|
-
setTimeout(function () {
|
|
216
|
-
divCloneRef.current = divElement.firstElementChild;
|
|
217
|
-
});
|
|
218
171
|
}
|
|
219
172
|
}
|
|
220
173
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { PropsWithChildren } from "react";
|
|
2
|
-
import { PolygonOptions } from "../../types/MapDrawables";
|
|
3
|
-
export interface MapPolygonWrapperProps extends PolygonOptions {
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* Mint Map 컴포넌트
|
|
7
|
-
*
|
|
8
|
-
* @param {MapControlWrapperProps} MapControlWrapperProps
|
|
9
|
-
*
|
|
10
|
-
* @returns {JSX.Element} JSX
|
|
11
|
-
*/
|
|
12
|
-
export declare function MapPolygonWrapper({ children, ...options }: PropsWithChildren<MapPolygonWrapperProps>): JSX.Element;
|
|
1
|
+
import { PropsWithChildren } from "react";
|
|
2
|
+
import { PolygonOptions } from "../../types/MapDrawables";
|
|
3
|
+
export interface MapPolygonWrapperProps extends PolygonOptions {
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Mint Map 컴포넌트
|
|
7
|
+
*
|
|
8
|
+
* @param {MapControlWrapperProps} MapControlWrapperProps
|
|
9
|
+
*
|
|
10
|
+
* @returns {JSX.Element} JSX
|
|
11
|
+
*/
|
|
12
|
+
export declare function MapPolygonWrapper({ children, ...options }: PropsWithChildren<MapPolygonWrapperProps>): JSX.Element;
|
|
@@ -11,12 +11,12 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
11
11
|
|
|
12
12
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
13
13
|
|
|
14
|
-
/**
|
|
15
|
-
* Mint Map 컴포넌트
|
|
16
|
-
*
|
|
17
|
-
* @param {MapControlWrapperProps} MapControlWrapperProps
|
|
18
|
-
*
|
|
19
|
-
* @returns {JSX.Element} JSX
|
|
14
|
+
/**
|
|
15
|
+
* Mint Map 컴포넌트
|
|
16
|
+
*
|
|
17
|
+
* @param {MapControlWrapperProps} MapControlWrapperProps
|
|
18
|
+
*
|
|
19
|
+
* @returns {JSX.Element} JSX
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
22
|
function MapPolygonWrapper(_a) {
|
|
@@ -31,6 +31,7 @@ function MapPolygonWrapper(_a) {
|
|
|
31
31
|
if (polygonRef.current) {
|
|
32
32
|
// console.log('polygon cleared')
|
|
33
33
|
controller.clearDrawable(polygonRef.current);
|
|
34
|
+
polygonRef.current = undefined;
|
|
34
35
|
}
|
|
35
36
|
};
|
|
36
37
|
}, []); //create/update object
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { PropsWithChildren } from "react";
|
|
2
|
-
import { PolylineOptions } from "../../types/MapDrawables";
|
|
3
|
-
export interface MapPolylineWrapperProps extends PolylineOptions {
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* Mint Map 컴포넌트
|
|
7
|
-
*
|
|
8
|
-
* @param {MapControlWrapperProps} MapControlWrapperProps
|
|
9
|
-
*
|
|
10
|
-
* @returns {JSX.Element} JSX
|
|
11
|
-
*/
|
|
12
|
-
export declare function MapPolylineWrapper({ children, ...options }: PropsWithChildren<MapPolylineWrapperProps>): JSX.Element;
|
|
1
|
+
import { PropsWithChildren } from "react";
|
|
2
|
+
import { PolylineOptions } from "../../types/MapDrawables";
|
|
3
|
+
export interface MapPolylineWrapperProps extends PolylineOptions {
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Mint Map 컴포넌트
|
|
7
|
+
*
|
|
8
|
+
* @param {MapControlWrapperProps} MapControlWrapperProps
|
|
9
|
+
*
|
|
10
|
+
* @returns {JSX.Element} JSX
|
|
11
|
+
*/
|
|
12
|
+
export declare function MapPolylineWrapper({ children, ...options }: PropsWithChildren<MapPolylineWrapperProps>): JSX.Element;
|
|
@@ -11,12 +11,12 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
11
11
|
|
|
12
12
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
13
13
|
|
|
14
|
-
/**
|
|
15
|
-
* Mint Map 컴포넌트
|
|
16
|
-
*
|
|
17
|
-
* @param {MapControlWrapperProps} MapControlWrapperProps
|
|
18
|
-
*
|
|
19
|
-
* @returns {JSX.Element} JSX
|
|
14
|
+
/**
|
|
15
|
+
* Mint Map 컴포넌트
|
|
16
|
+
*
|
|
17
|
+
* @param {MapControlWrapperProps} MapControlWrapperProps
|
|
18
|
+
*
|
|
19
|
+
* @returns {JSX.Element} JSX
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
22
|
function MapPolylineWrapper(_a) {
|
|
@@ -29,7 +29,8 @@ function MapPolylineWrapper(_a) {
|
|
|
29
29
|
React.useEffect(function () {
|
|
30
30
|
return function () {
|
|
31
31
|
if (polylineRef.current) {
|
|
32
|
-
controller.clearDrawable(polylineRef.current);
|
|
32
|
+
controller.clearDrawable(polylineRef.current);
|
|
33
|
+
polylineRef.current = undefined; // console.log('polyline cleared')
|
|
33
34
|
}
|
|
34
35
|
};
|
|
35
36
|
}, []); //create/update object
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './MapControlWrapper';
|
|
2
|
-
export * from './MapMarkerWrapper';
|
|
3
|
-
export * from './MapPolygonWrapper';
|
|
4
|
-
export * from './MapPolylineWrapper';
|
|
5
|
-
export * from './MapCanvasWrapper';
|
|
6
|
-
export * from './MapCanvasMarkerWrapper';
|
|
1
|
+
export * from './MapControlWrapper';
|
|
2
|
+
export * from './MapMarkerWrapper';
|
|
3
|
+
export * from './MapPolygonWrapper';
|
|
4
|
+
export * from './MapPolylineWrapper';
|
|
5
|
+
export * from './MapCanvasWrapper';
|
|
6
|
+
export * from './MapCanvasMarkerWrapper';
|
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
/// <reference types="google.maps" />
|
|
2
|
-
import { MintMapController } from "../core/MintMapController";
|
|
3
|
-
import { MapType, MapVendorType } from "../types/CommonTypes";
|
|
4
|
-
import { Drawable, Marker, MarkerOptions, Polygon, PolygonOptions, Polyline, PolylineOptions } from "../types/MapDrawables";
|
|
5
|
-
import { EventCallback, EventParamType, MapEvent, MapEventName, MapUIEvent } from "../types/MapEventTypes";
|
|
6
|
-
import { Bounds, Position } from "../types/MapTypes";
|
|
7
|
-
import { MintMapProps } from "../types/MintMapProps";
|
|
8
|
-
export declare class GoogleMintMapController extends MintMapController {
|
|
9
|
-
type: MapType;
|
|
10
|
-
map: google.maps.Map | null;
|
|
11
|
-
scriptUrl: string;
|
|
12
|
-
scriptModules: string[];
|
|
13
|
-
protected mapEvent: MapEvent;
|
|
14
|
-
protected mapUIEvent: MapUIEvent;
|
|
15
|
-
constructor(props: MintMapProps);
|
|
16
|
-
polylineEvents: string[];
|
|
17
|
-
createPolyline(polyline: Polyline): void;
|
|
18
|
-
updatePolyline(polyline: Polyline, options: PolylineOptions): void;
|
|
19
|
-
polygonEvents: string[];
|
|
20
|
-
createPolygon(polygon: Polygon): void;
|
|
21
|
-
updatePolygon(polygon: Polygon, options: PolygonOptions): void;
|
|
22
|
-
private getValidOptions;
|
|
23
|
-
markerEvents: string[];
|
|
24
|
-
createMarker(marker: Marker): void;
|
|
25
|
-
updateMarker(marker: Marker, options: MarkerOptions): void;
|
|
26
|
-
private markerMaxZIndex;
|
|
27
|
-
private getMaxZIndex;
|
|
28
|
-
setMarkerZIndex(marker: Marker, zIndex: number): void;
|
|
29
|
-
markerToTheTop(marker: Marker): void;
|
|
30
|
-
clearDrawable(drawable: Drawable): boolean;
|
|
31
|
-
private dragged;
|
|
32
|
-
isMapDragged(): boolean;
|
|
33
|
-
setMapDragged(value: boolean): void;
|
|
34
|
-
private checkLoaded;
|
|
35
|
-
loadMapApi(): Promise<boolean>;
|
|
36
|
-
lastMousePosition: Position | null;
|
|
37
|
-
initializingMap(divElement: HTMLDivElement): Promise<MapVendorType>;
|
|
38
|
-
destroyMap: () => void;
|
|
39
|
-
private fromGoogleBounds;
|
|
40
|
-
getCurrBounds(): Bounds;
|
|
41
|
-
panningTo(targetCenter: Position): void;
|
|
42
|
-
getZoomLevel(): number;
|
|
43
|
-
setZoomLevel(zoom: number): void;
|
|
44
|
-
getCenter(): Position;
|
|
45
|
-
setCenter(position: Position): void;
|
|
46
|
-
private eventMap;
|
|
47
|
-
addEventListener(eventName: MapEventName, callback: EventCallback<EventParamType>): void;
|
|
48
|
-
removeEventListener(eventName: MapEventName, callback: EventCallback<EventParamType>): void;
|
|
49
|
-
removeAllEventListener(eventName?: MapEventName | undefined): void;
|
|
50
|
-
private clearEventListener;
|
|
51
|
-
}
|
|
1
|
+
/// <reference types="google.maps" />
|
|
2
|
+
import { MintMapController } from "../core/MintMapController";
|
|
3
|
+
import { MapType, MapVendorType } from "../types/CommonTypes";
|
|
4
|
+
import { Drawable, Marker, MarkerOptions, Polygon, PolygonOptions, Polyline, PolylineOptions } from "../types/MapDrawables";
|
|
5
|
+
import { EventCallback, EventParamType, MapEvent, MapEventName, MapUIEvent } from "../types/MapEventTypes";
|
|
6
|
+
import { Bounds, Position } from "../types/MapTypes";
|
|
7
|
+
import { MintMapProps } from "../types/MintMapProps";
|
|
8
|
+
export declare class GoogleMintMapController extends MintMapController {
|
|
9
|
+
type: MapType;
|
|
10
|
+
map: google.maps.Map | null;
|
|
11
|
+
scriptUrl: string;
|
|
12
|
+
scriptModules: string[];
|
|
13
|
+
protected mapEvent: MapEvent;
|
|
14
|
+
protected mapUIEvent: MapUIEvent;
|
|
15
|
+
constructor(props: MintMapProps);
|
|
16
|
+
polylineEvents: string[];
|
|
17
|
+
createPolyline(polyline: Polyline): void;
|
|
18
|
+
updatePolyline(polyline: Polyline, options: PolylineOptions): void;
|
|
19
|
+
polygonEvents: string[];
|
|
20
|
+
createPolygon(polygon: Polygon): void;
|
|
21
|
+
updatePolygon(polygon: Polygon, options: PolygonOptions): void;
|
|
22
|
+
private getValidOptions;
|
|
23
|
+
markerEvents: string[];
|
|
24
|
+
createMarker(marker: Marker): void;
|
|
25
|
+
updateMarker(marker: Marker, options: MarkerOptions): void;
|
|
26
|
+
private markerMaxZIndex;
|
|
27
|
+
private getMaxZIndex;
|
|
28
|
+
setMarkerZIndex(marker: Marker, zIndex: number): void;
|
|
29
|
+
markerToTheTop(marker: Marker): void;
|
|
30
|
+
clearDrawable(drawable: Drawable): boolean;
|
|
31
|
+
private dragged;
|
|
32
|
+
isMapDragged(): boolean;
|
|
33
|
+
setMapDragged(value: boolean): void;
|
|
34
|
+
private checkLoaded;
|
|
35
|
+
loadMapApi(): Promise<boolean>;
|
|
36
|
+
lastMousePosition: Position | null;
|
|
37
|
+
initializingMap(divElement: HTMLDivElement): Promise<MapVendorType>;
|
|
38
|
+
destroyMap: () => void;
|
|
39
|
+
private fromGoogleBounds;
|
|
40
|
+
getCurrBounds(): Bounds;
|
|
41
|
+
panningTo(targetCenter: Position): void;
|
|
42
|
+
getZoomLevel(): number;
|
|
43
|
+
setZoomLevel(zoom: number): void;
|
|
44
|
+
getCenter(): Position;
|
|
45
|
+
setCenter(position: Position): void;
|
|
46
|
+
private eventMap;
|
|
47
|
+
addEventListener(eventName: MapEventName, callback: EventCallback<EventParamType>): void;
|
|
48
|
+
removeEventListener(eventName: MapEventName, callback: EventCallback<EventParamType>): void;
|
|
49
|
+
removeAllEventListener(eventName?: MapEventName | undefined): void;
|
|
50
|
+
private clearEventListener;
|
|
51
|
+
}
|
|
@@ -460,7 +460,7 @@ function (_super) {
|
|
|
460
460
|
center: (_a = this.mapProps.base) === null || _a === void 0 ? void 0 : _a.center,
|
|
461
461
|
maxZoom: (_b = this.mapProps.base) === null || _b === void 0 ? void 0 : _b.maxZoomLevel,
|
|
462
462
|
minZoom: (_c = this.mapProps.base) === null || _c === void 0 ? void 0 : _c.minZoomLevel,
|
|
463
|
-
zoom: (_d = this.mapProps.base) === null || _d === void 0 ? void 0 : _d.zoomLevel,
|
|
463
|
+
zoom: ((_d = this.mapProps.base) === null || _d === void 0 ? void 0 : _d.zoomLevel) || this.getBaseToMapZoom(15),
|
|
464
464
|
disableDefaultUI: true,
|
|
465
465
|
gestureHandling: this.mapProps.draggable === false ? 'none' : 'greedy',
|
|
466
466
|
keyboardShortcuts: this.mapProps.keyboardShortcuts === false ? false : true,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './MintMap';
|
|
2
|
-
export * from './core';
|
|
3
|
-
export * from './naver/NaverMintMapController';
|
|
4
|
-
export * from './google/GoogleMintMapController';
|
|
5
|
-
export * from './types';
|
|
1
|
+
export * from './MintMap';
|
|
2
|
+
export * from './core';
|
|
3
|
+
export * from './naver/NaverMintMapController';
|
|
4
|
+
export * from './google/GoogleMintMapController';
|
|
5
|
+
export * from './types';
|