ThinkGeo.com    |     Documentation    |     Premium Support

Editing features

I am evaluating Map Suite 3.0 Desktop Edition so I am unfamiliar with the product.  I need to edit a line feature.  What I would like to do is to click near the line, find the closest vertex to the mouse location, and attach that vertex of the line to the mouse (the vertex moves as the mouse moves) until the next mouse click.  At that time, the feature is written back to the source and the source refreshed.  For evaluation purposes, I am working with shape files, but the final product will use SQL Server.


I can already click near the line and get the desired feature.  I can highlight the feature,  I can get the nearest  vertex, or at least get a vertex value  within the vertex collection of the line.  As I move the mouse ater these steps, I can see that something is happening.  The 'unlicensed' watermark moves around.  The redraw process takes too long, and the line doesn't display as I would expect.


Am I overengineering this?  Is there a simple way to do what i want to do?  Is there sample code for this procedure?



Charles, 
  
 Thanks for evaluating our Desktop Edition! As we will have the Beta 2 release pretty soon (around 22th this month) which will have the Track & Edit feature integrated, can you wait some days for that and everything should be easier then. Now to implement this, too much work on the user end. 
  
 Sorry for the inconvenience now. We will keep adding features to it and I am sure it will be a great component when it is finally released. 
  
 Thanks, 
  
 Ben 


Beta 2 works quite well for editing features.  I have a few questions. 
  
 1.  I noticed that both the left and right mouse buttons drag the map.  I use the right mouse to toggle between features when selecting features to edit.  If I move the mouse at all between clicks, the winformsmap1.MouseClick event seems to fire intermittently. 
  
 2.  Once a feature is added to the EditOverlay it must still be clicked to start the edit process.  Can this step be automated?  Since I only add one feature to the EditOverlay at a time, skipping this step would be a plus. 
  
 3.  When in editing mode, all of the vertices of the feature are highlighted.  I notice there are a few extra markers.  One appears to enlarge the feature as if it is a bounding box.  Another rotates the feature.  Can these be toggled on and off depending on the type of edit I want to do? 
  
 4.  Is there a method to delete a vertex? 


Charles,


Here are the answers.
 
1, we recommended you to use Map1.MapClick event, which will be raised when mouse down’s position is identical to mouse up’s position, and not in track shape mode. So if you are in Track Polygon Mode for example (Map1.EditOverlay.TrackMode = TrackMode.Polygon), that event will not be raised. And if you drag a feature in Edit Mode, it will not be raised either. Maybe that’s what you need.
 
2, I’m afraid we cannot do it in this Beta. We are now optimizing its architecture to make it more extensible; I think you can easily accomplish that maybe in the next release.
 
3, There are a couple of switches like IsResizable, IsRotatable. Please see the snap short below.


4, we do not have this feature now. That’s an interesting requirement though and I will write down on our list for further discussion, thanks for the insights.
                       
 
Any queries please let us know.
 
Ben