Can't move a rectangle just created

3349
13
05-31-2017 07:14 PM
xiaoguangyan
New Contributor III

I happen to meet a strange problem, I use the "SketchEditor" to draw some geometry then use geometry to create feature and save them in different types of featurecollectiontables, WHEN I create " rectangle feature", I move it and save, the feature position remain unchange,all other like circle,polygon etc don't have this issue! so strange!

Tags (1)
13 Replies
dotMorten_esri
Esri Frequent Contributor

Could you share a little sample that reproduces the issues with more detailed steps how to reproduce?

0 Kudos
xiaoguangyan
New Contributor III

Thanks, I will post the sample later, but now I have another question, when using "SketchEditor" to draw geometry in 10.2.7, the geometry can be draged by choosing whole area like drag a polygon ; but in 100.0 , I can only drag by choosing outline, I wanna drag things like in 10.2.7

0 Kudos
dotMorten_esri
Esri Frequent Contributor

I believe for polygons the default is to not allow move. You can use the SketchEditConfiguration and set AllowMove=true.

0 Kudos
xiaoguangyan
New Contributor III

Hi Morten Nielsen
I have set AllowMove to True, I mean I can't move a polygon by draging it's area, but can move it by draging it's outline, in 10.2.7, we can move a polygon by draging it's area.

the pic up is ArcGIS Runtime SDK for .NET 10.2.7 samples----Editing------Draw and Edit Graphics,here we can move a polygon by draging it's area.

0 Kudos
JenniferNery
Esri Regular Contributor

Hi Xiaguang,

You might be hitting some of the expected behavior changes with SketchEditor.

SketchEditor.StartAsync(SketchCreationMode.Rectangle) 

is equivalent to

var geometry = await Editor.RequestShapeAsync(DrawShape.Rectangle);
geometry = await Editor.EditGeometryAsync(geometry);‍‍‍‍

Unless you specify optional parameter drawAndShape to false (default value: true), your draw will continue in edit mode.

You can also complete draw/edit using CompleteCommand just as before

Using command binding

<Button Content="Complete"
        Command="{Binding ElementName=MyMapView, Path=SketchEditor.CompleteCommand}" />

or programmatically invoking command

if (MyMapView.SketchEditor.CompleteCommand.CanExecute(null))
    MyMapView.SketchEditor.CompleteCommand.Execute(null);

To move the geometry, you tap on the outline of polyline/polygon while in edit mode. Once outline is highlighted, you can drag the feature just as before.

In 10.2.x, you may drag the feature right away but this may have caused unintentional edit (moved vertices/geometry by mistake). You also may complete interactively by tapping the geometry but this may have caused unintentional completion and also did not allow a vertex be added inside the geometry.

As Morten mentioned, there are default configurations in SketchEditConfiguration. You may have noticed that AllowVertexEditing is only enabled by default for SketchCreationMode.Polyline/Polygon or Polygon/Polyline geometry but AllowMove should be enabled for all types and you should be able to override default edit configuration.


I hope that works. Please let us know, otherwise. Thanks.

0 Kudos
xiaoguangyan
New Contributor III

Hi, Jennifer

I think in 10.2.7 is more convenient, because in 100 moving polygon by dragging outline is kind of hard to choose.

0 Kudos
JenniferNery
Esri Regular Contributor

I know this is quite an old post but EditConfiguration has `RequireSelectionBeforeDrag` property since v100.2 when set to false will have the same 10.2.x behavior geometry or vertex/scale/rotate tools can be dragged without being tapped or highlighted first.

0 Kudos
xiaoguangyan
New Contributor III

Hi Jennifer

   

I set EditConfiguration property`RequireSelectionBeforeDrag`  to false, and it's the same, I have to tap the outline and highlight it then I can move the polygon by drag the outline other than the polygon area

0 Kudos
JenniferNery
Esri Regular Contributor

Hi Xiaoguang, 

`RequireSelectionBeforeDrag` only changes the behavior of when a geometry or tool (vertex, scale, rotate) gets moved, it would be immediate once dragged, no need to tap/highlight. But you are right, in 10.2.x, one can drag geometry from the fill/area and in 100.x one can drag geometry only from its outline. The reason for this design is to allow vertices to be added/moved inside the geometry fill as well which was a limitation in 10.2.x. I will forward this request to runtime design lead for consideration. We have also included in 100.2.x enhancements ability to select, insert/move/delete vertices programmatically - I'm not sure if helps your current workflow.

Meanwhile, if it's a challenge to select the polygon outline, you might want to update SketchEditor.Style.

// change symbol
MyMapView.SketchEditor.Style = new SketchStyle()
{
    LineSymbol = new SimpleLineSymbol(SimpleLineSymbolStyle.Solid, Colors.Green, 8)
};

// or just increase width of default symbol
(MyMapView.SketchEditor.Style.LineSymbol as LineSymbol).Width = 8;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

You may also at any time without restarting your draw/edit turn on/off any of the configuration

<CheckBox Content="VertexEditing" IsChecked="{Binding ElementName=MyMapView, Path=SketchEditor.EditConfiguration.AllowVertexEditing, Mode=TwoWay}"/>‍‍

Hopefully, these make interacting with polygon outline better.

0 Kudos