When the projection of TrackShapeLayer change to some other projection (Ex: to use with Google Map) all previously drew shapes appear on the correct position of the map. But when adding new shapes those shapes are still using old projection. (Not appear the place I drew on the map). I’m using TrackOverlay.TrackMode to draw shapes
To overcome this I use TrackEnded event and converted just drew shape into new coordinates using projection. I believe this is not a very good option. And when drawing lines those are only appear on correct position of the map just after changed the coordinates using above said event. The track of the line with mouse doesn’t appear on the map.
What guess is, there should be another layer which hold current drawings before they add into TrackShapeLayer. If there is such layer, how to change the projection of that layer in order to change the projection of current drawings. Do thinkgeo expose such layer? If not, how to deal with this situation? I need to change the projection of my map frequently to use different backgrounds such as Google map, Wms, tif.
I think you have understood it into some extend. Look into the code I past here. When the line is drawing it will not appear on the map until change the coordinates. I'm looking for a solution to that issue. Please add winformsMap1.TrackOverlay.TrackEnded += _TrackOverlay_TrackEnded; line into form_Load event and add another button as buttonDrawLine into the code you sent to me
I think best option is to listen mouse events and change the coordinates using current projection. If I change projection of track shape layer when _TrackOverlay_TrackStarted, then existing features moved away from the map. In my situation I can only keep features in build in track shape layer.
That’s why I suggest you to put the tracked result to another overlay not track overlay, so that, you can change the projection for the track overlay freely. So if you have existed features in the track overlay, try to put them in other overlay in _TrackOverlay_TrackStarted.
I need to keep my old features in track shape layer as this is a bit a complex app and lots of other class refer to this layer for shapes. I think best work around is to use mouse events and change the coordinates according to the projection.
Is your old features have large number? if not, at the start event, you can copy all of them to a temporary layer, then change the projection of track shape layer, at the end event, change the projection back and copy the old features back, also you can keep the new features in the track shape layer.