@mint-ui/map 0.5.2-beta → 0.5.4-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +109 -109
- package/LICENSE +21 -21
- package/README.md +73 -73
- package/dist/components/mint-map/MintMap.d.ts +10 -10
- package/dist/components/mint-map/MintMap.js +14 -21
- package/dist/components/mint-map/core/MintMapCanvasRenderer.d.ts +4 -4
- package/dist/components/mint-map/core/MintMapController.d.ts +64 -64
- package/dist/components/mint-map/core/MintMapController.js +9 -9
- package/dist/components/mint-map/core/MintMapCore.d.ts +3 -3
- package/dist/components/mint-map/core/MintMapCore.js +13 -11
- package/dist/components/mint-map/core/advanced/MapBuildingProjection.d.ts +15 -15
- package/dist/components/mint-map/core/advanced/MapBuildingProjection.js +2 -2
- package/dist/components/mint-map/core/advanced/MapLoadingComponents.d.ts +17 -17
- package/dist/components/mint-map/core/advanced/index.d.ts +3 -3
- package/dist/components/mint-map/core/advanced/shapes/CircleMarker.d.ts +20 -20
- package/dist/components/mint-map/core/advanced/shapes/CircleMarker.js +9 -8
- package/dist/components/mint-map/core/advanced/shapes/PolygonMarker.d.ts +23 -23
- package/dist/components/mint-map/core/advanced/shapes/PolygonMarker.js +45 -58
- package/dist/components/mint-map/core/advanced/shapes/base/SVGCircle.d.ts +8 -8
- package/dist/components/mint-map/core/advanced/shapes/base/SVGPolygon.d.ts +12 -12
- package/dist/components/mint-map/core/advanced/shapes/base/SVGPolygon.js +5 -5
- package/dist/components/mint-map/core/advanced/shapes/base/SVGRect.d.ts +10 -10
- package/dist/components/mint-map/core/advanced/shapes/base/index.d.ts +3 -3
- package/dist/components/mint-map/core/advanced/shapes/index.d.ts +3 -3
- package/dist/components/mint-map/core/hooks/MarkerMovingHook.d.ts +6 -6
- package/dist/components/mint-map/core/hooks/MarkerMovingHook.js +2 -2
- package/dist/components/mint-map/core/hooks/index.d.ts +1 -1
- package/dist/components/mint-map/core/index.d.ts +8 -8
- package/dist/components/mint-map/core/provider/MintMapProvider.d.ts +8 -8
- package/dist/components/mint-map/core/provider/index.d.ts +1 -1
- package/dist/components/mint-map/core/util/animation.d.ts +16 -16
- package/dist/components/mint-map/core/util/cluster.d.ts +18 -18
- package/dist/components/mint-map/core/util/{calculate.d.ts → geo.d.ts} +38 -66
- package/dist/components/mint-map/core/util/geo.js +159 -0
- package/dist/components/mint-map/core/util/index.d.ts +5 -4
- package/dist/components/mint-map/core/util/polygon.d.ts +40 -0
- package/dist/components/mint-map/core/util/{calculate.js → polygon.js} +13 -159
- package/dist/components/mint-map/core/util/waiting.d.ts +1 -1
- package/dist/components/mint-map/core/wrapper/MapCanvasMarkerWrapper.d.ts +27 -27
- package/dist/components/mint-map/core/wrapper/MapCanvasMarkerWrapper.js +6 -6
- package/dist/components/mint-map/core/wrapper/MapCanvasWrapper.d.ts +11 -11
- package/dist/components/mint-map/core/wrapper/MapCanvasWrapper.js +28 -12
- package/dist/components/mint-map/core/wrapper/MapControlWrapper.d.ts +18 -18
- package/dist/components/mint-map/core/wrapper/MapControlWrapper.js +6 -6
- package/dist/components/mint-map/core/wrapper/MapMarkerWrapper.d.ts +42 -32
- package/dist/components/mint-map/core/wrapper/MapMarkerWrapper.js +15 -62
- package/dist/components/mint-map/core/wrapper/MapPolygonWrapper.d.ts +12 -12
- package/dist/components/mint-map/core/wrapper/MapPolygonWrapper.js +7 -6
- package/dist/components/mint-map/core/wrapper/MapPolylineWrapper.d.ts +12 -12
- package/dist/components/mint-map/core/wrapper/MapPolylineWrapper.js +8 -7
- package/dist/components/mint-map/core/wrapper/index.d.ts +6 -6
- package/dist/components/mint-map/google/GoogleMintMapController.d.ts +51 -51
- package/dist/components/mint-map/google/GoogleMintMapController.js +1 -1
- package/dist/components/mint-map/index.d.ts +5 -5
- package/dist/components/mint-map/kakao/KakaoMintMapController.d.ts +56 -56
- package/dist/components/mint-map/kakao/KakaoMintMapController.js +9 -8
- package/dist/components/mint-map/naver/NaverMintMapController.d.ts +54 -53
- package/dist/components/mint-map/naver/NaverMintMapController.js +16 -6
- package/dist/components/mint-map/types/CommonTypes.d.ts +11 -11
- package/dist/components/mint-map/types/MapDrawables.d.ts +110 -110
- package/dist/components/mint-map/types/MapDrawables.js +10 -10
- package/dist/components/mint-map/types/MapEventTypes.d.ts +44 -44
- package/dist/components/mint-map/types/MapTypes.d.ts +60 -60
- package/dist/components/mint-map/types/MapTypes.js +15 -15
- package/dist/components/mint-map/types/MintMapEvents.d.ts +25 -25
- package/dist/components/mint-map/types/MintMapProps.d.ts +92 -92
- package/dist/components/mint-map/types/index.d.ts +6 -6
- package/dist/index.d.ts +7 -7
- package/dist/index.es.js +364 -394
- package/dist/index.js +4 -3
- package/dist/index.umd.js +364 -394
- package/package.json +77 -77
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { PropsWithChildren } from "react";
|
|
2
|
-
import { MintMapProps } from "../types/MintMapProps";
|
|
3
|
-
export declare function MintMapCore({ onLoad, visible, zoomLevel, center, centerMoveWithPanning, children }: PropsWithChildren<MintMapProps>): JSX.Element;
|
|
1
|
+
import { PropsWithChildren } from "react";
|
|
2
|
+
import { MintMapProps } from "../types/MintMapProps";
|
|
3
|
+
export declare function MintMapCore({ onLoad, visible, zoomLevel, center, centerMoveWithPanning, children }: PropsWithChildren<MintMapProps>): JSX.Element;
|
|
@@ -35,6 +35,7 @@ function MintMapCore(_a) {
|
|
|
35
35
|
mapInitialized = _d[0],
|
|
36
36
|
setMapInitialized = _d[1];
|
|
37
37
|
|
|
38
|
+
var currMapInitialized = React.useRef(false);
|
|
38
39
|
React.useEffect(function () {
|
|
39
40
|
(function () {
|
|
40
41
|
return tslib.__awaiter(_this, void 0, void 0, function () {
|
|
@@ -47,16 +48,21 @@ function MintMapCore(_a) {
|
|
|
47
48
|
, 2];
|
|
48
49
|
return [4
|
|
49
50
|
/*yield*/
|
|
50
|
-
, controller.initializingMap(elementRef.current)
|
|
51
|
-
];
|
|
51
|
+
, controller.initializingMap(elementRef.current)];
|
|
52
52
|
|
|
53
53
|
case 1:
|
|
54
|
-
map_1 = _a.sent();
|
|
54
|
+
map_1 = _a.sent();
|
|
55
|
+
|
|
56
|
+
if (!currMapInitialized.current) {
|
|
57
|
+
currMapInitialized.current = true; //onload callback (setTimeout 으로 맵이 초기화 될 텀을 준다. 특히 google map..)
|
|
58
|
+
|
|
59
|
+
setTimeout(function () {
|
|
60
|
+
// console.log('setMapInitialized true');
|
|
61
|
+
setMapInitialized(true);
|
|
62
|
+
onLoad && onLoad(map_1, controller);
|
|
63
|
+
}, 100);
|
|
64
|
+
}
|
|
55
65
|
|
|
56
|
-
setTimeout(function () {
|
|
57
|
-
setMapInitialized(true);
|
|
58
|
-
onLoad && onLoad(map_1, controller);
|
|
59
|
-
}, 100);
|
|
60
66
|
_a.label = 2;
|
|
61
67
|
|
|
62
68
|
case 2:
|
|
@@ -67,10 +73,6 @@ function MintMapCore(_a) {
|
|
|
67
73
|
});
|
|
68
74
|
});
|
|
69
75
|
})();
|
|
70
|
-
|
|
71
|
-
return function () {
|
|
72
|
-
controller && controller.destroyMap();
|
|
73
|
-
};
|
|
74
76
|
}, [controller, elementRef]); //줌레벨
|
|
75
77
|
|
|
76
78
|
React.useEffect(function () {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { Position } from "../../types/MapTypes";
|
|
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 "../../types/MapTypes";
|
|
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 {};
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var tslib = require('tslib');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var MapTypes = require('../../types/MapTypes.js');
|
|
8
|
-
var
|
|
8
|
+
var geo = require('../util/geo.js');
|
|
9
9
|
var MapMarkerWrapper = require('../wrapper/MapMarkerWrapper.js');
|
|
10
10
|
var MapPolygonWrapper = require('../wrapper/MapPolygonWrapper.js');
|
|
11
11
|
|
|
@@ -82,7 +82,7 @@ function MapBuildingProjection(props) {
|
|
|
82
82
|
position: basePolygonPath
|
|
83
83
|
};
|
|
84
84
|
var height = numberOfFloor * heightOfFloor;
|
|
85
|
-
var projectionHeight =
|
|
85
|
+
var projectionHeight = geo.GeoCalulator.convertMeterToLatitudeValue(height); //roof
|
|
86
86
|
|
|
87
87
|
var roofPaths = [];
|
|
88
88
|
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
/**
|
|
3
|
-
* 유틸 컴포넌트 : 텍스트 로딩
|
|
4
|
-
*/
|
|
5
|
-
export interface PointLoadingProps {
|
|
6
|
-
text?: string;
|
|
7
|
-
pointCount?: number;
|
|
8
|
-
speedMs?: number;
|
|
9
|
-
}
|
|
10
|
-
export declare function PointLoading({ text, pointCount, speedMs }: PointLoadingProps): JSX.Element;
|
|
11
|
-
export declare function MapLoadingWithImage({ size }: MapImageLoadingProps): JSX.Element;
|
|
12
|
-
interface MapImageLoadingProps {
|
|
13
|
-
size?: number;
|
|
14
|
-
duration?: number;
|
|
15
|
-
delay?: number;
|
|
16
|
-
}
|
|
17
|
-
export {};
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/**
|
|
3
|
+
* 유틸 컴포넌트 : 텍스트 로딩
|
|
4
|
+
*/
|
|
5
|
+
export interface PointLoadingProps {
|
|
6
|
+
text?: string;
|
|
7
|
+
pointCount?: number;
|
|
8
|
+
speedMs?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare function PointLoading({ text, pointCount, speedMs }: PointLoadingProps): JSX.Element;
|
|
11
|
+
export declare function MapLoadingWithImage({ size }: MapImageLoadingProps): JSX.Element;
|
|
12
|
+
interface MapImageLoadingProps {
|
|
13
|
+
size?: number;
|
|
14
|
+
duration?: number;
|
|
15
|
+
delay?: number;
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './shapes';
|
|
2
|
-
export * from './MapBuildingProjection';
|
|
3
|
-
export * from './MapLoadingComponents';
|
|
1
|
+
export * from './shapes';
|
|
2
|
+
export * from './MapBuildingProjection';
|
|
3
|
+
export * from './MapLoadingComponents';
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import React, { PropsWithChildren } from "react";
|
|
2
|
-
import { Position } from "../../../types";
|
|
3
|
-
export interface CircleMarkerProps {
|
|
4
|
-
center: Position;
|
|
5
|
-
radius: number;
|
|
6
|
-
radiusUnit?: 'PIXEL' | 'METER';
|
|
7
|
-
background?: string;
|
|
8
|
-
visible?: boolean;
|
|
9
|
-
zIndex?: number;
|
|
10
|
-
svgProperties?: React.SVGProps<SVGSVGElement>;
|
|
11
|
-
shapeProperties?: React.SVGProps<SVGCircleElement>;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* CircleMarker
|
|
15
|
-
*
|
|
16
|
-
* @param {CircleMarkerProps} CircleMarkerProps
|
|
17
|
-
*
|
|
18
|
-
* @returns {JSX.Element} JSX
|
|
19
|
-
*/
|
|
20
|
-
export declare function CircleMarker({ children, center, radius, radiusUnit, background, svgProperties, shapeProperties, visible, zIndex, }: PropsWithChildren<CircleMarkerProps>): JSX.Element;
|
|
1
|
+
import React, { PropsWithChildren } from "react";
|
|
2
|
+
import { Position } from "../../../types";
|
|
3
|
+
export interface CircleMarkerProps {
|
|
4
|
+
center: Position;
|
|
5
|
+
radius: number;
|
|
6
|
+
radiusUnit?: 'PIXEL' | 'METER';
|
|
7
|
+
background?: string;
|
|
8
|
+
visible?: boolean;
|
|
9
|
+
zIndex?: number;
|
|
10
|
+
svgProperties?: React.SVGProps<SVGSVGElement>;
|
|
11
|
+
shapeProperties?: React.SVGProps<SVGCircleElement>;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* CircleMarker
|
|
15
|
+
*
|
|
16
|
+
* @param {CircleMarkerProps} CircleMarkerProps
|
|
17
|
+
*
|
|
18
|
+
* @returns {JSX.Element} JSX
|
|
19
|
+
*/
|
|
20
|
+
export declare function CircleMarker({ children, center, radius, radiusUnit, background, svgProperties, shapeProperties, visible, zIndex, }: PropsWithChildren<CircleMarkerProps>): JSX.Element;
|
|
@@ -11,18 +11,19 @@ var MapTypes = require('../../../types/MapTypes.js');
|
|
|
11
11
|
require('../../../types/MapEventTypes.js');
|
|
12
12
|
var SVGCircle = require('./base/SVGCircle.js');
|
|
13
13
|
require('../../util/animation.js');
|
|
14
|
-
var
|
|
14
|
+
var geo = require('../../util/geo.js');
|
|
15
|
+
require('../../util/polygon.js');
|
|
15
16
|
|
|
16
17
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
17
18
|
|
|
18
19
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
19
20
|
|
|
20
|
-
/**
|
|
21
|
-
* CircleMarker
|
|
22
|
-
*
|
|
23
|
-
* @param {CircleMarkerProps} CircleMarkerProps
|
|
24
|
-
*
|
|
25
|
-
* @returns {JSX.Element} JSX
|
|
21
|
+
/**
|
|
22
|
+
* CircleMarker
|
|
23
|
+
*
|
|
24
|
+
* @param {CircleMarkerProps} CircleMarkerProps
|
|
25
|
+
*
|
|
26
|
+
* @returns {JSX.Element} JSX
|
|
26
27
|
*/
|
|
27
28
|
|
|
28
29
|
function CircleMarker(_a) {
|
|
@@ -103,7 +104,7 @@ function CircleMarker(_a) {
|
|
|
103
104
|
radiusUnit = _a.radiusUnit;
|
|
104
105
|
|
|
105
106
|
if (radiusUnit === 'METER') {
|
|
106
|
-
var latMargin =
|
|
107
|
+
var latMargin = geo.GeoCalulator.convertMeterToLatitudeValue(radius);
|
|
107
108
|
var targetPos = new MapTypes.Position(center.lat + latMargin, center.lng);
|
|
108
109
|
var tempComputedRadius = calcRadius(center, targetPos);
|
|
109
110
|
setComputedRadius(tempComputedRadius);
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import React, { PropsWithChildren } from "react";
|
|
2
|
-
import { Position } from "../../../types";
|
|
3
|
-
export interface PolygonMarkerProps {
|
|
4
|
-
position: Position[];
|
|
5
|
-
innerPositions?: Position[][];
|
|
6
|
-
background?: string;
|
|
7
|
-
visible?: boolean;
|
|
8
|
-
zIndex?: number;
|
|
9
|
-
simplifyPath?: boolean;
|
|
10
|
-
simplifyTolerance?: number;
|
|
11
|
-
lastReapeated?: boolean;
|
|
12
|
-
mode?: 'POLYGON' | 'POLYLINE';
|
|
13
|
-
svgProperties?: React.SVGProps<SVGSVGElement>;
|
|
14
|
-
shapeProperties?: React.SVGProps<SVGPathElement>;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
*PolygonMarker
|
|
18
|
-
*
|
|
19
|
-
* @param {PolygonMarkerProps} PolygonMarkerProps
|
|
20
|
-
*
|
|
21
|
-
* @returns {JSX.Element} JSX
|
|
22
|
-
*/
|
|
23
|
-
export declare function PolygonMarker({ children, position, background, innerPositions, simplifyPath, simplifyTolerance, lastReapeated, svgProperties, shapeProperties, visible, zIndex, mode, }: PropsWithChildren<PolygonMarkerProps>): JSX.Element;
|
|
1
|
+
import React, { PropsWithChildren } from "react";
|
|
2
|
+
import { Position } from "../../../types";
|
|
3
|
+
export interface PolygonMarkerProps {
|
|
4
|
+
position: Position[];
|
|
5
|
+
innerPositions?: Position[][];
|
|
6
|
+
background?: string;
|
|
7
|
+
visible?: boolean;
|
|
8
|
+
zIndex?: number;
|
|
9
|
+
simplifyPath?: boolean;
|
|
10
|
+
simplifyTolerance?: number;
|
|
11
|
+
lastReapeated?: boolean;
|
|
12
|
+
mode?: 'POLYGON' | 'POLYLINE';
|
|
13
|
+
svgProperties?: React.SVGProps<SVGSVGElement>;
|
|
14
|
+
shapeProperties?: React.SVGProps<SVGPathElement>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
*PolygonMarker
|
|
18
|
+
*
|
|
19
|
+
* @param {PolygonMarkerProps} PolygonMarkerProps
|
|
20
|
+
*
|
|
21
|
+
* @returns {JSX.Element} JSX
|
|
22
|
+
*/
|
|
23
|
+
export declare function PolygonMarker({ children, position, background, innerPositions, simplifyPath, simplifyTolerance, lastReapeated, svgProperties, shapeProperties, visible, zIndex, mode, }: PropsWithChildren<PolygonMarkerProps>): JSX.Element;
|
|
@@ -10,19 +10,20 @@ require('../../../types/MapDrawables.js');
|
|
|
10
10
|
var MapTypes = require('../../../types/MapTypes.js');
|
|
11
11
|
require('../../../types/MapEventTypes.js');
|
|
12
12
|
require('../../util/animation.js');
|
|
13
|
-
|
|
13
|
+
require('../../util/geo.js');
|
|
14
14
|
require('tslib');
|
|
15
|
+
var polygon = require('../../util/polygon.js');
|
|
15
16
|
|
|
16
17
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
17
18
|
|
|
18
19
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
19
20
|
|
|
20
|
-
/**
|
|
21
|
-
*PolygonMarker
|
|
22
|
-
*
|
|
23
|
-
* @param {PolygonMarkerProps} PolygonMarkerProps
|
|
24
|
-
*
|
|
25
|
-
* @returns {JSX.Element} JSX
|
|
21
|
+
/**
|
|
22
|
+
*PolygonMarker
|
|
23
|
+
*
|
|
24
|
+
* @param {PolygonMarkerProps} PolygonMarkerProps
|
|
25
|
+
*
|
|
26
|
+
* @returns {JSX.Element} JSX
|
|
26
27
|
*/
|
|
27
28
|
|
|
28
29
|
function PolygonMarker(_a) {
|
|
@@ -85,11 +86,9 @@ function PolygonMarker(_a) {
|
|
|
85
86
|
|
|
86
87
|
var _l = React.useState([]),
|
|
87
88
|
innerOffsets = _l[0],
|
|
88
|
-
setInnerOffsets = _l[1]; //
|
|
89
|
+
setInnerOffsets = _l[1]; //polygon props ref
|
|
89
90
|
|
|
90
91
|
|
|
91
|
-
var offsetCache = React.useRef(new Map()); //polygon props ref
|
|
92
|
-
|
|
93
92
|
var polygonPropsRef = React.useRef({
|
|
94
93
|
position: position,
|
|
95
94
|
innerPositions: innerPositions,
|
|
@@ -100,7 +99,6 @@ function PolygonMarker(_a) {
|
|
|
100
99
|
|
|
101
100
|
React.useEffect(function () {
|
|
102
101
|
// console.log('polygon changed');
|
|
103
|
-
offsetCache.current.clear();
|
|
104
102
|
polygonPropsRef.current = {
|
|
105
103
|
position: position,
|
|
106
104
|
innerPositions: innerPositions,
|
|
@@ -122,53 +120,42 @@ function PolygonMarker(_a) {
|
|
|
122
120
|
innerPositions = _a.innerPositions,
|
|
123
121
|
simplifyPath = _a.simplifyPath,
|
|
124
122
|
simplifyTolerance = _a.simplifyTolerance,
|
|
125
|
-
lastReapeated = _a.lastReapeated;
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
var regionInfo = calculate.PolygonCalculator.getRegionInfo(simplified);
|
|
163
|
-
var startPosition = regionInfo.maxLat && regionInfo.minLng ? new MapTypes.Position(regionInfo.maxLat, regionInfo.minLng) : undefined;
|
|
164
|
-
setPolygonStart(startPosition); //cache set
|
|
165
|
-
|
|
166
|
-
offsetCache.current.set(zoomLevel.current, {
|
|
167
|
-
start: startPosition,
|
|
168
|
-
offsets: offsets_2,
|
|
169
|
-
innerOffsets: innerPath
|
|
170
|
-
});
|
|
171
|
-
}
|
|
123
|
+
lastReapeated = _a.lastReapeated; // path
|
|
124
|
+
|
|
125
|
+
var maxLat = undefined;
|
|
126
|
+
var minLng = undefined;
|
|
127
|
+
var offsets = position.map(function (pos) {
|
|
128
|
+
if (maxLat === undefined || maxLat < pos.lat) {
|
|
129
|
+
maxLat = pos.lat;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
if (minLng === undefined || minLng > pos.lng) {
|
|
133
|
+
minLng = pos.lng;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
return controller.positionToOffset(pos);
|
|
137
|
+
});
|
|
138
|
+
var simplified = simplifyPath ? polygon.PolygonCalculator.simplifyPoints(offsets, simplifyTolerance, lastReapeated) : offsets;
|
|
139
|
+
setOffsets(simplified); //inner path
|
|
140
|
+
|
|
141
|
+
var innerPath = [];
|
|
142
|
+
|
|
143
|
+
if (innerPositions) {
|
|
144
|
+
for (var _i = 0, innerPositions_1 = innerPositions; _i < innerPositions_1.length; _i++) {
|
|
145
|
+
var innerPosition = innerPositions_1[_i];
|
|
146
|
+
var offsets_1 = innerPosition.map(function (pos) {
|
|
147
|
+
return controller.positionToOffset(pos);
|
|
148
|
+
});
|
|
149
|
+
var simplified_1 = simplifyPath ? polygon.PolygonCalculator.simplifyPoints(offsets_1, simplifyTolerance, lastReapeated) : offsets_1;
|
|
150
|
+
innerPath.push(simplified_1);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
setInnerOffsets(innerPath);
|
|
154
|
+
} //start point
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
var startPosition = maxLat && minLng ? new MapTypes.Position(maxLat, minLng) : undefined;
|
|
158
|
+
setPolygonStart(startPosition);
|
|
172
159
|
}, []);
|
|
173
160
|
return React__default["default"].createElement(React__default["default"].Fragment, null, polygonStart && React__default["default"].createElement(MapMarkerWrapper.MapMarkerWrapper, {
|
|
174
161
|
position: polygonStart,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React, { PropsWithChildren } from "react";
|
|
2
|
-
export interface SVGCircleProps {
|
|
3
|
-
radius?: number;
|
|
4
|
-
background?: string;
|
|
5
|
-
svgProperties?: React.SVGProps<SVGSVGElement>;
|
|
6
|
-
shapeProperties?: React.SVGProps<SVGCircleElement>;
|
|
7
|
-
}
|
|
8
|
-
export declare function SVGCircle({ radius, background, children, svgProperties, shapeProperties, }: PropsWithChildren<SVGCircleProps>): JSX.Element;
|
|
1
|
+
import React, { PropsWithChildren } from "react";
|
|
2
|
+
export interface SVGCircleProps {
|
|
3
|
+
radius?: number;
|
|
4
|
+
background?: string;
|
|
5
|
+
svgProperties?: React.SVGProps<SVGSVGElement>;
|
|
6
|
+
shapeProperties?: React.SVGProps<SVGCircleElement>;
|
|
7
|
+
}
|
|
8
|
+
export declare function SVGCircle({ radius, background, children, svgProperties, shapeProperties, }: PropsWithChildren<SVGCircleProps>): JSX.Element;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { PropsWithChildren } from "react";
|
|
3
|
-
import { Offset } from "../../../../types";
|
|
4
|
-
export interface SVGPolygonProps {
|
|
5
|
-
path: Offset[];
|
|
6
|
-
innerPath?: Offset[][];
|
|
7
|
-
background?: string;
|
|
8
|
-
mode?: 'POLYGON' | 'POLYLINE';
|
|
9
|
-
svgProperties?: React.SVGProps<SVGSVGElement>;
|
|
10
|
-
shapeProperties?: React.SVGProps<SVGPathElement>;
|
|
11
|
-
}
|
|
12
|
-
export declare function SVGPolygon({ path, innerPath, background, svgProperties, shapeProperties, mode, children, }: PropsWithChildren<SVGPolygonProps>): JSX.Element;
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { PropsWithChildren } from "react";
|
|
3
|
+
import { Offset } from "../../../../types";
|
|
4
|
+
export interface SVGPolygonProps {
|
|
5
|
+
path: Offset[];
|
|
6
|
+
innerPath?: Offset[][];
|
|
7
|
+
background?: string;
|
|
8
|
+
mode?: 'POLYGON' | 'POLYLINE';
|
|
9
|
+
svgProperties?: React.SVGProps<SVGSVGElement>;
|
|
10
|
+
shapeProperties?: React.SVGProps<SVGPathElement>;
|
|
11
|
+
}
|
|
12
|
+
export declare function SVGPolygon({ path, innerPath, background, svgProperties, shapeProperties, mode, children, }: PropsWithChildren<SVGPolygonProps>): JSX.Element;
|
|
@@ -57,10 +57,10 @@ function SVGPolygon(_a) {
|
|
|
57
57
|
var width = maxX - minX;
|
|
58
58
|
var height = maxY - minY;
|
|
59
59
|
return {
|
|
60
|
-
containerLeft:
|
|
61
|
-
containerTop:
|
|
62
|
-
containerWidth:
|
|
63
|
-
containerHeight:
|
|
60
|
+
containerLeft: minX,
|
|
61
|
+
containerTop: minY,
|
|
62
|
+
containerWidth: width,
|
|
63
|
+
containerHeight: height
|
|
64
64
|
};
|
|
65
65
|
}, []);
|
|
66
66
|
var getD = React.useCallback(function (_a) {
|
|
@@ -134,7 +134,7 @@ function SVGPolygon(_a) {
|
|
|
134
134
|
height: height,
|
|
135
135
|
fill: mode === 'POLYLINE' ? 'none' : background,
|
|
136
136
|
stroke: mode === 'POLYLINE' ? 'black' : 'green',
|
|
137
|
-
strokeLinejoin: "
|
|
137
|
+
strokeLinejoin: "miter",
|
|
138
138
|
strokeLinecap: "butt",
|
|
139
139
|
d: d
|
|
140
140
|
}, shapeProperties))), React__default["default"].createElement("div", {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { PropsWithChildren } from "react";
|
|
3
|
-
export interface SVGRectProps {
|
|
4
|
-
width?: number;
|
|
5
|
-
height?: number;
|
|
6
|
-
background?: string;
|
|
7
|
-
svgProperties?: React.SVGProps<SVGSVGElement>;
|
|
8
|
-
shapeProperties?: React.SVGProps<SVGRectElement>;
|
|
9
|
-
}
|
|
10
|
-
export declare function SVGRect({ width, height, background, svgProperties, shapeProperties, children }: PropsWithChildren<SVGRectProps>): JSX.Element;
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { PropsWithChildren } from "react";
|
|
3
|
+
export interface SVGRectProps {
|
|
4
|
+
width?: number;
|
|
5
|
+
height?: number;
|
|
6
|
+
background?: string;
|
|
7
|
+
svgProperties?: React.SVGProps<SVGSVGElement>;
|
|
8
|
+
shapeProperties?: React.SVGProps<SVGRectElement>;
|
|
9
|
+
}
|
|
10
|
+
export declare function SVGRect({ width, height, background, svgProperties, shapeProperties, children }: PropsWithChildren<SVGRectProps>): JSX.Element;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './SVGCircle';
|
|
2
|
-
export * from './SVGPolygon';
|
|
3
|
-
export * from './SVGRect';
|
|
1
|
+
export * from './SVGCircle';
|
|
2
|
+
export * from './SVGPolygon';
|
|
3
|
+
export * from './SVGRect';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './base';
|
|
2
|
-
export * from './CircleMarker';
|
|
3
|
-
export * from './PolygonMarker';
|
|
1
|
+
export * from './base';
|
|
2
|
+
export * from './CircleMarker';
|
|
3
|
+
export * from './PolygonMarker';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Marker } from "../../types/MapDrawables";
|
|
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 "../../types/MapDrawables";
|
|
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)[];
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var MintMapProvider = require('../provider/MintMapProvider.js');
|
|
7
7
|
var animation = require('../util/animation.js');
|
|
8
|
-
var
|
|
8
|
+
var geo = require('../util/geo.js');
|
|
9
9
|
require('../../types/MapDrawables.js');
|
|
10
10
|
var MapTypes = require('../../types/MapTypes.js');
|
|
11
11
|
require('../../types/MapEventTypes.js');
|
|
@@ -71,7 +71,7 @@ function useMarkerMoving(_a) {
|
|
|
71
71
|
|
|
72
72
|
while (true) {
|
|
73
73
|
//계산
|
|
74
|
-
|
|
74
|
+
geo.GeoCalulator.computeNextPositionAndDistances(context_1); //타겟에 도착했으면, 원래 얼마나 더 갈수 있었는지 체크해서
|
|
75
75
|
//그 만큼 더 가도록 계속 처리하기위해 다시 계산
|
|
76
76
|
|
|
77
77
|
if (context_1.nextPos === context_1.pos2) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./MarkerMovingHook";
|
|
1
|
+
export * from "./MarkerMovingHook";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export * from "./MintMapCore";
|
|
2
|
-
export * from "./MintMapController";
|
|
3
|
-
export * from './MintMapCanvasRenderer';
|
|
4
|
-
export * from "./advanced";
|
|
5
|
-
export * from "./hooks";
|
|
6
|
-
export * from "./provider";
|
|
7
|
-
export * from './util';
|
|
8
|
-
export * from './wrapper';
|
|
1
|
+
export * from "./MintMapCore";
|
|
2
|
+
export * from "./MintMapController";
|
|
3
|
+
export * from './MintMapCanvasRenderer';
|
|
4
|
+
export * from "./advanced";
|
|
5
|
+
export * from "./hooks";
|
|
6
|
+
export * from "./provider";
|
|
7
|
+
export * from './util';
|
|
8
|
+
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
|
+
}
|