@mint-ui/map 0.1.8-beta → 0.1.9-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 (35) hide show
  1. package/.eslintrc.js +109 -109
  2. package/LICENSE +21 -21
  3. package/README.md +53 -53
  4. package/dist/components/mint-map/MintMap.d.ts +92 -90
  5. package/dist/components/mint-map/MintMap.js +19 -3
  6. package/dist/components/mint-map/core/MintMapController.d.ts +33 -33
  7. package/dist/components/mint-map/core/MintMapCore.d.ts +3 -3
  8. package/dist/components/mint-map/core/advanced/MapBuildingProjection.d.ts +15 -15
  9. package/dist/components/mint-map/core/advanced/index.d.ts +1 -1
  10. package/dist/components/mint-map/core/hooks/MarkerMovingHook.d.ts +6 -6
  11. package/dist/components/mint-map/core/hooks/index.d.ts +1 -1
  12. package/dist/components/mint-map/core/index.d.ts +7 -7
  13. package/dist/components/mint-map/core/provider/MintMapProvider.d.ts +8 -8
  14. package/dist/components/mint-map/core/provider/index.d.ts +1 -1
  15. package/dist/components/mint-map/core/util/animation.d.ts +16 -16
  16. package/dist/components/mint-map/core/util/calculate.d.ts +34 -29
  17. package/dist/components/mint-map/core/util/calculate.js +68 -8
  18. package/dist/components/mint-map/core/util/index.d.ts +3 -3
  19. package/dist/components/mint-map/core/util/waiting.d.ts +1 -1
  20. package/dist/components/mint-map/core/wrapper/MapControlWrapper.d.ts +11 -11
  21. package/dist/components/mint-map/core/wrapper/MapMarkerWrapper.d.ts +23 -23
  22. package/dist/components/mint-map/core/wrapper/MapMarkerWrapper.js +2 -2
  23. package/dist/components/mint-map/core/wrapper/MapPolygonWrapper.d.ts +5 -5
  24. package/dist/components/mint-map/core/wrapper/MapPolylineWrapper.d.ts +5 -5
  25. package/dist/components/mint-map/core/wrapper/index.d.ts +4 -4
  26. package/dist/components/mint-map/google/GoogleMintMapController.d.ts +35 -35
  27. package/dist/components/mint-map/google/GoogleMintMapController.js +3 -0
  28. package/dist/components/mint-map/index.d.ts +4 -4
  29. package/dist/components/mint-map/naver/NaverMintMapController.d.ts +38 -38
  30. package/dist/components/mint-map/naver/NaverMintMapController.js +3 -3
  31. package/dist/index.d.ts +1 -1
  32. package/dist/index.es.js +95 -16
  33. package/dist/index.umd.js +95 -16
  34. package/package.json +76 -76
  35. package/test.ts +6 -6
@@ -1,3 +1,3 @@
1
- import { PropsWithChildren } from "react";
2
- import { MintMapProps } from "../MintMap";
3
- export declare function MintMapCore({ onLoad, visible, base, children }: PropsWithChildren<MintMapProps>): JSX.Element;
1
+ import { PropsWithChildren } from "react";
2
+ import { MintMapProps } from "../MintMap";
3
+ export declare function MintMapCore({ onLoad, visible, base, children }: PropsWithChildren<MintMapProps>): JSX.Element;
@@ -1,15 +1,15 @@
1
- /// <reference types="react" />
2
- import { Position } from "../../MintMap";
3
- interface MapBuildingProjectionProps {
4
- basePolygonPath: Position[];
5
- numberOfFloor: number;
6
- heightOfFloor?: number;
7
- lineColor?: string;
8
- lineOpacity?: number;
9
- fillColor?: string;
10
- fillOpacity?: number;
11
- title?: string;
12
- titleElement?: JSX.Element;
13
- }
14
- export declare function MapBuildingProjection(props: MapBuildingProjectionProps): JSX.Element;
15
- export {};
1
+ /// <reference types="react" />
2
+ import { Position } from "../../MintMap";
3
+ interface MapBuildingProjectionProps {
4
+ basePolygonPath: Position[];
5
+ numberOfFloor: number;
6
+ heightOfFloor?: number;
7
+ lineColor?: string;
8
+ lineOpacity?: number;
9
+ fillColor?: string;
10
+ fillOpacity?: number;
11
+ title?: string;
12
+ titleElement?: JSX.Element;
13
+ }
14
+ export declare function MapBuildingProjection(props: MapBuildingProjectionProps): JSX.Element;
15
+ export {};
@@ -1 +1 @@
1
- export * from './MapBuildingProjection';
1
+ export * from './MapBuildingProjection';
@@ -1,6 +1,6 @@
1
- import { Marker } from "../../MintMap";
2
- import { MapMarkerMoving } from "../wrapper/MapMarkerWrapper";
3
- export interface MapMarkerMovingHookProps extends MapMarkerMoving {
4
- marker?: Marker;
5
- }
6
- export declare function useMarkerMoving({ marker, positions, positionClosed, loop, fps, startPositionIndex, velocity, onMovingStart, onMovingEnd }: MapMarkerMovingHookProps): (() => void)[];
1
+ import { Marker } from "../../MintMap";
2
+ import { MapMarkerMoving } from "../wrapper/MapMarkerWrapper";
3
+ export interface MapMarkerMovingHookProps extends MapMarkerMoving {
4
+ marker?: Marker;
5
+ }
6
+ export declare function useMarkerMoving({ marker, positions, positionClosed, loop, fps, startPositionIndex, velocity, onMovingStart, onMovingEnd }: MapMarkerMovingHookProps): (() => void)[];
@@ -1 +1 @@
1
- export * from "./MarkerMovingHook";
1
+ export * from "./MarkerMovingHook";
@@ -1,7 +1,7 @@
1
- export * from "./MintMapCore";
2
- export * from "./MintMapController";
3
- export * from "./advanced";
4
- export * from "./hooks";
5
- export * from "./provider";
6
- export * from './util';
7
- export * from './wrapper';
1
+ export * from "./MintMapCore";
2
+ export * from "./MintMapController";
3
+ export * from "./advanced";
4
+ export * from "./hooks";
5
+ export * from "./provider";
6
+ export * from './util';
7
+ export * from './wrapper';
@@ -1,8 +1,8 @@
1
- import { PropsWithChildren } from "react";
2
- import { MintMapController } from "../MintMapController";
3
- interface MintMapProviderProps {
4
- controller: MintMapController;
5
- }
6
- export declare function MintMapProvider({ controller, children }: PropsWithChildren<MintMapProviderProps>): JSX.Element;
7
- export declare function useMintMapController(): MintMapController;
8
- export {};
1
+ import { PropsWithChildren } from "react";
2
+ import { MintMapController } from "../MintMapController";
3
+ interface MintMapProviderProps {
4
+ controller: MintMapController;
5
+ }
6
+ export declare function MintMapProvider({ controller, children }: PropsWithChildren<MintMapProviderProps>): JSX.Element;
7
+ export declare function useMintMapController(): MintMapController;
8
+ export {};
@@ -1 +1 @@
1
- export * from "./MintMapProvider";
1
+ export * from "./MintMapProvider";
@@ -1,16 +1,16 @@
1
- export declare type DrawFunction = (frameGapTime: number, elapsedTime: number) => boolean | undefined;
2
- export declare class AnimationPlayer {
3
- prevtime: number;
4
- elapsedTime: number;
5
- fps: number | null;
6
- baseDrawGapTime: number | null;
7
- private deltaTime;
8
- private playing;
9
- draw: DrawFunction;
10
- constructor(drawFunction: DrawFunction, fps?: number);
11
- init(): void;
12
- start(): void;
13
- stop(): void;
14
- resume(): void;
15
- makeFrame(timestamp: number): void;
16
- }
1
+ export declare type DrawFunction = (frameGapTime: number, elapsedTime: number) => boolean | undefined;
2
+ export declare class AnimationPlayer {
3
+ prevtime: number;
4
+ elapsedTime: number;
5
+ fps: number | null;
6
+ baseDrawGapTime: number | null;
7
+ private deltaTime;
8
+ private playing;
9
+ draw: DrawFunction;
10
+ constructor(drawFunction: DrawFunction, fps?: number);
11
+ init(): void;
12
+ start(): void;
13
+ stop(): void;
14
+ resume(): void;
15
+ makeFrame(timestamp: number): void;
16
+ }
@@ -1,29 +1,34 @@
1
- import { Position } from "../../MintMap";
2
- export declare class PolygonCalculator {
3
- static getCenter(positions: Position[]): Position;
4
- static intersects(positions1: Position[], positions2: Position[]): boolean;
5
- private static convertPositionToPoints;
6
- private static findCrossPoint;
7
- }
8
- export interface NextPositionContext {
9
- pos1: Position;
10
- pos2: Position;
11
- velocityKmh: number;
12
- elapsedTimeMs: number;
13
- totalDistance: number;
14
- currDistance: number;
15
- distanceRemain: number;
16
- prevPos2: Position;
17
- prevVelocityKmh: number;
18
- vPerMs: number;
19
- nextPos: Position;
20
- }
21
- export declare class GeoCalulator {
22
- private static readonly EARTH_RADIUS;
23
- private static readonly LATITUDE_POSITION_VALUE_PER_METER;
24
- static computeDistanceKiloMeter(pos1: Position, pos2: Position): number;
25
- private static deg2rad;
26
- static convertMeterToLatitudeValue(meter: number): number;
27
- private static readonly MS_FROM_HOUR;
28
- static computeNextPositionAndDistances(context: NextPositionContext): NextPositionContext;
29
- }
1
+ import { Position } from "../../MintMap";
2
+ export declare class PolygonCalculator {
3
+ static getCenter(positions: Position[]): Position;
4
+ static intersects(positions1: Position[], positions2: Position[]): boolean;
5
+ static getIncludedPositions(polygon: Position[], position: Position | Position[]): Position[];
6
+ private static convertPolygonToLinePoints;
7
+ private static convertPositionToPoints;
8
+ private static getCrossPoint;
9
+ private static toFixedPosition;
10
+ private static getCrossPointAll;
11
+ private static findCrossPoint;
12
+ }
13
+ export interface NextPositionContext {
14
+ pos1: Position;
15
+ pos2: Position;
16
+ velocityKmh: number;
17
+ elapsedTimeMs: number;
18
+ totalDistance: number;
19
+ currDistance: number;
20
+ distanceRemain: number;
21
+ prevPos2: Position;
22
+ prevVelocityKmh: number;
23
+ vPerMs: number;
24
+ nextPos: Position;
25
+ }
26
+ export declare class GeoCalulator {
27
+ private static readonly EARTH_RADIUS;
28
+ private static readonly LATITUDE_POSITION_VALUE_PER_METER;
29
+ static computeDistanceKiloMeter(pos1: Position, pos2: Position): number;
30
+ private static deg2rad;
31
+ static convertMeterToLatitudeValue(meter: number): number;
32
+ private static readonly MS_FROM_HOUR;
33
+ static computeNextPositionAndDistances(context: NextPositionContext): NextPositionContext;
34
+ }
@@ -66,22 +66,82 @@ var PolygonCalculator = function () {
66
66
  return false;
67
67
  };
68
68
 
69
+ PolygonCalculator.getIncludedPositions = function (polygon, position) {
70
+ var targets = Array.isArray(position) ? position : [position];
71
+ var result = [];
72
+ var maxX = Math.max.apply(Math, polygon.map(function (pos) {
73
+ return pos.lng;
74
+ })) + 1;
75
+ var lines = this.convertPolygonToLinePoints(polygon);
76
+
77
+ for (var _i = 0, targets_1 = targets; _i < targets_1.length; _i++) {
78
+ var target = targets_1[_i];
79
+ var tempLine = this.convertPositionToPoints(target, new MintMap.Position(target.lat, maxX));
80
+ var crossPoints = this.getCrossPointAll(lines, tempLine);
81
+
82
+ if (crossPoints.length > 0 && crossPoints.length % 2 != 0) {
83
+ result.push(target);
84
+ }
85
+ }
86
+
87
+ return result;
88
+ };
89
+
90
+ PolygonCalculator.convertPolygonToLinePoints = function (polygon) {
91
+ var lines = [];
92
+
93
+ for (var i = 0; i < polygon.length; i++) {
94
+ lines.push(this.convertPositionToPoints(polygon[i], polygon[i + 1 === polygon.length ? 0 : i + 1]));
95
+ }
96
+
97
+ return lines;
98
+ };
99
+
69
100
  PolygonCalculator.convertPositionToPoints = function (pos1, pos2) {
70
101
  return new LinePoints(pos1.lng, pos1.lat, pos2.lng, pos2.lat);
71
102
  };
72
103
 
73
- PolygonCalculator.findCrossPoint = function (sr, tr) {
104
+ PolygonCalculator.getCrossPoint = function (sr, tr) {
105
+ var p1 = (sr.x1 - sr.x2) * (tr.y1 - tr.y2) - (sr.y1 - sr.y2) * (tr.x1 - tr.x2);
106
+
107
+ if (p1 != 0) {
108
+ var x = ((sr.x1 * sr.y2 - sr.y1 * sr.x2) * (tr.x1 - tr.x2) - (sr.x1 - sr.x2) * (tr.x1 * tr.y2 - tr.y1 * tr.x2)) / p1;
109
+ var y = ((sr.x1 * sr.y2 - sr.y1 * sr.x2) * (tr.y1 - tr.y2) - (sr.y1 - sr.y2) * (tr.x1 * tr.y2 - tr.y1 * tr.x2)) / p1;
110
+
111
+ if (this.toFixedPosition((x - sr.x1) * (x - sr.x2)) <= 0 && this.toFixedPosition((y - sr.y1) * (y - sr.y2)) <= 0 && this.toFixedPosition((x - tr.x1) * (x - tr.x2)) <= 0 && this.toFixedPosition((y - tr.y1) * (y - tr.y2)) <= 0) {
112
+ return {
113
+ x: x,
114
+ y: y
115
+ };
116
+ }
117
+ }
118
+ };
119
+
120
+ PolygonCalculator.toFixedPosition = function (n) {
121
+ return Number(n.toFixed(15));
122
+ };
123
+
124
+ PolygonCalculator.getCrossPointAll = function (sr, tr) {
125
+ var result = [];
126
+
74
127
  for (var _i = 0, sr_1 = sr; _i < sr_1.length; _i++) {
75
128
  var tmp = sr_1[_i];
76
- var p1 = (tmp.x1 - tmp.x2) * (tr.y1 - tr.y2) - (tmp.y1 - tmp.y2) * (tr.x1 - tr.x2);
129
+ var p = this.getCrossPoint(tmp, tr);
77
130
 
78
- if (p1 != 0) {
79
- var x = ((tmp.x1 * tmp.y2 - tmp.y1 * tmp.x2) * (tr.x1 - tr.x2) - (tmp.x1 - tmp.x2) * (tr.x1 * tr.y2 - tr.y1 * tr.x2)) / p1;
80
- var y = ((tmp.x1 * tmp.y2 - tmp.y1 * tmp.x2) * (tr.y1 - tr.y2) - (tmp.y1 - tmp.y2) * (tr.x1 * tr.y2 - tr.y1 * tr.x2)) / p1;
131
+ if (p) {
132
+ result.push(p);
133
+ }
134
+ }
135
+
136
+ return result;
137
+ };
81
138
 
82
- if ((x - tmp.x1) * (x - tmp.x2) <= 0 && (y - tmp.y1) * (y - tmp.y2) <= 0 && (x - tr.x1) * (x - tr.x2) <= 0 && (y - tr.y1) * (y - tr.y2) <= 0) {
83
- return true;
84
- }
139
+ PolygonCalculator.findCrossPoint = function (sr, tr) {
140
+ for (var _i = 0, sr_2 = sr; _i < sr_2.length; _i++) {
141
+ var tmp = sr_2[_i];
142
+
143
+ if (this.getCrossPoint(tmp, tr)) {
144
+ return true;
85
145
  }
86
146
  }
87
147
 
@@ -1,3 +1,3 @@
1
- export * from './animation';
2
- export * from './calculate';
3
- export * from './waiting';
1
+ export * from './animation';
2
+ export * from './calculate';
3
+ export * from './waiting';
@@ -1 +1 @@
1
- export declare function waiting(evaluation: () => boolean, timeoutSeconds?: number): Promise<boolean>;
1
+ export declare function waiting(evaluation: () => boolean, timeoutSeconds?: number): Promise<boolean>;
@@ -1,11 +1,11 @@
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
- export declare function MapControlWrapper({ width, height, positionHorizontal, positionVertical, children }: PropsWithChildren<MapControlWrapperProps>): JSX.Element;
11
- 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
+ export declare function MapControlWrapper({ width, height, positionHorizontal, positionVertical, children }: PropsWithChildren<MapControlWrapperProps>): JSX.Element;
11
+ export {};
@@ -1,23 +1,23 @@
1
- import { PropsWithChildren } from "react";
2
- import { MarkerOptions, Position } from "../../MintMap";
3
- export declare type MovingEventFunciton = () => void;
4
- export interface MapMarkerMoving {
5
- positions?: Position[];
6
- positionClosed?: boolean;
7
- startPositionIndex?: number;
8
- velocity?: number;
9
- loop?: boolean;
10
- delay?: number;
11
- autoStart?: boolean;
12
- fps?: number;
13
- onMovingStart?: MovingEventFunciton;
14
- onMovingEnd?: MovingEventFunciton;
15
- }
16
- export interface MapMarkerWrapperProps extends MarkerOptions {
17
- topOnClick?: boolean;
18
- topOnHover?: boolean;
19
- startAnimationClassName?: string;
20
- endAnimationClassName?: string;
21
- movingAnimation?: MapMarkerMoving;
22
- }
23
- export declare function MapMarkerWrapper({ startAnimationClassName, endAnimationClassName, topOnClick, topOnHover, movingAnimation, children, ...options }: PropsWithChildren<MapMarkerWrapperProps>): JSX.Element;
1
+ import { PropsWithChildren } from "react";
2
+ import { MarkerOptions, Position } from "../../MintMap";
3
+ export declare type MovingEventFunciton = () => void;
4
+ export interface MapMarkerMoving {
5
+ positions?: Position[];
6
+ positionClosed?: boolean;
7
+ startPositionIndex?: number;
8
+ velocity?: number;
9
+ loop?: boolean;
10
+ delay?: number;
11
+ autoStart?: boolean;
12
+ fps?: number;
13
+ onMovingStart?: MovingEventFunciton;
14
+ onMovingEnd?: MovingEventFunciton;
15
+ }
16
+ export interface MapMarkerWrapperProps extends MarkerOptions {
17
+ topOnClick?: boolean;
18
+ topOnHover?: boolean;
19
+ startAnimationClassName?: string;
20
+ endAnimationClassName?: string;
21
+ movingAnimation?: MapMarkerMoving;
22
+ }
23
+ export declare function MapMarkerWrapper({ startAnimationClassName, endAnimationClassName, topOnClick, topOnHover, movingAnimation, children, ...options }: PropsWithChildren<MapMarkerWrapperProps>): JSX.Element;
@@ -100,7 +100,7 @@ function MapMarkerWrapper(_a) {
100
100
  divCloneRef.current && divCloneRef.current.removeEventListener('animationend', aniListener_1);
101
101
 
102
102
  if (markerRef.current) {
103
- console.log('drawable cleared', controller.clearDrawable(markerRef.current));
103
+ controller.clearDrawable(markerRef.current);
104
104
  }
105
105
 
106
106
  divCloneRef.current = undefined;
@@ -113,7 +113,7 @@ function MapMarkerWrapper(_a) {
113
113
  divElement.removeEventListener('mouseover', onMouseOverHandler);
114
114
 
115
115
  if (markerRef.current) {
116
- console.log('drawable cleared', controller.clearDrawable(markerRef.current));
116
+ controller.clearDrawable(markerRef.current);
117
117
  }
118
118
  }
119
119
  };
@@ -1,5 +1,5 @@
1
- import { PropsWithChildren } from "react";
2
- import { PolygonOptions } from "../../MintMap";
3
- export interface MapPolygonWrapperProps extends PolygonOptions {
4
- }
5
- export declare function MapPolygonWrapper({ children, ...options }: PropsWithChildren<MapPolygonWrapperProps>): JSX.Element;
1
+ import { PropsWithChildren } from "react";
2
+ import { PolygonOptions } from "../../MintMap";
3
+ export interface MapPolygonWrapperProps extends PolygonOptions {
4
+ }
5
+ export declare function MapPolygonWrapper({ children, ...options }: PropsWithChildren<MapPolygonWrapperProps>): JSX.Element;
@@ -1,5 +1,5 @@
1
- import { PropsWithChildren } from "react";
2
- import { PolylineOptions } from "../../MintMap";
3
- export interface MapPolylineWrapperProps extends PolylineOptions {
4
- }
5
- export declare function MapPolylineWrapper({ children, ...options }: PropsWithChildren<MapPolylineWrapperProps>): JSX.Element;
1
+ import { PropsWithChildren } from "react";
2
+ import { PolylineOptions } from "../../MintMap";
3
+ export interface MapPolylineWrapperProps extends PolylineOptions {
4
+ }
5
+ export declare function MapPolylineWrapper({ children, ...options }: PropsWithChildren<MapPolylineWrapperProps>): JSX.Element;
@@ -1,4 +1,4 @@
1
- export * from './MapControlWrapper';
2
- export * from './MapMarkerWrapper';
3
- export * from './MapPolygonWrapper';
4
- export * from './MapPolylineWrapper';
1
+ export * from './MapControlWrapper';
2
+ export * from './MapMarkerWrapper';
3
+ export * from './MapPolygonWrapper';
4
+ export * from './MapPolylineWrapper';
@@ -1,35 +1,35 @@
1
- /// <reference types="google.maps" />
2
- import { MintMapController } from "../core/MintMapController";
3
- import { Bounds, Drawable, MapType, MapVendorType, Marker, MarkerOptions, MintMapProps, Polygon, PolygonOptions, Polyline, PolylineOptions, Position } from "../MintMap";
4
- export declare class GoogleMintMapController extends MintMapController {
5
- type: MapType;
6
- map: google.maps.Map | null;
7
- scriptUrl: string;
8
- scriptModules: string[];
9
- constructor(props: MintMapProps);
10
- polylineEvents: string[];
11
- createPolyline(polyline: Polyline): void;
12
- updatePolyline(polyline: Polyline, options: PolylineOptions): void;
13
- polygonEvents: string[];
14
- createPolygon(polygon: Polygon): void;
15
- updatePolygon(polygon: Polygon, options: PolygonOptions): void;
16
- private getValidOptions;
17
- markerEvents: string[];
18
- createMarker(marker: Marker): void;
19
- updateMarker(marker: Marker, options: MarkerOptions): void;
20
- private markerMaxZIndex;
21
- private getMaxZIndex;
22
- markerToTheTop(marker: Marker): void;
23
- clearDrawable(drawable: Drawable): boolean;
24
- private dragged;
25
- isMapDragged(): boolean;
26
- setMapDragged(value: boolean): void;
27
- loadMapApi(): Promise<boolean>;
28
- initializingMap(divElement: HTMLDivElement): Promise<MapVendorType>;
29
- destroyMap: () => void;
30
- private fromGoogleBounds;
31
- getCurrBounds(): Bounds;
32
- panningTo(targetCenter: Position): void;
33
- getZoomLevel(): number;
34
- setZoomLevel(zoom: number): void;
35
- }
1
+ /// <reference types="google.maps" />
2
+ import { MintMapController } from "../core/MintMapController";
3
+ import { Bounds, Drawable, MapType, MapVendorType, Marker, MarkerOptions, MintMapProps, Polygon, PolygonOptions, Polyline, PolylineOptions, Position } from "../MintMap";
4
+ export declare class GoogleMintMapController extends MintMapController {
5
+ type: MapType;
6
+ map: google.maps.Map | null;
7
+ scriptUrl: string;
8
+ scriptModules: string[];
9
+ constructor(props: MintMapProps);
10
+ polylineEvents: string[];
11
+ createPolyline(polyline: Polyline): void;
12
+ updatePolyline(polyline: Polyline, options: PolylineOptions): void;
13
+ polygonEvents: string[];
14
+ createPolygon(polygon: Polygon): void;
15
+ updatePolygon(polygon: Polygon, options: PolygonOptions): void;
16
+ private getValidOptions;
17
+ markerEvents: string[];
18
+ createMarker(marker: Marker): void;
19
+ updateMarker(marker: Marker, options: MarkerOptions): void;
20
+ private markerMaxZIndex;
21
+ private getMaxZIndex;
22
+ markerToTheTop(marker: Marker): void;
23
+ clearDrawable(drawable: Drawable): boolean;
24
+ private dragged;
25
+ isMapDragged(): boolean;
26
+ setMapDragged(value: boolean): void;
27
+ loadMapApi(): Promise<boolean>;
28
+ initializingMap(divElement: HTMLDivElement): Promise<MapVendorType>;
29
+ destroyMap: () => void;
30
+ private fromGoogleBounds;
31
+ getCurrBounds(): Bounds;
32
+ panningTo(targetCenter: Position): void;
33
+ getZoomLevel(): number;
34
+ setZoomLevel(zoom: number): void;
35
+ }
@@ -373,6 +373,9 @@ var GoogleMintMapController = function (_super) {
373
373
  console.log('map dragend');
374
374
  _this.mapProps.onBoundsChanged && _this.mapProps.onBoundsChanged(_this.getCurrBounds());
375
375
  });
376
+ map.addListener('idle', function () {
377
+ _this.mapProps.onBoundsChanged && _this.mapProps.onBoundsChanged(_this.getCurrBounds());
378
+ });
376
379
  map.addListener('zoom_changed', function () {
377
380
  console.log('zoom_changed');
378
381
  _this.map && _this.mapProps.onZoomChanged && _this.mapProps.onZoomChanged(_this.map.getZoom());
@@ -1,4 +1,4 @@
1
- export * from './MintMap';
2
- export * from './core';
3
- export * from './naver/NaverMintMapController';
4
- export * from './google/GoogleMintMapController';
1
+ export * from './MintMap';
2
+ export * from './core';
3
+ export * from './naver/NaverMintMapController';
4
+ export * from './google/GoogleMintMapController';
@@ -1,38 +1,38 @@
1
- /// <reference types="navermaps" />
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 NaverMintMapController extends MintMapController {
6
- type: MapType;
7
- map: naver.maps.Map | null;
8
- scriptUrl: string;
9
- scriptModules: string[];
10
- markerPool?: ObjectPool<naver.maps.Marker>;
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
- markerToTheTop(marker: Marker): void;
25
- clearDrawable(drawable: Drawable): boolean;
26
- private dragStartPoint;
27
- private dragged;
28
- isMapDragged(): boolean;
29
- setMapDragged(value: boolean): void;
30
- loadMapApi(): Promise<boolean>;
31
- initializingMap(divElement: HTMLDivElement): Promise<MapVendorType>;
32
- private getSafeZoomValue;
33
- destroyMap(): void;
34
- getCurrBounds(): Bounds;
35
- panningTo(targetCenter: Position): void;
36
- getZoomLevel(): number;
37
- setZoomLevel(zoom: number): void;
38
- }
1
+ /// <reference types="navermaps" />
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 NaverMintMapController extends MintMapController {
6
+ type: MapType;
7
+ map: naver.maps.Map | null;
8
+ scriptUrl: string;
9
+ scriptModules: string[];
10
+ markerPool?: ObjectPool<naver.maps.Marker>;
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
+ markerToTheTop(marker: Marker): void;
25
+ clearDrawable(drawable: Drawable): boolean;
26
+ private dragStartPoint;
27
+ private dragged;
28
+ isMapDragged(): boolean;
29
+ setMapDragged(value: boolean): void;
30
+ loadMapApi(): Promise<boolean>;
31
+ initializingMap(divElement: HTMLDivElement): Promise<MapVendorType>;
32
+ private getSafeZoomValue;
33
+ destroyMap(): void;
34
+ getCurrBounds(): Bounds;
35
+ panningTo(targetCenter: Position): void;
36
+ getZoomLevel(): number;
37
+ setZoomLevel(zoom: number): void;
38
+ }
@@ -38,7 +38,7 @@ var NaverMintMapController = function (_super) {
38
38
  });
39
39
  }).setClear(function (item) {
40
40
  item.setMap(null);
41
- }).createPool(1000).setCheckLiveTimeInterval(1000);
41
+ }).createPool(this.mapProps.markerCachePoolSize && this.mapProps.markerCachePoolSize > 0 ? this.mapProps.markerCachePoolSize : 1000).setCheckLiveTimeInterval(1000);
42
42
  };
43
43
 
44
44
  NaverMintMapController.prototype.createPolyline = function (polyline) {
@@ -414,12 +414,12 @@ var NaverMintMapController = function (_super) {
414
414
  } else {
415
415
  _this.dragged = true;
416
416
  }
417
-
417
+ });
418
+ map.addListener('idle', function () {
418
419
  _this.mapProps.onBoundsChanged && _this.mapProps.onBoundsChanged(_this.getCurrBounds());
419
420
  });
420
421
  map.addListener('zoom_changed', function () {
421
422
  _this.map && _this.mapProps.onZoomChanged && _this.mapProps.onZoomChanged(_this.map.getZoom());
422
- _this.mapProps.onBoundsChanged && _this.mapProps.onBoundsChanged(_this.getCurrBounds());
423
423
  });
424
424
  map.addListener('click', function (e) {
425
425
  console.log('map click', e);
package/dist/index.d.ts CHANGED
@@ -1 +1 @@
1
- export * from './components/mint-map';
1
+ export * from './components/mint-map';