@octostar/map-component 0.1.37 → 0.1.39

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/index.mjs CHANGED
@@ -6468,7 +6468,7 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
6468
6468
  }
6469
6469
  });
6470
6470
  }
6471
- const isFeatureSelected = selectedIds.includes(featureId) ? 1 : 0;
6471
+ const isFeatureSelected = (enableSelectionRef.current || enableDrawingRef.current) && selectedIds.includes(featureId) ? 1 : 0;
6472
6472
  let labelPriority = 100;
6473
6473
  if (isFeatureSelected) {
6474
6474
  labelPriority = 0;
@@ -8008,6 +8008,7 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
8008
8008
  });
8009
8009
  mapInstance.on("click", (e) => {
8010
8010
  var _a;
8011
+ if (!enableSelectionRef.current) return;
8011
8012
  if (e.originalEvent.button !== 0) return;
8012
8013
  if (contextMenuFiredRef.current) return;
8013
8014
  if (Date.now() - shiftSelectionRef.current.completedAt < 300) return;
@@ -10409,6 +10410,14 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
10409
10410
  useEffect(() => {
10410
10411
  selectedFeatureIdsRef.current = selectedFeatureIds;
10411
10412
  }, [selectedFeatureIds]);
10413
+ const enableSelectionRef = useRef(enableSelection);
10414
+ useEffect(() => {
10415
+ enableSelectionRef.current = enableSelection;
10416
+ }, [enableSelection]);
10417
+ const enableDrawingRef = useRef(enableDrawing);
10418
+ useEffect(() => {
10419
+ enableDrawingRef.current = enableDrawing;
10420
+ }, [enableDrawing]);
10412
10421
  useEffect(() => {
10413
10422
  if (!map.current || !isMapLoaded) {
10414
10423
  return;