@mint-ui/map 0.5.0-beta → 0.5.2-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.
Files changed (66) hide show
  1. package/.eslintrc.js +109 -109
  2. package/LICENSE +21 -21
  3. package/README.md +73 -73
  4. package/dist/components/mint-map/MintMap.d.ts +10 -10
  5. package/dist/components/mint-map/MintMap.js +6 -6
  6. package/dist/components/mint-map/core/MintMapCanvasRenderer.d.ts +4 -4
  7. package/dist/components/mint-map/core/MintMapController.d.ts +64 -64
  8. package/dist/components/mint-map/core/MintMapController.js +9 -9
  9. package/dist/components/mint-map/core/MintMapCore.d.ts +3 -3
  10. package/dist/components/mint-map/core/advanced/MapBuildingProjection.d.ts +15 -15
  11. package/dist/components/mint-map/core/advanced/MapLoadingComponents.d.ts +17 -17
  12. package/dist/components/mint-map/core/advanced/index.d.ts +3 -3
  13. package/dist/components/mint-map/core/advanced/shapes/CircleMarker.d.ts +20 -20
  14. package/dist/components/mint-map/core/advanced/shapes/CircleMarker.js +6 -6
  15. package/dist/components/mint-map/core/advanced/shapes/PolygonMarker.d.ts +23 -23
  16. package/dist/components/mint-map/core/advanced/shapes/PolygonMarker.js +6 -6
  17. package/dist/components/mint-map/core/advanced/shapes/base/SVGCircle.d.ts +8 -8
  18. package/dist/components/mint-map/core/advanced/shapes/base/SVGCircle.js +4 -4
  19. package/dist/components/mint-map/core/advanced/shapes/base/SVGPolygon.d.ts +12 -12
  20. package/dist/components/mint-map/core/advanced/shapes/base/SVGRect.d.ts +10 -10
  21. package/dist/components/mint-map/core/advanced/shapes/base/index.d.ts +3 -3
  22. package/dist/components/mint-map/core/advanced/shapes/index.d.ts +3 -3
  23. package/dist/components/mint-map/core/hooks/MarkerMovingHook.d.ts +6 -6
  24. package/dist/components/mint-map/core/hooks/index.d.ts +1 -1
  25. package/dist/components/mint-map/core/index.d.ts +8 -8
  26. package/dist/components/mint-map/core/provider/MintMapProvider.d.ts +8 -8
  27. package/dist/components/mint-map/core/provider/index.d.ts +1 -1
  28. package/dist/components/mint-map/core/util/animation.d.ts +16 -16
  29. package/dist/components/mint-map/core/util/calculate.d.ts +66 -66
  30. package/dist/components/mint-map/core/util/cluster.d.ts +18 -18
  31. package/dist/components/mint-map/core/util/index.d.ts +4 -4
  32. package/dist/components/mint-map/core/util/waiting.d.ts +1 -1
  33. package/dist/components/mint-map/core/wrapper/MapCanvasMarkerWrapper.d.ts +27 -27
  34. package/dist/components/mint-map/core/wrapper/MapCanvasMarkerWrapper.js +6 -6
  35. package/dist/components/mint-map/core/wrapper/MapCanvasWrapper.d.ts +11 -11
  36. package/dist/components/mint-map/core/wrapper/MapCanvasWrapper.js +6 -6
  37. package/dist/components/mint-map/core/wrapper/MapControlWrapper.d.ts +18 -18
  38. package/dist/components/mint-map/core/wrapper/MapControlWrapper.js +6 -6
  39. package/dist/components/mint-map/core/wrapper/MapMarkerWrapper.d.ts +32 -32
  40. package/dist/components/mint-map/core/wrapper/MapMarkerWrapper.js +6 -6
  41. package/dist/components/mint-map/core/wrapper/MapPolygonWrapper.d.ts +12 -12
  42. package/dist/components/mint-map/core/wrapper/MapPolygonWrapper.js +6 -6
  43. package/dist/components/mint-map/core/wrapper/MapPolylineWrapper.d.ts +12 -12
  44. package/dist/components/mint-map/core/wrapper/MapPolylineWrapper.js +6 -6
  45. package/dist/components/mint-map/core/wrapper/index.d.ts +6 -6
  46. package/dist/components/mint-map/google/GoogleMintMapController.d.ts +51 -51
  47. package/dist/components/mint-map/google/GoogleMintMapController.js +2 -2
  48. package/dist/components/mint-map/index.d.ts +5 -5
  49. package/dist/components/mint-map/kakao/KakaoMintMapController.d.ts +56 -56
  50. package/dist/components/mint-map/kakao/KakaoMintMapController.js +11 -8
  51. package/dist/components/mint-map/naver/NaverMintMapController.d.ts +53 -53
  52. package/dist/components/mint-map/naver/NaverMintMapController.js +10 -7
  53. package/dist/components/mint-map/types/CommonTypes.d.ts +11 -11
  54. package/dist/components/mint-map/types/MapDrawables.d.ts +110 -110
  55. package/dist/components/mint-map/types/MapDrawables.js +8 -8
  56. package/dist/components/mint-map/types/MapEventTypes.d.ts +44 -41
  57. package/dist/components/mint-map/types/MapEventTypes.js +2 -0
  58. package/dist/components/mint-map/types/MapTypes.d.ts +60 -60
  59. package/dist/components/mint-map/types/MapTypes.js +13 -13
  60. package/dist/components/mint-map/types/MintMapEvents.d.ts +25 -25
  61. package/dist/components/mint-map/types/MintMapProps.d.ts +92 -92
  62. package/dist/components/mint-map/types/index.d.ts +6 -6
  63. package/dist/index.d.ts +7 -7
  64. package/dist/index.es.js +113 -105
  65. package/dist/index.umd.js +113 -105
  66. package/package.json +77 -77
@@ -8,12 +8,12 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
8
8
 
9
9
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
10
10
 
11
- /**
12
- * Mint Map 컴포넌트
13
- *
14
- * @param {MapControlWrapperProps} MapControlWrapperProps
15
- *
16
- * @returns {JSX.Element} JSX
11
+ /**
12
+ * Mint Map 컴포넌트
13
+ *
14
+ * @param {MapControlWrapperProps} MapControlWrapperProps
15
+ *
16
+ * @returns {JSX.Element} JSX
17
17
  */
18
18
 
19
19
  function MapCanvasMarkerWrapper(_props) {
@@ -1,11 +1,11 @@
1
- import React from "react";
2
- export interface MapCanvasWrapperProps {
3
- }
4
- /**
5
- * Mint Map 컴포넌트
6
- *
7
- * @param {MapControlWrapperProps} MapControlWrapperProps
8
- *
9
- * @returns {JSX.Element} JSX
10
- */
11
- export declare function MapCanvasWrapper<T>({ children, ...props }: React.PropsWithChildren<MapCanvasWrapperProps>): JSX.Element;
1
+ import React from "react";
2
+ export interface MapCanvasWrapperProps {
3
+ }
4
+ /**
5
+ * Mint Map 컴포넌트
6
+ *
7
+ * @param {MapControlWrapperProps} MapControlWrapperProps
8
+ *
9
+ * @returns {JSX.Element} JSX
10
+ */
11
+ export declare function MapCanvasWrapper<T>({ children, ...props }: React.PropsWithChildren<MapCanvasWrapperProps>): JSX.Element;
@@ -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) {
@@ -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,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
- startAnimationClassName?: string;
21
- endAnimationClassName?: string;
22
- movingAnimation?: MapMarkerMoving;
23
- disablePointerEvent?: boolean;
24
- }
25
- /**
26
- * Mint Map 컴포넌트
27
- *
28
- * @param {MapControlWrapperProps} MapControlWrapperProps
29
- *
30
- * @returns {JSX.Element} JSX
31
- */
32
- export declare function MapMarkerWrapper({ startAnimationClassName, endAnimationClassName, topOnClick, topOnHover, movingAnimation, disablePointerEvent, children, ...options }: PropsWithChildren<MapMarkerWrapperProps>): JSX.Element;
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
+ startAnimationClassName?: string;
21
+ endAnimationClassName?: string;
22
+ movingAnimation?: MapMarkerMoving;
23
+ disablePointerEvent?: boolean;
24
+ }
25
+ /**
26
+ * Mint Map 컴포넌트
27
+ *
28
+ * @param {MapControlWrapperProps} MapControlWrapperProps
29
+ *
30
+ * @returns {JSX.Element} JSX
31
+ */
32
+ export declare function MapMarkerWrapper({ startAnimationClassName, endAnimationClassName, topOnClick, topOnHover, movingAnimation, disablePointerEvent, children, ...options }: PropsWithChildren<MapMarkerWrapperProps>): JSX.Element;
@@ -17,12 +17,12 @@ 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
 
@@ -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) {
@@ -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) {
@@ -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
+ }
@@ -605,7 +605,6 @@ function (_super) {
605
605
  };
606
606
  callback(param);
607
607
  } else if (eventName in _this.mapUIEvent) {
608
- if (eventName.startsWith('DRAG')) console.log(eventName, e);
609
608
  var position = null;
610
609
 
611
610
  if (e) {
@@ -621,7 +620,8 @@ function (_super) {
621
620
  vendorEventName: googleEventName,
622
621
  param: {
623
622
  position: position,
624
- offset: position === null || position === void 0 ? void 0 : position.offset
623
+ offset: position === null || position === void 0 ? void 0 : position.offset,
624
+ pointerEvent: e.domEvent
625
625
  }
626
626
  };
627
627
  callback(param);
@@ -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';
@@ -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
+ }
@@ -31,7 +31,9 @@ function (_super) {
31
31
  _this.dragged = false;
32
32
  _this.eventMap = new Map(); //kakao only 이벤트이름 재정의 zoom_start
33
33
 
34
- _this.mapEvent.ZOOMSTART = 'zoom_start';
34
+ _this.mapEvent.ZOOMSTART = 'zoom_start'; //contextmenu 는 지원하지 않지만 호환성을 위해 rightclick 으로 대체
35
+
36
+ _this.mapUIEvent.CONTEXTMENU = 'rightclick';
35
37
  Object.freeze(_this.mapEvent);
36
38
  Object.freeze(_this.mapUIEvent);
37
39
  return _this; // console.log(`${this.type} controller loadded`);
@@ -534,13 +536,13 @@ function (_super) {
534
536
  };
535
537
 
536
538
  KakaoMintMapController.prototype.getSafeZoomValue = function (value) {
537
- /**
538
- * 카카오는 구글/네이버와 다르게 줌레벨이 작아질수록 확대된다 (가장 확대된 것이 0)
539
- * - 가장 확대된 값 : 1
540
- * - 가장 축소된 값 : 14
541
- *
542
- * 그래서 세계지도가 없는 카카오는 동일한 사정인 네이버와 매핑하기로 한다.
543
- * 문제는 둘 간의 줌 레벨별 축척이 일치하지 않는다. 그래서 가장 유사한 레벨 끼리 매핑이 필요하다
539
+ /**
540
+ * 카카오는 구글/네이버와 다르게 줌레벨이 작아질수록 확대된다 (가장 확대된 것이 0)
541
+ * - 가장 확대된 값 : 1
542
+ * - 가장 축소된 값 : 14
543
+ *
544
+ * 그래서 세계지도가 없는 카카오는 동일한 사정인 네이버와 매핑하기로 한다.
545
+ * 문제는 둘 간의 줌 레벨별 축척이 일치하지 않는다. 그래서 가장 유사한 레벨 끼리 매핑이 필요하다
544
546
  */
545
547
  var mapValue = this.getBaseToMapZoom(value);
546
548
 
@@ -557,6 +559,7 @@ function (_super) {
557
559
  var _a;
558
560
 
559
561
  try {
562
+ this.removeAllEventListener();
560
563
  (_a = this.markerPool) === null || _a === void 0 ? void 0 : _a.destroy();
561
564
  } catch (e) {
562
565
  console.log('kakao map destroy error', e);