-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PB-1212: Allow delete last point by button when on line editing mode. #1138
base: develop
Are you sure you want to change the base?
PB-1212: Allow delete last point by button when on line editing mode. #1138
Conversation
…d vertex button overlay
web-mapviewer Run #3902
Run Properties:
|
Project |
web-mapviewer
|
Branch Review |
pb-1212-allow-delete-last-point-on-editing-mode
|
Run status |
Passed #3902
|
Run duration | 04m 01s |
Commit |
7ba9206170: PB-1212: Fix vue warning wrong type for props and improve code for add vertex bu...
|
Committer | Ismail Sunni |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
0
|
Flaky |
0
|
Pending |
21
|
Skipped |
0
|
Passing |
212
|
View all changes introduced in this branch ↗︎ |
@@ -38,6 +39,33 @@ const isDrawingLineOrMeasure = computed(() => | |||
currentDrawingMode.value | |||
) | |||
) | |||
const selectedEditableFeatures = computed(() => store.state.features.selectedEditableFeatures) | |||
const selectedLineString = computed(() => { | |||
if (selectedEditableFeatures.value && selectedEditableFeatures.value.length > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (selectedEditableFeatures.value?.length > 0) {
is fine too
const selectedEditableFeatures = computed(() => store.state.features.selectedEditableFeatures) | ||
const selectedLineString = computed(() => { | ||
if (selectedEditableFeatures.value && selectedEditableFeatures.value.length > 0) { | ||
const selectedFeature = selectedEditableFeatures.value[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can there be more than one feature selected while drawing?
if ( | ||
selectedFeature.geometry.type === 'LineString' && | ||
(selectedFeature.featureType === EditableFeatureTypes.LINEPOLYGON || | ||
selectedFeature.featureType === EditableFeatureTypes.MEASURE) | ||
) { | ||
return selectedFeature | ||
} | ||
} | ||
return null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if not, we could transform this in a simple
return selectedEditableFeatures.value.find((feature) => {
return feature.geometry.type === 'LineString' &&
[EditableFeatureTypes.LINEPOLYGON, EditableFeatureTypes.MEASURE].includes(feature.featureType))
})
Which will also return null
if there's no match
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when finishing editing/adding more point to a line measure, the last point is sometimes automatically removed, there might be some call to the remove function where it shouldn't be
Test link