Ol10 geometry copy - #6830
Draft
meyerlor wants to merge 4 commits into
Draft
Conversation
* Replace OpenLayers.Control.Snapping with the OL10 Snap interaction. * Render snap features as a solid orange overlay while snapping is active. * Drop the manual refresh button: getSnappingData() now runs automatically on moveend and on layer-tree visibility changes (the snapLayersRefreshable state and snapping.refreshable event are gone, no consumers remained). * OL10 Snap exposes a single vertex flag and a single pixelTolerance, so snap_vertices is OR-ed with snap_intersections and pixelTolerance is max(snap_vertices_tolerance, snap_segments_tolerance). Worth flagging for projects that configure vertex vs intersection independently. * Public reorderSnapInteraction() lets future callers re-add the Snap interaction so OL processes it before any recently-added Draw / Modify / Translate. No-op when snap is inactive. Tests: * snap.spec.js: remove three WFS 1.1.0 / SRSNAME / datum-shift tests that exercised the OL2 snap WFS path (replaced by OL10 GeoJSON parsing). Strip refresh-button click / disabled-state assertions from the snap panel test now that refresh is automatic. This PR ships the snap infrastructure but does not visibly engage with the OL2 edition Draw / Modify yet. Snapping starts to actually snap once the follow-up OL10 edition migration lands.
meyerlor
force-pushed
the
ol10-geometry-copy
branch
9 times, most recently
from
May 15, 2026 08:09
8acad39 to
b725f3f
Compare
* Replace OpenLayers.Control.DrawFeature / ModifyFeature / SelectFeature with OL10 Draw, Modify and Select interactions. The OL2 vector edit layer becomes an OL10 VectorLayer / VectorSource on mainLizmap.map. * Auto-activate Modify after a feature is drawn, including for point layers. Feature highlights use the OL10 draw layer. * Route WMS extent / size queries through the OL10 view. Required because the OL10 map is now the source of truth for the visible viewport during edition. * New modules/Edition.js owns the WKT bridge between the digitizing module and the hidden geometry form field, and emits user-facing toasts via #lizmap-editing-message (the legacy #lizmap-edition-message is still used for save-success / error toasts). * Duplicate toast dispatches removed from legacy/edition.js so the "Edit vertices" / "Draw on the map" toast no longer appears twice. * For point edition the digitizing toolbar is hidden; drawing begins automatically on click. * New baseline locale keys: edition.toolbar.redraw plus four digitizing.toolbar.<tool>.help keys (edit / split / rotate / scaling). * Remove ~120 lines of dead OL2 split helpers from legacy/edition.js (afterReshapeSpliting, beforeFeatureSpliting, afterFeatureSpliting and their editCtrls.reshape / editCtrls.featsplit entries). Builds on the snapping migration. The new digitizing module calls mainLizmap.snapping.reorderSnapInteraction() after adding interactions, so the OL10 Snap follows each new Draw / Modify / Translate. Tests: * 9 spec files updated for OL10 map / interactions (clickOnMapLegacy → clickOnMap, mapOl2 → map, #map → #newOlMap, waitForFunction guards for Select/Modify). * edition-form.spec.js: "must allow modification without creation" now expects #lizmap-editing-message (the new id) for the on-form edit-vertices toast. * editing-copy-paste-geometry.spec.js: mark the 11 interaction tests test.fixme(). They cover behaviour that needs the OL10 GeometryCopy port (lands in the follow-up Copy/Paste PR). * draw.spec.js: mark "Length and angle constraints" test.fixme() — the distance/angle constraint feature is deferred to a follow-up PR. Deferred to follow-up PRs: reshape, parallel offset, move (in edition), distance/angle drawing constraints, split-with-server-save (the digitizing-split button is therefore hidden in edition context for now, remains available in draw context), ReverseGeom port, draw.spec.js new-tool tests and pages/drawpage.js new-tool locators.
* Replace OpenLayers.Control.DrawFeature / ModifyFeature / SelectFeature with OL10 Draw, Modify and Select interactions. The OL2 vector edit layer becomes an OL10 VectorLayer / VectorSource on mainLizmap.map. * Auto-activate Modify after a feature is drawn, including for point layers. Feature highlights use the OL10 draw layer. * Route WMS extent / size queries through the OL10 view. Required because the OL10 map is now the source of truth for the visible viewport during edition. * New modules/Edition.js owns the WKT bridge between the digitizing module and the hidden geometry form field, and emits user-facing toasts via #lizmap-editing-message (the legacy #lizmap-edition-message is still used for save-success / error toasts). * Duplicate toast dispatches removed from legacy/edition.js so the "Edit vertices" / "Draw on the map" toast no longer appears twice. * For point edition the digitizing toolbar is hidden; drawing begins automatically on click. * New baseline locale keys: edition.toolbar.redraw plus four digitizing.toolbar.<tool>.help keys (edit / split / rotate / scaling). * Remove ~120 lines of dead OL2 split helpers from legacy/edition.js (afterReshapeSpliting, beforeFeatureSpliting, afterFeatureSpliting and their editCtrls.reshape / editCtrls.featsplit entries). Builds on the snapping migration. The new digitizing module calls mainLizmap.snapping.reorderSnapInteraction() after adding interactions, so the OL10 Snap follows each new Draw / Modify / Translate. Tests: * 9 spec files updated for OL10 map / interactions (clickOnMapLegacy → clickOnMap, mapOl2 → map, #map → #newOlMap, waitForFunction guards for Select/Modify). * edition-form.spec.js: "must allow modification without creation" now expects #lizmap-editing-message (the new id) for the on-form edit-vertices toast. * editing-copy-paste-geometry.spec.js: mark the 11 interaction tests test.fixme(). They cover behaviour that needs the OL10 GeometryCopy port (lands in the follow-up Copy/Paste PR). * draw.spec.js: mark "Length and angle constraints" test.fixme() — the distance/angle constraint feature is deferred to a follow-up PR. Deferred to follow-up PRs: reshape, parallel offset, move (in edition), distance/angle drawing constraints, split-with-server-save (the digitizing-split button is therefore hidden in edition context for now, remains available in draw context), ReverseGeom port, draw.spec.js new-tool tests and pages/drawpage.js new-tool locators.
* Bind clicks to mainLizmap.map (OL10) in edition context; keep the OL2 click handler for non-edition flows. * Toggle mainLizmap.digitizing.toolSelected = deactivate / restore to pause drawing while copy mode is active, instead of poking the now removed OL2 mainLizmap.edition.drawControl. Without this PR the <lizmap-paste-geom> button rendered by the OL10 digitizing toolbar would still call into the OL2 paths and silently fail on click. Tests: * Un-fixme the 13 editing-copy-paste-geometry.spec.js tests that the edition-baseline PR marked test.fixme(). They cover the OL10 Copy/Paste flow this PR enables.
meyerlor
force-pushed
the
ol10-geometry-copy
branch
from
May 15, 2026 09:18
b725f3f to
1b54cb9
Compare
|
The Lizmap project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 2 months and is being automatically marked as "stale". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migrate Copy/Paste geometry to OL10
click handler for non-edition flows.
pause drawing while copy mode is active, instead of poking the now
removed OL2 mainLizmap.edition.drawControl.
Without this PR the button rendered by the OL10
digitizing toolbar would still call into the OL2 paths and silently fail
on click.