I am currently using the Snap to Grid overrides mentioned in the posted project to snap vertices to a grid of points. However, if the object is a Line shape or MultiPoint Line Shape, I would also like to have the option to drag all the object vertices at once by dragging the crosshair icon as in the normal EditFeatureLayer behavior. How is it possible to add this functionality back in and retain the Snap to Grid overrides?
Moving Line Shape on Snap to Grid
Damian,
Thanks for your post!
Can you provide the link to the posted project you are referring to where it snaps vertices to a grid of points? I took a look at the SnappingToVertex sample at wiki.thinkgeo.com/wiki/Map_Suite_All_Samples#Snapping_to_Vertex and I was able to turn back on the dragging by setting the following property equal to true.
winformsMap1.EditOverlay.CanDrag = true;
Hope this helps.
Thanks!
Hi Clint,
Sorry for the delayed reply. Attached is a test project based on the SnapToLayer project.
Notice that there is an object loaded from a well known text line string. I would like to be able to drag the entire line string around the drawing area as well as be able to drag the control points to the snapping grid.
Thanks,
Damian
Damian,
Before we provide you with your sample with the necesary modifications, we want to make sure with you exactely what you want:
-You want to be able to drag the linestring as a whole. While dragging, it shows the line itself with its control points
-When a control point is within the tolerance of one of the point of the grid, it is going to snap the entire line to it based on the control point.
Is it the exact bahavior you want?
If not, can you please explain with as many details as possible what is the expected behavior?
Thank you.
Hi Val,
One minor clarification regarding the following statement:
-When a control point is within the tolerance of one of the point of the grid, it is going to snap the entire line to it based on the control point.
Specifically, if the entire linestring is being dragged, then it should snap to the grid based on which ever point is in tolerance. This preserves the line orientation. However, if a specific control point in a linestring is being dragged, it must snap only that control point to the grid. This method would potentially be altering the orientation.
It’s very much akin to how Powerpoint works (sorry if that’s a lame comparison).
Thanks,
Damian
Damian,
Thank you for the clarification. I think I understand exactely what you expect now. We will work on doing the necesary modifications to SnapToLayer sample app for your needs this afternoon. We wil send you the sample as soon as it is finished. Thank you.
Damian,
We had to fix a minor bug while writing your little sample. Tomorrow, we should have the solution for you. Thank you.
Damian,
Please, see the attached file. It contains the modified SnapToLayer sample according to your specifications. As I mentioned before, we uncovered a bug, so you will need to go to the Customer Portal and get the build 5.5.35.0 that contains the fix.
SnapToLayer_20111215.zip (153 KB)
Hi Val,
I’ve downloaded the solution zip file. Also, I went to the customer portal and downloaded the Daily Production Build for Desktop Edition found here. Note, it’s already updated to 5.5.0.38.
helpdesk.thinkgeo.com/FileItem.axd?fileitemid=e2503cd3-e3b2-4938-9059-6f3789b62792&Identity=00aa6caf-d247-42ac-b431-14748944b2e3
However, when I copy these files into my licensed 5.5.0 version, I get a license expired error. So, I restored my old dll for 5.5.0 and tried the solution which seems to work with the 5.5.0 dll with the exception that the dragged line doesn’t snap to any of the control points (which I assume is the bug you mentioned).
Can you please advice to the daily builds? I’ve never had to use a daily build before, so maybe I’m doing it wrong. Maybe I should be getting the Development build instead of the Production build?
Thanks for your help on this fix. It looks good so far.
Sorry, I downloaded the evaluation version accidentally.
I’ve got the right licensed DLL now and it looks to be working well.
Thanks very much for your help.
Damian
Damian,
You are very welcome. If you have any other questions, let us know.