ThinkGeo.com    |     Documentation    |     Premium Support

Display lat/long in label text for a GPS feature on map

I am following the EfficientlyMoveAPlaneImage sample in the C# WPF VS 2008 project. However, instead of using the great circle arc I am using a GPS device's coordinates (with a simulator that moves the GPS device ). A timer refreshes the map every second (just like the sample).


In order to display the latitude/longitude of the GPS device, I am using the following code:



_featureLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle =



TextStyles.CreateSimpleTextStyle(LABEL_KEY_NAME, "Arial", 10, DrawingFontStyles.Regular, GeoColor.StandardColors.White);

In addition, I have added an override to capture the CustomColumnFetch event. In the event I set the ColumnValue of the CustomColumnFetchEventArgs to the newly-updated latitude/longitude values of the GPS.


The problem is that when I refresh the map control (as in wpfMap1.Refresh) it doesn't force a refresh on the label text, and the event CustomColumnFetch does not re-fire. It only fires when I pan around the map.


Is this the right approach to handling this feature, and if so, how can I force a refresh on the label text?


Thanks!


Greg


 


 




Greg, 
  
    Two things on this.  For the short run before Monday what you need to do is before you call your Refresh you need to call the Overlay.Lock.IsDirty = True.  This is because we have an optimization that if you call refresh and you have not locked the overlay, set the IsDirty flag, or the current extent has not changed then we assume everything is the same and we just re-display a cached bitmap of the last screen draw.  This is really effecient when drawing thousands on things on top of static maps.  This is why panning causes it to fire and just a refresh standing still does not.  In the version being release Monday we approach this a bit differently and when you call Refresh() we clear all caches.  If only one overlay changed then the Refresh has a few new overloads where you can specify exactly the overlay or overlays that changed and we will only refresh those.  I hope this helps out.  Let me know what you find.  The release should be Monday sometime but I am not sure if it will be the morning or afternoon. 
  
 David