ThinkGeo.com    |     Documentation    |     Premium Support

Overlay refresh - WPF

Will all overlays redraw even if I only refresh one overlay?



I'm only refreshing one overlay but I see the map's overlay drawn event handler method being called once for ever overlay I have on the map.  Is that expected or should it only be called once for the overlay I'm trying to refresh.


MyMap.Refresh(MyMap.Overlays[



"HighlightOverlay"]);

 


//Called once for every overlay even though just refreshed one overlay.



private


{


 


}


 void wpfMap1_OverlayDrawn(object sender, OverlayDrawnWpfMapEventArgs e)MessageBox.Show(GetMapRenderingTimes(this.wpfMap1)); 



Peter, 

That is expected. 



The only difference if you are passing the Overlay to be refreshed is that all the other overlays will not be drawn again, it will use the original screen bitmap as its image and paste it to the screen. The target overlay you passed in to draw will call the Draw function in overlay itself to get a image back. 



Even so, the OverlayDrawing and OverlayDrawn events are expected to be same for both of them. 



Thanks. 



Yale