maplibre-gl-geo-editor 0.10.0 → 0.10.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/{geo-editor-BmXZmyoe.cjs → geo-editor-CGAbyy3C.cjs} +22 -11
- package/dist/{geo-editor-BmXZmyoe.cjs.map → geo-editor-CGAbyy3C.cjs.map} +1 -1
- package/dist/{geo-editor-Bf4KlZK2.js → geo-editor-DjhKOJls.js} +22 -11
- package/dist/{geo-editor-Bf4KlZK2.js.map → geo-editor-DjhKOJls.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/react.cjs +1 -1
- package/dist/react.mjs +2 -2
- package/dist/types/index.d.ts +2 -1
- package/dist/types/react.d.ts +4 -2
- package/package.json +1 -1
|
@@ -18490,6 +18490,10 @@ class GeoEditor {
|
|
|
18490
18490
|
pendingOperation = null;
|
|
18491
18491
|
// Snapping state (independent of other modes)
|
|
18492
18492
|
snappingEnabled = false;
|
|
18493
|
+
// Monotonic token identifying the most recent enableDrawMode() request. Each
|
|
18494
|
+
// call bumps it so a tool armed after an async teardown can bail if a newer
|
|
18495
|
+
// selection has since superseded it (see enableDrawMode).
|
|
18496
|
+
drawRequestId = 0;
|
|
18493
18497
|
// Last known feature operations
|
|
18494
18498
|
lastCreatedFeature = null;
|
|
18495
18499
|
lastEditedFeature = null;
|
|
@@ -19415,13 +19419,18 @@ class GeoEditor {
|
|
|
19415
19419
|
* Enable a draw mode
|
|
19416
19420
|
*/
|
|
19417
19421
|
enableDrawMode(mode) {
|
|
19418
|
-
this.
|
|
19419
|
-
|
|
19420
|
-
|
|
19421
|
-
|
|
19422
|
-
|
|
19423
|
-
|
|
19424
|
-
|
|
19422
|
+
const requestId = ++this.drawRequestId;
|
|
19423
|
+
const teardown = this.disableAllModes();
|
|
19424
|
+
const activate = () => {
|
|
19425
|
+
if (this.drawRequestId !== requestId) return;
|
|
19426
|
+
if (mode === "freehand") {
|
|
19427
|
+
this.enableFreehandMode();
|
|
19428
|
+
} else if (this.geoman) {
|
|
19429
|
+
this.geoman.enableDraw(mode);
|
|
19430
|
+
setTimeout(() => this.applyVertexMarkerStyles(), 50);
|
|
19431
|
+
}
|
|
19432
|
+
};
|
|
19433
|
+
teardown.then(activate).catch(activate);
|
|
19425
19434
|
this.state.activeDrawMode = mode;
|
|
19426
19435
|
this.state.isDrawing = true;
|
|
19427
19436
|
this.options.onModeChange?.(mode);
|
|
@@ -19561,10 +19570,12 @@ class GeoEditor {
|
|
|
19561
19570
|
this.state.isEditing = false;
|
|
19562
19571
|
this.updateToolbarState();
|
|
19563
19572
|
if (geomanDisable && typeof geomanDisable.then === "function") {
|
|
19564
|
-
|
|
19565
|
-
|
|
19566
|
-
|
|
19573
|
+
const settled = geomanDisable;
|
|
19574
|
+
settled.then(() => this.applySnappingState()).catch(() => this.applySnappingState());
|
|
19575
|
+
return settled;
|
|
19567
19576
|
}
|
|
19577
|
+
this.applySnappingState();
|
|
19578
|
+
return Promise.resolve();
|
|
19568
19579
|
}
|
|
19569
19580
|
// ============================================================================
|
|
19570
19581
|
// Finish polygon/line draw on double-click or right-click
|
|
@@ -22105,4 +22116,4 @@ exports.safeUnion = safeUnion;
|
|
|
22105
22116
|
exports.selectFeaturesWithinLasso = selectFeaturesWithinLasso;
|
|
22106
22117
|
exports.toSelectedFeatures = toSelectedFeatures;
|
|
22107
22118
|
exports.toggleInSelection = toggleInSelection;
|
|
22108
|
-
//# sourceMappingURL=geo-editor-
|
|
22119
|
+
//# sourceMappingURL=geo-editor-CGAbyy3C.cjs.map
|