Table of Contents

About MapObjects

MapObjects are used by the Viewer SDK to convey what should be rendered on the Reference Map in your host environment, and do this in a generic way to simplify the implementation. The Viewer SDK will return MapObject instances for e.g. :

MapObject Types

Each MapObject has a type property. MapObject types are used to group MapObjects that are related and should be rendered in the same layer.

Coordinate System

The Viewer has a central setting that determines the CRS of any spatial data returned by the Viewer API. By default, this settings is set to 4326 (WGS/84). It can be customized by providing the Constants.STARTUP_CRS startup option.

This setting also affects the CRS of all returned MapObject instances.

Rendering

Rendering MapObject instances is essential to implementing a good plugin. Write a generic function that handles rendering a list of MapObject instances into a third-party map layer. This function will be re-used in different places.

Rendering Lines

The spatialLine property is a CoordinatePath instance containing one or more CoordinateLine instances. Each CoordinateLine instance holds a list of Coordinate instances defining the outline of a single line.

Legend properties :

Rendering Areas

The spatialArea property is a CoordinatePath instance containing one or more CoordinateLine instances. Each CoordinateLine instance holds a list of Coordinate instances defining the outline of a single area.

Legend properties :

Rendering Points

The spatialPoint property is a symbol at a specific coordinate.

Legend properties :

The symbol is to be rendered inside a square with size symbolSize. The center of the square should be placed on the coordinate defined by spatialPoint.

Possible symbolName values :