@mint-ui/map 1.2.0 → 1.2.1
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.js +34 -22
- package/dist/components/mint-map/core/advanced/CanvasMarkerLayer/types.d.ts +14 -0
- package/dist/components/mint-map/core/advanced/CanvasPolygonLayer/CanvasPolygonLayer.js +21 -10
- package/dist/components/mint-map/core/advanced/CanvasPolygonLayer/renderer.js +25 -25
- package/dist/components/mint-map/core/advanced/CanvasPolygonLayer/types.d.ts +2 -0
- package/dist/index.es.js +80 -57
- package/dist/index.umd.js +80 -57
- package/package.json +1 -1
|
@@ -32,10 +32,12 @@ var CanvasMarkerLayer = function (props) {
|
|
|
32
32
|
cullingMargin = _a === void 0 ? performance.DEFAULT_CULLING_MARGIN : _a,
|
|
33
33
|
onOptimizationDataUpdate = props.onOptimizationDataUpdate,
|
|
34
34
|
renderBase = props.renderBase,
|
|
35
|
-
|
|
35
|
+
_b = props.spatialGridCellSize,
|
|
36
|
+
spatialGridCellSize = _b === void 0 ? performance.SPATIAL_GRID_CELL_SIZE : _b,
|
|
37
|
+
options = tslib.__rest(props, ["data", "cullingMargin", "onOptimizationDataUpdate", "renderBase", "spatialGridCellSize"]); // renderEvent가 있는 경우에만 인터랙션 관련 props 추출
|
|
36
38
|
|
|
37
39
|
|
|
38
|
-
var
|
|
40
|
+
var _c = hasRenderEvent && 'renderEvent' in props ? props : {
|
|
39
41
|
disableInteraction: false,
|
|
40
42
|
onClick: undefined,
|
|
41
43
|
onMouseOut: undefined,
|
|
@@ -45,15 +47,15 @@ var CanvasMarkerLayer = function (props) {
|
|
|
45
47
|
selectedItems: undefined,
|
|
46
48
|
topStageZIndex: undefined
|
|
47
49
|
},
|
|
48
|
-
|
|
49
|
-
disableInteraction =
|
|
50
|
-
onClick =
|
|
51
|
-
onMouseOut =
|
|
52
|
-
onMouseOver =
|
|
53
|
-
renderEvent =
|
|
54
|
-
externalSelectedItem =
|
|
55
|
-
externalSelectedItems =
|
|
56
|
-
rawTopStageZIndex =
|
|
50
|
+
_d = _c.disableInteraction,
|
|
51
|
+
disableInteraction = _d === void 0 ? false : _d,
|
|
52
|
+
onClick = _c.onClick,
|
|
53
|
+
onMouseOut = _c.onMouseOut,
|
|
54
|
+
onMouseOver = _c.onMouseOver,
|
|
55
|
+
renderEvent = _c.renderEvent,
|
|
56
|
+
externalSelectedItem = _c.selectedItem,
|
|
57
|
+
externalSelectedItems = _c.selectedItems,
|
|
58
|
+
rawTopStageZIndex = _c.topStageZIndex; // topStageZIndex가 있으면 hover 최상단 표시 활성화, 없으면 비활성화 (성능 우선)
|
|
57
59
|
|
|
58
60
|
|
|
59
61
|
var topStageZIndex = rawTopStageZIndex;
|
|
@@ -100,7 +102,7 @@ var CanvasMarkerLayer = function (props) {
|
|
|
100
102
|
} // 성능 최적화 Refs
|
|
101
103
|
|
|
102
104
|
|
|
103
|
-
var spatialIndexRef = React.useRef(new performance.SpatialHashGrid(
|
|
105
|
+
var spatialIndexRef = React.useRef(new performance.SpatialHashGrid(spatialGridCellSize));
|
|
104
106
|
var boundingBoxCacheRef = React.useRef(new Map());
|
|
105
107
|
var viewportRef = React.useRef(null); // 뷰포트 영역 계산 (Viewport Culling용)
|
|
106
108
|
|
|
@@ -144,9 +146,18 @@ var CanvasMarkerLayer = function (props) {
|
|
|
144
146
|
|
|
145
147
|
var buildSpatialIndex = function () {
|
|
146
148
|
hooks.buildSpatialIndex(dataRef.current, spatialIndexRef.current, computeBoundingBox);
|
|
147
|
-
}; //
|
|
149
|
+
}; // spatialGridCellSize가 변경되면 SpatialHashGrid 재생성
|
|
148
150
|
|
|
149
151
|
|
|
152
|
+
React.useEffect(function () {
|
|
153
|
+
spatialIndexRef.current = new performance.SpatialHashGrid(spatialGridCellSize); // 인덱스 재구성 (데이터가 있을 때만)
|
|
154
|
+
|
|
155
|
+
if (dataRef.current.length > 0) {
|
|
156
|
+
buildSpatialIndex();
|
|
157
|
+
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
158
|
+
|
|
159
|
+
}, [spatialGridCellSize]); // 렌더링 유틸리티 객체
|
|
160
|
+
|
|
150
161
|
var renderUtils = {
|
|
151
162
|
getOrComputeMarkerOffset: getOrComputeMarkerOffset,
|
|
152
163
|
getOrComputePolygonOffsets: function () {
|
|
@@ -351,7 +362,7 @@ var CanvasMarkerLayer = function (props) {
|
|
|
351
362
|
}; // 지도 이벤트 핸들러 생성
|
|
352
363
|
|
|
353
364
|
|
|
354
|
-
var
|
|
365
|
+
var _e = hooks.createMapEventHandlers({
|
|
355
366
|
accumTranslateRef: accumTranslateRef,
|
|
356
367
|
boundingBoxCacheRef: boundingBoxCacheRef,
|
|
357
368
|
clearCache: function () {
|
|
@@ -364,12 +375,12 @@ var CanvasMarkerLayer = function (props) {
|
|
|
364
375
|
prevCenterOffsetRef: prevCenterOffsetRef,
|
|
365
376
|
renderAllImmediate: renderAllImmediate
|
|
366
377
|
}),
|
|
367
|
-
handleIdleShared =
|
|
368
|
-
handleZoomStart =
|
|
369
|
-
handleZoomEnd =
|
|
370
|
-
handleCenterChangedShared =
|
|
371
|
-
handleDragStartShared =
|
|
372
|
-
handleDragEndShared =
|
|
378
|
+
handleIdleShared = _e.handleIdle,
|
|
379
|
+
handleZoomStart = _e.handleZoomStart,
|
|
380
|
+
handleZoomEnd = _e.handleZoomEnd,
|
|
381
|
+
handleCenterChangedShared = _e.handleCenterChanged,
|
|
382
|
+
handleDragStartShared = _e.handleDragStart,
|
|
383
|
+
handleDragEndShared = _e.handleDragEnd; // handleIdle 래핑: topStage transform 제거 추가
|
|
373
384
|
|
|
374
385
|
|
|
375
386
|
var handleIdle = function () {
|
|
@@ -415,8 +426,9 @@ var CanvasMarkerLayer = function (props) {
|
|
|
415
426
|
|
|
416
427
|
|
|
417
428
|
var findData = function (offset) {
|
|
418
|
-
//
|
|
419
|
-
|
|
429
|
+
// hover된 항목이 있으면 최우선으로 확인 (topOnHover 기능 지원)
|
|
430
|
+
// topStageZIndex가 없어도 hover된 항목이 다른 마커 위에 있어도 계속 hover 상태 유지
|
|
431
|
+
if (hoveredItemRef.current) {
|
|
420
432
|
var hovered = hoveredItemRef.current;
|
|
421
433
|
|
|
422
434
|
if (utils.isPointInMarkerData(offset, hovered, getOrComputeMarkerOffset)) {
|
|
@@ -12,6 +12,8 @@ export interface CanvasMarkerLayerPropsWithoutEvent<T> extends Pick<MarkerOption
|
|
|
12
12
|
cullingMargin?: number;
|
|
13
13
|
/** Queue 캐시 최대 크기 (기본값: 30000) */
|
|
14
14
|
maxCacheSize?: number;
|
|
15
|
+
/** Spatial Grid Hash 셀 크기 (픽셀 단위, 기본값: 200) */
|
|
16
|
+
spatialGridCellSize?: number;
|
|
15
17
|
/** Base Layer 렌더링 함수 (필수) */
|
|
16
18
|
renderBase: CustomRenderBase<T>;
|
|
17
19
|
/** Event Layer 렌더링 함수가 없으면 인터랙션 관련 props 사용 불가 */
|
|
@@ -51,6 +53,8 @@ export interface CanvasMarkerLayerPropsWithEventWithSelectedItem<T> extends Pick
|
|
|
51
53
|
cullingMargin?: number;
|
|
52
54
|
/** Queue 캐시 최대 크기 (기본값: 30000) */
|
|
53
55
|
maxCacheSize?: number;
|
|
56
|
+
/** Spatial Grid Hash 셀 크기 (픽셀 단위, 기본값: 200) */
|
|
57
|
+
spatialGridCellSize?: number;
|
|
54
58
|
/** 외부에서 전달된 단일 선택 아이템 */
|
|
55
59
|
selectedItem: CanvasData<T> | null;
|
|
56
60
|
/** 외부에서 제어하는 선택된 항목 배열 (selectedItem과 공존 불가) */
|
|
@@ -89,6 +93,8 @@ export interface CanvasMarkerLayerPropsWithEventWithSelectedItems<T> extends Pic
|
|
|
89
93
|
cullingMargin?: number;
|
|
90
94
|
/** Queue 캐시 최대 크기 (기본값: 30000) */
|
|
91
95
|
maxCacheSize?: number;
|
|
96
|
+
/** Spatial Grid Hash 셀 크기 (픽셀 단위, 기본값: 200) */
|
|
97
|
+
spatialGridCellSize?: number;
|
|
92
98
|
/** 외부에서 제어하는 선택된 항목 배열 */
|
|
93
99
|
selectedItems: CanvasData<T>[];
|
|
94
100
|
/** 외부에서 전달된 단일 선택 아이템 (selectedItems와 공존 불가) */
|
|
@@ -127,6 +133,8 @@ export interface CanvasMarkerLayerPropsWithEventWithoutSelection<T> extends Pick
|
|
|
127
133
|
cullingMargin?: number;
|
|
128
134
|
/** Queue 캐시 최대 크기 (기본값: 30000) */
|
|
129
135
|
maxCacheSize?: number;
|
|
136
|
+
/** Spatial Grid Hash 셀 크기 (픽셀 단위, 기본값: 200) */
|
|
137
|
+
spatialGridCellSize?: number;
|
|
130
138
|
/** 외부에서 제어하는 선택된 항목 배열 */
|
|
131
139
|
selectedItems?: never;
|
|
132
140
|
/** 외부에서 전달된 단일 선택 아이템 */
|
|
@@ -166,6 +174,8 @@ export interface CanvasMarkerLayerPropsWithEventWithTopStageWithSelectedItem<T>
|
|
|
166
174
|
cullingMargin?: number;
|
|
167
175
|
/** Queue 캐시 최대 크기 (기본값: 30000) */
|
|
168
176
|
maxCacheSize?: number;
|
|
177
|
+
/** Spatial Grid Hash 셀 크기 (픽셀 단위, 기본값: 200) */
|
|
178
|
+
spatialGridCellSize?: number;
|
|
169
179
|
/** 외부에서 전달된 단일 선택 아이템 */
|
|
170
180
|
selectedItem: CanvasData<T> | null;
|
|
171
181
|
/** 외부에서 제어하는 선택된 항목 배열 (selectedItem과 공존 불가) */
|
|
@@ -205,6 +215,8 @@ export interface CanvasMarkerLayerPropsWithEventWithTopStageWithSelectedItems<T>
|
|
|
205
215
|
cullingMargin?: number;
|
|
206
216
|
/** Queue 캐시 최대 크기 (기본값: 30000) */
|
|
207
217
|
maxCacheSize?: number;
|
|
218
|
+
/** Spatial Grid Hash 셀 크기 (픽셀 단위, 기본값: 200) */
|
|
219
|
+
spatialGridCellSize?: number;
|
|
208
220
|
/** 외부에서 제어하는 선택된 항목 배열 */
|
|
209
221
|
selectedItems: CanvasData<T>[];
|
|
210
222
|
/** 외부에서 전달된 단일 선택 아이템 (selectedItems와 공존 불가) */
|
|
@@ -244,6 +256,8 @@ export interface CanvasMarkerLayerPropsWithEventWithTopStageWithoutSelection<T>
|
|
|
244
256
|
cullingMargin?: number;
|
|
245
257
|
/** Queue 캐시 최대 크기 (기본값: 30000) */
|
|
246
258
|
maxCacheSize?: number;
|
|
259
|
+
/** Spatial Grid Hash 셀 크기 (픽셀 단위, 기본값: 200) */
|
|
260
|
+
spatialGridCellSize?: number;
|
|
247
261
|
/** 외부에서 제어하는 선택된 항목 배열 */
|
|
248
262
|
selectedItems?: never;
|
|
249
263
|
/** 외부에서 전달된 단일 선택 아이템 */
|
|
@@ -36,7 +36,9 @@ var CanvasPolygonLayer = function (props) {
|
|
|
36
36
|
externalSelectedItem = props.selectedItem,
|
|
37
37
|
_c = props.disableInteraction,
|
|
38
38
|
disableInteraction = _c === void 0 ? false : _c,
|
|
39
|
-
|
|
39
|
+
_d = props.spatialGridCellSize,
|
|
40
|
+
spatialGridCellSize = _d === void 0 ? performance.SPATIAL_GRID_CELL_SIZE : _d,
|
|
41
|
+
options = tslib.__rest(props, ["data", "enableMultiSelect", "cullingMargin", "onClick", "onOptimizationDataUpdate", "selectedItems", "selectedItem", "disableInteraction", "spatialGridCellSize"]); // customStyle은 다른 방식과 함께 사용 가능
|
|
40
42
|
|
|
41
43
|
|
|
42
44
|
var hasCustomStyle = 'customStyle' in props && props.customStyle !== undefined;
|
|
@@ -88,7 +90,7 @@ var CanvasPolygonLayer = function (props) {
|
|
|
88
90
|
} // 성능 최적화 Refs
|
|
89
91
|
|
|
90
92
|
|
|
91
|
-
var spatialIndexRef = React.useRef(new performance.SpatialHashGrid(
|
|
93
|
+
var spatialIndexRef = React.useRef(new performance.SpatialHashGrid(spatialGridCellSize));
|
|
92
94
|
var boundingBoxCacheRef = React.useRef(new Map());
|
|
93
95
|
var viewportRef = React.useRef(null); // 폴리곤 좌표 변환 (위경도 → 화면 좌표, 공유 캐시 사용)
|
|
94
96
|
|
|
@@ -150,9 +152,18 @@ var CanvasPolygonLayer = function (props) {
|
|
|
150
152
|
|
|
151
153
|
var buildSpatialIndex = function () {
|
|
152
154
|
hooks.buildSpatialIndex(dataRef.current, spatialIndexRef.current, computeBoundingBox);
|
|
153
|
-
}; //
|
|
155
|
+
}; // spatialGridCellSize가 변경되면 SpatialHashGrid 재생성
|
|
154
156
|
|
|
155
157
|
|
|
158
|
+
React.useEffect(function () {
|
|
159
|
+
spatialIndexRef.current = new performance.SpatialHashGrid(spatialGridCellSize); // 인덱스 재구성 (데이터가 있을 때만)
|
|
160
|
+
|
|
161
|
+
if (dataRef.current.length > 0) {
|
|
162
|
+
buildSpatialIndex();
|
|
163
|
+
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
164
|
+
|
|
165
|
+
}, [spatialGridCellSize]); // 렌더링 유틸리티 객체
|
|
166
|
+
|
|
156
167
|
var renderUtils = {
|
|
157
168
|
getOrComputeMarkerOffset: function () {
|
|
158
169
|
return null;
|
|
@@ -287,7 +298,7 @@ var CanvasPolygonLayer = function (props) {
|
|
|
287
298
|
}; // 지도 이벤트 핸들러 생성
|
|
288
299
|
|
|
289
300
|
|
|
290
|
-
var
|
|
301
|
+
var _e = hooks.createMapEventHandlers({
|
|
291
302
|
accumTranslateRef: accumTranslateRef,
|
|
292
303
|
boundingBoxCacheRef: boundingBoxCacheRef,
|
|
293
304
|
clearCache: function () {
|
|
@@ -300,12 +311,12 @@ var CanvasPolygonLayer = function (props) {
|
|
|
300
311
|
prevCenterOffsetRef: prevCenterOffsetRef,
|
|
301
312
|
renderAllImmediate: renderAllImmediate
|
|
302
313
|
}),
|
|
303
|
-
handleIdle =
|
|
304
|
-
handleZoomStart =
|
|
305
|
-
handleZoomEnd =
|
|
306
|
-
handleCenterChanged =
|
|
307
|
-
handleDragStartShared =
|
|
308
|
-
handleDragEndShared =
|
|
314
|
+
handleIdle = _e.handleIdle,
|
|
315
|
+
handleZoomStart = _e.handleZoomStart,
|
|
316
|
+
handleZoomEnd = _e.handleZoomEnd,
|
|
317
|
+
handleCenterChanged = _e.handleCenterChanged,
|
|
318
|
+
handleDragStartShared = _e.handleDragStart,
|
|
319
|
+
handleDragEndShared = _e.handleDragEnd;
|
|
309
320
|
|
|
310
321
|
var handleDragStart = function () {
|
|
311
322
|
handleDragStartShared(); // 드래그 시작 시점의 hover 상태 저장
|
|
@@ -149,14 +149,14 @@ var drawPolygon = function (_a) {
|
|
|
149
149
|
var renderPolygonBase = function (baseFillColor, baseStrokeColor, baseLineWidth) {
|
|
150
150
|
return function (_a) {
|
|
151
151
|
var ctx = _a.ctx,
|
|
152
|
-
items = _a.items
|
|
153
|
-
|
|
154
|
-
utils = _a.utils;
|
|
152
|
+
items = _a.items;
|
|
153
|
+
_a.selectedIds;
|
|
154
|
+
var utils = _a.utils;
|
|
155
155
|
|
|
156
156
|
for (var _i = 0, items_1 = items; _i < items_1.length; _i++) {
|
|
157
157
|
var item = items_1[_i]; // 선택된 항목은 Event Layer에서 그림 (중복 렌더링 방지)
|
|
158
|
-
|
|
159
|
-
|
|
158
|
+
// if (selectedIds.has(item.id)) continue;
|
|
159
|
+
// paths가 없으면 스킵
|
|
160
160
|
|
|
161
161
|
if (!item.paths) continue; // 좌표 변환 (자동 캐싱)
|
|
162
162
|
|
|
@@ -326,14 +326,14 @@ var renderPolygonEvent = function (baseFillColor, baseStrokeColor, baseLineWidth
|
|
|
326
326
|
var renderPolygonBaseWithObject = function (renderStyle) {
|
|
327
327
|
return function (_a) {
|
|
328
328
|
var ctx = _a.ctx,
|
|
329
|
-
items = _a.items
|
|
330
|
-
|
|
331
|
-
utils = _a.utils;
|
|
329
|
+
items = _a.items;
|
|
330
|
+
_a.selectedIds;
|
|
331
|
+
var utils = _a.utils;
|
|
332
332
|
|
|
333
333
|
for (var _i = 0, items_2 = items; _i < items_2.length; _i++) {
|
|
334
334
|
var item = items_2[_i]; // 선택된 항목은 Event Layer에서 그림 (중복 렌더링 방지)
|
|
335
|
-
|
|
336
|
-
|
|
335
|
+
// if (selectedIds.has(item.id)) continue;
|
|
336
|
+
// paths가 없으면 스킵
|
|
337
337
|
|
|
338
338
|
if (!item.paths) continue; // 좌표 변환 (자동 캐싱)
|
|
339
339
|
|
|
@@ -489,14 +489,14 @@ var renderPolygonEventWithObject = function (renderStyle) {
|
|
|
489
489
|
var renderPolygonBaseWithCustomStyle = function (customStyle) {
|
|
490
490
|
return function (_a) {
|
|
491
491
|
var ctx = _a.ctx,
|
|
492
|
-
items = _a.items
|
|
493
|
-
|
|
494
|
-
utils = _a.utils;
|
|
492
|
+
items = _a.items;
|
|
493
|
+
_a.selectedIds;
|
|
494
|
+
var utils = _a.utils;
|
|
495
495
|
|
|
496
496
|
for (var _i = 0, items_3 = items; _i < items_3.length; _i++) {
|
|
497
497
|
var item = items_3[_i]; // 선택된 항목은 Event Layer에서 그림 (중복 렌더링 방지)
|
|
498
|
-
|
|
499
|
-
|
|
498
|
+
// if (selectedIds.has(item.id)) continue;
|
|
499
|
+
// paths가 없으면 스킵
|
|
500
500
|
|
|
501
501
|
if (!item.paths) continue; // 좌표 변환 (자동 캐싱)
|
|
502
502
|
|
|
@@ -665,14 +665,14 @@ var renderPolygonEventWithCustomStyle = function (customStyle) {
|
|
|
665
665
|
var renderPolygonBaseWithHybrid = function (customStyle, baseFillColor, baseStrokeColor, baseLineWidth) {
|
|
666
666
|
return function (_a) {
|
|
667
667
|
var ctx = _a.ctx,
|
|
668
|
-
items = _a.items
|
|
669
|
-
|
|
670
|
-
utils = _a.utils;
|
|
668
|
+
items = _a.items;
|
|
669
|
+
_a.selectedIds;
|
|
670
|
+
var utils = _a.utils;
|
|
671
671
|
|
|
672
672
|
for (var _i = 0, items_4 = items; _i < items_4.length; _i++) {
|
|
673
673
|
var item = items_4[_i]; // 선택된 항목은 Event Layer에서 그림 (중복 렌더링 방지)
|
|
674
|
-
|
|
675
|
-
|
|
674
|
+
// if (selectedIds.has(item.id)) continue;
|
|
675
|
+
// paths가 없으면 스킵
|
|
676
676
|
|
|
677
677
|
if (!item.paths) continue; // 좌표 변환 (자동 캐싱)
|
|
678
678
|
|
|
@@ -898,14 +898,14 @@ var renderPolygonEventWithHybrid = function (customStyle, baseFillColor, baseStr
|
|
|
898
898
|
var renderPolygonBaseWithHybridObject = function (customStyle, renderStyle) {
|
|
899
899
|
return function (_a) {
|
|
900
900
|
var ctx = _a.ctx,
|
|
901
|
-
items = _a.items
|
|
902
|
-
|
|
903
|
-
utils = _a.utils;
|
|
901
|
+
items = _a.items;
|
|
902
|
+
_a.selectedIds;
|
|
903
|
+
var utils = _a.utils;
|
|
904
904
|
|
|
905
905
|
for (var _i = 0, items_5 = items; _i < items_5.length; _i++) {
|
|
906
906
|
var item = items_5[_i]; // 선택된 항목은 Event Layer에서 그림 (중복 렌더링 방지)
|
|
907
|
-
|
|
908
|
-
|
|
907
|
+
// if (selectedIds.has(item.id)) continue;
|
|
908
|
+
// paths가 없으면 스킵
|
|
909
909
|
|
|
910
910
|
if (!item.paths) continue; // 좌표 변환 (자동 캐싱)
|
|
911
911
|
|
|
@@ -117,6 +117,8 @@ export interface CanvasPolygonLayerBaseProps<T> extends Pick<MarkerOptions, 'zIn
|
|
|
117
117
|
cullingMargin?: number;
|
|
118
118
|
/** Queue 캐시 최대 크기 (기본값: 30000) */
|
|
119
119
|
maxCacheSize?: number;
|
|
120
|
+
/** Spatial Grid Hash 셀 크기 (픽셀 단위, 기본값: 200) */
|
|
121
|
+
spatialGridCellSize?: number;
|
|
120
122
|
/** 외부에서 제어하는 선택된 항목 배열 */
|
|
121
123
|
selectedItems?: CanvasData<T>[];
|
|
122
124
|
/** 외부에서 전달된 단일 선택 아이템 */
|
package/dist/index.es.js
CHANGED
|
@@ -3985,10 +3985,12 @@ var CanvasMarkerLayer = function (props) {
|
|
|
3985
3985
|
cullingMargin = _a === void 0 ? DEFAULT_CULLING_MARGIN : _a,
|
|
3986
3986
|
onOptimizationDataUpdate = props.onOptimizationDataUpdate,
|
|
3987
3987
|
renderBase = props.renderBase,
|
|
3988
|
-
|
|
3988
|
+
_b = props.spatialGridCellSize,
|
|
3989
|
+
spatialGridCellSize = _b === void 0 ? SPATIAL_GRID_CELL_SIZE : _b,
|
|
3990
|
+
options = __rest(props, ["data", "cullingMargin", "onOptimizationDataUpdate", "renderBase", "spatialGridCellSize"]); // renderEvent가 있는 경우에만 인터랙션 관련 props 추출
|
|
3989
3991
|
|
|
3990
3992
|
|
|
3991
|
-
var
|
|
3993
|
+
var _c = hasRenderEvent && 'renderEvent' in props ? props : {
|
|
3992
3994
|
disableInteraction: false,
|
|
3993
3995
|
onClick: undefined,
|
|
3994
3996
|
onMouseOut: undefined,
|
|
@@ -3998,15 +4000,15 @@ var CanvasMarkerLayer = function (props) {
|
|
|
3998
4000
|
selectedItems: undefined,
|
|
3999
4001
|
topStageZIndex: undefined
|
|
4000
4002
|
},
|
|
4001
|
-
|
|
4002
|
-
disableInteraction =
|
|
4003
|
-
onClick =
|
|
4004
|
-
onMouseOut =
|
|
4005
|
-
onMouseOver =
|
|
4006
|
-
renderEvent =
|
|
4007
|
-
externalSelectedItem =
|
|
4008
|
-
externalSelectedItems =
|
|
4009
|
-
rawTopStageZIndex =
|
|
4003
|
+
_d = _c.disableInteraction,
|
|
4004
|
+
disableInteraction = _d === void 0 ? false : _d,
|
|
4005
|
+
onClick = _c.onClick,
|
|
4006
|
+
onMouseOut = _c.onMouseOut,
|
|
4007
|
+
onMouseOver = _c.onMouseOver,
|
|
4008
|
+
renderEvent = _c.renderEvent,
|
|
4009
|
+
externalSelectedItem = _c.selectedItem,
|
|
4010
|
+
externalSelectedItems = _c.selectedItems,
|
|
4011
|
+
rawTopStageZIndex = _c.topStageZIndex; // topStageZIndex가 있으면 hover 최상단 표시 활성화, 없으면 비활성화 (성능 우선)
|
|
4010
4012
|
|
|
4011
4013
|
|
|
4012
4014
|
var topStageZIndex = rawTopStageZIndex;
|
|
@@ -4053,7 +4055,7 @@ var CanvasMarkerLayer = function (props) {
|
|
|
4053
4055
|
} // 성능 최적화 Refs
|
|
4054
4056
|
|
|
4055
4057
|
|
|
4056
|
-
var spatialIndexRef = useRef(new SpatialHashGrid(
|
|
4058
|
+
var spatialIndexRef = useRef(new SpatialHashGrid(spatialGridCellSize));
|
|
4057
4059
|
var boundingBoxCacheRef = useRef(new Map());
|
|
4058
4060
|
var viewportRef = useRef(null); // 뷰포트 영역 계산 (Viewport Culling용)
|
|
4059
4061
|
|
|
@@ -4097,8 +4099,17 @@ var CanvasMarkerLayer = function (props) {
|
|
|
4097
4099
|
|
|
4098
4100
|
var buildSpatialIndex$1 = function () {
|
|
4099
4101
|
buildSpatialIndex(dataRef.current, spatialIndexRef.current, computeBoundingBox);
|
|
4100
|
-
}; //
|
|
4102
|
+
}; // spatialGridCellSize가 변경되면 SpatialHashGrid 재생성
|
|
4103
|
+
|
|
4104
|
+
|
|
4105
|
+
useEffect(function () {
|
|
4106
|
+
spatialIndexRef.current = new SpatialHashGrid(spatialGridCellSize); // 인덱스 재구성 (데이터가 있을 때만)
|
|
4101
4107
|
|
|
4108
|
+
if (dataRef.current.length > 0) {
|
|
4109
|
+
buildSpatialIndex$1();
|
|
4110
|
+
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
4111
|
+
|
|
4112
|
+
}, [spatialGridCellSize]); // 렌더링 유틸리티 객체
|
|
4102
4113
|
|
|
4103
4114
|
var renderUtils = {
|
|
4104
4115
|
getOrComputeMarkerOffset: getOrComputeMarkerOffset,
|
|
@@ -4304,7 +4315,7 @@ var CanvasMarkerLayer = function (props) {
|
|
|
4304
4315
|
}; // 지도 이벤트 핸들러 생성
|
|
4305
4316
|
|
|
4306
4317
|
|
|
4307
|
-
var
|
|
4318
|
+
var _e = createMapEventHandlers({
|
|
4308
4319
|
accumTranslateRef: accumTranslateRef,
|
|
4309
4320
|
boundingBoxCacheRef: boundingBoxCacheRef,
|
|
4310
4321
|
clearCache: function () {
|
|
@@ -4317,12 +4328,12 @@ var CanvasMarkerLayer = function (props) {
|
|
|
4317
4328
|
prevCenterOffsetRef: prevCenterOffsetRef,
|
|
4318
4329
|
renderAllImmediate: renderAllImmediate
|
|
4319
4330
|
}),
|
|
4320
|
-
handleIdleShared =
|
|
4321
|
-
handleZoomStart =
|
|
4322
|
-
handleZoomEnd =
|
|
4323
|
-
handleCenterChangedShared =
|
|
4324
|
-
handleDragStartShared =
|
|
4325
|
-
handleDragEndShared =
|
|
4331
|
+
handleIdleShared = _e.handleIdle,
|
|
4332
|
+
handleZoomStart = _e.handleZoomStart,
|
|
4333
|
+
handleZoomEnd = _e.handleZoomEnd,
|
|
4334
|
+
handleCenterChangedShared = _e.handleCenterChanged,
|
|
4335
|
+
handleDragStartShared = _e.handleDragStart,
|
|
4336
|
+
handleDragEndShared = _e.handleDragEnd; // handleIdle 래핑: topStage transform 제거 추가
|
|
4326
4337
|
|
|
4327
4338
|
|
|
4328
4339
|
var handleIdle = function () {
|
|
@@ -4368,8 +4379,9 @@ var CanvasMarkerLayer = function (props) {
|
|
|
4368
4379
|
|
|
4369
4380
|
|
|
4370
4381
|
var findData = function (offset) {
|
|
4371
|
-
//
|
|
4372
|
-
|
|
4382
|
+
// hover된 항목이 있으면 최우선으로 확인 (topOnHover 기능 지원)
|
|
4383
|
+
// topStageZIndex가 없어도 hover된 항목이 다른 마커 위에 있어도 계속 hover 상태 유지
|
|
4384
|
+
if (hoveredItemRef.current) {
|
|
4373
4385
|
var hovered = hoveredItemRef.current;
|
|
4374
4386
|
|
|
4375
4387
|
if (isPointInMarkerData(offset, hovered, getOrComputeMarkerOffset)) {
|
|
@@ -5048,14 +5060,14 @@ var drawPolygon = function (_a) {
|
|
|
5048
5060
|
var renderPolygonBase = function (baseFillColor, baseStrokeColor, baseLineWidth) {
|
|
5049
5061
|
return function (_a) {
|
|
5050
5062
|
var ctx = _a.ctx,
|
|
5051
|
-
items = _a.items
|
|
5052
|
-
|
|
5053
|
-
utils = _a.utils;
|
|
5063
|
+
items = _a.items;
|
|
5064
|
+
_a.selectedIds;
|
|
5065
|
+
var utils = _a.utils;
|
|
5054
5066
|
|
|
5055
5067
|
for (var _i = 0, items_1 = items; _i < items_1.length; _i++) {
|
|
5056
5068
|
var item = items_1[_i]; // 선택된 항목은 Event Layer에서 그림 (중복 렌더링 방지)
|
|
5057
|
-
|
|
5058
|
-
|
|
5069
|
+
// if (selectedIds.has(item.id)) continue;
|
|
5070
|
+
// paths가 없으면 스킵
|
|
5059
5071
|
|
|
5060
5072
|
if (!item.paths) continue; // 좌표 변환 (자동 캐싱)
|
|
5061
5073
|
|
|
@@ -5225,14 +5237,14 @@ var renderPolygonEvent = function (baseFillColor, baseStrokeColor, baseLineWidth
|
|
|
5225
5237
|
var renderPolygonBaseWithObject = function (renderStyle) {
|
|
5226
5238
|
return function (_a) {
|
|
5227
5239
|
var ctx = _a.ctx,
|
|
5228
|
-
items = _a.items
|
|
5229
|
-
|
|
5230
|
-
utils = _a.utils;
|
|
5240
|
+
items = _a.items;
|
|
5241
|
+
_a.selectedIds;
|
|
5242
|
+
var utils = _a.utils;
|
|
5231
5243
|
|
|
5232
5244
|
for (var _i = 0, items_2 = items; _i < items_2.length; _i++) {
|
|
5233
5245
|
var item = items_2[_i]; // 선택된 항목은 Event Layer에서 그림 (중복 렌더링 방지)
|
|
5234
|
-
|
|
5235
|
-
|
|
5246
|
+
// if (selectedIds.has(item.id)) continue;
|
|
5247
|
+
// paths가 없으면 스킵
|
|
5236
5248
|
|
|
5237
5249
|
if (!item.paths) continue; // 좌표 변환 (자동 캐싱)
|
|
5238
5250
|
|
|
@@ -5388,14 +5400,14 @@ var renderPolygonEventWithObject = function (renderStyle) {
|
|
|
5388
5400
|
var renderPolygonBaseWithCustomStyle = function (customStyle) {
|
|
5389
5401
|
return function (_a) {
|
|
5390
5402
|
var ctx = _a.ctx,
|
|
5391
|
-
items = _a.items
|
|
5392
|
-
|
|
5393
|
-
utils = _a.utils;
|
|
5403
|
+
items = _a.items;
|
|
5404
|
+
_a.selectedIds;
|
|
5405
|
+
var utils = _a.utils;
|
|
5394
5406
|
|
|
5395
5407
|
for (var _i = 0, items_3 = items; _i < items_3.length; _i++) {
|
|
5396
5408
|
var item = items_3[_i]; // 선택된 항목은 Event Layer에서 그림 (중복 렌더링 방지)
|
|
5397
|
-
|
|
5398
|
-
|
|
5409
|
+
// if (selectedIds.has(item.id)) continue;
|
|
5410
|
+
// paths가 없으면 스킵
|
|
5399
5411
|
|
|
5400
5412
|
if (!item.paths) continue; // 좌표 변환 (자동 캐싱)
|
|
5401
5413
|
|
|
@@ -5564,14 +5576,14 @@ var renderPolygonEventWithCustomStyle = function (customStyle) {
|
|
|
5564
5576
|
var renderPolygonBaseWithHybrid = function (customStyle, baseFillColor, baseStrokeColor, baseLineWidth) {
|
|
5565
5577
|
return function (_a) {
|
|
5566
5578
|
var ctx = _a.ctx,
|
|
5567
|
-
items = _a.items
|
|
5568
|
-
|
|
5569
|
-
utils = _a.utils;
|
|
5579
|
+
items = _a.items;
|
|
5580
|
+
_a.selectedIds;
|
|
5581
|
+
var utils = _a.utils;
|
|
5570
5582
|
|
|
5571
5583
|
for (var _i = 0, items_4 = items; _i < items_4.length; _i++) {
|
|
5572
5584
|
var item = items_4[_i]; // 선택된 항목은 Event Layer에서 그림 (중복 렌더링 방지)
|
|
5573
|
-
|
|
5574
|
-
|
|
5585
|
+
// if (selectedIds.has(item.id)) continue;
|
|
5586
|
+
// paths가 없으면 스킵
|
|
5575
5587
|
|
|
5576
5588
|
if (!item.paths) continue; // 좌표 변환 (자동 캐싱)
|
|
5577
5589
|
|
|
@@ -5797,14 +5809,14 @@ var renderPolygonEventWithHybrid = function (customStyle, baseFillColor, baseStr
|
|
|
5797
5809
|
var renderPolygonBaseWithHybridObject = function (customStyle, renderStyle) {
|
|
5798
5810
|
return function (_a) {
|
|
5799
5811
|
var ctx = _a.ctx,
|
|
5800
|
-
items = _a.items
|
|
5801
|
-
|
|
5802
|
-
utils = _a.utils;
|
|
5812
|
+
items = _a.items;
|
|
5813
|
+
_a.selectedIds;
|
|
5814
|
+
var utils = _a.utils;
|
|
5803
5815
|
|
|
5804
5816
|
for (var _i = 0, items_5 = items; _i < items_5.length; _i++) {
|
|
5805
5817
|
var item = items_5[_i]; // 선택된 항목은 Event Layer에서 그림 (중복 렌더링 방지)
|
|
5806
|
-
|
|
5807
|
-
|
|
5818
|
+
// if (selectedIds.has(item.id)) continue;
|
|
5819
|
+
// paths가 없으면 스킵
|
|
5808
5820
|
|
|
5809
5821
|
if (!item.paths) continue; // 좌표 변환 (자동 캐싱)
|
|
5810
5822
|
|
|
@@ -5989,7 +6001,9 @@ var CanvasPolygonLayer = function (props) {
|
|
|
5989
6001
|
externalSelectedItem = props.selectedItem,
|
|
5990
6002
|
_c = props.disableInteraction,
|
|
5991
6003
|
disableInteraction = _c === void 0 ? false : _c,
|
|
5992
|
-
|
|
6004
|
+
_d = props.spatialGridCellSize,
|
|
6005
|
+
spatialGridCellSize = _d === void 0 ? SPATIAL_GRID_CELL_SIZE : _d,
|
|
6006
|
+
options = __rest(props, ["data", "enableMultiSelect", "cullingMargin", "onClick", "onOptimizationDataUpdate", "selectedItems", "selectedItem", "disableInteraction", "spatialGridCellSize"]); // customStyle은 다른 방식과 함께 사용 가능
|
|
5993
6007
|
|
|
5994
6008
|
|
|
5995
6009
|
var hasCustomStyle = 'customStyle' in props && props.customStyle !== undefined;
|
|
@@ -6041,7 +6055,7 @@ var CanvasPolygonLayer = function (props) {
|
|
|
6041
6055
|
} // 성능 최적화 Refs
|
|
6042
6056
|
|
|
6043
6057
|
|
|
6044
|
-
var spatialIndexRef = useRef(new SpatialHashGrid(
|
|
6058
|
+
var spatialIndexRef = useRef(new SpatialHashGrid(spatialGridCellSize));
|
|
6045
6059
|
var boundingBoxCacheRef = useRef(new Map());
|
|
6046
6060
|
var viewportRef = useRef(null); // 폴리곤 좌표 변환 (위경도 → 화면 좌표, 공유 캐시 사용)
|
|
6047
6061
|
|
|
@@ -6103,8 +6117,17 @@ var CanvasPolygonLayer = function (props) {
|
|
|
6103
6117
|
|
|
6104
6118
|
var buildSpatialIndex$1 = function () {
|
|
6105
6119
|
buildSpatialIndex(dataRef.current, spatialIndexRef.current, computeBoundingBox);
|
|
6106
|
-
}; //
|
|
6120
|
+
}; // spatialGridCellSize가 변경되면 SpatialHashGrid 재생성
|
|
6121
|
+
|
|
6122
|
+
|
|
6123
|
+
useEffect(function () {
|
|
6124
|
+
spatialIndexRef.current = new SpatialHashGrid(spatialGridCellSize); // 인덱스 재구성 (데이터가 있을 때만)
|
|
6125
|
+
|
|
6126
|
+
if (dataRef.current.length > 0) {
|
|
6127
|
+
buildSpatialIndex$1();
|
|
6128
|
+
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
6107
6129
|
|
|
6130
|
+
}, [spatialGridCellSize]); // 렌더링 유틸리티 객체
|
|
6108
6131
|
|
|
6109
6132
|
var renderUtils = {
|
|
6110
6133
|
getOrComputeMarkerOffset: function () {
|
|
@@ -6240,7 +6263,7 @@ var CanvasPolygonLayer = function (props) {
|
|
|
6240
6263
|
}; // 지도 이벤트 핸들러 생성
|
|
6241
6264
|
|
|
6242
6265
|
|
|
6243
|
-
var
|
|
6266
|
+
var _e = createMapEventHandlers({
|
|
6244
6267
|
accumTranslateRef: accumTranslateRef,
|
|
6245
6268
|
boundingBoxCacheRef: boundingBoxCacheRef,
|
|
6246
6269
|
clearCache: function () {
|
|
@@ -6253,12 +6276,12 @@ var CanvasPolygonLayer = function (props) {
|
|
|
6253
6276
|
prevCenterOffsetRef: prevCenterOffsetRef,
|
|
6254
6277
|
renderAllImmediate: renderAllImmediate
|
|
6255
6278
|
}),
|
|
6256
|
-
handleIdle =
|
|
6257
|
-
handleZoomStart =
|
|
6258
|
-
handleZoomEnd =
|
|
6259
|
-
handleCenterChanged =
|
|
6260
|
-
handleDragStartShared =
|
|
6261
|
-
handleDragEndShared =
|
|
6279
|
+
handleIdle = _e.handleIdle,
|
|
6280
|
+
handleZoomStart = _e.handleZoomStart,
|
|
6281
|
+
handleZoomEnd = _e.handleZoomEnd,
|
|
6282
|
+
handleCenterChanged = _e.handleCenterChanged,
|
|
6283
|
+
handleDragStartShared = _e.handleDragStart,
|
|
6284
|
+
handleDragEndShared = _e.handleDragEnd;
|
|
6262
6285
|
|
|
6263
6286
|
var handleDragStart = function () {
|
|
6264
6287
|
handleDragStartShared(); // 드래그 시작 시점의 hover 상태 저장
|
package/dist/index.umd.js
CHANGED
|
@@ -3989,10 +3989,12 @@
|
|
|
3989
3989
|
cullingMargin = _a === void 0 ? DEFAULT_CULLING_MARGIN : _a,
|
|
3990
3990
|
onOptimizationDataUpdate = props.onOptimizationDataUpdate,
|
|
3991
3991
|
renderBase = props.renderBase,
|
|
3992
|
-
|
|
3992
|
+
_b = props.spatialGridCellSize,
|
|
3993
|
+
spatialGridCellSize = _b === void 0 ? SPATIAL_GRID_CELL_SIZE : _b,
|
|
3994
|
+
options = tslib.__rest(props, ["data", "cullingMargin", "onOptimizationDataUpdate", "renderBase", "spatialGridCellSize"]); // renderEvent가 있는 경우에만 인터랙션 관련 props 추출
|
|
3993
3995
|
|
|
3994
3996
|
|
|
3995
|
-
var
|
|
3997
|
+
var _c = hasRenderEvent && 'renderEvent' in props ? props : {
|
|
3996
3998
|
disableInteraction: false,
|
|
3997
3999
|
onClick: undefined,
|
|
3998
4000
|
onMouseOut: undefined,
|
|
@@ -4002,15 +4004,15 @@
|
|
|
4002
4004
|
selectedItems: undefined,
|
|
4003
4005
|
topStageZIndex: undefined
|
|
4004
4006
|
},
|
|
4005
|
-
|
|
4006
|
-
disableInteraction =
|
|
4007
|
-
onClick =
|
|
4008
|
-
onMouseOut =
|
|
4009
|
-
onMouseOver =
|
|
4010
|
-
renderEvent =
|
|
4011
|
-
externalSelectedItem =
|
|
4012
|
-
externalSelectedItems =
|
|
4013
|
-
rawTopStageZIndex =
|
|
4007
|
+
_d = _c.disableInteraction,
|
|
4008
|
+
disableInteraction = _d === void 0 ? false : _d,
|
|
4009
|
+
onClick = _c.onClick,
|
|
4010
|
+
onMouseOut = _c.onMouseOut,
|
|
4011
|
+
onMouseOver = _c.onMouseOver,
|
|
4012
|
+
renderEvent = _c.renderEvent,
|
|
4013
|
+
externalSelectedItem = _c.selectedItem,
|
|
4014
|
+
externalSelectedItems = _c.selectedItems,
|
|
4015
|
+
rawTopStageZIndex = _c.topStageZIndex; // topStageZIndex가 있으면 hover 최상단 표시 활성화, 없으면 비활성화 (성능 우선)
|
|
4014
4016
|
|
|
4015
4017
|
|
|
4016
4018
|
var topStageZIndex = rawTopStageZIndex;
|
|
@@ -4057,7 +4059,7 @@
|
|
|
4057
4059
|
} // 성능 최적화 Refs
|
|
4058
4060
|
|
|
4059
4061
|
|
|
4060
|
-
var spatialIndexRef = React.useRef(new SpatialHashGrid(
|
|
4062
|
+
var spatialIndexRef = React.useRef(new SpatialHashGrid(spatialGridCellSize));
|
|
4061
4063
|
var boundingBoxCacheRef = React.useRef(new Map());
|
|
4062
4064
|
var viewportRef = React.useRef(null); // 뷰포트 영역 계산 (Viewport Culling용)
|
|
4063
4065
|
|
|
@@ -4101,8 +4103,17 @@
|
|
|
4101
4103
|
|
|
4102
4104
|
var buildSpatialIndex$1 = function () {
|
|
4103
4105
|
buildSpatialIndex(dataRef.current, spatialIndexRef.current, computeBoundingBox);
|
|
4104
|
-
}; //
|
|
4106
|
+
}; // spatialGridCellSize가 변경되면 SpatialHashGrid 재생성
|
|
4107
|
+
|
|
4108
|
+
|
|
4109
|
+
React.useEffect(function () {
|
|
4110
|
+
spatialIndexRef.current = new SpatialHashGrid(spatialGridCellSize); // 인덱스 재구성 (데이터가 있을 때만)
|
|
4105
4111
|
|
|
4112
|
+
if (dataRef.current.length > 0) {
|
|
4113
|
+
buildSpatialIndex$1();
|
|
4114
|
+
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
4115
|
+
|
|
4116
|
+
}, [spatialGridCellSize]); // 렌더링 유틸리티 객체
|
|
4106
4117
|
|
|
4107
4118
|
var renderUtils = {
|
|
4108
4119
|
getOrComputeMarkerOffset: getOrComputeMarkerOffset,
|
|
@@ -4308,7 +4319,7 @@
|
|
|
4308
4319
|
}; // 지도 이벤트 핸들러 생성
|
|
4309
4320
|
|
|
4310
4321
|
|
|
4311
|
-
var
|
|
4322
|
+
var _e = createMapEventHandlers({
|
|
4312
4323
|
accumTranslateRef: accumTranslateRef,
|
|
4313
4324
|
boundingBoxCacheRef: boundingBoxCacheRef,
|
|
4314
4325
|
clearCache: function () {
|
|
@@ -4321,12 +4332,12 @@
|
|
|
4321
4332
|
prevCenterOffsetRef: prevCenterOffsetRef,
|
|
4322
4333
|
renderAllImmediate: renderAllImmediate
|
|
4323
4334
|
}),
|
|
4324
|
-
handleIdleShared =
|
|
4325
|
-
handleZoomStart =
|
|
4326
|
-
handleZoomEnd =
|
|
4327
|
-
handleCenterChangedShared =
|
|
4328
|
-
handleDragStartShared =
|
|
4329
|
-
handleDragEndShared =
|
|
4335
|
+
handleIdleShared = _e.handleIdle,
|
|
4336
|
+
handleZoomStart = _e.handleZoomStart,
|
|
4337
|
+
handleZoomEnd = _e.handleZoomEnd,
|
|
4338
|
+
handleCenterChangedShared = _e.handleCenterChanged,
|
|
4339
|
+
handleDragStartShared = _e.handleDragStart,
|
|
4340
|
+
handleDragEndShared = _e.handleDragEnd; // handleIdle 래핑: topStage transform 제거 추가
|
|
4330
4341
|
|
|
4331
4342
|
|
|
4332
4343
|
var handleIdle = function () {
|
|
@@ -4372,8 +4383,9 @@
|
|
|
4372
4383
|
|
|
4373
4384
|
|
|
4374
4385
|
var findData = function (offset) {
|
|
4375
|
-
//
|
|
4376
|
-
|
|
4386
|
+
// hover된 항목이 있으면 최우선으로 확인 (topOnHover 기능 지원)
|
|
4387
|
+
// topStageZIndex가 없어도 hover된 항목이 다른 마커 위에 있어도 계속 hover 상태 유지
|
|
4388
|
+
if (hoveredItemRef.current) {
|
|
4377
4389
|
var hovered = hoveredItemRef.current;
|
|
4378
4390
|
|
|
4379
4391
|
if (isPointInMarkerData(offset, hovered, getOrComputeMarkerOffset)) {
|
|
@@ -5052,14 +5064,14 @@
|
|
|
5052
5064
|
var renderPolygonBase = function (baseFillColor, baseStrokeColor, baseLineWidth) {
|
|
5053
5065
|
return function (_a) {
|
|
5054
5066
|
var ctx = _a.ctx,
|
|
5055
|
-
items = _a.items
|
|
5056
|
-
|
|
5057
|
-
utils = _a.utils;
|
|
5067
|
+
items = _a.items;
|
|
5068
|
+
_a.selectedIds;
|
|
5069
|
+
var utils = _a.utils;
|
|
5058
5070
|
|
|
5059
5071
|
for (var _i = 0, items_1 = items; _i < items_1.length; _i++) {
|
|
5060
5072
|
var item = items_1[_i]; // 선택된 항목은 Event Layer에서 그림 (중복 렌더링 방지)
|
|
5061
|
-
|
|
5062
|
-
|
|
5073
|
+
// if (selectedIds.has(item.id)) continue;
|
|
5074
|
+
// paths가 없으면 스킵
|
|
5063
5075
|
|
|
5064
5076
|
if (!item.paths) continue; // 좌표 변환 (자동 캐싱)
|
|
5065
5077
|
|
|
@@ -5229,14 +5241,14 @@
|
|
|
5229
5241
|
var renderPolygonBaseWithObject = function (renderStyle) {
|
|
5230
5242
|
return function (_a) {
|
|
5231
5243
|
var ctx = _a.ctx,
|
|
5232
|
-
items = _a.items
|
|
5233
|
-
|
|
5234
|
-
utils = _a.utils;
|
|
5244
|
+
items = _a.items;
|
|
5245
|
+
_a.selectedIds;
|
|
5246
|
+
var utils = _a.utils;
|
|
5235
5247
|
|
|
5236
5248
|
for (var _i = 0, items_2 = items; _i < items_2.length; _i++) {
|
|
5237
5249
|
var item = items_2[_i]; // 선택된 항목은 Event Layer에서 그림 (중복 렌더링 방지)
|
|
5238
|
-
|
|
5239
|
-
|
|
5250
|
+
// if (selectedIds.has(item.id)) continue;
|
|
5251
|
+
// paths가 없으면 스킵
|
|
5240
5252
|
|
|
5241
5253
|
if (!item.paths) continue; // 좌표 변환 (자동 캐싱)
|
|
5242
5254
|
|
|
@@ -5392,14 +5404,14 @@
|
|
|
5392
5404
|
var renderPolygonBaseWithCustomStyle = function (customStyle) {
|
|
5393
5405
|
return function (_a) {
|
|
5394
5406
|
var ctx = _a.ctx,
|
|
5395
|
-
items = _a.items
|
|
5396
|
-
|
|
5397
|
-
utils = _a.utils;
|
|
5407
|
+
items = _a.items;
|
|
5408
|
+
_a.selectedIds;
|
|
5409
|
+
var utils = _a.utils;
|
|
5398
5410
|
|
|
5399
5411
|
for (var _i = 0, items_3 = items; _i < items_3.length; _i++) {
|
|
5400
5412
|
var item = items_3[_i]; // 선택된 항목은 Event Layer에서 그림 (중복 렌더링 방지)
|
|
5401
|
-
|
|
5402
|
-
|
|
5413
|
+
// if (selectedIds.has(item.id)) continue;
|
|
5414
|
+
// paths가 없으면 스킵
|
|
5403
5415
|
|
|
5404
5416
|
if (!item.paths) continue; // 좌표 변환 (자동 캐싱)
|
|
5405
5417
|
|
|
@@ -5568,14 +5580,14 @@
|
|
|
5568
5580
|
var renderPolygonBaseWithHybrid = function (customStyle, baseFillColor, baseStrokeColor, baseLineWidth) {
|
|
5569
5581
|
return function (_a) {
|
|
5570
5582
|
var ctx = _a.ctx,
|
|
5571
|
-
items = _a.items
|
|
5572
|
-
|
|
5573
|
-
utils = _a.utils;
|
|
5583
|
+
items = _a.items;
|
|
5584
|
+
_a.selectedIds;
|
|
5585
|
+
var utils = _a.utils;
|
|
5574
5586
|
|
|
5575
5587
|
for (var _i = 0, items_4 = items; _i < items_4.length; _i++) {
|
|
5576
5588
|
var item = items_4[_i]; // 선택된 항목은 Event Layer에서 그림 (중복 렌더링 방지)
|
|
5577
|
-
|
|
5578
|
-
|
|
5589
|
+
// if (selectedIds.has(item.id)) continue;
|
|
5590
|
+
// paths가 없으면 스킵
|
|
5579
5591
|
|
|
5580
5592
|
if (!item.paths) continue; // 좌표 변환 (자동 캐싱)
|
|
5581
5593
|
|
|
@@ -5801,14 +5813,14 @@
|
|
|
5801
5813
|
var renderPolygonBaseWithHybridObject = function (customStyle, renderStyle) {
|
|
5802
5814
|
return function (_a) {
|
|
5803
5815
|
var ctx = _a.ctx,
|
|
5804
|
-
items = _a.items
|
|
5805
|
-
|
|
5806
|
-
utils = _a.utils;
|
|
5816
|
+
items = _a.items;
|
|
5817
|
+
_a.selectedIds;
|
|
5818
|
+
var utils = _a.utils;
|
|
5807
5819
|
|
|
5808
5820
|
for (var _i = 0, items_5 = items; _i < items_5.length; _i++) {
|
|
5809
5821
|
var item = items_5[_i]; // 선택된 항목은 Event Layer에서 그림 (중복 렌더링 방지)
|
|
5810
|
-
|
|
5811
|
-
|
|
5822
|
+
// if (selectedIds.has(item.id)) continue;
|
|
5823
|
+
// paths가 없으면 스킵
|
|
5812
5824
|
|
|
5813
5825
|
if (!item.paths) continue; // 좌표 변환 (자동 캐싱)
|
|
5814
5826
|
|
|
@@ -5993,7 +6005,9 @@
|
|
|
5993
6005
|
externalSelectedItem = props.selectedItem,
|
|
5994
6006
|
_c = props.disableInteraction,
|
|
5995
6007
|
disableInteraction = _c === void 0 ? false : _c,
|
|
5996
|
-
|
|
6008
|
+
_d = props.spatialGridCellSize,
|
|
6009
|
+
spatialGridCellSize = _d === void 0 ? SPATIAL_GRID_CELL_SIZE : _d,
|
|
6010
|
+
options = tslib.__rest(props, ["data", "enableMultiSelect", "cullingMargin", "onClick", "onOptimizationDataUpdate", "selectedItems", "selectedItem", "disableInteraction", "spatialGridCellSize"]); // customStyle은 다른 방식과 함께 사용 가능
|
|
5997
6011
|
|
|
5998
6012
|
|
|
5999
6013
|
var hasCustomStyle = 'customStyle' in props && props.customStyle !== undefined;
|
|
@@ -6045,7 +6059,7 @@
|
|
|
6045
6059
|
} // 성능 최적화 Refs
|
|
6046
6060
|
|
|
6047
6061
|
|
|
6048
|
-
var spatialIndexRef = React.useRef(new SpatialHashGrid(
|
|
6062
|
+
var spatialIndexRef = React.useRef(new SpatialHashGrid(spatialGridCellSize));
|
|
6049
6063
|
var boundingBoxCacheRef = React.useRef(new Map());
|
|
6050
6064
|
var viewportRef = React.useRef(null); // 폴리곤 좌표 변환 (위경도 → 화면 좌표, 공유 캐시 사용)
|
|
6051
6065
|
|
|
@@ -6107,8 +6121,17 @@
|
|
|
6107
6121
|
|
|
6108
6122
|
var buildSpatialIndex$1 = function () {
|
|
6109
6123
|
buildSpatialIndex(dataRef.current, spatialIndexRef.current, computeBoundingBox);
|
|
6110
|
-
}; //
|
|
6124
|
+
}; // spatialGridCellSize가 변경되면 SpatialHashGrid 재생성
|
|
6125
|
+
|
|
6126
|
+
|
|
6127
|
+
React.useEffect(function () {
|
|
6128
|
+
spatialIndexRef.current = new SpatialHashGrid(spatialGridCellSize); // 인덱스 재구성 (데이터가 있을 때만)
|
|
6129
|
+
|
|
6130
|
+
if (dataRef.current.length > 0) {
|
|
6131
|
+
buildSpatialIndex$1();
|
|
6132
|
+
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
6111
6133
|
|
|
6134
|
+
}, [spatialGridCellSize]); // 렌더링 유틸리티 객체
|
|
6112
6135
|
|
|
6113
6136
|
var renderUtils = {
|
|
6114
6137
|
getOrComputeMarkerOffset: function () {
|
|
@@ -6244,7 +6267,7 @@
|
|
|
6244
6267
|
}; // 지도 이벤트 핸들러 생성
|
|
6245
6268
|
|
|
6246
6269
|
|
|
6247
|
-
var
|
|
6270
|
+
var _e = createMapEventHandlers({
|
|
6248
6271
|
accumTranslateRef: accumTranslateRef,
|
|
6249
6272
|
boundingBoxCacheRef: boundingBoxCacheRef,
|
|
6250
6273
|
clearCache: function () {
|
|
@@ -6257,12 +6280,12 @@
|
|
|
6257
6280
|
prevCenterOffsetRef: prevCenterOffsetRef,
|
|
6258
6281
|
renderAllImmediate: renderAllImmediate
|
|
6259
6282
|
}),
|
|
6260
|
-
handleIdle =
|
|
6261
|
-
handleZoomStart =
|
|
6262
|
-
handleZoomEnd =
|
|
6263
|
-
handleCenterChanged =
|
|
6264
|
-
handleDragStartShared =
|
|
6265
|
-
handleDragEndShared =
|
|
6283
|
+
handleIdle = _e.handleIdle,
|
|
6284
|
+
handleZoomStart = _e.handleZoomStart,
|
|
6285
|
+
handleZoomEnd = _e.handleZoomEnd,
|
|
6286
|
+
handleCenterChanged = _e.handleCenterChanged,
|
|
6287
|
+
handleDragStartShared = _e.handleDragStart,
|
|
6288
|
+
handleDragEndShared = _e.handleDragEnd;
|
|
6266
6289
|
|
|
6267
6290
|
var handleDragStart = function () {
|
|
6268
6291
|
handleDragStartShared(); // 드래그 시작 시점의 hover 상태 저장
|