Skip to content

[New sample] Snap geometry edits with utility network rules#1566

Merged
duffh merged 19 commits intov.nextfrom
hduff/snapgeometrywithrules-sample-
Mar 21, 2025
Merged

[New sample] Snap geometry edits with utility network rules#1566
duffh merged 19 commits intov.nextfrom
hduff/snapgeometrywithrules-sample-

Conversation

@duffh
Copy link
Copy Markdown
Collaborator

@duffh duffh commented Mar 17, 2025

Description

Added new sample to demonstrate how to use the GeometryEditor to edit geometries using utility network connectivity rules.

Type of change

  • New sample implementation

Platforms tested on

  • WPF .NET 8
  • WPF Framework
  • WinUI
  • MAUI WinUI
  • MAUI Android
  • MAUI iOS
  • MAUI MacCatalyst

Checklist

  • Self-review of changes
  • All changes work as expected on all affected platforms
  • There are no warnings related to changes
  • Code is commented and follows .NET conventions and standards
  • Codemaid and XAML styler extensions have been run on every changed file
  • No unrelated changes have been made to any other code or project files
  • Screenshots are correct size and display in description tab (800 x 600 on Windows, MAUI mobile platforms use the MAUI Windows screenshot)

@duffh duffh requested a review from williambohrmann3 March 17, 2025 20:22
@duffh duffh self-assigned this Mar 17, 2025
Copy link
Copy Markdown
Contributor

@williambohrmann3 williambohrmann3 left a comment

Choose a reason for hiding this comment

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

Sample works great! Overall, minor feedback. Regarding unrelated changes to other metadata json files, if you can undo those on this branch, PR #1565 addresses cases where we have multiple redirect links.


Snap sources can be enabled and disabled. Snapping will not occur when `SnapRuleBehavior.RulesPreventSnapping` even when the source is enabled.

To interactively snap a vertex to a feature or graphic, ensure that snapping is enabled for the relevant snap source, then move the mouse pointer or drag a vertex to nearby an existing feature or graphic. If the existing feature or graphic has valid utility network connectivity rules for the asset type that is being created or edited, the edit position will be adjusted to coincide with (or snap to) edges and vertices of its geometry. Tap or release the touch pointer to place the vertex at the snapped location.
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.

then move the mouse pointer or drag a vertex to nearby an existing feature or graphic

I'd rephrase this to

"then move the mouse pointer or drag a vertex close to an existing feature or graphic"

WidthRequest="10" />
<Label Text="RulesPreventSnapping" />
</StackLayout>
<Button Clicked="SnapSourcesButton_Clicked" Text="Close" />
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.

Your choice, but I think this button could be removed. A tap gesture recognizer when tapping a semitransparent border would work since you're following the popup UI pattern, alike the TakeScreenshot MAUI sample.

Copy link
Copy Markdown
Collaborator Author

@duffh duffh Mar 20, 2025

Choose a reason for hiding this comment

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

I thought about using a tap gesture recognizer here as well, I tried with and without and I think I prefer the button in this case. Mostly because we don't need a scroll view here so it's easy to see the snap sources and the close button all together.

If you're happy I'll leave it in.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Changed my mind and removed it 👍

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.

ui bug

My apologies, the TakeScreenshot sample wasn't a great example since tapping anywhere on screen closes the screenshot "popup". Tapping anywhere in the popup, say the snap source checkbox shouldn't close the popup automatically. But tapping the greyed out GeoView should close out the popup. DisplayGrid is a better sample of what I meant by the popup UI pattern.

AUsHWPooVo

The problem was the grid with the greyed out the semitransparent background was the parent of the popup, so tapping the popup was also tapping the grid due to inheritance. I went ahead and separated the popup background from the actual popup (indention is why the diff is large, did not make any other edits).

commit: 6fbb6b1

@duffh duffh requested a review from williambohrmann3 March 20, 2025 11:15
duffh and others added 2 commits March 20, 2025 15:11
allows us to edit the snap sources without automatically closing the popup; tapping the greyed out geoview ("popup background") is required to close popup
Copy link
Copy Markdown
Contributor

@williambohrmann3 williambohrmann3 left a comment

Choose a reason for hiding this comment

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

Nice addition to our samples offering :)

@duffh duffh merged commit 54f1781 into v.next Mar 21, 2025
2 checks passed
@duffh duffh deleted the hduff/snapgeometrywithrules-sample- branch March 21, 2025 15:27
williambohrmann3 added a commit that referenced this pull request Apr 8, 2025
Co-authored-by: Prathamesh Narkhede <55591622+prathameshnarkhede@users.noreply.github.com>
Co-authored-by: William Bohrmann <wbohrmann@esri.com>
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.

3 participants