Skip to content

Allow adding a new part to multipart geometries#4496

Open
uclaros wants to merge 1 commit into
masterfrom
multipart-editing
Open

Allow adding a new part to multipart geometries#4496
uclaros wants to merge 1 commit into
masterfrom
multipart-editing

Conversation

@uclaros

@uclaros uclaros commented May 15, 2026

Copy link
Copy Markdown
Contributor

New feature for adding parts to multipart features.

Works with MultiPoint, MultiLineString and MultiPolygon layers.

Peek 2026-05-15 17-37

The button is not available for singlepart layers.

@github-actions

Copy link
Copy Markdown

Coverage Report for CI Build 25923332422

Coverage increased (+0.1%) to 58.031%

Details

  • Coverage increased (+0.1%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 107 coverage regressions across 2 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

107 previously-covered lines in 2 files lost coverage.

File Lines Losing Coverage Coverage
mm/app/maptools/recordingmaptool.cpp 106 68.28%
mm/app/position/providers/simulatedpositionprovider.cpp 1 91.67%

Coverage Stats

Coverage Status
Relevant Lines: 15247
Covered Lines: 8848
Line Coverage: 58.03%
Coverage Strength: 100.8 hits per line

💛 - Coveralls

@github-actions

Copy link
Copy Markdown

📦 Build Artifacts Ready

OS Status Build Info Workflow run
macOS Build 📬 Mergin Maps 68491 dmg Expires: 13/08/2026 #6849
linux Build 📬 Mergin Maps 68671 x86_64 Expires: 13/08/2026 #6867
win64 Build 📬 Mergin Maps 60431 win64 Expires: 13/08/2026 #6043
Android Build 📬 Mergin Maps 815951 APK [arm64-v8a] Expires: 13/08/2026 #8159
📬 Mergin Maps 815951 APK [arm64-v8a] Google Play Store #8159
Android Build 📬 Mergin Maps 815911 APK [armeabi-v7a] Expires: 13/08/2026 #8159
📬 Mergin Maps 815911 APK [armeabi-v7a] Google Play Store #8159
iOS Build Build failed or not found. #9101

@uclaros uclaros linked an issue May 19, 2026 that may be closed by this pull request

@tomasMizera tomasMizera left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Comment on lines +1155 to +1156
// if maptool is in GRAB and VIEW state, no part should be added
if ( mState == RecordingMapTool::View || mState == RecordingMapTool::Grab )

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@uclaros why not? :)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking View is a great state to add a new part

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The state is set to Record in qml before invoking this method. This is kind of a safeguard that the method doesn't get called properly.

Should I set the state in cpp and just call startDigitizingNewPart() from qml?

Comment thread app/qml/map/MMMapController.qml

@Withalion Withalion left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rebase the PR on current master so the builds pass and run astyle to fix the formatting issue

Comment thread app/qml/map/MMMapController.qml
Comment thread app/qml/map/MMMapController.qml

function addPart( featurepair) {
__activeProject.setActiveLayer( featurepair.layer )
root.centerToPair( featurepair )

@uclaros uclaros Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
root.centerToPair( featurepair )

I think this is a bad idea and would like to remove it (also from split and redraw logic).
User is centered to the geometry when identifying it, then if he has panned the map he is re-centered a second time when tapping Edit geometry.
I think it is very probable that the user has already panned the map to where he wants to add the new part / split / redraw and we're just forcing him back to the original geometry location!

@IvaKuklica

IvaKuklica commented Jun 11, 2026

Copy link
Copy Markdown

@uclaros
Comment for Add Part - New Feature for Multipart Geometry - Remove button incorrectly displayed as active when entering Add Part mode

Actual result:

  1. When the user enters Add Part mode for all multipart geometry types feature via Edit → Edit Geometry → More → Add Part, the Remove button in the bottom toolbar is displayed as active even though no points have been added yet to the new part.

Expected result:

  1. The Remove button should be inactive/disabled at this stage as there are no points to remove.
  2. The issue is reproducible across all multipart geometry types: MultiPoint, MultiLineString and MultiPolygon layers.
Screen_Recording_20260610_152928.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add part of multiline and polygon feature

4 participants