I tried to draw some information (colored frame) on the map when the user activates the track mode of TrackInteractiveOverlay when clicking on a button.
I overwrite the drawcore() method of TrackInteractiveOverlay to draw this information to the sceen but the drawcore() method is only called when the user clicks on the Overlay to start the drawing of the shape.
But I want to draw the colored frame when the track mode is activated. Any suggestion where I can place my drawing code?
I use draw() method of BackgroundLayer class to draw a white transparent effect on the map. In drawcore() method of TrackInteractiveOverlay I get the canvas-object I assign to the draw() method of BackgroundLayer to draw the effect.
If I put the drawing code in button click event where can I get the canvas to draw on? Or is there a method I can draw direct to the map? I only know a method to draw text to screen.
If you add your BackgroundLayer to LayerOverlay and add this LayerOverlay to map.Overlays, it will draw automatically when map.Refresh(overlay). So you can call map.Refresh(layerOverlay) after the track mode activated.
Or you can create a concrete class GdiPlusCanvas which is derived from Canvas and assign to the draw() method of BackgroundLayer to draw the effect.
You can provide a simple sample to show your requirement, and we will modify it to fix your problem.