@octostar/map-component 0.1.34 → 0.1.35
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.cjs +22 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +22 -8
- package/dist/index.mjs.map +1 -1
- package/dist/types/components/drawing-toolbar.d.ts +1 -1
- package/dist/types/components/drawing-toolbar.d.ts.map +1 -1
- package/dist/types/components/map-editor-canvas.d.ts.map +1 -1
- package/dist/types/lib/map-editor-api.d.ts +1 -1
- package/dist/types/lib/map-editor-api.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1132,7 +1132,20 @@ function DrawingToolbar({
|
|
|
1132
1132
|
showShortcutHint: showShortcutHints
|
|
1133
1133
|
}
|
|
1134
1134
|
),
|
|
1135
|
-
!hiddenDrawingTools.includes("polygon") && /* @__PURE__ */ jsx(
|
|
1135
|
+
!hiddenDrawingTools.includes("polygon") && hiddenDrawingTools.includes("rectangle") && /* @__PURE__ */ jsx(
|
|
1136
|
+
ToolButton,
|
|
1137
|
+
{
|
|
1138
|
+
mode: "draw_polygon",
|
|
1139
|
+
activeMode,
|
|
1140
|
+
onModeChange,
|
|
1141
|
+
icon: /* @__PURE__ */ jsx(Pentagon, { className: "w-5 h-5" }),
|
|
1142
|
+
label: "Draw Polygon",
|
|
1143
|
+
shortcut: "G",
|
|
1144
|
+
disabled: drawingDisabled,
|
|
1145
|
+
showShortcutHint: showShortcutHints
|
|
1146
|
+
}
|
|
1147
|
+
),
|
|
1148
|
+
!hiddenDrawingTools.includes("polygon") && !hiddenDrawingTools.includes("rectangle") && /* @__PURE__ */ jsx(
|
|
1136
1149
|
Dropdown,
|
|
1137
1150
|
{
|
|
1138
1151
|
menu: {
|
|
@@ -7941,7 +7954,7 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
7941
7954
|
});
|
|
7942
7955
|
setSelectedFeatureIds(ids);
|
|
7943
7956
|
selectedFeatureIdsRef.current = ids;
|
|
7944
|
-
setShowProperties(ids.length > 0);
|
|
7957
|
+
if (enableProperties) setShowProperties(ids.length > 0);
|
|
7945
7958
|
syncRef.current();
|
|
7946
7959
|
onFeatureSelect == null ? void 0 : onFeatureSelect(e.features);
|
|
7947
7960
|
});
|
|
@@ -9136,6 +9149,7 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
9136
9149
|
handleModeChange(activeMode === "draw_polygon" ? "simple_select" : "draw_polygon");
|
|
9137
9150
|
break;
|
|
9138
9151
|
case "b":
|
|
9152
|
+
if (hiddenDrawingTools.includes("rectangle")) break;
|
|
9139
9153
|
e.preventDefault();
|
|
9140
9154
|
handleModeChange(activeMode === "draw_rectangle" ? "simple_select" : "draw_rectangle");
|
|
9141
9155
|
break;
|
|
@@ -9158,7 +9172,7 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
9158
9172
|
};
|
|
9159
9173
|
container.addEventListener("keydown", handleKeyDown);
|
|
9160
9174
|
return () => container.removeEventListener("keydown", handleKeyDown);
|
|
9161
|
-
}, [isMapLoaded, enableKeyboardShortcuts, isEditMode, activeMode, handleToggleEditMode, handleUndo, handleRedo, handleModeChange, selectedFeatureIds, handleDeleteSelected, canDeleteSelected]);
|
|
9175
|
+
}, [isMapLoaded, enableKeyboardShortcuts, isEditMode, activeMode, handleToggleEditMode, handleUndo, handleRedo, handleModeChange, selectedFeatureIds, handleDeleteSelected, canDeleteSelected, hiddenDrawingTools]);
|
|
9162
9176
|
const createPointAtCoords = useCallback((lng, lat) => {
|
|
9163
9177
|
if (!draw.current || !isMapLoaded) return;
|
|
9164
9178
|
if (!isEditModeRef.current) {
|
|
@@ -9190,13 +9204,13 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
9190
9204
|
});
|
|
9191
9205
|
draw.current.changeMode("simple_select", { featureIds: [id] });
|
|
9192
9206
|
setSelectedFeatureIds([id]);
|
|
9193
|
-
setShowProperties(true);
|
|
9207
|
+
if (enableProperties) setShowProperties(true);
|
|
9194
9208
|
updateFeatureCount();
|
|
9195
9209
|
scheduleTimelineUpdate();
|
|
9196
9210
|
saveStateForUndo();
|
|
9197
9211
|
syncFeaturesToCustomLayers();
|
|
9198
9212
|
onFeatureCreate == null ? void 0 : onFeatureCreate(feature);
|
|
9199
|
-
}, [isMapLoaded, externalPersistence, saveStateForUndo, updateFeatureCount, scheduleTimelineUpdate, syncFeaturesToCustomLayers, onFeatureCreate]);
|
|
9213
|
+
}, [isMapLoaded, externalPersistence, enableProperties, saveStateForUndo, updateFeatureCount, scheduleTimelineUpdate, syncFeaturesToCustomLayers, onFeatureCreate]);
|
|
9200
9214
|
const handleFeatureContextMenu = useCallback((e) => {
|
|
9201
9215
|
var _a, _b;
|
|
9202
9216
|
contextMenuFiredRef.current = true;
|
|
@@ -10898,7 +10912,7 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
10898
10912
|
map.current.getCanvas().style.cursor = "";
|
|
10899
10913
|
}
|
|
10900
10914
|
};
|
|
10901
|
-
}, [activeMode, isMapLoaded, onFeatureCreate]);
|
|
10915
|
+
}, [activeMode, isMapLoaded, onFeatureCreate, enableProperties]);
|
|
10902
10916
|
useEffect(() => {
|
|
10903
10917
|
if (!map.current || !isMapLoaded || !draw.current) return;
|
|
10904
10918
|
if (activeMode !== "draw_rectangle") {
|
|
@@ -10993,7 +11007,7 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
10993
11007
|
drawInstance.changeMode("simple_select", { featureIds: [featureId] });
|
|
10994
11008
|
setActiveMode("simple_select");
|
|
10995
11009
|
setSelectedFeatureIds([featureId]);
|
|
10996
|
-
setShowProperties(true);
|
|
11010
|
+
if (enableProperties) setShowProperties(true);
|
|
10997
11011
|
if (onFeatureCreate) {
|
|
10998
11012
|
onFeatureCreate(rectFeature);
|
|
10999
11013
|
}
|
|
@@ -11026,7 +11040,7 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
11026
11040
|
map.current.getCanvas().style.cursor = "";
|
|
11027
11041
|
}
|
|
11028
11042
|
};
|
|
11029
|
-
}, [activeMode, isMapLoaded, onFeatureCreate]);
|
|
11043
|
+
}, [activeMode, isMapLoaded, onFeatureCreate, enableProperties]);
|
|
11030
11044
|
const measurePointsRef = useRef([]);
|
|
11031
11045
|
useEffect(() => {
|
|
11032
11046
|
measurePointsRef.current = measurePoints;
|