Get modified feature in DotSpatial.Plugins.ShapeEditor

Dec 18, 2012 at 8:08 AM
Edited Dec 18, 2012 at 8:33 AM

Hi all !

I'm trying using DotSpatial.Plugins.ShapeEditor for my app. But i don't know get modified feature after i'm edit it with "Move Vertex" tools.

Please help me get modified feature !

Thank all !

Sorry ! i'm poor English !

Dec 19, 2012 at 3:38 AM
Edited Dec 20, 2012 at 1:18 AM

I'm current testing my idea !

// Modified comment

Dec 19, 2012 at 1:03 PM

Hi trungdung143 !

if you did you solve this issue please publish it for others who have the same doubts as yours to find solutions to this discussions.

 

Dec 20, 2012 at 1:09 AM

@Camiza

I'm currently testing its accuracy and performance. I'm publish soon !


I think need to add an attribute to mark the change of a Feature or FeatureSet in the solutions may be more convenient for us.

Dec 20, 2012 at 3:28 PM

that sounds great!!!

thanks trungdung143

Dec 25, 2012 at 1:39 AM
Edited Dec 25, 2012 at 1:45 AM

@Camiza:

I'm use a list feature  contain the feature modified.
The list add an objects when perform function "OnMouseUp" in class "
MoveVertexFunction"

 

 

private List<Feature> _listEdit = new List<Feature>();

-----------------------OnMouseUp---------------------
 if (e.Button == MouseButtons.Left && _dragging) { _dragging = false; Map.IsBusy = false; _featureSet.InvalidateVertices(); Feature edit = new Feature(); if (_featureSet.FeatureType == FeatureType.Point || _featureSet.FeatureType == FeatureType.MultiPoint) { if (_activeFeature == null) { return; } if (_layer.GetCategory(_activeFeature) != _selectedCategory) { _layer.SetCategory(_activeFeature, _selectedCategory); _layer.SetVisible(_activeFeature, true); } if (this.Enabled == true) { edit = (Feature)_activeFeature; for (int i = 0; i < _listEdit.Count; i++) { if (_listEdit[i].Fid == edit.Fid) { _listEdit.Remove(_listEdit[i]); } } _listEdit.Add(edit); } } else { if (_selectedFeature == null) { return; } if (_layer.GetCategory(_selectedFeature) != _selectedCategory) { _layer.SetCategory(_selectedFeature, _selectedCategory); } if (this.Enabled == true) { edit = (Feature)_selectedFeature; for (int i = 0; i < _listEdit.Count; i++) { if (_listEdit[i].Fid == edit.Fid) { _listEdit.Remove(_listEdit[i]); } } _listEdit.Add(edit); } } } Map.MapFrame.Initialize();

My code is stupid and contains some bugs but it satisfies my problem !
I'm don't edit DotSpatial Core because when it updates by DotSpatial Team, the application will fail

Sorry ! i'm poor English !