@mint-ui/map 0.4.5-beta → 0.4.6-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 -117
- package/dist/components/mint-map/MintMap.js +24 -421
- package/dist/components/mint-map/core/MintMapCanvasRenderer.d.ts +4 -4
- package/dist/components/mint-map/core/MintMapCanvasRenderer.js +3 -1
- package/dist/components/mint-map/core/MintMapController.d.ts +58 -44
- package/dist/components/mint-map/core/MintMapController.js +49 -15
- package/dist/components/mint-map/core/MintMapCore.d.ts +3 -3
- package/dist/components/mint-map/core/MintMapCore.js +22 -10
- package/dist/components/mint-map/core/advanced/MapBuildingProjection.d.ts +15 -15
- package/dist/components/mint-map/core/advanced/MapBuildingProjection.js +11 -7
- package/dist/components/mint-map/core/advanced/MapLoadingComponents.d.ts +17 -0
- package/dist/components/mint-map/core/advanced/MapLoadingComponents.js +257 -0
- package/dist/components/mint-map/core/advanced/index.d.ts +2 -1
- package/dist/components/mint-map/core/hooks/MarkerMovingHook.d.ts +6 -6
- package/dist/components/mint-map/core/hooks/MarkerMovingHook.js +17 -8
- 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/animation.js +14 -5
- package/dist/components/mint-map/core/util/calculate.d.ts +39 -34
- package/dist/components/mint-map/core/util/calculate.js +65 -26
- package/dist/components/mint-map/core/util/cluster.d.ts +18 -18
- package/dist/components/mint-map/core/util/cluster.js +14 -9
- package/dist/components/mint-map/core/util/index.d.ts +4 -4
- package/dist/components/mint-map/core/util/waiting.d.ts +1 -1
- package/dist/components/mint-map/core/util/waiting.js +6 -2
- package/dist/components/mint-map/core/wrapper/MapCanvasMarkerWrapper.d.ts +27 -19
- package/dist/components/mint-map/core/wrapper/MapCanvasMarkerWrapper.js +9 -0
- package/dist/components/mint-map/core/wrapper/MapCanvasWrapper.d.ts +11 -4
- package/dist/components/mint-map/core/wrapper/MapCanvasWrapper.js +107 -35
- package/dist/components/mint-map/core/wrapper/MapControlWrapper.d.ts +18 -11
- package/dist/components/mint-map/core/wrapper/MapControlWrapper.js +8 -0
- package/dist/components/mint-map/core/wrapper/MapMarkerWrapper.d.ts +31 -23
- package/dist/components/mint-map/core/wrapper/MapMarkerWrapper.js +54 -25
- package/dist/components/mint-map/core/wrapper/MapPolygonWrapper.d.ts +12 -5
- package/dist/components/mint-map/core/wrapper/MapPolygonWrapper.js +21 -6
- package/dist/components/mint-map/core/wrapper/MapPolylineWrapper.d.ts +12 -5
- package/dist/components/mint-map/core/wrapper/MapPolylineWrapper.js +21 -7
- package/dist/components/mint-map/core/wrapper/index.d.ts +6 -6
- package/dist/components/mint-map/google/GoogleMintMapController.d.ts +42 -39
- package/dist/components/mint-map/google/GoogleMintMapController.js +90 -44
- package/dist/components/mint-map/index.d.ts +5 -4
- package/dist/components/mint-map/kakao/KakaoMintMapController.d.ts +48 -44
- package/dist/components/mint-map/kakao/KakaoMintMapController.js +147 -65
- package/dist/components/mint-map/naver/NaverMintMapController.d.ts +45 -42
- package/dist/components/mint-map/naver/NaverMintMapController.js +136 -49
- package/dist/components/mint-map/types/CommonTypes.d.ts +11 -0
- package/dist/components/mint-map/types/MapDrawables.d.ts +110 -0
- package/dist/components/mint-map/types/MapDrawables.js +92 -0
- package/dist/components/mint-map/types/MapTypes.d.ts +59 -0
- package/dist/components/mint-map/types/MapTypes.js +151 -0
- package/dist/components/mint-map/types/MintMapEvents.d.ts +25 -0
- package/dist/components/mint-map/types/MintMapProps.d.ts +92 -0
- package/dist/components/mint-map/types/index.d.ts +5 -0
- package/dist/index.d.ts +7 -1
- package/dist/index.es.js +1505 -946
- package/dist/index.js +12 -9
- package/dist/index.umd.js +1505 -946
- package/package.json +77 -77
- package/test.ts +0 -7
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var calculate = require('../core/util/calculate.js');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* 좌표값
|
|
9
|
+
* @description 위도/경도, DOM 상의 X/Y 좌표
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
var Position =
|
|
13
|
+
/** @class */
|
|
14
|
+
function () {
|
|
15
|
+
function Position(lat, lng) {
|
|
16
|
+
/**
|
|
17
|
+
* 위도
|
|
18
|
+
* @description 위도(latitude)
|
|
19
|
+
*/
|
|
20
|
+
this.lat = 0;
|
|
21
|
+
/**
|
|
22
|
+
* 경도
|
|
23
|
+
* @description 경도(longitude)
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
this.lng = 0;
|
|
27
|
+
this.lat = lat;
|
|
28
|
+
this.lng = lng;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
Position.equals = function (pos1, pos2) {
|
|
32
|
+
return pos1.lat === pos2.lat && pos1.lng === pos2.lng;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
return Position;
|
|
36
|
+
}();
|
|
37
|
+
|
|
38
|
+
var Bounds =
|
|
39
|
+
/** @class */
|
|
40
|
+
function () {
|
|
41
|
+
function Bounds(nw, se, ne, sw) {
|
|
42
|
+
if (!(nw && se || ne && sw)) {
|
|
43
|
+
throw new Error('nw/se or ne/sw needed');
|
|
44
|
+
} //@ts-ignore
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
this.nw = nw;
|
|
48
|
+
this.se = se;
|
|
49
|
+
this.ne = ne;
|
|
50
|
+
this.sw = sw;
|
|
51
|
+
|
|
52
|
+
if (nw && se) {
|
|
53
|
+
this.covertNWSEtoNESW(nw, se);
|
|
54
|
+
} else if (ne && sw) {
|
|
55
|
+
this.covertNESWtoNWSE(ne, sw);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
Bounds.fromNWSE = function (nw, se) {
|
|
60
|
+
return new Bounds(nw, se, undefined, undefined);
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
Bounds.fromNESW = function (ne, sw) {
|
|
64
|
+
return new Bounds(undefined, undefined, ne, sw);
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
Bounds.prototype.covertNWSEtoNESW = function (nw, se) {
|
|
68
|
+
this.ne = new Position(nw.lat, se.lng);
|
|
69
|
+
this.sw = new Position(se.lat, nw.lng);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
Bounds.prototype.covertNESWtoNWSE = function (ne, sw) {
|
|
73
|
+
this.nw = new Position(ne.lat, sw.lng);
|
|
74
|
+
this.se = new Position(sw.lat, ne.lng);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
Bounds.prototype.getCenter = function () {
|
|
78
|
+
return new Position(this.se.lat + (this.nw.lat - this.se.lat) / 2, this.nw.lng + (this.se.lng - this.nw.lng) / 2);
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
Bounds.prototype.includesPosition = function (pos) {
|
|
82
|
+
return this.nw.lng < pos.lng && this.se.lng > pos.lng && this.se.lat < pos.lat && this.nw.lat > pos.lat;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
Bounds.prototype.getIncludedPositions = function (positions) {
|
|
86
|
+
var result = [];
|
|
87
|
+
|
|
88
|
+
for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) {
|
|
89
|
+
var pos = positions_1[_i];
|
|
90
|
+
|
|
91
|
+
if (this.includesPosition(pos)) {
|
|
92
|
+
result.push(pos);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
return result;
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
Bounds.prototype.includes = function (positions) {
|
|
100
|
+
positions = Array.isArray(positions) ? positions : [positions];
|
|
101
|
+
|
|
102
|
+
for (var _i = 0, positions_2 = positions; _i < positions_2.length; _i++) {
|
|
103
|
+
var pos = positions_2[_i];
|
|
104
|
+
|
|
105
|
+
if (!this.includesPosition(pos)) {
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
return true;
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
Bounds.prototype.includesOnlyOnePoint = function (positions) {
|
|
114
|
+
for (var _i = 0, positions_3 = positions; _i < positions_3.length; _i++) {
|
|
115
|
+
var pos = positions_3[_i];
|
|
116
|
+
|
|
117
|
+
if (this.includesPosition(pos)) {
|
|
118
|
+
return true;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return false;
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
Bounds.prototype.intersects = function (positions) {
|
|
126
|
+
return calculate.PolygonCalculator.intersects([this.nw, this.se], positions);
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
return Bounds;
|
|
130
|
+
}();
|
|
131
|
+
/**
|
|
132
|
+
* DOM 상에서의 좌표를 표현 (픽셀을 나타내는 숫자)
|
|
133
|
+
*/
|
|
134
|
+
|
|
135
|
+
var Offset =
|
|
136
|
+
/** @class */
|
|
137
|
+
function () {
|
|
138
|
+
/**
|
|
139
|
+
* DOM 상에서의 좌표를 표현 (픽셀을 나타내는 숫자)
|
|
140
|
+
*/
|
|
141
|
+
function Offset(x, y) {
|
|
142
|
+
this.x = x;
|
|
143
|
+
this.y = y;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
return Offset;
|
|
147
|
+
}();
|
|
148
|
+
|
|
149
|
+
exports.Bounds = Bounds;
|
|
150
|
+
exports.Offset = Offset;
|
|
151
|
+
exports.Position = Position;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { MapVendorType } from "./CommonTypes";
|
|
2
|
+
import { Bounds, Position } from "./MapTypes";
|
|
3
|
+
import { MintMapController } from "../core/MintMapController";
|
|
4
|
+
export interface MintMapEvents {
|
|
5
|
+
/**
|
|
6
|
+
* 지도의 보여지는 영역이 변경되었을때 호출되는 콜백
|
|
7
|
+
*/
|
|
8
|
+
onBoundsChanged?: (bounds: Bounds) => void;
|
|
9
|
+
/**
|
|
10
|
+
* 지도의 줌이 변경되었을때 호출되는 콜백
|
|
11
|
+
*/
|
|
12
|
+
onZoomChanged?: (level: number) => void;
|
|
13
|
+
/**
|
|
14
|
+
* 지도 준비완료시 호출되는 콜백
|
|
15
|
+
*/
|
|
16
|
+
onLoad?: (map: MapVendorType, controller: MintMapController) => void;
|
|
17
|
+
/**
|
|
18
|
+
* 지도 클릭시 호출되는 콜백
|
|
19
|
+
*/
|
|
20
|
+
onClick?: (positon: Position) => void;
|
|
21
|
+
/**
|
|
22
|
+
* 지도 위에서 마우스 이동시 호출되는 콜백
|
|
23
|
+
*/
|
|
24
|
+
onMouseMove?: (positon: Position) => void;
|
|
25
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { MapType } from "./CommonTypes";
|
|
3
|
+
import { Position } from "./MapTypes";
|
|
4
|
+
import { MintMapEvents } from "./MintMapEvents";
|
|
5
|
+
/**
|
|
6
|
+
* Mint Map Props
|
|
7
|
+
*/
|
|
8
|
+
export interface MintMapProps extends MintMapEvents {
|
|
9
|
+
/**
|
|
10
|
+
* Mint Map 에서 지원하는 지도 타입
|
|
11
|
+
*/
|
|
12
|
+
mapType: MapType | null;
|
|
13
|
+
/**
|
|
14
|
+
* Map 종류에 따른 인증키
|
|
15
|
+
* @description 각 지도 타입에 맞는 키를 입력해야한다.
|
|
16
|
+
*/
|
|
17
|
+
mapKey: string;
|
|
18
|
+
/**
|
|
19
|
+
* Map 종류에 따른 추가 맵 ID
|
|
20
|
+
* @description 특정 지도에서는 맵ID 가 추가로 요구된다 (ex: Google Maps)
|
|
21
|
+
*/
|
|
22
|
+
mapId?: string;
|
|
23
|
+
/**
|
|
24
|
+
* 지도의 기본 설정 정보
|
|
25
|
+
*/
|
|
26
|
+
base?: BaseProps;
|
|
27
|
+
/**
|
|
28
|
+
* 지도의 보기 설정
|
|
29
|
+
*/
|
|
30
|
+
visible?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* 지도 중심 좌표
|
|
33
|
+
*/
|
|
34
|
+
center?: Position;
|
|
35
|
+
/**
|
|
36
|
+
* center 값을 통해 지도의 중심 으로 이동할때 panning 효과 적용 여부
|
|
37
|
+
*/
|
|
38
|
+
centerMoveWithPanning?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* 지도 줌레벨
|
|
41
|
+
*/
|
|
42
|
+
zoomLevel?: number;
|
|
43
|
+
/**
|
|
44
|
+
* 마우스의 드래그로 지도 위치 움직임 가능 여부
|
|
45
|
+
*/
|
|
46
|
+
draggable?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* 키보드 방향키로 지도 위치 움직임 가능 여부
|
|
49
|
+
*/
|
|
50
|
+
keyboardShortcuts?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* 마커 cache 사용 여부
|
|
53
|
+
*/
|
|
54
|
+
markerCache?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* 마커 cache 사용시 초기 pool 갯수
|
|
57
|
+
*/
|
|
58
|
+
markerCachePoolSize?: number;
|
|
59
|
+
/**
|
|
60
|
+
* 마커 cache 사용시 초기 pool 갯수
|
|
61
|
+
*/
|
|
62
|
+
boundsChangeThrottlingTime?: number;
|
|
63
|
+
/**
|
|
64
|
+
* 로딩 완료 후 장면전환 효과 여부
|
|
65
|
+
*/
|
|
66
|
+
dissolveEffectWhenLoaded?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* 맵 로딩화면
|
|
69
|
+
*/
|
|
70
|
+
mapLoadingComponent?: () => JSX.Element;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* 지도의 기본 설정
|
|
74
|
+
*/
|
|
75
|
+
export interface BaseProps {
|
|
76
|
+
/**
|
|
77
|
+
* 지도 시작시의 중심 좌표
|
|
78
|
+
*/
|
|
79
|
+
center?: Position;
|
|
80
|
+
/**
|
|
81
|
+
* 지도 시작시의 줌레벨
|
|
82
|
+
*/
|
|
83
|
+
zoomLevel?: number;
|
|
84
|
+
/**
|
|
85
|
+
* 지도의 최대 줌 레벨
|
|
86
|
+
*/
|
|
87
|
+
maxZoomLevel?: number;
|
|
88
|
+
/**
|
|
89
|
+
* 지도의 최소 줌 레벨
|
|
90
|
+
*/
|
|
91
|
+
minZoomLevel?: number;
|
|
92
|
+
}
|