Skip to content
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

Geometry Editor #1251

Merged
merged 21 commits into from
Jun 20, 2023
Merged

Geometry Editor #1251

merged 21 commits into from
Jun 20, 2023

Conversation

williambohrmann3
Copy link
Collaborator

@williambohrmann3 williambohrmann3 commented Jun 2, 2023

Description

  • Add new sample: Create and edit geometries
  • Feature Create and edit geometries
  • Remove sample: Sketch on map
  • Remove Sketch on map resources from .Net.csproj and .NetFramework.csproj

Type of change

  • New sample implementation

Platforms tested on

  • WPF .NET 6
  • 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)

@williambohrmann3 williambohrmann3 self-assigned this Jun 2, 2023
Copy link

@jnery-yy jnery-yy left a comment

Choose a reason for hiding this comment

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

Great job, @williambohrmann3! All samples are looking very polished.

I just reviewed the WPF bits but most of my suggestions probably apply to other platforms. Please feel free to apply only what you think is necessary. Like if samples team have a prescribed way of doing things, then go with consistency. I think most of my comments are for readability or making things concise.

@duffh
Copy link
Collaborator

duffh commented Jun 6, 2023

Missing nuget package updates to 200.2

@duffh
Copy link
Collaborator

duffh commented Jun 6, 2023

Slightly unintuitive UI when you can select the Freehand Tool but then Point and Multipoint change the tool back to Vertex Tool. Maybe disable these buttons while Freehand Tool is selected?


## Additional information

The sample opens with the ArcGIS Imagery basemap centered on the island of Inis Me�in (Aran Islands) in Ireland. Inis Me�in comprises a landscape of interlinked stone walls, roads, buildings, archaeological sites, and geological features, producing complex geometrical relationships.
Copy link
Collaborator

Choose a reason for hiding this comment

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

The á character is not rendering properly in the sample viewer.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Maybe we change the text to Inishmaan unless you know of a workaround?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think for this case just use a rather than á it's close enough for our purposes.

<UserControl.Resources>
<FontFamily x:Key="Calcite">/Resources/Fonts/calcite-ui-icons-24.ttf#calcite-ui-icons-24</FontFamily>
</UserControl.Resources>
<Grid>
Copy link
Collaborator

Choose a reason for hiding this comment

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

UI looks a little cramped and maybe a little too large.

xmlns:esriUI="clr-namespace:Esri.ArcGISRuntime.Maui;assembly=Esri.ArcGISRuntime.Maui">
<Grid>
<esriUI:MapView x:Name="MyMapView" GeoViewTapped="MyMapView_GeoViewTapped" />
<Grid Margin="5,5,5,5"
Copy link
Collaborator

Choose a reason for hiding this comment

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

UI doesn't fit on the screen on mobile in horizontal orientation.

Copy link
Collaborator

@duffh duffh left a comment

Choose a reason for hiding this comment

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

Looks good, just a few comments just now.

Copy link

@jnery-yy jnery-yy left a comment

Choose a reason for hiding this comment

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

Thanks for the update, just few more questions; but otherwise, I think it's much closer to done!


// Account for case when vertex tool is selected and geometry editor is started with a polyline or polygon geometry type.
// Ensure point and multipoint buttons are only enabled when the selected tool is a vertex tool.
PointButton.IsEnabled = MultipointButton.IsEnabled = !_geometryEditor.IsStarted && tool is VertexTool;
Copy link

Choose a reason for hiding this comment

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

Is this needed when DisableOtherGeometryButtons(..) was called by start polyline/polygon button click?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't believe this is technically necessary. But is it worth adding a geometry editor type conditional check around this?

GeometryType geometryType = _selectedGraphic.Geometry.GeometryType;
if (geometryType == GeometryType.Point || geometryType == GeometryType.Multipoint)
{
ToolComboBox.SelectedIndex = 0;
Copy link

Choose a reason for hiding this comment

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

I think we want VertexTool to always be the default.
Allowing users to change it to Freehand when Polyline/Polygon seem enough. Which you're doing by handling the ComboBox.SelectionChanged event

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If user has freehand tool enabled, selects a polyline/polygon, no need to change the tool to vertex tool. But if they have freehand tool enabled, select a point/multipoint, it is necessary to change the tool to a vertex tool.

_polygonSymbol = new SimpleFillSymbol(SimpleFillSymbolStyle.Solid, Color.FromArgb(70, 255, 0, 0), polygonLineSymbol);

// Create geometry objects from JSON formatted strings.
var houseCoordinates = (MapPoint)Geometry.FromJson
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd pull these json strings out of the method as constant strings, it just tidies up readability. We do this in other samples.

Copy link
Collaborator

@duffh duffh left a comment

Choose a reason for hiding this comment

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

Looking better!

Copy link

@jnery-yy jnery-yy left a comment

Choose a reason for hiding this comment

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

LGTM, thanks 👍

@williambohrmann3
Copy link
Collaborator Author

Checks are failing because of lowercase screenshot name for MAUI.

@duffh
Copy link
Collaborator

duffh commented Jun 16, 2023

Checks are failing because of lowercase screenshot name for MAUI.

Looks like the README check is failing as the metadata is inconsistent, the difference is that I think it is expecting a .png image but we are using a .jpg for our screenshot. I'll take a look at the check.

@duffh
Copy link
Collaborator

duffh commented Jun 16, 2023

The checks are failing because the screenshot should be a .jpg file not a .png. If you update this both checks should pass.

@williambohrmann3 williambohrmann3 merged commit 4f8a680 into v.next Jun 20, 2023
@williambohrmann3 williambohrmann3 deleted the wbohr/GeometryEditor branch June 20, 2023 15:09
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