@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
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
/// <reference types="kakaomaps" />
|
|
2
|
-
import { MintMapController } from "../core/MintMapController";
|
|
3
|
-
import { ObjectPool } from '@mint-ui/tools';
|
|
4
|
-
import { MapType, MapVendorType } from "../types/CommonTypes";
|
|
5
|
-
import { Drawable, Marker, MarkerOptions, Polygon, PolygonOptions, Polyline, PolylineOptions } from "../types/MapDrawables";
|
|
6
|
-
import { Bounds, Position } from "../types/MapTypes";
|
|
7
|
-
import { MintMapProps } from "../types/MintMapProps";
|
|
8
|
-
import { EventCallback, EventParamType, MapEvent, MapEventName, MapUIEvent } from "../types/MapEventTypes";
|
|
9
|
-
export declare class KakaoMintMapController extends MintMapController {
|
|
10
|
-
type: MapType;
|
|
11
|
-
map: kakao.maps.Map | null;
|
|
12
|
-
scriptUrl: string;
|
|
13
|
-
scriptModules: string[];
|
|
14
|
-
protected mapEvent: MapEvent;
|
|
15
|
-
protected mapUIEvent: MapUIEvent;
|
|
16
|
-
markerPool?: ObjectPool<kakao.maps.CustomOverlay>;
|
|
17
|
-
constructor(props: MintMapProps);
|
|
18
|
-
private initMarkerPool;
|
|
19
|
-
polylineEvents: string[];
|
|
20
|
-
createPolyline(polyline: Polyline): void;
|
|
21
|
-
updatePolyline(polyline: Polyline, options: PolylineOptions): void;
|
|
22
|
-
polygonEvents: string[];
|
|
23
|
-
createPolygon(polygon: Polygon): void;
|
|
24
|
-
updatePolygon(polygon: Polygon, options: PolygonOptions): void;
|
|
25
|
-
markerEvents: string[];
|
|
26
|
-
createMarker(marker: Marker): void;
|
|
27
|
-
updateMarker(marker: Marker, options: MarkerOptions): void;
|
|
28
|
-
private removeParentElementsMargin;
|
|
29
|
-
private markerMaxZIndex;
|
|
30
|
-
private getMaxZIndex;
|
|
31
|
-
setMarkerZIndex(marker: Marker, zIndex: number): void;
|
|
32
|
-
markerToTheTop(marker: Marker): void;
|
|
33
|
-
clearDrawable(drawable: Drawable): boolean;
|
|
34
|
-
private dragStartPoint;
|
|
35
|
-
private dragged;
|
|
36
|
-
isMapDragged(): boolean;
|
|
37
|
-
setMapDragged(value: boolean): void;
|
|
38
|
-
private checkLoaded;
|
|
39
|
-
loadMapApi(): Promise<boolean>;
|
|
40
|
-
initializingMap(divElement: HTMLDivElement): Promise<MapVendorType>;
|
|
41
|
-
private getSafeZoomValue;
|
|
42
|
-
destroyMap(): void;
|
|
43
|
-
getCurrBounds(): Bounds;
|
|
44
|
-
panningTo(targetCenter: Position): void;
|
|
45
|
-
getZoomLevel(): number;
|
|
46
|
-
setZoomLevel(zoom: number): void;
|
|
47
|
-
getCenter(): Position;
|
|
48
|
-
setCenter(position: Position): void;
|
|
49
|
-
private positionToLatLng;
|
|
50
|
-
private latLngToPosition;
|
|
51
|
-
private eventMap;
|
|
52
|
-
addEventListener(eventName: MapEventName, callback: EventCallback<EventParamType>): void;
|
|
53
|
-
removeEventListener(eventName: MapEventName, callback: EventCallback<EventParamType>): void;
|
|
54
|
-
removeAllEventListener(eventName?: MapEventName | undefined): void;
|
|
55
|
-
private clearEventListener;
|
|
56
|
-
}
|
|
1
|
+
/// <reference types="kakaomaps" />
|
|
2
|
+
import { MintMapController } from "../core/MintMapController";
|
|
3
|
+
import { ObjectPool } from '@mint-ui/tools';
|
|
4
|
+
import { MapType, MapVendorType } from "../types/CommonTypes";
|
|
5
|
+
import { Drawable, Marker, MarkerOptions, Polygon, PolygonOptions, Polyline, PolylineOptions } from "../types/MapDrawables";
|
|
6
|
+
import { Bounds, Position } from "../types/MapTypes";
|
|
7
|
+
import { MintMapProps } from "../types/MintMapProps";
|
|
8
|
+
import { EventCallback, EventParamType, MapEvent, MapEventName, MapUIEvent } from "../types/MapEventTypes";
|
|
9
|
+
export declare class KakaoMintMapController extends MintMapController {
|
|
10
|
+
type: MapType;
|
|
11
|
+
map: kakao.maps.Map | null;
|
|
12
|
+
scriptUrl: string;
|
|
13
|
+
scriptModules: string[];
|
|
14
|
+
protected mapEvent: MapEvent;
|
|
15
|
+
protected mapUIEvent: MapUIEvent;
|
|
16
|
+
markerPool?: ObjectPool<kakao.maps.CustomOverlay>;
|
|
17
|
+
constructor(props: MintMapProps);
|
|
18
|
+
private initMarkerPool;
|
|
19
|
+
polylineEvents: string[];
|
|
20
|
+
createPolyline(polyline: Polyline): void;
|
|
21
|
+
updatePolyline(polyline: Polyline, options: PolylineOptions): void;
|
|
22
|
+
polygonEvents: string[];
|
|
23
|
+
createPolygon(polygon: Polygon): void;
|
|
24
|
+
updatePolygon(polygon: Polygon, options: PolygonOptions): void;
|
|
25
|
+
markerEvents: string[];
|
|
26
|
+
createMarker(marker: Marker): void;
|
|
27
|
+
updateMarker(marker: Marker, options: MarkerOptions): void;
|
|
28
|
+
private removeParentElementsMargin;
|
|
29
|
+
private markerMaxZIndex;
|
|
30
|
+
private getMaxZIndex;
|
|
31
|
+
setMarkerZIndex(marker: Marker, zIndex: number): void;
|
|
32
|
+
markerToTheTop(marker: Marker): void;
|
|
33
|
+
clearDrawable(drawable: Drawable): boolean;
|
|
34
|
+
private dragStartPoint;
|
|
35
|
+
private dragged;
|
|
36
|
+
isMapDragged(): boolean;
|
|
37
|
+
setMapDragged(value: boolean): void;
|
|
38
|
+
private checkLoaded;
|
|
39
|
+
loadMapApi(): Promise<boolean>;
|
|
40
|
+
initializingMap(divElement: HTMLDivElement): Promise<MapVendorType>;
|
|
41
|
+
private getSafeZoomValue;
|
|
42
|
+
destroyMap(): void;
|
|
43
|
+
getCurrBounds(): Bounds;
|
|
44
|
+
panningTo(targetCenter: Position): void;
|
|
45
|
+
getZoomLevel(): number;
|
|
46
|
+
setZoomLevel(zoom: number): void;
|
|
47
|
+
getCenter(): Position;
|
|
48
|
+
setCenter(position: Position): void;
|
|
49
|
+
private positionToLatLng;
|
|
50
|
+
private latLngToPosition;
|
|
51
|
+
private eventMap;
|
|
52
|
+
addEventListener(eventName: MapEventName, callback: EventCallback<EventParamType>): void;
|
|
53
|
+
removeEventListener(eventName: MapEventName, callback: EventCallback<EventParamType>): void;
|
|
54
|
+
removeAllEventListener(eventName?: MapEventName | undefined): void;
|
|
55
|
+
private clearEventListener;
|
|
56
|
+
}
|
|
@@ -452,7 +452,7 @@ function (_super) {
|
|
|
452
452
|
case 2:
|
|
453
453
|
options = {
|
|
454
454
|
center: this.positionToLatLng((_a = this.mapProps.base) === null || _a === void 0 ? void 0 : _a.center),
|
|
455
|
-
level: this.getBaseToMapZoom(((_b = this.mapProps.base) === null || _b === void 0 ? void 0 : _b.zoomLevel) ||
|
|
455
|
+
level: this.getBaseToMapZoom(((_b = this.mapProps.base) === null || _b === void 0 ? void 0 : _b.zoomLevel) || 15),
|
|
456
456
|
draggable: this.mapProps.draggable === false ? false : true,
|
|
457
457
|
scrollWheel: this.mapProps.draggable === false ? false : true,
|
|
458
458
|
keyboardShortcuts: this.mapProps.keyboardShortcuts === false ? false : true
|
|
@@ -472,6 +472,7 @@ function (_super) {
|
|
|
472
472
|
minZoom = 14;
|
|
473
473
|
}
|
|
474
474
|
|
|
475
|
+
divElement.innerHTML = '';
|
|
475
476
|
map = new kakao.maps.Map(divElement, options);
|
|
476
477
|
map.setMaxLevel(minZoom);
|
|
477
478
|
map.setMinLevel(maxZoom);
|
|
@@ -536,13 +537,13 @@ function (_super) {
|
|
|
536
537
|
};
|
|
537
538
|
|
|
538
539
|
KakaoMintMapController.prototype.getSafeZoomValue = function (value) {
|
|
539
|
-
/**
|
|
540
|
-
* 카카오는 구글/네이버와 다르게 줌레벨이 작아질수록 확대된다 (가장 확대된 것이 0)
|
|
541
|
-
* - 가장 확대된 값 : 1
|
|
542
|
-
* - 가장 축소된 값 : 14
|
|
543
|
-
*
|
|
544
|
-
* 그래서 세계지도가 없는 카카오는 동일한 사정인 네이버와 매핑하기로 한다.
|
|
545
|
-
* 문제는 둘 간의 줌 레벨별 축척이 일치하지 않는다. 그래서 가장 유사한 레벨 끼리 매핑이 필요하다
|
|
540
|
+
/**
|
|
541
|
+
* 카카오는 구글/네이버와 다르게 줌레벨이 작아질수록 확대된다 (가장 확대된 것이 0)
|
|
542
|
+
* - 가장 확대된 값 : 1
|
|
543
|
+
* - 가장 축소된 값 : 14
|
|
544
|
+
*
|
|
545
|
+
* 그래서 세계지도가 없는 카카오는 동일한 사정인 네이버와 매핑하기로 한다.
|
|
546
|
+
* 문제는 둘 간의 줌 레벨별 축척이 일치하지 않는다. 그래서 가장 유사한 레벨 끼리 매핑이 필요하다
|
|
546
547
|
*/
|
|
547
548
|
var mapValue = this.getBaseToMapZoom(value);
|
|
548
549
|
|
|
@@ -1,53 +1,54 @@
|
|
|
1
|
-
/// <reference types="navermaps" />
|
|
2
|
-
import { MintMapController } from "../core/MintMapController";
|
|
3
|
-
import { ObjectPool } from '@mint-ui/tools';
|
|
4
|
-
import { MapType, MapVendorType } from "../types/CommonTypes";
|
|
5
|
-
import { Drawable, Marker, MarkerOptions, Polygon, PolygonOptions, Polyline, PolylineOptions } from "../types/MapDrawables";
|
|
6
|
-
import { Bounds, Position } from "../types/MapTypes";
|
|
7
|
-
import { MintMapProps } from "../types/MintMapProps";
|
|
8
|
-
import { EventCallback, EventParamType, MapEvent, MapEventName, MapUIEvent } from "../types/MapEventTypes";
|
|
9
|
-
export declare class NaverMintMapController extends MintMapController {
|
|
10
|
-
type: MapType;
|
|
11
|
-
map: naver.maps.Map | null;
|
|
12
|
-
scriptUrl: string;
|
|
13
|
-
scriptModules: string[];
|
|
14
|
-
protected mapEvent: MapEvent;
|
|
15
|
-
protected mapUIEvent: MapUIEvent;
|
|
16
|
-
markerPool?: ObjectPool<naver.maps.Marker>;
|
|
17
|
-
constructor(props: MintMapProps);
|
|
18
|
-
private initMarkerPool;
|
|
19
|
-
polylineEvents: string[];
|
|
20
|
-
createPolyline(polyline: Polyline): void;
|
|
21
|
-
updatePolyline(polyline: Polyline, options: PolylineOptions): void;
|
|
22
|
-
polygonEvents: string[];
|
|
23
|
-
createPolygon(polygon: Polygon): void;
|
|
24
|
-
updatePolygon(polygon: Polygon, options: PolygonOptions): void;
|
|
25
|
-
markerEvents: string[];
|
|
26
|
-
createMarker(marker: Marker): void;
|
|
27
|
-
updateMarker(marker: Marker, options: MarkerOptions): void;
|
|
28
|
-
private markerMaxZIndex;
|
|
29
|
-
private getMaxZIndex;
|
|
30
|
-
setMarkerZIndex(marker: Marker, zIndex: number): void;
|
|
31
|
-
markerToTheTop(marker: Marker): void;
|
|
32
|
-
clearDrawable(drawable: Drawable): boolean;
|
|
33
|
-
private dragStartPoint;
|
|
34
|
-
private dragged;
|
|
35
|
-
isMapDragged(): boolean;
|
|
36
|
-
setMapDragged(value: boolean): void;
|
|
37
|
-
private checkLoaded;
|
|
38
|
-
loadMapApi(): Promise<boolean>;
|
|
39
|
-
initializingMap(divElement: HTMLDivElement): Promise<MapVendorType>;
|
|
40
|
-
private getSafeZoomValue;
|
|
41
|
-
destroyMap(): void;
|
|
42
|
-
getCurrBounds(): Bounds;
|
|
43
|
-
panningTo(targetCenter: Position): void;
|
|
44
|
-
getZoomLevel(): number;
|
|
45
|
-
setZoomLevel(zoom: number): void;
|
|
46
|
-
getCenter(): Position;
|
|
47
|
-
setCenter(position: Position): void;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
1
|
+
/// <reference types="navermaps" />
|
|
2
|
+
import { MintMapController } from "../core/MintMapController";
|
|
3
|
+
import { ObjectPool } from '@mint-ui/tools';
|
|
4
|
+
import { MapType, MapVendorType } from "../types/CommonTypes";
|
|
5
|
+
import { Drawable, Marker, MarkerOptions, Polygon, PolygonOptions, Polyline, PolylineOptions } from "../types/MapDrawables";
|
|
6
|
+
import { Bounds, Offset, Position } from "../types/MapTypes";
|
|
7
|
+
import { MintMapProps } from "../types/MintMapProps";
|
|
8
|
+
import { EventCallback, EventParamType, MapEvent, MapEventName, MapUIEvent } from "../types/MapEventTypes";
|
|
9
|
+
export declare class NaverMintMapController extends MintMapController {
|
|
10
|
+
type: MapType;
|
|
11
|
+
map: naver.maps.Map | null;
|
|
12
|
+
scriptUrl: string;
|
|
13
|
+
scriptModules: string[];
|
|
14
|
+
protected mapEvent: MapEvent;
|
|
15
|
+
protected mapUIEvent: MapUIEvent;
|
|
16
|
+
markerPool?: ObjectPool<naver.maps.Marker>;
|
|
17
|
+
constructor(props: MintMapProps);
|
|
18
|
+
private initMarkerPool;
|
|
19
|
+
polylineEvents: string[];
|
|
20
|
+
createPolyline(polyline: Polyline): void;
|
|
21
|
+
updatePolyline(polyline: Polyline, options: PolylineOptions): void;
|
|
22
|
+
polygonEvents: string[];
|
|
23
|
+
createPolygon(polygon: Polygon): void;
|
|
24
|
+
updatePolygon(polygon: Polygon, options: PolygonOptions): void;
|
|
25
|
+
markerEvents: string[];
|
|
26
|
+
createMarker(marker: Marker): void;
|
|
27
|
+
updateMarker(marker: Marker, options: MarkerOptions): void;
|
|
28
|
+
private markerMaxZIndex;
|
|
29
|
+
private getMaxZIndex;
|
|
30
|
+
setMarkerZIndex(marker: Marker, zIndex: number): void;
|
|
31
|
+
markerToTheTop(marker: Marker): void;
|
|
32
|
+
clearDrawable(drawable: Drawable): boolean;
|
|
33
|
+
private dragStartPoint;
|
|
34
|
+
private dragged;
|
|
35
|
+
isMapDragged(): boolean;
|
|
36
|
+
setMapDragged(value: boolean): void;
|
|
37
|
+
private checkLoaded;
|
|
38
|
+
loadMapApi(): Promise<boolean>;
|
|
39
|
+
initializingMap(divElement: HTMLDivElement): Promise<MapVendorType>;
|
|
40
|
+
private getSafeZoomValue;
|
|
41
|
+
destroyMap(): void;
|
|
42
|
+
getCurrBounds(): Bounds;
|
|
43
|
+
panningTo(targetCenter: Position): void;
|
|
44
|
+
getZoomLevel(): number;
|
|
45
|
+
setZoomLevel(zoom: number): void;
|
|
46
|
+
getCenter(): Position;
|
|
47
|
+
setCenter(position: Position): void;
|
|
48
|
+
positionToOffset(position: Position): Offset;
|
|
49
|
+
private eventMap;
|
|
50
|
+
addEventListener(eventName: MapEventName, callback: EventCallback<EventParamType>): void;
|
|
51
|
+
removeEventListener(eventName: MapEventName, callback: EventCallback<EventParamType>): void;
|
|
52
|
+
removeAllEventListener(eventName?: MapEventName | undefined): void;
|
|
53
|
+
private clearEventListener;
|
|
54
|
+
}
|
|
@@ -249,11 +249,11 @@ function (_super) {
|
|
|
249
249
|
var map = marker.native.getMap();
|
|
250
250
|
|
|
251
251
|
if (map) {
|
|
252
|
-
/** 중요!!!!
|
|
253
|
-
* naver 마커의 setOption(MarkerOptions) 은 내부적으로 setMap 을 무조건 강제 처리한다!!!
|
|
254
|
-
* setMap 을 처리하면 맵의 이벤트리스너 등등이 모두 초기화 되고 다시 맵을 add 하면서 마커관련된 모든 초기화가 다시 일어난다.
|
|
255
|
-
* (심지어 map 이 기존과 같은 객체인데도 초기화 처리함)
|
|
256
|
-
* 그래서 민트맵에서는 update 를 지원하는 항목별로 명시적으로 각각 처리한다.
|
|
252
|
+
/** 중요!!!!
|
|
253
|
+
* naver 마커의 setOption(MarkerOptions) 은 내부적으로 setMap 을 무조건 강제 처리한다!!!
|
|
254
|
+
* setMap 을 처리하면 맵의 이벤트리스너 등등이 모두 초기화 되고 다시 맵을 add 하면서 마커관련된 모든 초기화가 다시 일어난다.
|
|
255
|
+
* (심지어 map 이 기존과 같은 객체인데도 초기화 처리함)
|
|
256
|
+
* 그래서 민트맵에서는 update 를 지원하는 항목별로 명시적으로 각각 처리한다.
|
|
257
257
|
*/
|
|
258
258
|
//Position
|
|
259
259
|
if (options.position && options.position instanceof MapTypes.Position) {
|
|
@@ -481,7 +481,7 @@ function (_super) {
|
|
|
481
481
|
case 2:
|
|
482
482
|
options = {
|
|
483
483
|
center: (_a = this.mapProps.base) === null || _a === void 0 ? void 0 : _a.center,
|
|
484
|
-
zoom: (_b = this.mapProps.base) === null || _b === void 0 ? void 0 : _b.zoomLevel,
|
|
484
|
+
zoom: ((_b = this.mapProps.base) === null || _b === void 0 ? void 0 : _b.zoomLevel) || this.getBaseToMapZoom(15),
|
|
485
485
|
draggable: this.mapProps.draggable === false ? false : true,
|
|
486
486
|
scrollWheel: this.mapProps.draggable === false ? false : true,
|
|
487
487
|
keyboardShortcuts: this.mapProps.keyboardShortcuts === false ? false : true,
|
|
@@ -507,6 +507,7 @@ function (_super) {
|
|
|
507
507
|
|
|
508
508
|
options.minZoom = minZoom;
|
|
509
509
|
options.maxZoom = maxZoom;
|
|
510
|
+
divElement.innerHTML = '';
|
|
510
511
|
map = new naver.maps.Map(divElement, options);
|
|
511
512
|
this.map = map; //@ts-ignore
|
|
512
513
|
|
|
@@ -631,6 +632,15 @@ function (_super) {
|
|
|
631
632
|
(_a = this.map) === null || _a === void 0 ? void 0 : _a.setCenter(position);
|
|
632
633
|
};
|
|
633
634
|
|
|
635
|
+
NaverMintMapController.prototype.positionToOffset = function (position) {
|
|
636
|
+
if (!this.map) {
|
|
637
|
+
return new MapTypes.Offset(0, 0);
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
var offset = this.map.getProjection().fromCoordToOffset(new naver.maps.LatLng(position.lat, position.lng));
|
|
641
|
+
return new MapTypes.Offset(offset.x, offset.y);
|
|
642
|
+
};
|
|
643
|
+
|
|
634
644
|
NaverMintMapController.prototype.addEventListener = function (eventName, callback) {
|
|
635
645
|
var _this = this;
|
|
636
646
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/// <reference types="navermaps" />
|
|
2
|
-
/// <reference types="google.maps" />
|
|
3
|
-
/// <reference types="kakaomaps" />
|
|
4
|
-
/**
|
|
5
|
-
* 지원되는 맵 종류
|
|
6
|
-
*/
|
|
7
|
-
export declare type MapType = 'naver' | 'google' | 'kakao';
|
|
8
|
-
/**
|
|
9
|
-
* 맵 객체의 native 타입
|
|
10
|
-
*/
|
|
11
|
-
export declare type MapVendorType = naver.maps.Map | google.maps.Map | kakao.maps.Map;
|
|
1
|
+
/// <reference types="navermaps" />
|
|
2
|
+
/// <reference types="google.maps" />
|
|
3
|
+
/// <reference types="kakaomaps" />
|
|
4
|
+
/**
|
|
5
|
+
* 지원되는 맵 종류
|
|
6
|
+
*/
|
|
7
|
+
export declare type MapType = 'naver' | 'google' | 'kakao';
|
|
8
|
+
/**
|
|
9
|
+
* 맵 객체의 native 타입
|
|
10
|
+
*/
|
|
11
|
+
export declare type MapVendorType = naver.maps.Map | google.maps.Map | kakao.maps.Map;
|
|
@@ -1,110 +1,110 @@
|
|
|
1
|
-
import { Offset, Position } from "./MapTypes";
|
|
2
|
-
export interface DrawableOptions {
|
|
3
|
-
/**
|
|
4
|
-
* 좌표값
|
|
5
|
-
*/
|
|
6
|
-
position: Position | Position[] | [number, number][];
|
|
7
|
-
/**
|
|
8
|
-
* 좌표값
|
|
9
|
-
*/
|
|
10
|
-
visible?: boolean;
|
|
11
|
-
/**
|
|
12
|
-
* 이벤트 목록
|
|
13
|
-
*/
|
|
14
|
-
event?: Map<keyof DocumentEventMap, (e: Event) => boolean | void>;
|
|
15
|
-
}
|
|
16
|
-
export declare abstract class Drawable {
|
|
17
|
-
/**
|
|
18
|
-
* 지도의 native drawable object
|
|
19
|
-
*/
|
|
20
|
-
native?: any;
|
|
21
|
-
/**
|
|
22
|
-
* Drawable options
|
|
23
|
-
*/
|
|
24
|
-
abstract options: DrawableOptions;
|
|
25
|
-
}
|
|
26
|
-
export interface MarkerOptions extends DrawableOptions {
|
|
27
|
-
/**
|
|
28
|
-
* 마커의 좌표와 Element 사이의 offset 값
|
|
29
|
-
*/
|
|
30
|
-
anchor?: Offset;
|
|
31
|
-
/**
|
|
32
|
-
* zIndex 설정
|
|
33
|
-
*/
|
|
34
|
-
zIndex?: number;
|
|
35
|
-
}
|
|
36
|
-
export declare class Marker extends Drawable {
|
|
37
|
-
/**
|
|
38
|
-
* Marker 의 옵션
|
|
39
|
-
*/
|
|
40
|
-
options: MarkerOptions;
|
|
41
|
-
/**
|
|
42
|
-
* 커스텀 마커 Element
|
|
43
|
-
*/
|
|
44
|
-
element?: string | HTMLElement;
|
|
45
|
-
/**
|
|
46
|
-
* 지도에 표시할 마커정보
|
|
47
|
-
*/
|
|
48
|
-
constructor(options: MarkerOptions);
|
|
49
|
-
}
|
|
50
|
-
export interface PolylineOptions extends DrawableOptions {
|
|
51
|
-
/**
|
|
52
|
-
* 외곽선 의 색상
|
|
53
|
-
* @description css 의 color 에 준함
|
|
54
|
-
*/
|
|
55
|
-
lineColor?: string;
|
|
56
|
-
/**
|
|
57
|
-
* 외곽선 의 굵기
|
|
58
|
-
* @description 픽셀
|
|
59
|
-
*/
|
|
60
|
-
lineSize?: number;
|
|
61
|
-
/**
|
|
62
|
-
* 외곽선 의 투명도
|
|
63
|
-
* @description 0.0과 1.0 사이의 불투명도
|
|
64
|
-
*/
|
|
65
|
-
lineOpacity?: number;
|
|
66
|
-
/**
|
|
67
|
-
* 편집가능 여부
|
|
68
|
-
*/
|
|
69
|
-
editable?: boolean;
|
|
70
|
-
}
|
|
71
|
-
export declare class Polyline extends Drawable {
|
|
72
|
-
/**
|
|
73
|
-
* Polygon 의 옵션
|
|
74
|
-
*/
|
|
75
|
-
options: PolylineOptions;
|
|
76
|
-
/**
|
|
77
|
-
* 지도에 표시할 폴리곤정보
|
|
78
|
-
*/
|
|
79
|
-
constructor(options: PolylineOptions);
|
|
80
|
-
}
|
|
81
|
-
export interface PolygonOptions extends PolylineOptions {
|
|
82
|
-
/**
|
|
83
|
-
* 폴리곤 외곽선의 내부 다각형 position
|
|
84
|
-
*/
|
|
85
|
-
innerPositions?: Position[][];
|
|
86
|
-
/**
|
|
87
|
-
* 면의 배경색
|
|
88
|
-
* @description css 의 color 에 준함
|
|
89
|
-
*/
|
|
90
|
-
fillColor?: string;
|
|
91
|
-
/**
|
|
92
|
-
* 면의 투명도
|
|
93
|
-
* @description 0~1 의 값
|
|
94
|
-
*/
|
|
95
|
-
fillOpacity?: number;
|
|
96
|
-
}
|
|
97
|
-
export declare class Polygon extends Drawable {
|
|
98
|
-
/**
|
|
99
|
-
* Polygon 의 옵션
|
|
100
|
-
*/
|
|
101
|
-
options: PolygonOptions;
|
|
102
|
-
/**
|
|
103
|
-
* 지도에 표시할 폴리곤정보
|
|
104
|
-
*/
|
|
105
|
-
constructor(options: PolygonOptions);
|
|
106
|
-
/**
|
|
107
|
-
* 폴리곤의 중점을 구한다.
|
|
108
|
-
*/
|
|
109
|
-
getCenter(): Position;
|
|
110
|
-
}
|
|
1
|
+
import { Offset, Position } from "./MapTypes";
|
|
2
|
+
export interface DrawableOptions {
|
|
3
|
+
/**
|
|
4
|
+
* 좌표값
|
|
5
|
+
*/
|
|
6
|
+
position: Position | Position[] | [number, number][];
|
|
7
|
+
/**
|
|
8
|
+
* 좌표값
|
|
9
|
+
*/
|
|
10
|
+
visible?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* 이벤트 목록
|
|
13
|
+
*/
|
|
14
|
+
event?: Map<keyof DocumentEventMap, (e: Event) => boolean | void>;
|
|
15
|
+
}
|
|
16
|
+
export declare abstract class Drawable {
|
|
17
|
+
/**
|
|
18
|
+
* 지도의 native drawable object
|
|
19
|
+
*/
|
|
20
|
+
native?: any;
|
|
21
|
+
/**
|
|
22
|
+
* Drawable options
|
|
23
|
+
*/
|
|
24
|
+
abstract options: DrawableOptions;
|
|
25
|
+
}
|
|
26
|
+
export interface MarkerOptions extends DrawableOptions {
|
|
27
|
+
/**
|
|
28
|
+
* 마커의 좌표와 Element 사이의 offset 값
|
|
29
|
+
*/
|
|
30
|
+
anchor?: Offset;
|
|
31
|
+
/**
|
|
32
|
+
* zIndex 설정
|
|
33
|
+
*/
|
|
34
|
+
zIndex?: number;
|
|
35
|
+
}
|
|
36
|
+
export declare class Marker extends Drawable {
|
|
37
|
+
/**
|
|
38
|
+
* Marker 의 옵션
|
|
39
|
+
*/
|
|
40
|
+
options: MarkerOptions;
|
|
41
|
+
/**
|
|
42
|
+
* 커스텀 마커 Element
|
|
43
|
+
*/
|
|
44
|
+
element?: string | HTMLElement;
|
|
45
|
+
/**
|
|
46
|
+
* 지도에 표시할 마커정보
|
|
47
|
+
*/
|
|
48
|
+
constructor(options: MarkerOptions);
|
|
49
|
+
}
|
|
50
|
+
export interface PolylineOptions extends DrawableOptions {
|
|
51
|
+
/**
|
|
52
|
+
* 외곽선 의 색상
|
|
53
|
+
* @description css 의 color 에 준함
|
|
54
|
+
*/
|
|
55
|
+
lineColor?: string;
|
|
56
|
+
/**
|
|
57
|
+
* 외곽선 의 굵기
|
|
58
|
+
* @description 픽셀
|
|
59
|
+
*/
|
|
60
|
+
lineSize?: number;
|
|
61
|
+
/**
|
|
62
|
+
* 외곽선 의 투명도
|
|
63
|
+
* @description 0.0과 1.0 사이의 불투명도
|
|
64
|
+
*/
|
|
65
|
+
lineOpacity?: number;
|
|
66
|
+
/**
|
|
67
|
+
* 편집가능 여부
|
|
68
|
+
*/
|
|
69
|
+
editable?: boolean;
|
|
70
|
+
}
|
|
71
|
+
export declare class Polyline extends Drawable {
|
|
72
|
+
/**
|
|
73
|
+
* Polygon 의 옵션
|
|
74
|
+
*/
|
|
75
|
+
options: PolylineOptions;
|
|
76
|
+
/**
|
|
77
|
+
* 지도에 표시할 폴리곤정보
|
|
78
|
+
*/
|
|
79
|
+
constructor(options: PolylineOptions);
|
|
80
|
+
}
|
|
81
|
+
export interface PolygonOptions extends PolylineOptions {
|
|
82
|
+
/**
|
|
83
|
+
* 폴리곤 외곽선의 내부 다각형 position
|
|
84
|
+
*/
|
|
85
|
+
innerPositions?: Position[][];
|
|
86
|
+
/**
|
|
87
|
+
* 면의 배경색
|
|
88
|
+
* @description css 의 color 에 준함
|
|
89
|
+
*/
|
|
90
|
+
fillColor?: string;
|
|
91
|
+
/**
|
|
92
|
+
* 면의 투명도
|
|
93
|
+
* @description 0~1 의 값
|
|
94
|
+
*/
|
|
95
|
+
fillOpacity?: number;
|
|
96
|
+
}
|
|
97
|
+
export declare class Polygon extends Drawable {
|
|
98
|
+
/**
|
|
99
|
+
* Polygon 의 옵션
|
|
100
|
+
*/
|
|
101
|
+
options: PolygonOptions;
|
|
102
|
+
/**
|
|
103
|
+
* 지도에 표시할 폴리곤정보
|
|
104
|
+
*/
|
|
105
|
+
constructor(options: PolygonOptions);
|
|
106
|
+
/**
|
|
107
|
+
* 폴리곤의 중점을 구한다.
|
|
108
|
+
*/
|
|
109
|
+
getCenter(): Position;
|
|
110
|
+
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var tslib = require('tslib');
|
|
6
|
-
var
|
|
6
|
+
var polygon = require('../core/util/polygon.js');
|
|
7
7
|
var MapTypes = require('./MapTypes.js');
|
|
8
8
|
|
|
9
9
|
var Drawable =
|
|
@@ -18,8 +18,8 @@ var Marker =
|
|
|
18
18
|
/** @class */
|
|
19
19
|
function (_super) {
|
|
20
20
|
tslib.__extends(Marker, _super);
|
|
21
|
-
/**
|
|
22
|
-
* 지도에 표시할 마커정보
|
|
21
|
+
/**
|
|
22
|
+
* 지도에 표시할 마커정보
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
25
|
|
|
@@ -37,8 +37,8 @@ var Polyline =
|
|
|
37
37
|
/** @class */
|
|
38
38
|
function (_super) {
|
|
39
39
|
tslib.__extends(Polyline, _super);
|
|
40
|
-
/**
|
|
41
|
-
* 지도에 표시할 폴리곤정보
|
|
40
|
+
/**
|
|
41
|
+
* 지도에 표시할 폴리곤정보
|
|
42
42
|
*/
|
|
43
43
|
|
|
44
44
|
|
|
@@ -56,8 +56,8 @@ var Polygon =
|
|
|
56
56
|
/** @class */
|
|
57
57
|
function (_super) {
|
|
58
58
|
tslib.__extends(Polygon, _super);
|
|
59
|
-
/**
|
|
60
|
-
* 지도에 표시할 폴리곤정보
|
|
59
|
+
/**
|
|
60
|
+
* 지도에 표시할 폴리곤정보
|
|
61
61
|
*/
|
|
62
62
|
|
|
63
63
|
|
|
@@ -67,8 +67,8 @@ function (_super) {
|
|
|
67
67
|
_this.options = options;
|
|
68
68
|
return _this;
|
|
69
69
|
}
|
|
70
|
-
/**
|
|
71
|
-
* 폴리곤의 중점을 구한다.
|
|
70
|
+
/**
|
|
71
|
+
* 폴리곤의 중점을 구한다.
|
|
72
72
|
*/
|
|
73
73
|
|
|
74
74
|
|
|
@@ -77,7 +77,7 @@ function (_super) {
|
|
|
77
77
|
var paths = this.options.position.map(function (elem) {
|
|
78
78
|
return elem instanceof MapTypes.Position ? elem : new MapTypes.Position(elem[0], elem[1]);
|
|
79
79
|
});
|
|
80
|
-
return
|
|
80
|
+
return polygon.PolygonCalculator.getCenter(paths);
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
throw new Error('center 를 찾을 수 없습니다.');
|