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

MeasureToolbar: Hides active sketch editor when no measure mode is selected #226

Open
jNery-zz opened this issue Aug 2, 2018 · 1 comment

Comments

@jNery-zz
Copy link

jNery-zz commented Aug 2, 2018

MeasureToolbar: Hides active sketch editor when no measure mode is selected

Workaround:

  • Ensure SketchEditor.IsVisible before starting a sketch

To reproduce:

  • Add MeasureToolbar and assign to the same MapView
  • Start Draw/Edit with default SketchEditor, no draw feedback is drawn
        xmlns:esri="http://schemas.esri.com/arcgis/runtime/2013">
    <Grid>
        <esri:MapView x:Name="MyMapView"/>
        <Button VerticalAlignment="Top" HorizontalAlignment="Right" Content="Draw" Click="OnDraw"/>
        <esri:MeasureToolbar x:Name="MyMeasureToolbar" MapView="{Binding ElementName=MyMapView}" VerticalAlignment="Top" HorizontalAlignment="Left"/>
    </Grid>
        public MainWindow()
        {
            InitializeComponent();

            MyMapView.Map = new Map(Basemap.CreateTopographic());
        }

        private async void OnDraw(object sender, RoutedEventArgs e)
        {
            try
            {
                // MyMapView.SketchEditor.IsVisible = true; // workaround
                var geometry = await MyMapView.SketchEditor.StartAsync(SketchCreationMode.Rectangle, false);
                var _ = MyMapView.SetViewpointAsync(new Viewpoint(geometry));
            }
            catch (TaskCanceledException)
            {

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, ex.GetType().Name);
            }
        }

Relevant code: https://github.com/Esri/arcgis-toolkit-dotnet/blob/master/src/Esri.ArcGISRuntime.Toolkit/Esri.ArcGISRuntime.Toolkit/UI/Controls/MeasureToolbar/MeasureToolbar.cs#L243
Add a check that one of the modes that need SketchEditor has been enabled before hiding current SketchEditor.

@williambohrmann3
Copy link
Collaborator

TODO: try to repro this with new GeometryEditor

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

No branches or pull requests

2 participants