ThinkGeo.com    |     Documentation    |     Premium Support

TrackOverlay Question

Hello all,


I use sample of code.thinkgeo.com/projects/show/customtrackline to create a line trackshape.


and Get all Coordinates of line trackshape as follows code:


     Protected Overloads Overrides Function MouseDownCore(ByVal interactionArguments As InteractionArguments) As InteractiveResult


        If interactionArguments.MouseButton <> MapMouseButton.Right Then

            System.Console.Write((interactionArguments.WorldX).ToString & vbNewLine)

            System.Console.Write((interactionArguments.WorldY).ToString & vbNewLine)

            coordinates.Add(New Feature(interactionArguments.WorldX, interactionArguments.WorldY))

            Return MyBase.MouseDownCore(interactionArguments)


        Else

            RemoveLastVertexAdded()

        End If

        Return New InteractiveResult()


    End Function


But, how to ended the last track line?


In this sample, I have to double click Mouse button, the track line shape is end.


but it can't get the last coordinate.


If I modify MouseDoubleClickCore like MouseDownCore, I don't know how to end track line shape.


Could you give any idea about:


1. I double click Mouse button, then track shape ended and add its coordinate value to coordinates


2. other method about how to end track shape.


 


 



The purpose of the sample Custum Track Line is to shopw how to track a line left clicking and remove the last vertex right clicking. In your case, I don’t understand very well from your explanation what your goal is exactely. I don’t see very well what you are trying to get accomplished with the coordinates collection. What is the purpose of that collection? Thank you. 


Thanks for your reply, Val 
 Sorry, I explain unclearly. 
 I hope I can use trackoverlay tool to draw polygon/line/point on the map and I want to get value of coordinates collection to create new shp file. 
  
 Or, you can give me other idea to accomplish this purpose. 
  


Carol, 
  
 I think your requrement is not related with this sample, the defaul trackoverlay can fit your requriement. 
  
 Trackoverlay has a property called TrackShapeLayer, every shape which you track is stored here, you can get them and save to the new shp files. 
  
 If I am misunderstand, please let me know and describe the exactly requirement. 
  
 Thanks 
  
 James

Oh~Thanks a lot, James 
 Sorry, I never use TrackOverlay before. :( 
  
 I know how to do it, it works well! :) 


Carol, 
  
 You’re welcome, I am very glad it’s working with you, hope you can play it very well soon. 
  
 Thanks 
  
 James