@mint-ui/map 1.2.0-test.67 → 1.2.0-test.69
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/dist/components/mint-map/core/advanced/CanvasMarkerLayer/CanvasMarkerLayer.d.ts +1 -1
- package/dist/components/mint-map/core/advanced/CanvasMarkerLayer/CanvasMarkerLayer.js +9 -3
- package/dist/components/mint-map/core/advanced/CanvasMarkerLayer/types.d.ts +7 -7
- package/dist/components/mint-map/core/advanced/CanvasPolygonLayer/CanvasPolygonLayer.d.ts +1 -1
- package/dist/components/mint-map/core/advanced/CanvasPolygonLayer/CanvasPolygonLayer.js +3 -3
- package/dist/components/mint-map/core/advanced/CanvasPolygonLayer/types.d.ts +1 -1
- package/dist/components/mint-map/core/advanced/shared/performance.d.ts +4 -3
- package/dist/components/mint-map/core/advanced/shared/performance.js +12 -11
- package/dist/components/mint-map/core/advanced/shared/types.d.ts +13 -3
- package/dist/components/mint-map/core/advanced/shared/types.js +12 -0
- package/dist/index.es.js +30 -15
- package/dist/index.js +5 -1
- package/dist/index.umd.js +30 -15
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { CanvasMarkerLayerProps } from './types';
|
|
3
|
-
export { CanvasDataType, CanvasProvider,
|
|
3
|
+
export { CanvasDataType, CanvasProvider, QueueCache, RenderSource, SpatialHashGrid } from '../shared';
|
|
4
4
|
export type { CanvasData, CanvasOption, CustomRenderBase, CustomRenderEvent, MarkerBoundingBox, RenderBaseParams, RenderEventParams, RenderUtils } from '../shared';
|
|
5
5
|
export type { CanvasMarkerLayerProps, CanvasMarkerLayerPropsWithEvent, CanvasMarkerLayerPropsWithEventWithoutSelection, CanvasMarkerLayerPropsWithEventWithSelectedItem, CanvasMarkerLayerPropsWithEventWithSelectedItems, CanvasMarkerLayerPropsWithEventWithTopStageWithoutSelection, CanvasMarkerLayerPropsWithEventWithTopStageWithSelectedItem, CanvasMarkerLayerPropsWithEventWithTopStageWithSelectedItems, CanvasMarkerLayerPropsWithoutEvent } from './types';
|
|
6
6
|
declare const CanvasMarkerLayer: <T>(props: CanvasMarkerLayerProps<T>) => JSX.Element;
|
|
@@ -97,14 +97,14 @@ var CanvasMarkerLayer = function (props) {
|
|
|
97
97
|
|
|
98
98
|
var dragStartHoveredItemRef = React.useRef(null); // 성능 최적화 Refs
|
|
99
99
|
|
|
100
|
-
var offsetCacheRef = React.useRef(new performance.
|
|
100
|
+
var offsetCacheRef = React.useRef(new performance.QueueCache(maxCacheSize));
|
|
101
101
|
var spatialIndexRef = React.useRef(new performance.SpatialHashGrid(performance.SPATIAL_GRID_CELL_SIZE));
|
|
102
102
|
var boundingBoxCacheRef = React.useRef(new Map());
|
|
103
103
|
var viewportRef = React.useRef(null); // 뷰포트 영역 계산 (Viewport Culling용)
|
|
104
104
|
|
|
105
105
|
var updateViewport = function () {
|
|
106
106
|
viewport.updateViewport(stageRef.current, cullingMargin, viewportRef);
|
|
107
|
-
}; // 마커 좌표 변환 (위경도 → 화면 좌표,
|
|
107
|
+
}; // 마커 좌표 변환 (위경도 → 화면 좌표, Queue 캐시 사용)
|
|
108
108
|
|
|
109
109
|
|
|
110
110
|
var getOrComputeMarkerOffset = function (markerData) {
|
|
@@ -221,6 +221,7 @@ var CanvasMarkerLayer = function (props) {
|
|
|
221
221
|
ctx: ctx,
|
|
222
222
|
hasTopStage: topStageZIndex !== undefined,
|
|
223
223
|
hoveredItem: hovered,
|
|
224
|
+
renderSource: types.RenderSource.EVENT,
|
|
224
225
|
selectedItem: selectedItemRef.current,
|
|
225
226
|
selectedItems: selectedItems,
|
|
226
227
|
utils: renderUtils
|
|
@@ -291,6 +292,7 @@ var CanvasMarkerLayer = function (props) {
|
|
|
291
292
|
ctx: ctx,
|
|
292
293
|
hasTopStage: true,
|
|
293
294
|
hoveredItem: currentHovered,
|
|
295
|
+
renderSource: types.RenderSource.TOP,
|
|
294
296
|
selectedItem: selectedItemRef.current,
|
|
295
297
|
selectedItems: hoverSelectedItems,
|
|
296
298
|
utils: renderUtils
|
|
@@ -962,10 +964,14 @@ var CanvasMarkerLayer = function (props) {
|
|
|
962
964
|
};
|
|
963
965
|
|
|
964
966
|
exports.CanvasProvider = context.CanvasProvider;
|
|
965
|
-
exports.
|
|
967
|
+
exports.QueueCache = performance.QueueCache;
|
|
966
968
|
exports.SpatialHashGrid = performance.SpatialHashGrid;
|
|
967
969
|
Object.defineProperty(exports, 'CanvasDataType', {
|
|
968
970
|
enumerable: true,
|
|
969
971
|
get: function () { return types.CanvasDataType; }
|
|
970
972
|
});
|
|
973
|
+
Object.defineProperty(exports, 'RenderSource', {
|
|
974
|
+
enumerable: true,
|
|
975
|
+
get: function () { return types.RenderSource; }
|
|
976
|
+
});
|
|
971
977
|
exports["default"] = CanvasMarkerLayer;
|
|
@@ -12,7 +12,7 @@ export interface CanvasMarkerLayerPropsWithoutEvent<T> extends Pick<MarkerOption
|
|
|
12
12
|
enableViewportCulling?: boolean;
|
|
13
13
|
/** 뷰포트 컬링 여유 공간 (픽셀 단위, 기본값: 100) */
|
|
14
14
|
cullingMargin?: number;
|
|
15
|
-
/**
|
|
15
|
+
/** Queue 캐시 최대 크기 (기본값: 30000) */
|
|
16
16
|
maxCacheSize?: number;
|
|
17
17
|
/** Base Layer 렌더링 함수 (필수) */
|
|
18
18
|
renderBase: CustomRenderBase<T>;
|
|
@@ -47,7 +47,7 @@ export interface CanvasMarkerLayerPropsWithEventWithSelectedItem<T> extends Pick
|
|
|
47
47
|
enableViewportCulling?: boolean;
|
|
48
48
|
/** 뷰포트 컬링 여유 공간 (픽셀 단위, 기본값: 100) */
|
|
49
49
|
cullingMargin?: number;
|
|
50
|
-
/**
|
|
50
|
+
/** Queue 캐시 최대 크기 (기본값: 30000) */
|
|
51
51
|
maxCacheSize?: number;
|
|
52
52
|
/** 외부에서 전달된 단일 선택 아이템 */
|
|
53
53
|
selectedItem: CanvasData<T> | null;
|
|
@@ -81,7 +81,7 @@ export interface CanvasMarkerLayerPropsWithEventWithSelectedItems<T> extends Pic
|
|
|
81
81
|
enableViewportCulling?: boolean;
|
|
82
82
|
/** 뷰포트 컬링 여유 공간 (픽셀 단위, 기본값: 100) */
|
|
83
83
|
cullingMargin?: number;
|
|
84
|
-
/**
|
|
84
|
+
/** Queue 캐시 최대 크기 (기본값: 30000) */
|
|
85
85
|
maxCacheSize?: number;
|
|
86
86
|
/** 외부에서 제어하는 선택된 항목 배열 */
|
|
87
87
|
selectedItems: CanvasData<T>[];
|
|
@@ -115,7 +115,7 @@ export interface CanvasMarkerLayerPropsWithEventWithoutSelection<T> extends Pick
|
|
|
115
115
|
enableViewportCulling?: boolean;
|
|
116
116
|
/** 뷰포트 컬링 여유 공간 (픽셀 단위, 기본값: 100) */
|
|
117
117
|
cullingMargin?: number;
|
|
118
|
-
/**
|
|
118
|
+
/** Queue 캐시 최대 크기 (기본값: 30000) */
|
|
119
119
|
maxCacheSize?: number;
|
|
120
120
|
/** 외부에서 제어하는 선택된 항목 배열 */
|
|
121
121
|
selectedItems?: never;
|
|
@@ -150,7 +150,7 @@ export interface CanvasMarkerLayerPropsWithEventWithTopStageWithSelectedItem<T>
|
|
|
150
150
|
enableViewportCulling?: boolean;
|
|
151
151
|
/** 뷰포트 컬링 여유 공간 (픽셀 단위, 기본값: 100) */
|
|
152
152
|
cullingMargin?: number;
|
|
153
|
-
/**
|
|
153
|
+
/** Queue 캐시 최대 크기 (기본값: 30000) */
|
|
154
154
|
maxCacheSize?: number;
|
|
155
155
|
/** 외부에서 전달된 단일 선택 아이템 */
|
|
156
156
|
selectedItem: CanvasData<T> | null;
|
|
@@ -185,7 +185,7 @@ export interface CanvasMarkerLayerPropsWithEventWithTopStageWithSelectedItems<T>
|
|
|
185
185
|
enableViewportCulling?: boolean;
|
|
186
186
|
/** 뷰포트 컬링 여유 공간 (픽셀 단위, 기본값: 100) */
|
|
187
187
|
cullingMargin?: number;
|
|
188
|
-
/**
|
|
188
|
+
/** Queue 캐시 최대 크기 (기본값: 30000) */
|
|
189
189
|
maxCacheSize?: number;
|
|
190
190
|
/** 외부에서 제어하는 선택된 항목 배열 */
|
|
191
191
|
selectedItems: CanvasData<T>[];
|
|
@@ -220,7 +220,7 @@ export interface CanvasMarkerLayerPropsWithEventWithTopStageWithoutSelection<T>
|
|
|
220
220
|
enableViewportCulling?: boolean;
|
|
221
221
|
/** 뷰포트 컬링 여유 공간 (픽셀 단위, 기본값: 100) */
|
|
222
222
|
cullingMargin?: number;
|
|
223
|
-
/**
|
|
223
|
+
/** Queue 캐시 최대 크기 (기본값: 30000) */
|
|
224
224
|
maxCacheSize?: number;
|
|
225
225
|
/** 외부에서 제어하는 선택된 항목 배열 */
|
|
226
226
|
selectedItems?: never;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { CanvasPolygonLayerProps } from './types';
|
|
3
|
-
export { CanvasProvider,
|
|
3
|
+
export { CanvasProvider, QueueCache, SpatialHashGrid } from '../shared';
|
|
4
4
|
export type { CanvasData, CanvasOption, RenderUtils } from '../shared';
|
|
5
5
|
export type { CanvasPolygonLayerBaseProps, CanvasPolygonLayerProps, CanvasPolygonLayerPropsWithCustomStyle, CanvasPolygonLayerPropsWithIndividualStyles, CanvasPolygonLayerPropsWithObjectStyle, PolygonStyle, PolygonStyleContext, PolygonStyleCustomizer, PolygonStyleCustomizerWithDeps, PolygonStyleObject } from './types';
|
|
6
6
|
declare const CanvasPolygonLayer: <T>(props: CanvasPolygonLayerProps<T>) => React.ReactPortal;
|
|
@@ -85,10 +85,10 @@ var CanvasPolygonLayer = function (props) {
|
|
|
85
85
|
|
|
86
86
|
var dragStartHoveredItemRef = React.useRef(null); // 성능 최적화 Refs
|
|
87
87
|
|
|
88
|
-
var offsetCacheRef = React.useRef(new performance.
|
|
88
|
+
var offsetCacheRef = React.useRef(new performance.QueueCache(maxCacheSize));
|
|
89
89
|
var spatialIndexRef = React.useRef(new performance.SpatialHashGrid(performance.SPATIAL_GRID_CELL_SIZE));
|
|
90
90
|
var boundingBoxCacheRef = React.useRef(new Map());
|
|
91
|
-
var viewportRef = React.useRef(null); // 폴리곤 좌표 변환 (위경도 → 화면 좌표,
|
|
91
|
+
var viewportRef = React.useRef(null); // 폴리곤 좌표 변환 (위경도 → 화면 좌표, Queue 캐시 사용)
|
|
92
92
|
|
|
93
93
|
var getOrComputePolygonOffsets = function (polygonData) {
|
|
94
94
|
var cached = offsetCacheRef.current.get(polygonData.id);
|
|
@@ -629,6 +629,6 @@ var CanvasPolygonLayer = function (props) {
|
|
|
629
629
|
};
|
|
630
630
|
|
|
631
631
|
exports.CanvasProvider = context.CanvasProvider;
|
|
632
|
-
exports.
|
|
632
|
+
exports.QueueCache = performance.QueueCache;
|
|
633
633
|
exports.SpatialHashGrid = performance.SpatialHashGrid;
|
|
634
634
|
exports["default"] = CanvasPolygonLayer;
|
|
@@ -117,7 +117,7 @@ export interface CanvasPolygonLayerBaseProps<T> extends Pick<MarkerOptions, 'zIn
|
|
|
117
117
|
enableViewportCulling?: boolean;
|
|
118
118
|
/** 뷰포트 컬링 여유 공간 (픽셀 단위, 기본값: 100) */
|
|
119
119
|
cullingMargin?: number;
|
|
120
|
-
/**
|
|
120
|
+
/** Queue 캐시 최대 크기 (기본값: 30000) */
|
|
121
121
|
maxCacheSize?: number;
|
|
122
122
|
/** 외부에서 제어하는 선택된 항목 배열 */
|
|
123
123
|
selectedItems?: CanvasData<T>[];
|
|
@@ -25,20 +25,21 @@ export declare const SPATIAL_GRID_CELL_SIZE = 100;
|
|
|
25
25
|
*/
|
|
26
26
|
export declare const DEFAULT_CULLING_MARGIN = 100;
|
|
27
27
|
/**
|
|
28
|
-
*
|
|
28
|
+
* Queue 캐시 최대 항목 수
|
|
29
29
|
*
|
|
30
30
|
* @default 30000
|
|
31
31
|
*/
|
|
32
32
|
export declare const DEFAULT_MAX_CACHE_SIZE = 30000;
|
|
33
33
|
/**
|
|
34
|
-
*
|
|
34
|
+
* Queue Cache (FIFO - First In First Out)
|
|
35
35
|
*
|
|
36
36
|
* 좌표 변환 결과를 캐싱하기 위한 캐시 구현
|
|
37
|
+
* FIFO 방식으로 가장 먼저 저장된 항목부터 제거합니다.
|
|
37
38
|
*
|
|
38
39
|
* @template K 캐시 키 타입
|
|
39
40
|
* @template V 캐시 값 타입
|
|
40
41
|
*/
|
|
41
|
-
export declare class
|
|
42
|
+
export declare class QueueCache<K, V> {
|
|
42
43
|
private cache;
|
|
43
44
|
private maxSize;
|
|
44
45
|
constructor(maxSize?: number);
|
|
@@ -34,25 +34,26 @@ var SPATIAL_GRID_CELL_SIZE = 100;
|
|
|
34
34
|
|
|
35
35
|
var DEFAULT_CULLING_MARGIN = 100;
|
|
36
36
|
/**
|
|
37
|
-
*
|
|
37
|
+
* Queue 캐시 최대 항목 수
|
|
38
38
|
*
|
|
39
39
|
* @default 30000
|
|
40
40
|
*/
|
|
41
41
|
|
|
42
42
|
var DEFAULT_MAX_CACHE_SIZE = 30000;
|
|
43
43
|
/**
|
|
44
|
-
*
|
|
44
|
+
* Queue Cache (FIFO - First In First Out)
|
|
45
45
|
*
|
|
46
46
|
* 좌표 변환 결과를 캐싱하기 위한 캐시 구현
|
|
47
|
+
* FIFO 방식으로 가장 먼저 저장된 항목부터 제거합니다.
|
|
47
48
|
*
|
|
48
49
|
* @template K 캐시 키 타입
|
|
49
50
|
* @template V 캐시 값 타입
|
|
50
51
|
*/
|
|
51
52
|
|
|
52
|
-
var
|
|
53
|
+
var QueueCache =
|
|
53
54
|
/** @class */
|
|
54
55
|
function () {
|
|
55
|
-
function
|
|
56
|
+
function QueueCache(maxSize) {
|
|
56
57
|
if (maxSize === void 0) {
|
|
57
58
|
maxSize = 10000;
|
|
58
59
|
}
|
|
@@ -62,12 +63,12 @@ function () {
|
|
|
62
63
|
} // 캐시에서 값 조회
|
|
63
64
|
|
|
64
65
|
|
|
65
|
-
|
|
66
|
+
QueueCache.prototype.get = function (key) {
|
|
66
67
|
return this.cache.get(key);
|
|
67
68
|
}; // 캐시에 값 저장 (FIFO eviction)
|
|
68
69
|
|
|
69
70
|
|
|
70
|
-
|
|
71
|
+
QueueCache.prototype.set = function (key, value) {
|
|
71
72
|
var exists = this.cache.has(key);
|
|
72
73
|
|
|
73
74
|
if (exists) {
|
|
@@ -87,21 +88,21 @@ function () {
|
|
|
87
88
|
}; // 캐시 초기화
|
|
88
89
|
|
|
89
90
|
|
|
90
|
-
|
|
91
|
+
QueueCache.prototype.clear = function () {
|
|
91
92
|
this.cache.clear();
|
|
92
93
|
}; // 캐시 크기 반환
|
|
93
94
|
|
|
94
95
|
|
|
95
|
-
|
|
96
|
+
QueueCache.prototype.size = function () {
|
|
96
97
|
return this.cache.size;
|
|
97
98
|
}; // 키 존재 여부 확인
|
|
98
99
|
|
|
99
100
|
|
|
100
|
-
|
|
101
|
+
QueueCache.prototype.has = function (key) {
|
|
101
102
|
return this.cache.has(key);
|
|
102
103
|
};
|
|
103
104
|
|
|
104
|
-
return
|
|
105
|
+
return QueueCache;
|
|
105
106
|
}();
|
|
106
107
|
/**
|
|
107
108
|
* Spatial Hash Grid (공간 해시 그리드)
|
|
@@ -262,6 +263,6 @@ function () {
|
|
|
262
263
|
|
|
263
264
|
exports.DEFAULT_CULLING_MARGIN = DEFAULT_CULLING_MARGIN;
|
|
264
265
|
exports.DEFAULT_MAX_CACHE_SIZE = DEFAULT_MAX_CACHE_SIZE;
|
|
265
|
-
exports.
|
|
266
|
+
exports.QueueCache = QueueCache;
|
|
266
267
|
exports.SPATIAL_GRID_CELL_SIZE = SPATIAL_GRID_CELL_SIZE;
|
|
267
268
|
exports.SpatialHashGrid = SpatialHashGrid;
|
|
@@ -120,17 +120,27 @@ export interface RenderAnimationParams<T> {
|
|
|
120
120
|
* @template T 마커/폴리곤 데이터의 추가 속성 타입
|
|
121
121
|
*/
|
|
122
122
|
export declare type CustomRenderAnimation<T> = (params: RenderAnimationParams<T>) => void;
|
|
123
|
+
/**
|
|
124
|
+
* 렌더링 소스 Enum
|
|
125
|
+
*/
|
|
126
|
+
export declare enum RenderSource {
|
|
127
|
+
BASE = "BASE",
|
|
128
|
+
EVENT = "EVENT",
|
|
129
|
+
TOP = "TOP"
|
|
130
|
+
}
|
|
123
131
|
/**
|
|
124
132
|
* 커스텀 렌더링 함수 파라미터 - Event Layer
|
|
125
133
|
*/
|
|
126
134
|
export interface RenderEventParams<T> {
|
|
127
135
|
ctx: CanvasRenderingContext2D;
|
|
136
|
+
/** topStageZIndex가 설정되어 있는지 여부 */
|
|
137
|
+
hasTopStage: boolean;
|
|
128
138
|
hoveredItem: CanvasData<T> | null;
|
|
129
|
-
|
|
139
|
+
/** 렌더링 소스 (BASE, EVENT, TOP) */
|
|
140
|
+
renderSource: RenderSource;
|
|
130
141
|
selectedItems?: CanvasData<T>[];
|
|
131
142
|
selectedItem?: CanvasData<T> | null;
|
|
132
|
-
|
|
133
|
-
hasTopStage?: boolean;
|
|
143
|
+
utils: RenderUtils<T>;
|
|
134
144
|
}
|
|
135
145
|
/**
|
|
136
146
|
* 커스텀 렌더링 함수 타입 - Event Layer
|
|
@@ -14,6 +14,18 @@ exports.CanvasDataType = void 0;
|
|
|
14
14
|
CanvasDataType["MARKER"] = "MARKER";
|
|
15
15
|
CanvasDataType["POLYGON"] = "POLYGON";
|
|
16
16
|
})(exports.CanvasDataType || (exports.CanvasDataType = {}));
|
|
17
|
+
/**
|
|
18
|
+
* 렌더링 소스 Enum
|
|
19
|
+
*/
|
|
20
|
+
// eslint-disable-next-line no-shadow
|
|
21
|
+
|
|
22
|
+
exports.RenderSource = void 0;
|
|
23
|
+
|
|
24
|
+
(function (RenderSource) {
|
|
25
|
+
RenderSource["BASE"] = "BASE";
|
|
26
|
+
RenderSource["EVENT"] = "EVENT";
|
|
27
|
+
RenderSource["TOP"] = "TOP";
|
|
28
|
+
})(exports.RenderSource || (exports.RenderSource = {}));
|
|
17
29
|
|
|
18
30
|
exports.createCanvasData = utils.createCanvasData;
|
|
19
31
|
exports.createCanvasDataArray = utils.createCanvasDataArray;
|
package/dist/index.es.js
CHANGED
|
@@ -1110,25 +1110,26 @@ var SPATIAL_GRID_CELL_SIZE = 100;
|
|
|
1110
1110
|
|
|
1111
1111
|
var DEFAULT_CULLING_MARGIN = 100;
|
|
1112
1112
|
/**
|
|
1113
|
-
*
|
|
1113
|
+
* Queue 캐시 최대 항목 수
|
|
1114
1114
|
*
|
|
1115
1115
|
* @default 30000
|
|
1116
1116
|
*/
|
|
1117
1117
|
|
|
1118
1118
|
var DEFAULT_MAX_CACHE_SIZE = 30000;
|
|
1119
1119
|
/**
|
|
1120
|
-
*
|
|
1120
|
+
* Queue Cache (FIFO - First In First Out)
|
|
1121
1121
|
*
|
|
1122
1122
|
* 좌표 변환 결과를 캐싱하기 위한 캐시 구현
|
|
1123
|
+
* FIFO 방식으로 가장 먼저 저장된 항목부터 제거합니다.
|
|
1123
1124
|
*
|
|
1124
1125
|
* @template K 캐시 키 타입
|
|
1125
1126
|
* @template V 캐시 값 타입
|
|
1126
1127
|
*/
|
|
1127
1128
|
|
|
1128
|
-
var
|
|
1129
|
+
var QueueCache =
|
|
1129
1130
|
/** @class */
|
|
1130
1131
|
function () {
|
|
1131
|
-
function
|
|
1132
|
+
function QueueCache(maxSize) {
|
|
1132
1133
|
if (maxSize === void 0) {
|
|
1133
1134
|
maxSize = 10000;
|
|
1134
1135
|
}
|
|
@@ -1138,12 +1139,12 @@ function () {
|
|
|
1138
1139
|
} // 캐시에서 값 조회
|
|
1139
1140
|
|
|
1140
1141
|
|
|
1141
|
-
|
|
1142
|
+
QueueCache.prototype.get = function (key) {
|
|
1142
1143
|
return this.cache.get(key);
|
|
1143
1144
|
}; // 캐시에 값 저장 (FIFO eviction)
|
|
1144
1145
|
|
|
1145
1146
|
|
|
1146
|
-
|
|
1147
|
+
QueueCache.prototype.set = function (key, value) {
|
|
1147
1148
|
var exists = this.cache.has(key);
|
|
1148
1149
|
|
|
1149
1150
|
if (exists) {
|
|
@@ -1163,21 +1164,21 @@ function () {
|
|
|
1163
1164
|
}; // 캐시 초기화
|
|
1164
1165
|
|
|
1165
1166
|
|
|
1166
|
-
|
|
1167
|
+
QueueCache.prototype.clear = function () {
|
|
1167
1168
|
this.cache.clear();
|
|
1168
1169
|
}; // 캐시 크기 반환
|
|
1169
1170
|
|
|
1170
1171
|
|
|
1171
|
-
|
|
1172
|
+
QueueCache.prototype.size = function () {
|
|
1172
1173
|
return this.cache.size;
|
|
1173
1174
|
}; // 키 존재 여부 확인
|
|
1174
1175
|
|
|
1175
1176
|
|
|
1176
|
-
|
|
1177
|
+
QueueCache.prototype.has = function (key) {
|
|
1177
1178
|
return this.cache.has(key);
|
|
1178
1179
|
};
|
|
1179
1180
|
|
|
1180
|
-
return
|
|
1181
|
+
return QueueCache;
|
|
1181
1182
|
}();
|
|
1182
1183
|
/**
|
|
1183
1184
|
* Spatial Hash Grid (공간 해시 그리드)
|
|
@@ -1842,6 +1843,18 @@ var CanvasDataType;
|
|
|
1842
1843
|
CanvasDataType["MARKER"] = "MARKER";
|
|
1843
1844
|
CanvasDataType["POLYGON"] = "POLYGON";
|
|
1844
1845
|
})(CanvasDataType || (CanvasDataType = {}));
|
|
1846
|
+
/**
|
|
1847
|
+
* 렌더링 소스 Enum
|
|
1848
|
+
*/
|
|
1849
|
+
// eslint-disable-next-line no-shadow
|
|
1850
|
+
|
|
1851
|
+
var RenderSource;
|
|
1852
|
+
|
|
1853
|
+
(function (RenderSource) {
|
|
1854
|
+
RenderSource["BASE"] = "BASE";
|
|
1855
|
+
RenderSource["EVENT"] = "EVENT";
|
|
1856
|
+
RenderSource["TOP"] = "TOP";
|
|
1857
|
+
})(RenderSource || (RenderSource = {}));
|
|
1845
1858
|
|
|
1846
1859
|
/**
|
|
1847
1860
|
* 현재 뷰포트 영역 계산
|
|
@@ -4008,14 +4021,14 @@ var CanvasMarkerLayer = function (props) {
|
|
|
4008
4021
|
|
|
4009
4022
|
var dragStartHoveredItemRef = useRef(null); // 성능 최적화 Refs
|
|
4010
4023
|
|
|
4011
|
-
var offsetCacheRef = useRef(new
|
|
4024
|
+
var offsetCacheRef = useRef(new QueueCache(maxCacheSize));
|
|
4012
4025
|
var spatialIndexRef = useRef(new SpatialHashGrid(SPATIAL_GRID_CELL_SIZE));
|
|
4013
4026
|
var boundingBoxCacheRef = useRef(new Map());
|
|
4014
4027
|
var viewportRef = useRef(null); // 뷰포트 영역 계산 (Viewport Culling용)
|
|
4015
4028
|
|
|
4016
4029
|
var updateViewport$1 = function () {
|
|
4017
4030
|
updateViewport(stageRef.current, cullingMargin, viewportRef);
|
|
4018
|
-
}; // 마커 좌표 변환 (위경도 → 화면 좌표,
|
|
4031
|
+
}; // 마커 좌표 변환 (위경도 → 화면 좌표, Queue 캐시 사용)
|
|
4019
4032
|
|
|
4020
4033
|
|
|
4021
4034
|
var getOrComputeMarkerOffset = function (markerData) {
|
|
@@ -4132,6 +4145,7 @@ var CanvasMarkerLayer = function (props) {
|
|
|
4132
4145
|
ctx: ctx,
|
|
4133
4146
|
hasTopStage: topStageZIndex !== undefined,
|
|
4134
4147
|
hoveredItem: hovered,
|
|
4148
|
+
renderSource: RenderSource.EVENT,
|
|
4135
4149
|
selectedItem: selectedItemRef.current,
|
|
4136
4150
|
selectedItems: selectedItems,
|
|
4137
4151
|
utils: renderUtils
|
|
@@ -4202,6 +4216,7 @@ var CanvasMarkerLayer = function (props) {
|
|
|
4202
4216
|
ctx: ctx,
|
|
4203
4217
|
hasTopStage: true,
|
|
4204
4218
|
hoveredItem: currentHovered,
|
|
4219
|
+
renderSource: RenderSource.TOP,
|
|
4205
4220
|
selectedItem: selectedItemRef.current,
|
|
4206
4221
|
selectedItems: hoverSelectedItems,
|
|
4207
4222
|
utils: renderUtils
|
|
@@ -6009,10 +6024,10 @@ var CanvasPolygonLayer = function (props) {
|
|
|
6009
6024
|
|
|
6010
6025
|
var dragStartHoveredItemRef = useRef(null); // 성능 최적화 Refs
|
|
6011
6026
|
|
|
6012
|
-
var offsetCacheRef = useRef(new
|
|
6027
|
+
var offsetCacheRef = useRef(new QueueCache(maxCacheSize));
|
|
6013
6028
|
var spatialIndexRef = useRef(new SpatialHashGrid(SPATIAL_GRID_CELL_SIZE));
|
|
6014
6029
|
var boundingBoxCacheRef = useRef(new Map());
|
|
6015
|
-
var viewportRef = useRef(null); // 폴리곤 좌표 변환 (위경도 → 화면 좌표,
|
|
6030
|
+
var viewportRef = useRef(null); // 폴리곤 좌표 변환 (위경도 → 화면 좌표, Queue 캐시 사용)
|
|
6016
6031
|
|
|
6017
6032
|
var getOrComputePolygonOffsets = function (polygonData) {
|
|
6018
6033
|
var cached = offsetCacheRef.current.get(polygonData.id);
|
|
@@ -10765,4 +10780,4 @@ function MintMap(_a) {
|
|
|
10765
10780
|
}), loading));
|
|
10766
10781
|
}
|
|
10767
10782
|
|
|
10768
|
-
export { AnimationPlayer, Bounds, CanvasDataType, CanvasMarker, CanvasMarkerClaude, CanvasMarkerLayer, CanvasPolygonLayer, CanvasProvider, CircleMarker, DEFAULT_CULLING_MARGIN, DEFAULT_MAX_CACHE_SIZE, Drawable, GeoCalulator, GoogleMintMapController,
|
|
10783
|
+
export { AnimationPlayer, Bounds, CanvasDataType, CanvasMarker, CanvasMarkerClaude, CanvasMarkerLayer, CanvasPolygonLayer, CanvasProvider, CircleMarker, DEFAULT_CULLING_MARGIN, DEFAULT_MAX_CACHE_SIZE, Drawable, GeoCalulator, GoogleMintMapController, MapBuildingProjection, MapCanvasMarkerWrapper, MapCanvasWrapper, MapControlWrapper, MapEvent, MapLoadingWithImage, MapMarkerWrapper, MapPolygonWrapper, MapPolylineWrapper, MapUIEvent, Marker, MintMap, MintMapCanvasRenderer, MintMapController, MintMapCore, MintMapProvider, NaverMintMapController, Offset, PointLoading, Polygon, PolygonCalculator, PolygonMarker, Polyline, Position, QueueCache, RenderSource, SPATIAL_GRID_CELL_SIZE, SVGCircle, SVGPolygon, SVGRect, Spacing, SpatialHashGrid, Status, buildSpatialIndex, calculateMarkerBoundingBox, calculateTextBoxWidth, computeMarkerOffset, computePolygonOffsets, createCanvasData, createCanvasDataArray, createMapEventHandlers, getClusterInfo, getMapOfType, hexToRgba, isInViewport, isPointInMarkerData, isPointInPolygon, isPointInPolygonData, log, mapValuesToArray, syncExternalSelectedItems, syncSelectedItems, updateViewport, useCanvasContext, useMarkerMoving, useMintMapController, validateEvent, waiting };
|
package/dist/index.js
CHANGED
|
@@ -64,13 +64,17 @@ exports.syncExternalSelectedItems = hooks.syncExternalSelectedItems;
|
|
|
64
64
|
exports.syncSelectedItems = hooks.syncSelectedItems;
|
|
65
65
|
exports.DEFAULT_CULLING_MARGIN = performance.DEFAULT_CULLING_MARGIN;
|
|
66
66
|
exports.DEFAULT_MAX_CACHE_SIZE = performance.DEFAULT_MAX_CACHE_SIZE;
|
|
67
|
-
exports.
|
|
67
|
+
exports.QueueCache = performance.QueueCache;
|
|
68
68
|
exports.SPATIAL_GRID_CELL_SIZE = performance.SPATIAL_GRID_CELL_SIZE;
|
|
69
69
|
exports.SpatialHashGrid = performance.SpatialHashGrid;
|
|
70
70
|
Object.defineProperty(exports, 'CanvasDataType', {
|
|
71
71
|
enumerable: true,
|
|
72
72
|
get: function () { return types.CanvasDataType; }
|
|
73
73
|
});
|
|
74
|
+
Object.defineProperty(exports, 'RenderSource', {
|
|
75
|
+
enumerable: true,
|
|
76
|
+
get: function () { return types.RenderSource; }
|
|
77
|
+
});
|
|
74
78
|
exports.calculateMarkerBoundingBox = utils.calculateMarkerBoundingBox;
|
|
75
79
|
exports.calculateTextBoxWidth = utils.calculateTextBoxWidth;
|
|
76
80
|
exports.computeMarkerOffset = utils.computeMarkerOffset;
|
package/dist/index.umd.js
CHANGED
|
@@ -1114,25 +1114,26 @@
|
|
|
1114
1114
|
|
|
1115
1115
|
var DEFAULT_CULLING_MARGIN = 100;
|
|
1116
1116
|
/**
|
|
1117
|
-
*
|
|
1117
|
+
* Queue 캐시 최대 항목 수
|
|
1118
1118
|
*
|
|
1119
1119
|
* @default 30000
|
|
1120
1120
|
*/
|
|
1121
1121
|
|
|
1122
1122
|
var DEFAULT_MAX_CACHE_SIZE = 30000;
|
|
1123
1123
|
/**
|
|
1124
|
-
*
|
|
1124
|
+
* Queue Cache (FIFO - First In First Out)
|
|
1125
1125
|
*
|
|
1126
1126
|
* 좌표 변환 결과를 캐싱하기 위한 캐시 구현
|
|
1127
|
+
* FIFO 방식으로 가장 먼저 저장된 항목부터 제거합니다.
|
|
1127
1128
|
*
|
|
1128
1129
|
* @template K 캐시 키 타입
|
|
1129
1130
|
* @template V 캐시 값 타입
|
|
1130
1131
|
*/
|
|
1131
1132
|
|
|
1132
|
-
var
|
|
1133
|
+
var QueueCache =
|
|
1133
1134
|
/** @class */
|
|
1134
1135
|
function () {
|
|
1135
|
-
function
|
|
1136
|
+
function QueueCache(maxSize) {
|
|
1136
1137
|
if (maxSize === void 0) {
|
|
1137
1138
|
maxSize = 10000;
|
|
1138
1139
|
}
|
|
@@ -1142,12 +1143,12 @@
|
|
|
1142
1143
|
} // 캐시에서 값 조회
|
|
1143
1144
|
|
|
1144
1145
|
|
|
1145
|
-
|
|
1146
|
+
QueueCache.prototype.get = function (key) {
|
|
1146
1147
|
return this.cache.get(key);
|
|
1147
1148
|
}; // 캐시에 값 저장 (FIFO eviction)
|
|
1148
1149
|
|
|
1149
1150
|
|
|
1150
|
-
|
|
1151
|
+
QueueCache.prototype.set = function (key, value) {
|
|
1151
1152
|
var exists = this.cache.has(key);
|
|
1152
1153
|
|
|
1153
1154
|
if (exists) {
|
|
@@ -1167,21 +1168,21 @@
|
|
|
1167
1168
|
}; // 캐시 초기화
|
|
1168
1169
|
|
|
1169
1170
|
|
|
1170
|
-
|
|
1171
|
+
QueueCache.prototype.clear = function () {
|
|
1171
1172
|
this.cache.clear();
|
|
1172
1173
|
}; // 캐시 크기 반환
|
|
1173
1174
|
|
|
1174
1175
|
|
|
1175
|
-
|
|
1176
|
+
QueueCache.prototype.size = function () {
|
|
1176
1177
|
return this.cache.size;
|
|
1177
1178
|
}; // 키 존재 여부 확인
|
|
1178
1179
|
|
|
1179
1180
|
|
|
1180
|
-
|
|
1181
|
+
QueueCache.prototype.has = function (key) {
|
|
1181
1182
|
return this.cache.has(key);
|
|
1182
1183
|
};
|
|
1183
1184
|
|
|
1184
|
-
return
|
|
1185
|
+
return QueueCache;
|
|
1185
1186
|
}();
|
|
1186
1187
|
/**
|
|
1187
1188
|
* Spatial Hash Grid (공간 해시 그리드)
|
|
@@ -1846,6 +1847,18 @@
|
|
|
1846
1847
|
CanvasDataType["MARKER"] = "MARKER";
|
|
1847
1848
|
CanvasDataType["POLYGON"] = "POLYGON";
|
|
1848
1849
|
})(exports.CanvasDataType || (exports.CanvasDataType = {}));
|
|
1850
|
+
/**
|
|
1851
|
+
* 렌더링 소스 Enum
|
|
1852
|
+
*/
|
|
1853
|
+
// eslint-disable-next-line no-shadow
|
|
1854
|
+
|
|
1855
|
+
exports.RenderSource = void 0;
|
|
1856
|
+
|
|
1857
|
+
(function (RenderSource) {
|
|
1858
|
+
RenderSource["BASE"] = "BASE";
|
|
1859
|
+
RenderSource["EVENT"] = "EVENT";
|
|
1860
|
+
RenderSource["TOP"] = "TOP";
|
|
1861
|
+
})(exports.RenderSource || (exports.RenderSource = {}));
|
|
1849
1862
|
|
|
1850
1863
|
/**
|
|
1851
1864
|
* 현재 뷰포트 영역 계산
|
|
@@ -4012,14 +4025,14 @@
|
|
|
4012
4025
|
|
|
4013
4026
|
var dragStartHoveredItemRef = React.useRef(null); // 성능 최적화 Refs
|
|
4014
4027
|
|
|
4015
|
-
var offsetCacheRef = React.useRef(new
|
|
4028
|
+
var offsetCacheRef = React.useRef(new QueueCache(maxCacheSize));
|
|
4016
4029
|
var spatialIndexRef = React.useRef(new SpatialHashGrid(SPATIAL_GRID_CELL_SIZE));
|
|
4017
4030
|
var boundingBoxCacheRef = React.useRef(new Map());
|
|
4018
4031
|
var viewportRef = React.useRef(null); // 뷰포트 영역 계산 (Viewport Culling용)
|
|
4019
4032
|
|
|
4020
4033
|
var updateViewport$1 = function () {
|
|
4021
4034
|
updateViewport(stageRef.current, cullingMargin, viewportRef);
|
|
4022
|
-
}; // 마커 좌표 변환 (위경도 → 화면 좌표,
|
|
4035
|
+
}; // 마커 좌표 변환 (위경도 → 화면 좌표, Queue 캐시 사용)
|
|
4023
4036
|
|
|
4024
4037
|
|
|
4025
4038
|
var getOrComputeMarkerOffset = function (markerData) {
|
|
@@ -4136,6 +4149,7 @@
|
|
|
4136
4149
|
ctx: ctx,
|
|
4137
4150
|
hasTopStage: topStageZIndex !== undefined,
|
|
4138
4151
|
hoveredItem: hovered,
|
|
4152
|
+
renderSource: exports.RenderSource.EVENT,
|
|
4139
4153
|
selectedItem: selectedItemRef.current,
|
|
4140
4154
|
selectedItems: selectedItems,
|
|
4141
4155
|
utils: renderUtils
|
|
@@ -4206,6 +4220,7 @@
|
|
|
4206
4220
|
ctx: ctx,
|
|
4207
4221
|
hasTopStage: true,
|
|
4208
4222
|
hoveredItem: currentHovered,
|
|
4223
|
+
renderSource: exports.RenderSource.TOP,
|
|
4209
4224
|
selectedItem: selectedItemRef.current,
|
|
4210
4225
|
selectedItems: hoverSelectedItems,
|
|
4211
4226
|
utils: renderUtils
|
|
@@ -6013,10 +6028,10 @@
|
|
|
6013
6028
|
|
|
6014
6029
|
var dragStartHoveredItemRef = React.useRef(null); // 성능 최적화 Refs
|
|
6015
6030
|
|
|
6016
|
-
var offsetCacheRef = React.useRef(new
|
|
6031
|
+
var offsetCacheRef = React.useRef(new QueueCache(maxCacheSize));
|
|
6017
6032
|
var spatialIndexRef = React.useRef(new SpatialHashGrid(SPATIAL_GRID_CELL_SIZE));
|
|
6018
6033
|
var boundingBoxCacheRef = React.useRef(new Map());
|
|
6019
|
-
var viewportRef = React.useRef(null); // 폴리곤 좌표 변환 (위경도 → 화면 좌표,
|
|
6034
|
+
var viewportRef = React.useRef(null); // 폴리곤 좌표 변환 (위경도 → 화면 좌표, Queue 캐시 사용)
|
|
6020
6035
|
|
|
6021
6036
|
var getOrComputePolygonOffsets = function (polygonData) {
|
|
6022
6037
|
var cached = offsetCacheRef.current.get(polygonData.id);
|
|
@@ -10782,7 +10797,6 @@
|
|
|
10782
10797
|
exports.Drawable = Drawable;
|
|
10783
10798
|
exports.GeoCalulator = GeoCalulator;
|
|
10784
10799
|
exports.GoogleMintMapController = GoogleMintMapController;
|
|
10785
|
-
exports.LRUCache = LRUCache;
|
|
10786
10800
|
exports.MapBuildingProjection = MapBuildingProjection;
|
|
10787
10801
|
exports.MapCanvasMarkerWrapper = MapCanvasMarkerWrapper;
|
|
10788
10802
|
exports.MapCanvasWrapper = MapCanvasWrapper;
|
|
@@ -10807,6 +10821,7 @@
|
|
|
10807
10821
|
exports.PolygonMarker = PolygonMarker;
|
|
10808
10822
|
exports.Polyline = Polyline;
|
|
10809
10823
|
exports.Position = Position;
|
|
10824
|
+
exports.QueueCache = QueueCache;
|
|
10810
10825
|
exports.SPATIAL_GRID_CELL_SIZE = SPATIAL_GRID_CELL_SIZE;
|
|
10811
10826
|
exports.SVGCircle = SVGCircle;
|
|
10812
10827
|
exports.SVGPolygon = SVGPolygon;
|