@mint-ui/map 1.2.0 → 1.2.2

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.
@@ -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
- options = tslib.__rest(props, ["data", "cullingMargin", "onOptimizationDataUpdate", "renderBase"]); // renderEvent가 있는 경우에만 인터랙션 관련 props 추출
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 _b = hasRenderEvent && 'renderEvent' in props ? props : {
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
- _c = _b.disableInteraction,
49
- disableInteraction = _c === void 0 ? false : _c,
50
- onClick = _b.onClick,
51
- onMouseOut = _b.onMouseOut,
52
- onMouseOver = _b.onMouseOver,
53
- renderEvent = _b.renderEvent,
54
- externalSelectedItem = _b.selectedItem,
55
- externalSelectedItems = _b.selectedItems,
56
- rawTopStageZIndex = _b.topStageZIndex; // topStageZIndex가 있으면 hover 최상단 표시 활성화, 없으면 비활성화 (성능 우선)
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(performance.SPATIAL_GRID_CELL_SIZE));
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 _d = hooks.createMapEventHandlers({
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 = _d.handleIdle,
368
- handleZoomStart = _d.handleZoomStart,
369
- handleZoomEnd = _d.handleZoomEnd,
370
- handleCenterChangedShared = _d.handleCenterChanged,
371
- handleDragStartShared = _d.handleDragStart,
372
- handleDragEndShared = _d.handleDragEnd; // handleIdle 래핑: topStage transform 제거 추가
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
- // topStageZIndex가 설정되어 있으면 hover된 항목을 최우선으로 확인
419
- if (topStageZIndex !== undefined && hoveredItemRef.current) {
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
- options = tslib.__rest(props, ["data", "enableMultiSelect", "cullingMargin", "onClick", "onOptimizationDataUpdate", "selectedItems", "selectedItem", "disableInteraction"]); // customStyle은 다른 방식과 함께 사용 가능
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(performance.SPATIAL_GRID_CELL_SIZE));
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 _d = hooks.createMapEventHandlers({
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 = _d.handleIdle,
304
- handleZoomStart = _d.handleZoomStart,
305
- handleZoomEnd = _d.handleZoomEnd,
306
- handleCenterChanged = _d.handleCenterChanged,
307
- handleDragStartShared = _d.handleDragStart,
308
- handleDragEndShared = _d.handleDragEnd;
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 상태 저장
@@ -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
- options = __rest(props, ["data", "cullingMargin", "onOptimizationDataUpdate", "renderBase"]); // renderEvent가 있는 경우에만 인터랙션 관련 props 추출
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 _b = hasRenderEvent && 'renderEvent' in props ? props : {
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
- _c = _b.disableInteraction,
4002
- disableInteraction = _c === void 0 ? false : _c,
4003
- onClick = _b.onClick,
4004
- onMouseOut = _b.onMouseOut,
4005
- onMouseOver = _b.onMouseOver,
4006
- renderEvent = _b.renderEvent,
4007
- externalSelectedItem = _b.selectedItem,
4008
- externalSelectedItems = _b.selectedItems,
4009
- rawTopStageZIndex = _b.topStageZIndex; // topStageZIndex가 있으면 hover 최상단 표시 활성화, 없으면 비활성화 (성능 우선)
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(SPATIAL_GRID_CELL_SIZE));
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); // 인덱스 재구성 (데이터가 있을 때만)
4107
+
4108
+ if (dataRef.current.length > 0) {
4109
+ buildSpatialIndex$1();
4110
+ } // eslint-disable-next-line react-hooks/exhaustive-deps
4101
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 _d = createMapEventHandlers({
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 = _d.handleIdle,
4321
- handleZoomStart = _d.handleZoomStart,
4322
- handleZoomEnd = _d.handleZoomEnd,
4323
- handleCenterChangedShared = _d.handleCenterChanged,
4324
- handleDragStartShared = _d.handleDragStart,
4325
- handleDragEndShared = _d.handleDragEnd; // handleIdle 래핑: topStage transform 제거 추가
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
- // topStageZIndex가 설정되어 있으면 hover된 항목을 최우선으로 확인
4372
- if (topStageZIndex !== undefined && hoveredItemRef.current) {
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)) {
@@ -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
- options = __rest(props, ["data", "enableMultiSelect", "cullingMargin", "onClick", "onOptimizationDataUpdate", "selectedItems", "selectedItem", "disableInteraction"]); // customStyle은 다른 방식과 함께 사용 가능
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(SPATIAL_GRID_CELL_SIZE));
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 _d = createMapEventHandlers({
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 = _d.handleIdle,
6257
- handleZoomStart = _d.handleZoomStart,
6258
- handleZoomEnd = _d.handleZoomEnd,
6259
- handleCenterChanged = _d.handleCenterChanged,
6260
- handleDragStartShared = _d.handleDragStart,
6261
- handleDragEndShared = _d.handleDragEnd;
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
- options = tslib.__rest(props, ["data", "cullingMargin", "onOptimizationDataUpdate", "renderBase"]); // renderEvent가 있는 경우에만 인터랙션 관련 props 추출
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 _b = hasRenderEvent && 'renderEvent' in props ? props : {
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
- _c = _b.disableInteraction,
4006
- disableInteraction = _c === void 0 ? false : _c,
4007
- onClick = _b.onClick,
4008
- onMouseOut = _b.onMouseOut,
4009
- onMouseOver = _b.onMouseOver,
4010
- renderEvent = _b.renderEvent,
4011
- externalSelectedItem = _b.selectedItem,
4012
- externalSelectedItems = _b.selectedItems,
4013
- rawTopStageZIndex = _b.topStageZIndex; // topStageZIndex가 있으면 hover 최상단 표시 활성화, 없으면 비활성화 (성능 우선)
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(SPATIAL_GRID_CELL_SIZE));
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); // 인덱스 재구성 (데이터가 있을 때만)
4111
+
4112
+ if (dataRef.current.length > 0) {
4113
+ buildSpatialIndex$1();
4114
+ } // eslint-disable-next-line react-hooks/exhaustive-deps
4105
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 _d = createMapEventHandlers({
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 = _d.handleIdle,
4325
- handleZoomStart = _d.handleZoomStart,
4326
- handleZoomEnd = _d.handleZoomEnd,
4327
- handleCenterChangedShared = _d.handleCenterChanged,
4328
- handleDragStartShared = _d.handleDragStart,
4329
- handleDragEndShared = _d.handleDragEnd; // handleIdle 래핑: topStage transform 제거 추가
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
- // topStageZIndex가 설정되어 있으면 hover된 항목을 최우선으로 확인
4376
- if (topStageZIndex !== undefined && hoveredItemRef.current) {
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)) {
@@ -5993,7 +6005,9 @@
5993
6005
  externalSelectedItem = props.selectedItem,
5994
6006
  _c = props.disableInteraction,
5995
6007
  disableInteraction = _c === void 0 ? false : _c,
5996
- options = tslib.__rest(props, ["data", "enableMultiSelect", "cullingMargin", "onClick", "onOptimizationDataUpdate", "selectedItems", "selectedItem", "disableInteraction"]); // customStyle은 다른 방식과 함께 사용 가능
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(SPATIAL_GRID_CELL_SIZE));
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 _d = createMapEventHandlers({
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 = _d.handleIdle,
6261
- handleZoomStart = _d.handleZoomStart,
6262
- handleZoomEnd = _d.handleZoomEnd,
6263
- handleCenterChanged = _d.handleCenterChanged,
6264
- handleDragStartShared = _d.handleDragStart,
6265
- handleDragEndShared = _d.handleDragEnd;
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 상태 저장
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mint-ui/map",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.es.js",
6
6
  "browser": "./dist/index.umd.js",