Feat/routing marker drag - #926
Open
JoselinGuevaraHoppe wants to merge 2 commits into
Open
Conversation
JoselinGuevaraHoppe
requested review from
czirkelbach,
dopenguin,
oeninghe-dataport,
raschju and
warm-coolguy
as code owners
August 10, 2026 09:23
dopenguin
removed request for
czirkelbach,
oeninghe-dataport,
raschju and
warm-coolguy
August 10, 2026 11:51
dopenguin
requested changes
Aug 10, 2026
dopenguin
left a comment
Member
There was a problem hiding this comment.
I should not be able to modify a feature while I am actively adding a new coordinate. It may also cause issues with other plugins. Please take a look at coreStore.maskInteraction and how this is handled for Draw in routing for both.
Comment on lines
+49
to
+55
| route.value = markerSource.getFeatures().map((feature) => { | ||
| const geometry = feature.getGeometry() | ||
| if (geometry instanceof Point) { | ||
| return geometry.getCoordinates() | ||
| } | ||
| return [] | ||
| }) |
Member
There was a problem hiding this comment.
This has two issues
- If I only have one input filled, the second (currently empty) input is removed. Only the modified feature / coordinate should be updated
- If I enter both coordinates, then update the first feature, the coordinate in the second input gets updated as well. This should not be the case.
| }) | ||
| map.addInteraction(modify) | ||
|
|
||
| map.on('pointermove', function (evt) { |
Member
There was a problem hiding this comment.
This should be placed above addInteraction just like the modifyend-event-handler.
| }) | ||
| map.addInteraction(modify) | ||
|
|
||
| map.on('pointermove', function (evt) { |
Member
There was a problem hiding this comment.
A normal function may be usable here, but an arrow function should be favoured.
| map.on('pointermove', function (evt) { | ||
| const pixel = map.getEventPixel(evt.originalEvent) | ||
| const hit = map.hasFeatureAtPixel(pixel) | ||
| map.getTargetElement().style.cursor = hit ? 'pointer' : '' |
Member
There was a problem hiding this comment.
The cursor should rather be grab if the user is hovering a feature and grabbing while modifying the feature.
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.
Summary
Add a dragging-feature to the markers of an existing route.
Instructions for local reproduction and review