@mint-ui/map 0.3.5-beta → 0.3.7-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/dist/components/mint-map/MintMap.d.ts +8 -2
- package/dist/components/mint-map/MintMap.js +18 -5
- package/dist/components/mint-map/core/MintMapController.d.ts +4 -0
- package/dist/components/mint-map/core/MintMapController.js +216 -0
- package/dist/components/mint-map/core/MintMapCore.d.ts +1 -1
- package/dist/components/mint-map/core/MintMapCore.js +20 -9
- package/dist/components/mint-map/core/wrapper/MapMarkerWrapper.js +3 -1
- package/dist/components/mint-map/google/GoogleMintMapController.d.ts +2 -0
- package/dist/components/mint-map/google/GoogleMintMapController.js +12 -1
- package/dist/components/mint-map/kakao/KakaoMintMapController.d.ts +43 -0
- package/dist/components/mint-map/kakao/KakaoMintMapController.js +514 -0
- package/dist/components/mint-map/naver/NaverMintMapController.d.ts +2 -0
- package/dist/components/mint-map/naver/NaverMintMapController.js +13 -0
- package/dist/index.es.js +785 -18
- package/dist/index.umd.js +783 -16
- package/package.json +2 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// <reference types="google.maps" />
|
|
3
3
|
import { PropsWithChildren } from "react";
|
|
4
4
|
import { MintMapController } from "./core/MintMapController";
|
|
5
|
-
export declare type MapType = 'naver' | 'google';
|
|
5
|
+
export declare type MapType = 'naver' | 'google' | 'kakao';
|
|
6
6
|
export declare type MapVendorType = naver.maps.Map | google.maps.Map;
|
|
7
7
|
export interface MintMapProps extends MintMapEvents {
|
|
8
8
|
mapType: MapType | null;
|
|
@@ -10,9 +10,14 @@ export interface MintMapProps extends MintMapEvents {
|
|
|
10
10
|
mapId?: string;
|
|
11
11
|
base?: BaseProps;
|
|
12
12
|
visible?: boolean;
|
|
13
|
+
center?: Position;
|
|
14
|
+
zoomLevel?: number;
|
|
15
|
+
draggable?: boolean;
|
|
16
|
+
keyboardShortcuts?: boolean;
|
|
13
17
|
markerCache?: boolean;
|
|
14
18
|
markerCachePoolSize?: number;
|
|
15
19
|
boundsChangeThrottlingTime?: number;
|
|
20
|
+
mapLoadingComponent?: () => JSX.Element;
|
|
16
21
|
}
|
|
17
22
|
export interface MintMapEvents {
|
|
18
23
|
onBoundsChanged?: (bounds: Bounds) => void;
|
|
@@ -26,6 +31,7 @@ export declare class Position {
|
|
|
26
31
|
lng: number;
|
|
27
32
|
offset?: Offset;
|
|
28
33
|
constructor(lat: number, lng: number);
|
|
34
|
+
static equals(pos1: Position, pos2: Position): boolean;
|
|
29
35
|
}
|
|
30
36
|
export declare class Bounds {
|
|
31
37
|
nw: Position;
|
|
@@ -93,4 +99,4 @@ export declare class Polygon extends Drawable {
|
|
|
93
99
|
constructor(options: PolygonOptions);
|
|
94
100
|
getCenter(): Position;
|
|
95
101
|
}
|
|
96
|
-
export declare function MintMap({ mapType, children, base, ...props }: PropsWithChildren<MintMapProps>): JSX.Element;
|
|
102
|
+
export declare function MintMap({ mapLoadingComponent, mapType, children, base, ...props }: PropsWithChildren<MintMapProps>): JSX.Element;
|
|
@@ -11,6 +11,7 @@ var MintMapProvider = require('./core/provider/MintMapProvider.js');
|
|
|
11
11
|
var calculate = require('./core/util/calculate.js');
|
|
12
12
|
var NaverMintMapController = require('./naver/NaverMintMapController.js');
|
|
13
13
|
var GoogleMintMapController = require('./google/GoogleMintMapController.js');
|
|
14
|
+
var KakaoMintMapController = require('./kakao/KakaoMintMapController.js');
|
|
14
15
|
|
|
15
16
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
16
17
|
|
|
@@ -25,6 +26,10 @@ var Position = function () {
|
|
|
25
26
|
this.lng = lng;
|
|
26
27
|
}
|
|
27
28
|
|
|
29
|
+
Position.equals = function (pos1, pos2) {
|
|
30
|
+
return pos1.lat === pos2.lat && pos1.lng === pos2.lng;
|
|
31
|
+
};
|
|
32
|
+
|
|
28
33
|
return Position;
|
|
29
34
|
}();
|
|
30
35
|
|
|
@@ -189,19 +194,25 @@ var DEFAULT_CENTER = {
|
|
|
189
194
|
lng: 127.0448698
|
|
190
195
|
};
|
|
191
196
|
function MintMap(_a) {
|
|
192
|
-
var
|
|
197
|
+
var mapLoadingComponent = _a.mapLoadingComponent,
|
|
198
|
+
mapType = _a.mapType,
|
|
193
199
|
children = _a.children,
|
|
194
200
|
_b = _a.base,
|
|
195
201
|
base = _b === void 0 ? {
|
|
196
202
|
center: DEFAULT_CENTER,
|
|
197
203
|
zoomLevel: 12
|
|
198
204
|
} : _b,
|
|
199
|
-
props = tslib.__rest(_a, ["mapType", "children", "base"]);
|
|
205
|
+
props = tslib.__rest(_a, ["mapLoadingComponent", "mapType", "children", "base"]);
|
|
200
206
|
|
|
201
207
|
var _c = React.useState(),
|
|
202
208
|
controller = _c[0],
|
|
203
209
|
setController = _c[1];
|
|
204
210
|
|
|
211
|
+
var loading = React.useMemo(function () {
|
|
212
|
+
return mapLoadingComponent ? mapLoadingComponent() : React__default["default"].createElement(PointLoading, {
|
|
213
|
+
text: "Loading"
|
|
214
|
+
});
|
|
215
|
+
}, [mapLoadingComponent]);
|
|
205
216
|
React.useEffect(function () {
|
|
206
217
|
if (mapType && mapType.length > 0) {
|
|
207
218
|
setController(undefined);
|
|
@@ -213,6 +224,10 @@ function MintMap(_a) {
|
|
|
213
224
|
mapType: mapType
|
|
214
225
|
}, props), {
|
|
215
226
|
base: base
|
|
227
|
+
})) : mapType === 'kakao' ? new KakaoMintMapController.KakaoMintMapController(tslib.__assign(tslib.__assign({
|
|
228
|
+
mapType: mapType
|
|
229
|
+
}, props), {
|
|
230
|
+
base: base
|
|
216
231
|
})) : null;
|
|
217
232
|
|
|
218
233
|
if (newController_1) {
|
|
@@ -232,9 +247,7 @@ function MintMap(_a) {
|
|
|
232
247
|
mapType: mapType
|
|
233
248
|
}, props, {
|
|
234
249
|
base: base
|
|
235
|
-
}), children)) : React__default["default"].createElement(
|
|
236
|
-
text: "Loading"
|
|
237
|
-
}));
|
|
250
|
+
}), children)) : React__default["default"].createElement(React__default["default"].Fragment, null, loading));
|
|
238
251
|
}
|
|
239
252
|
|
|
240
253
|
function PointLoading(_a) {
|
|
@@ -10,6 +10,8 @@ export declare abstract class MintMapController {
|
|
|
10
10
|
abstract panningTo(targetCenter: Position): void;
|
|
11
11
|
abstract getZoomLevel(): number;
|
|
12
12
|
abstract setZoomLevel(zoom: number): void;
|
|
13
|
+
abstract getCenter(): Position;
|
|
14
|
+
abstract setCenter(position: Position): void;
|
|
13
15
|
abstract createMarker(marker: Marker): void;
|
|
14
16
|
abstract updateMarker(marker: Marker, options: MarkerOptions): void;
|
|
15
17
|
abstract clearDrawable(drawable: Drawable): boolean;
|
|
@@ -33,4 +35,6 @@ export declare abstract class MintMapController {
|
|
|
33
35
|
}): string;
|
|
34
36
|
private processedTime;
|
|
35
37
|
checkBoundsChangeThrottleTime(): boolean;
|
|
38
|
+
getBaseToMapZoom(zoomBase: number): number;
|
|
39
|
+
getMapToBaseZoom(mapZoom: number): number;
|
|
36
40
|
}
|
|
@@ -65,7 +65,223 @@ var MintMapController = function () {
|
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
67
|
|
|
68
|
+
MintMapController.prototype.getBaseToMapZoom = function (zoomBase) {
|
|
69
|
+
var baseMap = MapZoomInfo.BASE_TO_MAP.get(zoomBase);
|
|
70
|
+
|
|
71
|
+
if (baseMap) {
|
|
72
|
+
var mapZoomInfo = baseMap.get(this.getMapType());
|
|
73
|
+
|
|
74
|
+
if (mapZoomInfo) {
|
|
75
|
+
return mapZoomInfo.level;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
throw new Error("[getBaseToMapZoom][".concat(zoomBase, "] is not valid zoom level"));
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
MintMapController.prototype.getMapToBaseZoom = function (mapZoom) {
|
|
83
|
+
var baseZoom = MapZoomInfo.MAP_TO_BASE.get(this.getMapType() + mapZoom);
|
|
84
|
+
|
|
85
|
+
if (baseZoom) {
|
|
86
|
+
return baseZoom;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
throw new Error("[getMapToBaseZoom][".concat(mapZoom, "] is not valid zoom level"));
|
|
90
|
+
};
|
|
91
|
+
|
|
68
92
|
return MintMapController;
|
|
69
93
|
}();
|
|
70
94
|
|
|
95
|
+
var MapZoomInfo = function () {
|
|
96
|
+
function MapZoomInfo() {}
|
|
97
|
+
|
|
98
|
+
MapZoomInfo.BASE_TO_MAP = new Map([[1, new Map([['google', {
|
|
99
|
+
level: 1
|
|
100
|
+
}], ['naver', {
|
|
101
|
+
level: 6
|
|
102
|
+
}], ['kakao', {
|
|
103
|
+
level: 14
|
|
104
|
+
}]])], [2, new Map([['google', {
|
|
105
|
+
level: 2,
|
|
106
|
+
distance: 2000,
|
|
107
|
+
unit: 'km'
|
|
108
|
+
}], ['naver', {
|
|
109
|
+
level: 6
|
|
110
|
+
}], ['kakao', {
|
|
111
|
+
level: 14
|
|
112
|
+
}]])], [3, new Map([['google', {
|
|
113
|
+
level: 3,
|
|
114
|
+
distance: 1000,
|
|
115
|
+
unit: 'km'
|
|
116
|
+
}], ['naver', {
|
|
117
|
+
level: 6
|
|
118
|
+
}], ['kakao', {
|
|
119
|
+
level: 14
|
|
120
|
+
}]])], [4, new Map([['google', {
|
|
121
|
+
level: 4,
|
|
122
|
+
distance: 500,
|
|
123
|
+
unit: 'km'
|
|
124
|
+
}], ['naver', {
|
|
125
|
+
level: 6
|
|
126
|
+
}], ['kakao', {
|
|
127
|
+
level: 14
|
|
128
|
+
}]])], [5, new Map([['google', {
|
|
129
|
+
level: 5,
|
|
130
|
+
distance: 200,
|
|
131
|
+
unit: 'km'
|
|
132
|
+
}], ['naver', {
|
|
133
|
+
level: 6
|
|
134
|
+
}], ['kakao', {
|
|
135
|
+
level: 14
|
|
136
|
+
}]])], [6, new Map([['google', {
|
|
137
|
+
level: 6,
|
|
138
|
+
distance: 100,
|
|
139
|
+
unit: 'km'
|
|
140
|
+
}], ['naver', {
|
|
141
|
+
level: 6
|
|
142
|
+
}], ['kakao', {
|
|
143
|
+
level: 14
|
|
144
|
+
}]])], [7, new Map([['google', {
|
|
145
|
+
level: 7,
|
|
146
|
+
distance: 50,
|
|
147
|
+
unit: 'km'
|
|
148
|
+
}], ['naver', {
|
|
149
|
+
level: 7
|
|
150
|
+
}], ['kakao', {
|
|
151
|
+
level: 13
|
|
152
|
+
}]])], [8, new Map([['google', {
|
|
153
|
+
level: 8,
|
|
154
|
+
distance: 20,
|
|
155
|
+
unit: 'km'
|
|
156
|
+
}], ['naver', {
|
|
157
|
+
level: 8
|
|
158
|
+
}], ['kakao', {
|
|
159
|
+
level: 12
|
|
160
|
+
}]])], [9, new Map([['google', {
|
|
161
|
+
level: 9,
|
|
162
|
+
distance: 10,
|
|
163
|
+
unit: 'km'
|
|
164
|
+
}], ['naver', {
|
|
165
|
+
level: 9
|
|
166
|
+
}], ['kakao', {
|
|
167
|
+
level: 11
|
|
168
|
+
}]])], [10, new Map([['google', {
|
|
169
|
+
level: 10,
|
|
170
|
+
distance: 5,
|
|
171
|
+
unit: 'km'
|
|
172
|
+
}], ['naver', {
|
|
173
|
+
level: 10
|
|
174
|
+
}], ['kakao', {
|
|
175
|
+
level: 10
|
|
176
|
+
}]])], [11, new Map([['google', {
|
|
177
|
+
level: 11,
|
|
178
|
+
distance: 2,
|
|
179
|
+
unit: 'km'
|
|
180
|
+
}], ['naver', {
|
|
181
|
+
level: 11
|
|
182
|
+
}], ['kakao', {
|
|
183
|
+
level: 9
|
|
184
|
+
}]])], [12, new Map([['google', {
|
|
185
|
+
level: 12,
|
|
186
|
+
distance: 1,
|
|
187
|
+
unit: 'km'
|
|
188
|
+
}], ['naver', {
|
|
189
|
+
level: 12
|
|
190
|
+
}], ['kakao', {
|
|
191
|
+
level: 8
|
|
192
|
+
}]])], [13, new Map([['google', {
|
|
193
|
+
level: 13,
|
|
194
|
+
distance: 500,
|
|
195
|
+
unit: 'm'
|
|
196
|
+
}], ['naver', {
|
|
197
|
+
level: 13
|
|
198
|
+
}], ['kakao', {
|
|
199
|
+
level: 7
|
|
200
|
+
}]])], [14, new Map([['google', {
|
|
201
|
+
level: 14,
|
|
202
|
+
distance: 500,
|
|
203
|
+
unit: 'm'
|
|
204
|
+
}], ['naver', {
|
|
205
|
+
level: 14
|
|
206
|
+
}], ['kakao', {
|
|
207
|
+
level: 6
|
|
208
|
+
}]])], [15, new Map([['google', {
|
|
209
|
+
level: 15,
|
|
210
|
+
distance: 500,
|
|
211
|
+
unit: 'm'
|
|
212
|
+
}], ['naver', {
|
|
213
|
+
level: 15
|
|
214
|
+
}], ['kakao', {
|
|
215
|
+
level: 5
|
|
216
|
+
}]])], [16, new Map([['google', {
|
|
217
|
+
level: 16,
|
|
218
|
+
distance: 500,
|
|
219
|
+
unit: 'm'
|
|
220
|
+
}], ['naver', {
|
|
221
|
+
level: 16
|
|
222
|
+
}], ['kakao', {
|
|
223
|
+
level: 4
|
|
224
|
+
}]])], [17, new Map([['google', {
|
|
225
|
+
level: 17,
|
|
226
|
+
distance: 500,
|
|
227
|
+
unit: 'm'
|
|
228
|
+
}], ['naver', {
|
|
229
|
+
level: 17
|
|
230
|
+
}], ['kakao', {
|
|
231
|
+
level: 3
|
|
232
|
+
}]])], [18, new Map([['google', {
|
|
233
|
+
level: 18,
|
|
234
|
+
distance: 500,
|
|
235
|
+
unit: 'm'
|
|
236
|
+
}], ['naver', {
|
|
237
|
+
level: 18
|
|
238
|
+
}], ['kakao', {
|
|
239
|
+
level: 2
|
|
240
|
+
}]])], [19, new Map([['google', {
|
|
241
|
+
level: 19,
|
|
242
|
+
distance: 500,
|
|
243
|
+
unit: 'm'
|
|
244
|
+
}], ['naver', {
|
|
245
|
+
level: 19
|
|
246
|
+
}], ['kakao', {
|
|
247
|
+
level: 1
|
|
248
|
+
}]])], [20, new Map([['google', {
|
|
249
|
+
level: 20,
|
|
250
|
+
distance: 500,
|
|
251
|
+
unit: 'm'
|
|
252
|
+
}], ['naver', {
|
|
253
|
+
level: 20
|
|
254
|
+
}], ['kakao', {
|
|
255
|
+
level: 1
|
|
256
|
+
}]])], [21, new Map([['google', {
|
|
257
|
+
level: 21,
|
|
258
|
+
distance: 500,
|
|
259
|
+
unit: 'm'
|
|
260
|
+
}], ['naver', {
|
|
261
|
+
level: 21
|
|
262
|
+
}], ['kakao', {
|
|
263
|
+
level: 1
|
|
264
|
+
}]])], [22, new Map([['google', {
|
|
265
|
+
level: 22,
|
|
266
|
+
distance: 500,
|
|
267
|
+
unit: 'm'
|
|
268
|
+
}], ['naver', {
|
|
269
|
+
level: 21
|
|
270
|
+
}], ['kakao', {
|
|
271
|
+
level: 1
|
|
272
|
+
}]])]]);
|
|
273
|
+
MapZoomInfo.MAP_TO_BASE = new Map(tslib.__spreadArray([], Array.from(MapZoomInfo.BASE_TO_MAP.entries()).map(function (item) {
|
|
274
|
+
var base = item[0];
|
|
275
|
+
var mapZoom = item[1];
|
|
276
|
+
var result = [];
|
|
277
|
+
mapZoom.forEach(function (value, key) {
|
|
278
|
+
result.push([key + value.level, base]);
|
|
279
|
+
});
|
|
280
|
+
return result;
|
|
281
|
+
}).flatMap(function (a) {
|
|
282
|
+
return a;
|
|
283
|
+
}), true));
|
|
284
|
+
return MapZoomInfo;
|
|
285
|
+
}();
|
|
286
|
+
|
|
71
287
|
exports.MintMapController = MintMapController;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { PropsWithChildren } from "react";
|
|
2
2
|
import { MintMapProps } from "../MintMap";
|
|
3
|
-
export declare function MintMapCore({ onLoad, visible,
|
|
3
|
+
export declare function MintMapCore({ onLoad, visible, zoomLevel, center, children }: PropsWithChildren<MintMapProps>): JSX.Element;
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var tslib = require('tslib');
|
|
6
6
|
var classNames = require('classnames/bind');
|
|
7
7
|
var React = require('react');
|
|
8
|
+
var MintMap = require('../MintMap.js');
|
|
8
9
|
var MintMapProvider = require('./provider/MintMapProvider.js');
|
|
9
10
|
var MintMapCore_module = require('./MintMapCore.module.scss.js');
|
|
10
11
|
|
|
@@ -20,7 +21,8 @@ function MintMapCore(_a) {
|
|
|
20
21
|
var onLoad = _a.onLoad,
|
|
21
22
|
_b = _a.visible,
|
|
22
23
|
visible = _b === void 0 ? true : _b,
|
|
23
|
-
|
|
24
|
+
zoomLevel = _a.zoomLevel,
|
|
25
|
+
center = _a.center,
|
|
24
26
|
children = _a.children;
|
|
25
27
|
var controller = MintMapProvider.useMintMapController();
|
|
26
28
|
var elementRef = React.useRef(null);
|
|
@@ -59,21 +61,30 @@ function MintMapCore(_a) {
|
|
|
59
61
|
};
|
|
60
62
|
}, [controller, elementRef]);
|
|
61
63
|
React.useEffect(function () {
|
|
62
|
-
if (
|
|
64
|
+
if (zoomLevel && controller && mapInitialized) {
|
|
63
65
|
var prevZoomLevel = controller === null || controller === void 0 ? void 0 : controller.getZoomLevel();
|
|
64
66
|
|
|
65
|
-
if (prevZoomLevel !==
|
|
66
|
-
controller === null || controller === void 0 ? void 0 : controller.setZoomLevel(
|
|
67
|
+
if (prevZoomLevel !== zoomLevel) {
|
|
68
|
+
controller === null || controller === void 0 ? void 0 : controller.setZoomLevel(zoomLevel);
|
|
67
69
|
}
|
|
68
70
|
}
|
|
69
|
-
}, [
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
}, [zoomLevel]);
|
|
72
|
+
React.useEffect(function () {
|
|
73
|
+
if (center && controller && mapInitialized) {
|
|
74
|
+
var prevCenter = controller.getCenter();
|
|
75
|
+
|
|
76
|
+
if (!MintMap.Position.equals(prevCenter, center)) {
|
|
77
|
+
controller === null || controller === void 0 ? void 0 : controller.setCenter(center);
|
|
78
|
+
}
|
|
74
79
|
}
|
|
80
|
+
}, [center]);
|
|
81
|
+
return React__default["default"].createElement("div", {
|
|
82
|
+
className: cn('mint-map-root')
|
|
75
83
|
}, mapInitialized && children, React__default["default"].createElement("div", {
|
|
76
84
|
className: cn('mint-map-container'),
|
|
85
|
+
style: {
|
|
86
|
+
visibility: visible ? 'inherit' : 'hidden'
|
|
87
|
+
},
|
|
77
88
|
ref: elementRef
|
|
78
89
|
}));
|
|
79
90
|
}
|
|
@@ -12,6 +12,8 @@ var MarkerMovingHook = require('../hooks/MarkerMovingHook.js');
|
|
|
12
12
|
var offsetCalibration = function (mapType, divElement, options) {
|
|
13
13
|
if (mapType === 'google') {
|
|
14
14
|
divElement.style.transform = "translate(50%, 100%) translate(-".concat(options.anchor ? options.anchor.x : '0', "px, -").concat(options.anchor ? options.anchor.y : '0', "px)");
|
|
15
|
+
} else if (mapType === 'kakao') {
|
|
16
|
+
divElement.style.transform = "translate(50%, 50%) translate(-".concat(options.anchor ? options.anchor.x : '0', "px, -").concat(options.anchor ? options.anchor.y : '0', "px)");
|
|
15
17
|
}
|
|
16
18
|
};
|
|
17
19
|
|
|
@@ -93,7 +95,7 @@ function MapMarkerWrapper(_a) {
|
|
|
93
95
|
divElement.addEventListener('click', onClickHandler);
|
|
94
96
|
divElement.addEventListener('mouseover', onMouseOverHandler);
|
|
95
97
|
return function () {
|
|
96
|
-
if (divCloneRef.current && endAnimationClassName) {
|
|
98
|
+
if (divCloneRef.current && endAnimationClassName && controller.getMapType() !== 'kakao') {
|
|
97
99
|
divCloneRef.current.classList.add(endAnimationClassName);
|
|
98
100
|
|
|
99
101
|
var aniListener_1 = function () {
|
|
@@ -396,7 +396,8 @@ var GoogleMintMapController = function (_super) {
|
|
|
396
396
|
minZoom: (_c = this.mapProps.base) === null || _c === void 0 ? void 0 : _c.minZoomLevel,
|
|
397
397
|
zoom: (_d = this.mapProps.base) === null || _d === void 0 ? void 0 : _d.zoomLevel,
|
|
398
398
|
disableDefaultUI: true,
|
|
399
|
-
gestureHandling: 'greedy',
|
|
399
|
+
gestureHandling: this.mapProps.draggable === false ? 'none' : 'greedy',
|
|
400
|
+
keyboardShortcuts: this.mapProps.keyboardShortcuts === false ? false : true,
|
|
400
401
|
clickableIcons: false
|
|
401
402
|
});
|
|
402
403
|
this.map = map;
|
|
@@ -468,6 +469,16 @@ var GoogleMintMapController = function (_super) {
|
|
|
468
469
|
(_a = this.map) === null || _a === void 0 ? void 0 : _a.setZoom(zoom);
|
|
469
470
|
};
|
|
470
471
|
|
|
472
|
+
GoogleMintMapController.prototype.getCenter = function () {
|
|
473
|
+
return this.getCurrBounds().getCenter();
|
|
474
|
+
};
|
|
475
|
+
|
|
476
|
+
GoogleMintMapController.prototype.setCenter = function (position) {
|
|
477
|
+
var _a;
|
|
478
|
+
|
|
479
|
+
(_a = this.map) === null || _a === void 0 ? void 0 : _a.setCenter(position);
|
|
480
|
+
};
|
|
481
|
+
|
|
471
482
|
return GoogleMintMapController;
|
|
472
483
|
}(MintMapController.MintMapController);
|
|
473
484
|
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/// <reference types="kakaomaps" />
|
|
2
|
+
import { MintMapController } from "../core/MintMapController";
|
|
3
|
+
import { Bounds, Drawable, MapType, MapVendorType, Marker, MarkerOptions, MintMapProps, Polygon, PolygonOptions, Polyline, PolylineOptions, Position } from "../MintMap";
|
|
4
|
+
import { ObjectPool } from '@mint-ui/tools';
|
|
5
|
+
export declare class KakaoMintMapController extends MintMapController {
|
|
6
|
+
type: MapType;
|
|
7
|
+
map: kakao.maps.Map | null;
|
|
8
|
+
scriptUrl: string;
|
|
9
|
+
scriptModules: string[];
|
|
10
|
+
markerPool?: ObjectPool<kakao.maps.CustomOverlay>;
|
|
11
|
+
constructor(props: MintMapProps);
|
|
12
|
+
private initMarkerPool;
|
|
13
|
+
polylineEvents: string[];
|
|
14
|
+
createPolyline(polyline: Polyline): void;
|
|
15
|
+
updatePolyline(polyline: Polyline, options: PolylineOptions): void;
|
|
16
|
+
polygonEvents: string[];
|
|
17
|
+
createPolygon(polygon: Polygon): void;
|
|
18
|
+
updatePolygon(polygon: Polygon, options: PolygonOptions): void;
|
|
19
|
+
markerEvents: string[];
|
|
20
|
+
createMarker(marker: Marker): void;
|
|
21
|
+
updateMarker(marker: Marker, options: MarkerOptions): void;
|
|
22
|
+
private markerMaxZIndex;
|
|
23
|
+
private getMaxZIndex;
|
|
24
|
+
setMarkerZIndex(marker: Marker, zIndex: number): void;
|
|
25
|
+
markerToTheTop(marker: Marker): void;
|
|
26
|
+
clearDrawable(drawable: Drawable): boolean;
|
|
27
|
+
private dragStartPoint;
|
|
28
|
+
private dragged;
|
|
29
|
+
isMapDragged(): boolean;
|
|
30
|
+
setMapDragged(value: boolean): void;
|
|
31
|
+
loadMapApi(): Promise<boolean>;
|
|
32
|
+
initializingMap(divElement: HTMLDivElement): Promise<MapVendorType>;
|
|
33
|
+
private getSafeZoomValue;
|
|
34
|
+
destroyMap(): void;
|
|
35
|
+
getCurrBounds(): Bounds;
|
|
36
|
+
panningTo(targetCenter: Position): void;
|
|
37
|
+
getZoomLevel(): number;
|
|
38
|
+
setZoomLevel(zoom: number): void;
|
|
39
|
+
getCenter(): Position;
|
|
40
|
+
setCenter(position: Position): void;
|
|
41
|
+
private positionToLatLng;
|
|
42
|
+
private latLngToPosition;
|
|
43
|
+
}
|