IMapRenderer Interface |
Namespace: Telogis.GeoBase
The IMapRenderer type exposes the following members.
Name | Description | |
---|---|---|
RequiredRendermodes |
Specifies at which stages of rendering this renderer should be called.
|
To use a renderer, assign an object that implements IMapRenderer to the Renderer property of an IMap object. When the map is redrawn it will invoke the Render(Graphics, RenderContext) method of the IMapRenderer.
Multiple renderers can be attached to a single IMap by using a RendererList.
Related articles: Render Modes in Detail, Routing Concept, Using a Navigator, Using a LabelBox, Defining the Renderer, Using Multiple Renderers.
public class CenterRenderer : IMapRenderer { public void Render(Graphics graphics, RenderContext rc) { if (rc.Mode != RenderMode.PostLabelling) { return; } // Render a circle at the center of the map Pen pen = new Pen(Color.Red, 3); int center_x, center_y; int radius = 20; rc.Map.LatLontoXY(out center_x, out center_y, rc.Map.Center); graphics.DrawEllipse(pen, center_x - radius, center_y - radius, radius * 2, radius * 2); } } ... public class MyApplication { IMap map; ... public void InitApplication() { ... map.Renderer = new CenterRenderer(); ... } ... }