SketchEditor: Is it possible to remove the halo around selected symbol?

09-13-2018 12:12 PM
New Contributor II

I am using Esri.ArcGISRuntime.UWP 100.3.0

When using the SketchEditor - in point selection mode - the displayed symbol will always have a halo around it:symbol halo.

I assume this is because the selected vertex is always the current point. I tried to remove the white halo by doing the following:

1). SketchEditor.Style.SelectionColor = Color.Transparent. This actually just makes the halo white.

2). SketchEditor.ClearVertexSelection(). This does not seem to do anything in point selection mode. Immediately after calling this, SketchEditor.SelectedVertex is still populated.

When selecting a point, there is no need to have a halo around the selected vertex to differentiate it, so my question is: Is there a way to get rid of the halo?

Here is my symbol for reference:

SketchEditor.Style.SelectedVertexSymbol = new SimpleMarkerSymbol() {       Style = SimpleMarkerSymbolStyle.Cross,       Color = Color.Transparent,       Outline = new SimpleLineSymbol()       {            Color = Color.Red,            Width = 2       },       Size = 20 }



0 Kudos
2 Replies
Esri Regular Contributor

Thanks for your feedback, Jeff. It is currently a known issue for dynamic rendering mode to render transparent color as white. Also any of the vertex methods are only applicable to geometries that allow vertex editing (i.e. Polyline, Polygon) that is why you're not seeing this affect SketchCreationMode.Point. You are right updating SelectedVertexSymbol. However, updating the graphic's selection state is internal and for Point, they are always selected.

To workaround this issue, you can do the following

// Known issue for RenderingMode=Dynamic to render white
// MyMapView.SketchEditor.Style.SelectionColor = Color.Transparent; 

// Workaround make SketchEditor invisible, add geometry to your own GraphicsOverlay
MyMapView.SketchEditor.IsVisible = false;
MyMapView.GraphicsOverlays.Add(new GraphicsOverlay() { Renderer = new SimpleRenderer(new SimpleMarkerSymbol(SimpleMarkerSymbolStyle.Cross, Color.Red, 20)) });
MyMapView.SketchEditor.GeometryChanged += (s, e) =>
      if (MyMapView.GraphicsOverlays[0].Graphics.Count == 0)
          MyMapView.GraphicsOverlays[0].Graphics.Add(new Graphic(e.NewGeometry));
          MyMapView.GraphicsOverlays[0].Graphics[0].Geometry = e.NewGeometry;
0 Kudos
New Contributor II

That workaround is alright, except that you lose the ability to drag the geometry. I've since figured out how to get around this: = Color.FromRgba(0, 0, 0, 0);

Or, since the above property is deprecated in 100.4:
MapView.SelectionProperties.Color = Color.FromRgba(0,0,0,0);
0 Kudos