ThinkGeo.com    |     Documentation    |     Premium Support

How to modify trace of trackoverlay

Hi Team of thinkgeo

I have the next poblem, 2 months ago I started working with snap points (you are near of a vertex and automatically this point is highlighted), when I do click near of one highlighted point, I want my current trace of a line or poligon move to this point.


I would like to know how modify the content of trackoverlay??.

Currently I set trackoverlay invisible and I put the feature traced in trackoverlay in another layer (inmemoryfeaturelayer) but the problem in this case is that I lose the trace of my line or polygon becouse 

trackoverlay has this trace and this is invisible..


 


  


I don´t know if you understand my problem because 1 mounth ago I posted the same problem but I haven´t received help.


I've attached a picture trying to explain better my problem


thanks for your time


 


 


TrackOverlay.TrackShapeLayer.InternalFeatures.Clear()


 


TrackOverlay.TrackShapeLayer.InternalFeatures.Add(featureChanged)



1532-snap.png (27.4 KB)

Abraham,


Thanks for your post.
 
I am not hundred sure about your requirement, recently, we have done a support on the snapping, hope it was something you are searching:
gis.thinkgeo.com/Support/Dis...fault.aspx
 
Also, we have a application in our code community:
code.thinkgeo.com/projects/show/snappingtovertex
 
If you could find the post you did 1 month ago for your requirement, that would be helpful.
 
Any more questions just feel free to let me know.
 
Thanks.
 
Yale

Hi Yale 
 well i think I haven´t explained,  
  
 is there a way to modify trackoverlay?? or where is saved this  TrackOverlay.GetTrackingShape  
 Look I tryed with this code : 
  
 TrackOverlay.TrackShapeLayer.InternalFeatures.Clear() 
 TrackOverlay.TrackShapeLayer.InternalFeatures.Add(featureChangedBySnapPoints) 
  
 That is good, it puts my modified feature (featureChangedBySnapPoints) in the way I’m waiting but TrackOverlay.GetTrackingShape has another feature, and this feature is still there, although I have done this TrackOverlay.TrackShapeLayer.InternalFeatures.Clear()… 
  
 Now, the question is this??  
 Can I modify the origen where is gotten the content of this TrackOverlay.GetTrackingShape?, or can I modify the feature that I’m drawing currently?, not in EditOverlay (I have done this, modify vertex, and it works).   
  
 Thanks a lot.

Hi Yale 
 well i think I haven´t explained,  
  
 is there a way to modify trackoverlay?? or where is saved this  TrackOverlay.GetTrackingShape  
 Look I tryed with this code : 
  
 TrackOverlay.TrackShapeLayer.InternalFeatures.Clear() 
 TrackOverlay.TrackShapeLayer.InternalFeatures.Add(featureChangedBySnapPoints) 
  
 That is good, it puts my modified feature (featureChangedBySnapPoints) in the way I’m waiting but TrackOverlay.GetTrackingShape has another feature, and this feature is still there, although I have done this TrackOverlay.TrackShapeLayer.InternalFeatures.Clear()… 
  
 Now, the question is this??  
 Can I modify the origen where is gotten the content of this TrackOverlay.GetTrackingShape?, or can I modify the feature that I’m drawing currently?, not in EditOverlay (I have done this, modify vertex, and it works).   
  
 Thanks a lot.

Hi Yale, 
 Well I think I have found the solution of my problem, look … 
  
 class SnappingToTrackOverlay : TrackInteractiveOverlay 
     { 
          protected override InteractiveResult MouseClickCore(InteractionArguments interactionArguments) 
         { 
             interactionArguments.WorldX = NewWorldXOfSnapPoint; 
             interactionArguments.WorldY = NewWorldXOfSnapPoint; 
             return base.MouseClickCore(interactionArguments); 
         } 
  } 
  
 and with this I can modify the current trace I’m drawing… 
  
 thanks for your time 
  
 regards 


Abraham, 
  
 Thanks for your sharing, I appreciate it very much. 
  
 Any more questions just feel free to let me know. 
  
 Thanks. 
  
 Yale 


Hi 
 How can I put one feature in the border of other… 
 No more, no less, in the exactly border, something like snap but over polygons… 
  
 For example 
 I have a layer of cities and move one city but i would like to get back in the correct place…

Abraham,


Thanks for your post and question.


I am not exactly sure about your new requirement here, while following 2 samples are talking about how to make the snapping logic with Map Suite 3.x Desktop edition, Could you have a try on them? If they do not satisfy you requirement, please feel free to let me know.


code.thinkgeo.com/projects/show/snaptolayer

code.thinkgeo.com/projects/show/snappingtovertex


Thanks.


Yale