Share via


BasicRenderingOnly method

Disable some of the map rendering for increased performance.

Applies to

Objects: Map

Syntax

object.BasicRenderingOnly

Parameters

Part

Description

object

Required. An expression that returns a Map object.

Remarks

  • Objects such as pushpins and drawn shapes will not be rendered for increased performance. To return rendering to normal, call the DefaultRendering method.

C# Example

    private void TestRendering()
    {
        MapPoint.Map objMap = objApp.ActiveMap;

        // turn off optional rendering to increase performance
        objMap.BasicRenderingOnly();

        // do operations that are expensive to render
        // for example, draw a Sierpinski triangle
        Random rand = new Random();
        Point[] vertices = new Point[3];
        vertices[0] = new Point(objMap.Width / 2, 0); // top vertex
        vertices[1] = new Point(0, objMap.Height); // left vertex
        vertices[2] = new Point(objMap.Width, objMap.Height); // right vertex
        Point current = new Point(objMap.Width / 2, objMap.Height / 2);

        for (int i = 0; i < 2000; i++)
        {
            int randVertex = rand.Next(0, 3);
            current.X = (vertices[randVertex].X + current.X) / 2;
            current.Y = (vertices[randVertex].Y + current.Y) / 2;

            MapPoint.Location plot = objMap.XYToLocation(current.X, current.Y);
            objMap.Shapes.AddShape(MapPoint.GeoAutoShapeType.geoShapeOval, plot, 10, 10);
        }

        // return rendering to default to show shapes
        objMap.DefaultRendering();
    }

Visual Basic Example

    Private Sub TestRendering()
        Dim objMap As MapPoint.Map = objApp.ActiveMap

        'turn off optional rendering to increase performance
        objMap.BasicRenderingOnly()

        'do operations that are expensive to render
        'for example, draw a Sierpinski triangle
        Dim rand As Random = New Random()
        Dim vertices(2) As Point
        vertices(0) = New Point(objMap.Width / 2, 0) 'top vertex
        vertices(1) = New Point(0, objMap.Height) 'left vertex
        vertices(2) = New Point(objMap.Width, objMap.Height) 'right vertex
        Dim current As Point = New Point(objMap.Width / 2, objMap.Height / 2)

        For i As Integer = 1 To 2000
            Dim randVertex As Integer = rand.Next(0, 3)
            current.X = (vertices(randVertex).X + current.X) / 2
            current.Y = (vertices(randVertex).Y + current.Y) / 2

            Dim plot As MapPoint.Location = objMap.XYToLocation(current.X, current.Y)
            objMap.Shapes.AddShape(MapPoint.GeoAutoShapeType.geoShapeOval, plot, 10, 10)
        Next

        'return rendering to default to show shapes
        objMap.DefaultRendering()
    End Sub