Migrate snapping from OL2 to OL10#6828
Open
meyerlor wants to merge 1 commit into
Open
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.
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.
Picking up the work of my previous attempt to migrate the edition tools to OL10 - i tried to atomize the needed changes as much as possible to make reviewing easier. This is the first of 3 PR's in the initial pipeline, targeting only the snapping function. Opening those other two PR's as draft, they are based on this PR subsequently.
This PR's scope:
Tests:
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.
Note: The provided gif shows the snapping function is working on my testsystem where the follow up PR's are merged already:
