@mint-ui/map 0.1.9-beta → 0.2.1-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 +53 -53
- package/dist/components/mint-map/MintMap.d.ts +92 -92
- package/dist/components/mint-map/core/MintMapController.d.ts +33 -33
- package/dist/components/mint-map/core/MintMapCore.d.ts +3 -3
- package/dist/components/mint-map/core/advanced/MapBuildingProjection.d.ts +15 -15
- package/dist/components/mint-map/core/advanced/index.d.ts +1 -1
- package/dist/components/mint-map/core/hooks/MarkerMovingHook.d.ts +6 -6
- package/dist/components/mint-map/core/hooks/index.d.ts +1 -1
- package/dist/components/mint-map/core/index.d.ts +7 -7
- 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/calculate.d.ts +34 -34
- package/dist/components/mint-map/core/util/index.d.ts +3 -3
- package/dist/components/mint-map/core/util/waiting.d.ts +1 -1
- package/dist/components/mint-map/core/wrapper/MapControlWrapper.d.ts +11 -11
- package/dist/components/mint-map/core/wrapper/MapMarkerWrapper.d.ts +23 -23
- package/dist/components/mint-map/core/wrapper/MapPolygonWrapper.d.ts +5 -5
- package/dist/components/mint-map/core/wrapper/MapPolylineWrapper.d.ts +5 -5
- package/dist/components/mint-map/core/wrapper/index.d.ts +4 -4
- package/dist/components/mint-map/google/GoogleMintMapController.d.ts +35 -35
- package/dist/components/mint-map/google/GoogleMintMapController.js +3 -9
- package/dist/components/mint-map/index.d.ts +4 -4
- package/dist/components/mint-map/naver/NaverMintMapController.d.ts +38 -38
- package/dist/components/mint-map/naver/NaverMintMapController.js +2 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.es.js +6 -11
- package/dist/index.umd.js +5 -10
- package/package.json +76 -76
- package/test.ts +6 -6
|
@@ -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,34 +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
|
-
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
|
-
}
|
|
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
|
+
}
|
|
@@ -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;
|
|
@@ -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
|
+
}
|
|
@@ -111,7 +111,8 @@ var GoogleMintMapController = function (_super) {
|
|
|
111
111
|
var outLine = position.map(function (elem) {
|
|
112
112
|
return Array.isArray(elem) ? new MintMap.Position(elem[1], elem[0]) : elem;
|
|
113
113
|
});
|
|
114
|
-
var paths =
|
|
114
|
+
var paths = [outLine];
|
|
115
|
+
innerPositions && paths.push.apply(paths, innerPositions);
|
|
115
116
|
var pol_2 = new google.maps.Polygon({
|
|
116
117
|
map: this.map,
|
|
117
118
|
paths: paths,
|
|
@@ -361,7 +362,7 @@ var GoogleMintMapController = function (_super) {
|
|
|
361
362
|
|
|
362
363
|
case 2:
|
|
363
364
|
map = new google.maps.Map(divElement, {
|
|
364
|
-
mapId: this.mapProps.mapId,
|
|
365
|
+
mapId: this.mapProps.mapId || 'TEMP_MAP_ID',
|
|
365
366
|
center: (_a = this.mapProps.base) === null || _a === void 0 ? void 0 : _a.center,
|
|
366
367
|
maxZoom: (_b = this.mapProps.base) === null || _b === void 0 ? void 0 : _b.maxZoomLevel,
|
|
367
368
|
minZoom: (_c = this.mapProps.base) === null || _c === void 0 ? void 0 : _c.minZoomLevel,
|
|
@@ -369,20 +370,13 @@ var GoogleMintMapController = function (_super) {
|
|
|
369
370
|
disableDefaultUI: true,
|
|
370
371
|
gestureHandling: 'greedy'
|
|
371
372
|
});
|
|
372
|
-
map.addListener('dragend', function () {
|
|
373
|
-
console.log('map dragend');
|
|
374
|
-
_this.mapProps.onBoundsChanged && _this.mapProps.onBoundsChanged(_this.getCurrBounds());
|
|
375
|
-
});
|
|
376
373
|
map.addListener('idle', function () {
|
|
377
374
|
_this.mapProps.onBoundsChanged && _this.mapProps.onBoundsChanged(_this.getCurrBounds());
|
|
378
375
|
});
|
|
379
376
|
map.addListener('zoom_changed', function () {
|
|
380
|
-
console.log('zoom_changed');
|
|
381
377
|
_this.map && _this.mapProps.onZoomChanged && _this.mapProps.onZoomChanged(_this.map.getZoom());
|
|
382
|
-
_this.mapProps.onBoundsChanged && _this.mapProps.onBoundsChanged(_this.getCurrBounds());
|
|
383
378
|
});
|
|
384
379
|
map.addListener('click', function (e) {
|
|
385
|
-
console.log('map click', e);
|
|
386
380
|
var pos = new MintMap.Position(e.latLng.lat(), e.latLng.lng());
|
|
387
381
|
pos.offset = new MintMap.Offset(e.pixel.x, e.pixel.y);
|
|
388
382
|
_this.mapProps.onClick && _this.mapProps.onClick(pos);
|
|
@@ -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
|
+
}
|
|
@@ -127,7 +127,8 @@ var NaverMintMapController = function (_super) {
|
|
|
127
127
|
var outLine = position.map(function (elem) {
|
|
128
128
|
return Array.isArray(elem) ? new MintMap.Position(elem[1], elem[0]) : elem;
|
|
129
129
|
});
|
|
130
|
-
var paths =
|
|
130
|
+
var paths = [outLine];
|
|
131
|
+
innerPositions && paths.push.apply(paths, innerPositions);
|
|
131
132
|
var pol_2 = new naver.maps.Polygon({
|
|
132
133
|
map: this.map,
|
|
133
134
|
paths: paths,
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './components/mint-map';
|
|
1
|
+
export * from './components/mint-map';
|
package/dist/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __awaiter, __generator, __extends,
|
|
1
|
+
import { __awaiter, __generator, __extends, __assign, __rest, __spreadArray } from 'tslib';
|
|
2
2
|
import React, { createContext, useContext, useRef, useState, useEffect } from 'react';
|
|
3
3
|
import classNames from 'classnames/bind';
|
|
4
4
|
import styleInject from 'style-inject';
|
|
@@ -511,7 +511,8 @@ var NaverMintMapController = function (_super) {
|
|
|
511
511
|
var outLine = position.map(function (elem) {
|
|
512
512
|
return Array.isArray(elem) ? new Position(elem[1], elem[0]) : elem;
|
|
513
513
|
});
|
|
514
|
-
var paths =
|
|
514
|
+
var paths = [outLine];
|
|
515
|
+
innerPositions && paths.push.apply(paths, innerPositions);
|
|
515
516
|
var pol_2 = new naver.maps.Polygon({
|
|
516
517
|
map: this.map,
|
|
517
518
|
paths: paths,
|
|
@@ -984,7 +985,8 @@ var GoogleMintMapController = function (_super) {
|
|
|
984
985
|
var outLine = position.map(function (elem) {
|
|
985
986
|
return Array.isArray(elem) ? new Position(elem[1], elem[0]) : elem;
|
|
986
987
|
});
|
|
987
|
-
var paths =
|
|
988
|
+
var paths = [outLine];
|
|
989
|
+
innerPositions && paths.push.apply(paths, innerPositions);
|
|
988
990
|
var pol_2 = new google.maps.Polygon({
|
|
989
991
|
map: this.map,
|
|
990
992
|
paths: paths,
|
|
@@ -1234,7 +1236,7 @@ var GoogleMintMapController = function (_super) {
|
|
|
1234
1236
|
|
|
1235
1237
|
case 2:
|
|
1236
1238
|
map = new google.maps.Map(divElement, {
|
|
1237
|
-
mapId: this.mapProps.mapId,
|
|
1239
|
+
mapId: this.mapProps.mapId || 'TEMP_MAP_ID',
|
|
1238
1240
|
center: (_a = this.mapProps.base) === null || _a === void 0 ? void 0 : _a.center,
|
|
1239
1241
|
maxZoom: (_b = this.mapProps.base) === null || _b === void 0 ? void 0 : _b.maxZoomLevel,
|
|
1240
1242
|
minZoom: (_c = this.mapProps.base) === null || _c === void 0 ? void 0 : _c.minZoomLevel,
|
|
@@ -1242,20 +1244,13 @@ var GoogleMintMapController = function (_super) {
|
|
|
1242
1244
|
disableDefaultUI: true,
|
|
1243
1245
|
gestureHandling: 'greedy'
|
|
1244
1246
|
});
|
|
1245
|
-
map.addListener('dragend', function () {
|
|
1246
|
-
console.log('map dragend');
|
|
1247
|
-
_this.mapProps.onBoundsChanged && _this.mapProps.onBoundsChanged(_this.getCurrBounds());
|
|
1248
|
-
});
|
|
1249
1247
|
map.addListener('idle', function () {
|
|
1250
1248
|
_this.mapProps.onBoundsChanged && _this.mapProps.onBoundsChanged(_this.getCurrBounds());
|
|
1251
1249
|
});
|
|
1252
1250
|
map.addListener('zoom_changed', function () {
|
|
1253
|
-
console.log('zoom_changed');
|
|
1254
1251
|
_this.map && _this.mapProps.onZoomChanged && _this.mapProps.onZoomChanged(_this.map.getZoom());
|
|
1255
|
-
_this.mapProps.onBoundsChanged && _this.mapProps.onBoundsChanged(_this.getCurrBounds());
|
|
1256
1252
|
});
|
|
1257
1253
|
map.addListener('click', function (e) {
|
|
1258
|
-
console.log('map click', e);
|
|
1259
1254
|
var pos = new Position(e.latLng.lat(), e.latLng.lng());
|
|
1260
1255
|
pos.offset = new Offset(e.pixel.x, e.pixel.y);
|
|
1261
1256
|
_this.mapProps.onClick && _this.mapProps.onClick(pos);
|
package/dist/index.umd.js
CHANGED
|
@@ -516,7 +516,8 @@
|
|
|
516
516
|
var outLine = position.map(function (elem) {
|
|
517
517
|
return Array.isArray(elem) ? new Position(elem[1], elem[0]) : elem;
|
|
518
518
|
});
|
|
519
|
-
var paths =
|
|
519
|
+
var paths = [outLine];
|
|
520
|
+
innerPositions && paths.push.apply(paths, innerPositions);
|
|
520
521
|
var pol_2 = new naver.maps.Polygon({
|
|
521
522
|
map: this.map,
|
|
522
523
|
paths: paths,
|
|
@@ -989,7 +990,8 @@
|
|
|
989
990
|
var outLine = position.map(function (elem) {
|
|
990
991
|
return Array.isArray(elem) ? new Position(elem[1], elem[0]) : elem;
|
|
991
992
|
});
|
|
992
|
-
var paths =
|
|
993
|
+
var paths = [outLine];
|
|
994
|
+
innerPositions && paths.push.apply(paths, innerPositions);
|
|
993
995
|
var pol_2 = new google.maps.Polygon({
|
|
994
996
|
map: this.map,
|
|
995
997
|
paths: paths,
|
|
@@ -1239,7 +1241,7 @@
|
|
|
1239
1241
|
|
|
1240
1242
|
case 2:
|
|
1241
1243
|
map = new google.maps.Map(divElement, {
|
|
1242
|
-
mapId: this.mapProps.mapId,
|
|
1244
|
+
mapId: this.mapProps.mapId || 'TEMP_MAP_ID',
|
|
1243
1245
|
center: (_a = this.mapProps.base) === null || _a === void 0 ? void 0 : _a.center,
|
|
1244
1246
|
maxZoom: (_b = this.mapProps.base) === null || _b === void 0 ? void 0 : _b.maxZoomLevel,
|
|
1245
1247
|
minZoom: (_c = this.mapProps.base) === null || _c === void 0 ? void 0 : _c.minZoomLevel,
|
|
@@ -1247,20 +1249,13 @@
|
|
|
1247
1249
|
disableDefaultUI: true,
|
|
1248
1250
|
gestureHandling: 'greedy'
|
|
1249
1251
|
});
|
|
1250
|
-
map.addListener('dragend', function () {
|
|
1251
|
-
console.log('map dragend');
|
|
1252
|
-
_this.mapProps.onBoundsChanged && _this.mapProps.onBoundsChanged(_this.getCurrBounds());
|
|
1253
|
-
});
|
|
1254
1252
|
map.addListener('idle', function () {
|
|
1255
1253
|
_this.mapProps.onBoundsChanged && _this.mapProps.onBoundsChanged(_this.getCurrBounds());
|
|
1256
1254
|
});
|
|
1257
1255
|
map.addListener('zoom_changed', function () {
|
|
1258
|
-
console.log('zoom_changed');
|
|
1259
1256
|
_this.map && _this.mapProps.onZoomChanged && _this.mapProps.onZoomChanged(_this.map.getZoom());
|
|
1260
|
-
_this.mapProps.onBoundsChanged && _this.mapProps.onBoundsChanged(_this.getCurrBounds());
|
|
1261
1257
|
});
|
|
1262
1258
|
map.addListener('click', function (e) {
|
|
1263
|
-
console.log('map click', e);
|
|
1264
1259
|
var pos = new Position(e.latLng.lat(), e.latLng.lng());
|
|
1265
1260
|
pos.offset = new Offset(e.pixel.x, e.pixel.y);
|
|
1266
1261
|
_this.mapProps.onClick && _this.mapProps.onClick(pos);
|