Click or drag to resize

IMapRenderer Interface

Verizon Connect Logo
Print this page
Learn more about Verizon Connect GeoBase.
Get information about the latest release
Supports rendering user-defined features onto a map.

Namespace:  Telogis.GeoBase
Assembly:  geobase.net (in geobase.net.dll) Version: 4.99.0.0
Syntax
public interface IMapRenderer

The IMapRenderer type exposes the following members.

Properties
  NameDescription
Public propertyCode exampleRequiredRendermodes
Specifies at which stages of rendering this renderer should be called.
Top
Methods
  NameDescription
Public methodCode exampleRender
Called when this item should render itself on the map.
Top
Remarks
This interface is implemented by types that are to draw additional features onto a map.

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.

Examples
C#
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();
        ...
    }

    ...
}
See Also