@mint-ui/map 0.6.2-beta-test1 → 0.6.2-beta-test4
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 +6 -6
- package/dist/components/mint-map/core/MintMapCanvasRenderer.d.ts +4 -4
- package/dist/components/mint-map/core/MintMapController.d.ts +66 -66
- 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/advanced/MapBuildingProjection.d.ts +15 -15
- 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 +22 -22
- package/dist/components/mint-map/core/advanced/shapes/CircleMarker.js +6 -6
- package/dist/components/mint-map/core/advanced/shapes/PolygonMarker.d.ts +28 -28
- package/dist/components/mint-map/core/advanced/shapes/PolygonMarker.js +6 -6
- 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/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/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/geo.d.ts +38 -38
- package/dist/components/mint-map/core/util/index.d.ts +7 -7
- package/dist/components/mint-map/core/util/log.d.ts +1 -1
- package/dist/components/mint-map/core/util/polygon.d.ts +42 -42
- package/dist/components/mint-map/core/util/status.d.ts +9 -9
- 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 +6 -6
- 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 +44 -43
- package/dist/components/mint-map/core/wrapper/MapMarkerWrapper.js +55 -44
- package/dist/components/mint-map/core/wrapper/MapPolygonWrapper.d.ts +12 -12
- package/dist/components/mint-map/core/wrapper/MapPolygonWrapper.js +6 -6
- package/dist/components/mint-map/core/wrapper/MapPolylineWrapper.d.ts +12 -12
- package/dist/components/mint-map/core/wrapper/MapPolylineWrapper.js +6 -6
- 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/index.d.ts +5 -5
- package/dist/components/mint-map/kakao/KakaoMintMapController.d.ts +55 -55
- package/dist/components/mint-map/kakao/KakaoMintMapController.js +7 -7
- package/dist/components/mint-map/naver/NaverMintMapController.d.ts +53 -53
- package/dist/components/mint-map/naver/NaverMintMapController.js +5 -5
- package/dist/components/mint-map/types/CommonTypes.d.ts +11 -11
- package/dist/components/mint-map/types/MapDrawables.d.ts +118 -118
- package/dist/components/mint-map/types/MapDrawables.js +8 -8
- 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 +13 -13
- package/dist/components/mint-map/types/MintMapEvents.d.ts +25 -25
- package/dist/components/mint-map/types/MintMapProps.d.ts +101 -101
- package/dist/components/mint-map/types/index.d.ts +6 -6
- package/dist/index.d.ts +7 -7
- package/dist/index.es.js +145 -134
- package/dist/index.umd.js +145 -134
- package/package.json +77 -77
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { MarkerOptions } from "../../types/MapDrawables";
|
|
3
|
-
import { Offset } from "../../types/MapTypes";
|
|
4
|
-
import { MintMapCanvasRenderer } from "../MintMapCanvasRenderer";
|
|
5
|
-
export declare type CanvasMarkerRenderer<T> = (ctx: MintMapCanvasRenderer, offset: Offset, payload?: T) => void;
|
|
6
|
-
export interface CanvasMarkerMouseEvent {
|
|
7
|
-
x: number;
|
|
8
|
-
y: number;
|
|
9
|
-
}
|
|
10
|
-
export declare type CanvasMarkerMouseEventCallback = (e: CanvasMarkerMouseEvent) => boolean | undefined | void;
|
|
11
|
-
export interface MapCanvasMarkerWrapperProps<T> extends MarkerOptions {
|
|
12
|
-
renderer: CanvasMarkerRenderer<T>;
|
|
13
|
-
payload?: T;
|
|
14
|
-
boxWidth: number;
|
|
15
|
-
boxHeight: number;
|
|
16
|
-
onClick?: CanvasMarkerMouseEventCallback;
|
|
17
|
-
onMouseOver?: CanvasMarkerMouseEventCallback;
|
|
18
|
-
onMouseOut?: CanvasMarkerMouseEventCallback;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Mint Map 컴포넌트
|
|
22
|
-
*
|
|
23
|
-
* @param {MapControlWrapperProps} MapControlWrapperProps
|
|
24
|
-
*
|
|
25
|
-
* @returns {JSX.Element} JSX
|
|
26
|
-
*/
|
|
27
|
-
export declare function MapCanvasMarkerWrapper<T>(_props: MapCanvasMarkerWrapperProps<T>): JSX.Element;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { MarkerOptions } from "../../types/MapDrawables";
|
|
3
|
+
import { Offset } from "../../types/MapTypes";
|
|
4
|
+
import { MintMapCanvasRenderer } from "../MintMapCanvasRenderer";
|
|
5
|
+
export declare type CanvasMarkerRenderer<T> = (ctx: MintMapCanvasRenderer, offset: Offset, payload?: T) => void;
|
|
6
|
+
export interface CanvasMarkerMouseEvent {
|
|
7
|
+
x: number;
|
|
8
|
+
y: number;
|
|
9
|
+
}
|
|
10
|
+
export declare type CanvasMarkerMouseEventCallback = (e: CanvasMarkerMouseEvent) => boolean | undefined | void;
|
|
11
|
+
export interface MapCanvasMarkerWrapperProps<T> extends MarkerOptions {
|
|
12
|
+
renderer: CanvasMarkerRenderer<T>;
|
|
13
|
+
payload?: T;
|
|
14
|
+
boxWidth: number;
|
|
15
|
+
boxHeight: number;
|
|
16
|
+
onClick?: CanvasMarkerMouseEventCallback;
|
|
17
|
+
onMouseOver?: CanvasMarkerMouseEventCallback;
|
|
18
|
+
onMouseOut?: CanvasMarkerMouseEventCallback;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Mint Map 컴포넌트
|
|
22
|
+
*
|
|
23
|
+
* @param {MapControlWrapperProps} MapControlWrapperProps
|
|
24
|
+
*
|
|
25
|
+
* @returns {JSX.Element} JSX
|
|
26
|
+
*/
|
|
27
|
+
export declare function MapCanvasMarkerWrapper<T>(_props: MapCanvasMarkerWrapperProps<T>): JSX.Element;
|
|
@@ -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?: string | number;
|
|
6
|
-
height?: string | number;
|
|
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?: string | number;
|
|
6
|
+
height?: string | number;
|
|
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 {};
|
|
@@ -12,12 +12,12 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
12
12
|
var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
|
|
13
13
|
|
|
14
14
|
var cn = classNames__default["default"].bind(MintMapWrapper_module);
|
|
15
|
-
/**
|
|
16
|
-
* Mint Map 컴포넌트
|
|
17
|
-
*
|
|
18
|
-
* @param {MapControlWrapperProps} MapControlWrapperProps
|
|
19
|
-
*
|
|
20
|
-
* @returns {JSX.Element} JSX
|
|
15
|
+
/**
|
|
16
|
+
* Mint Map 컴포넌트
|
|
17
|
+
*
|
|
18
|
+
* @param {MapControlWrapperProps} MapControlWrapperProps
|
|
19
|
+
*
|
|
20
|
+
* @returns {JSX.Element} JSX
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
23
|
function MapControlWrapper(_a) {
|
|
@@ -1,43 +1,44 @@
|
|
|
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
|
-
/**
|
|
21
|
-
* 메모리 누수의 위험성이 존재하여 삭제될 예정
|
|
22
|
-
* animation 은 marker wrapper 의 children 레벨에서 구현하는것을 기본으로 한다.
|
|
23
|
-
* @deprecated
|
|
24
|
-
*/
|
|
25
|
-
startAnimationClassName?: string;
|
|
26
|
-
/**
|
|
27
|
-
* 메모리 누수의 위험성이 존재하여 삭제될 예정
|
|
28
|
-
* animation 은 marker wrapper 의 children 레벨에서 구현하는것을 기본으로 한다.
|
|
29
|
-
* @deprecated
|
|
30
|
-
*/
|
|
31
|
-
endAnimationClassName?: string;
|
|
32
|
-
movingAnimation?: MapMarkerMoving;
|
|
33
|
-
disablePointerEvent?: boolean;
|
|
34
|
-
autoFitToViewport?: boolean;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
|
|
43
|
-
|
|
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
|
+
/**
|
|
21
|
+
* 메모리 누수의 위험성이 존재하여 삭제될 예정
|
|
22
|
+
* animation 은 marker wrapper 의 children 레벨에서 구현하는것을 기본으로 한다.
|
|
23
|
+
* @deprecated
|
|
24
|
+
*/
|
|
25
|
+
startAnimationClassName?: string;
|
|
26
|
+
/**
|
|
27
|
+
* 메모리 누수의 위험성이 존재하여 삭제될 예정
|
|
28
|
+
* animation 은 marker wrapper 의 children 레벨에서 구현하는것을 기본으로 한다.
|
|
29
|
+
* @deprecated
|
|
30
|
+
*/
|
|
31
|
+
endAnimationClassName?: string;
|
|
32
|
+
movingAnimation?: MapMarkerMoving;
|
|
33
|
+
disablePointerEvent?: boolean;
|
|
34
|
+
autoFitToViewport?: boolean;
|
|
35
|
+
autoAdjustAnchor?: boolean;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Mint Map 컴포넌트
|
|
39
|
+
*
|
|
40
|
+
* @param {MapControlWrapperProps} MapControlWrapperProps
|
|
41
|
+
*
|
|
42
|
+
* @returns {JSX.Element} JSX
|
|
43
|
+
*/
|
|
44
|
+
export declare function MapMarkerWrapper({ startAnimationClassName, endAnimationClassName, autoFitToViewport, autoAdjustAnchor, topOnClick, topOnHover, movingAnimation, disablePointerEvent, children, ...options }: PropsWithChildren<MapMarkerWrapperProps>): JSX.Element;
|
|
@@ -9,25 +9,30 @@ var MintMapProvider = require('../provider/MintMapProvider.js');
|
|
|
9
9
|
var MarkerMovingHook = require('../hooks/MarkerMovingHook.js');
|
|
10
10
|
var MapDrawables = require('../../types/MapDrawables.js');
|
|
11
11
|
|
|
12
|
-
var offsetCalibration = function (mapType, divElement, options, autoFitToViewport, mapDivElement) {
|
|
12
|
+
var offsetCalibration = function (mapType, divElement, options, autoFitToViewport, autoAdjustAnchor, mapDivElement) {
|
|
13
13
|
//google 맵의 anchor 보정 (네이버와 같이 왼쪽/위 기준으로 처리)
|
|
14
|
+
var baseTransform = '';
|
|
15
|
+
|
|
14
16
|
if (mapType === 'google') {
|
|
15
|
-
|
|
17
|
+
baseTransform = "translate(50%, 100%) translate(".concat(options.anchor ? options.anchor.x * -1 : '0', "px, ").concat(options.anchor ? options.anchor.y * -1 : '0', "px)");
|
|
16
18
|
} else if (mapType === 'kakao') {
|
|
17
|
-
|
|
19
|
+
baseTransform = "translate(".concat(options.anchor ? options.anchor.x * -1 : '0', "px, ").concat(options.anchor ? options.anchor.y * -1 : '0', "px)");
|
|
18
20
|
}
|
|
19
21
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
divElement.style.transform = baseTransform;
|
|
23
|
+
|
|
24
|
+
if (autoFitToViewport || autoAdjustAnchor) {
|
|
25
|
+
// google 은 마커의 getBoundingClientRect 값을 바로 얻을 수 없어서 next tick 에 처리 (50회 트라이)
|
|
22
26
|
if (mapType === 'google') {
|
|
23
|
-
|
|
27
|
+
divElement.style.visibility = 'hidden';
|
|
28
|
+
transformToFitWithNextTick(divElement, mapDivElement, baseTransform, autoAdjustAnchor, 50);
|
|
24
29
|
} else {
|
|
25
|
-
transformToFit(
|
|
30
|
+
transformToFit(divElement, mapDivElement, baseTransform, autoAdjustAnchor);
|
|
26
31
|
}
|
|
27
32
|
}
|
|
28
33
|
};
|
|
29
34
|
|
|
30
|
-
var transformToFitWithNextTick = function (
|
|
35
|
+
var transformToFitWithNextTick = function (divElement, mapDivElement, baseTransform, anchorAdjust, maxTryCount, nextCount) {
|
|
31
36
|
var tryCount = nextCount || 0;
|
|
32
37
|
setTimeout(function () {
|
|
33
38
|
tryCount += 1;
|
|
@@ -39,51 +44,54 @@ var transformToFitWithNextTick = function (mapType, divElement, options, mapDivE
|
|
|
39
44
|
var rect = divElement.getBoundingClientRect();
|
|
40
45
|
|
|
41
46
|
if (rect.x === 0 && rect.y === 0 && rect.width === 0 && rect.height === 0) {
|
|
42
|
-
transformToFitWithNextTick(
|
|
47
|
+
transformToFitWithNextTick(divElement, mapDivElement, baseTransform, anchorAdjust, maxTryCount, tryCount);
|
|
43
48
|
} else {
|
|
44
|
-
transformToFit(
|
|
49
|
+
transformToFit(divElement, mapDivElement, baseTransform, anchorAdjust);
|
|
50
|
+
divElement.style.visibility = 'visible';
|
|
45
51
|
}
|
|
46
52
|
}, 20);
|
|
47
53
|
};
|
|
48
54
|
|
|
49
|
-
var transformToFit = function (
|
|
55
|
+
var transformToFit = function (divElement, mapDivElement, baseTransform, anchorAdjust) {
|
|
50
56
|
var mapRect = mapDivElement.getBoundingClientRect();
|
|
51
57
|
var rect = divElement.getBoundingClientRect(); // 보정 값 계산
|
|
52
58
|
|
|
53
59
|
var xValue = getMarkersFitPosition(mapRect.x, mapRect.width, rect.x, rect.width);
|
|
54
60
|
var yValue = getMarkersFitPosition(mapRect.y, mapRect.height, rect.y, rect.height);
|
|
55
61
|
|
|
56
|
-
if (
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
if (anchorAdjust) {
|
|
63
|
+
var toLeft = xValue < 0;
|
|
64
|
+
var toRight = xValue > 0;
|
|
65
|
+
var toTop = yValue < 0;
|
|
66
|
+
var toBottom = yValue > 0;
|
|
67
|
+
var transX = toLeft ? rect.width * -1 : toRight ? rect.width : 0;
|
|
68
|
+
var transY = toTop ? rect.height * -1 : toBottom ? rect.height : 0;
|
|
69
|
+
divElement.style.transform = baseTransform + " translate(".concat(transX, "px, ").concat(transY, "px)");
|
|
70
|
+
} else {
|
|
71
|
+
divElement.style.transform = baseTransform + " translate(".concat(xValue, "px, ").concat(yValue, "px)");
|
|
64
72
|
}
|
|
65
73
|
};
|
|
66
74
|
|
|
67
75
|
var getMarkersFitPosition = function (containerPosition, containerSize, markerPosition, markerSize) {
|
|
68
76
|
var delta = markerPosition - containerPosition;
|
|
69
77
|
var mapSize = containerSize;
|
|
70
|
-
var overflowMin = delta
|
|
71
|
-
var overflowMax = delta + markerSize
|
|
78
|
+
var overflowMin = delta < 0;
|
|
79
|
+
var overflowMax = delta + markerSize > mapSize; // 한쪽만 넘어간 경우 처리
|
|
72
80
|
|
|
73
81
|
if (overflowMin && !overflowMax) {
|
|
74
|
-
return delta;
|
|
82
|
+
return delta * -1;
|
|
75
83
|
} else if (!overflowMin && overflowMax) {
|
|
76
84
|
return mapSize - delta - markerSize;
|
|
77
85
|
}
|
|
78
86
|
|
|
79
87
|
return 0;
|
|
80
88
|
};
|
|
81
|
-
/**
|
|
82
|
-
* Mint Map 컴포넌트
|
|
83
|
-
*
|
|
84
|
-
* @param {MapControlWrapperProps} MapControlWrapperProps
|
|
85
|
-
*
|
|
86
|
-
* @returns {JSX.Element} JSX
|
|
89
|
+
/**
|
|
90
|
+
* Mint Map 컴포넌트
|
|
91
|
+
*
|
|
92
|
+
* @param {MapControlWrapperProps} MapControlWrapperProps
|
|
93
|
+
*
|
|
94
|
+
* @returns {JSX.Element} JSX
|
|
87
95
|
*/
|
|
88
96
|
|
|
89
97
|
|
|
@@ -92,15 +100,17 @@ function MapMarkerWrapper(_a) {
|
|
|
92
100
|
_a.endAnimationClassName;
|
|
93
101
|
var _b = _a.autoFitToViewport,
|
|
94
102
|
autoFitToViewport = _b === void 0 ? false : _b,
|
|
95
|
-
_c = _a.
|
|
96
|
-
|
|
97
|
-
_d = _a.
|
|
98
|
-
|
|
103
|
+
_c = _a.autoAdjustAnchor,
|
|
104
|
+
autoAdjustAnchor = _c === void 0 ? false : _c,
|
|
105
|
+
_d = _a.topOnClick,
|
|
106
|
+
topOnClick = _d === void 0 ? false : _d,
|
|
107
|
+
_e = _a.topOnHover,
|
|
108
|
+
topOnHover = _e === void 0 ? false : _e,
|
|
99
109
|
movingAnimation = _a.movingAnimation,
|
|
100
|
-
|
|
101
|
-
disablePointerEvent =
|
|
110
|
+
_f = _a.disablePointerEvent,
|
|
111
|
+
disablePointerEvent = _f === void 0 ? false : _f,
|
|
102
112
|
children = _a.children,
|
|
103
|
-
options = tslib.__rest(_a, ["startAnimationClassName", "endAnimationClassName", "autoFitToViewport", "topOnClick", "topOnHover", "movingAnimation", "disablePointerEvent", "children"]); //controller
|
|
113
|
+
options = tslib.__rest(_a, ["startAnimationClassName", "endAnimationClassName", "autoFitToViewport", "autoAdjustAnchor", "topOnClick", "topOnHover", "movingAnimation", "disablePointerEvent", "children"]); //controller
|
|
104
114
|
|
|
105
115
|
|
|
106
116
|
var controller = MintMapProvider.useMintMapController(); //element
|
|
@@ -110,9 +120,9 @@ function MapMarkerWrapper(_a) {
|
|
|
110
120
|
|
|
111
121
|
var markerRef = React.useRef(); //moving animation
|
|
112
122
|
|
|
113
|
-
var
|
|
114
|
-
movingState =
|
|
115
|
-
setMovingState =
|
|
123
|
+
var _g = React.useState({}),
|
|
124
|
+
movingState = _g[0],
|
|
125
|
+
setMovingState = _g[1];
|
|
116
126
|
|
|
117
127
|
React.useEffect(function () {
|
|
118
128
|
// console.log('movingState', movingState);
|
|
@@ -178,10 +188,11 @@ function MapMarkerWrapper(_a) {
|
|
|
178
188
|
|
|
179
189
|
React.useEffect(function () {
|
|
180
190
|
// console.log('drawable created')
|
|
181
|
-
divElement.style.display = 'flex'
|
|
182
|
-
divElement.style.justifyContent = 'flex-start'
|
|
183
|
-
divElement.style.alignItems = 'flex-start'
|
|
184
|
-
divElement.style.flexDirection = 'column'
|
|
191
|
+
// divElement.style.display = 'flex'
|
|
192
|
+
// divElement.style.justifyContent = 'flex-start'
|
|
193
|
+
// divElement.style.alignItems = 'flex-start'
|
|
194
|
+
// divElement.style.flexDirection = 'column'
|
|
195
|
+
divElement.style.width = 'fit-content';
|
|
185
196
|
divElement.style.pointerEvents = disablePointerEvent ? 'none' : '';
|
|
186
197
|
divElement.addEventListener('click', onClickHandler);
|
|
187
198
|
divElement.addEventListener('mousedown', onMousedownHandler, {
|
|
@@ -213,7 +224,7 @@ function MapMarkerWrapper(_a) {
|
|
|
213
224
|
} //marker offset 보정
|
|
214
225
|
|
|
215
226
|
|
|
216
|
-
offsetCalibration(controller.getMapType(), divElement, options, autoFitToViewport, controller.mapDivElement); //z-index 처리
|
|
227
|
+
offsetCalibration(controller.getMapType(), divElement, options, autoFitToViewport, autoAdjustAnchor, controller.mapDivElement); //z-index 처리
|
|
217
228
|
|
|
218
229
|
if (options.zIndex !== undefined) {
|
|
219
230
|
controller.setMarkerZIndex(markerRef.current, options.zIndex);
|
|
@@ -230,7 +241,7 @@ function MapMarkerWrapper(_a) {
|
|
|
230
241
|
} //marker offset 보정
|
|
231
242
|
|
|
232
243
|
|
|
233
|
-
offsetCalibration(controller.getMapType(), divElement, options, autoFitToViewport, controller.mapDivElement); //z-index 처리
|
|
244
|
+
offsetCalibration(controller.getMapType(), divElement, options, autoFitToViewport, autoAdjustAnchor, controller.mapDivElement); //z-index 처리
|
|
234
245
|
|
|
235
246
|
if (options.zIndex !== undefined) {
|
|
236
247
|
controller.setMarkerZIndex(markerRef.current, options.zIndex);
|
|
@@ -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';
|