This is documentation of an archived release.
For documentation on the current version, please check Knowledge Base.

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. :

  • Measurement results
  • Field-of-view indicators
  • Resource footprints

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 :

  • color : the outline color.
  • lineWidth : the outline width in 96dpi pixels.

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 :

  • color : the outline color.
  • lineWidth : the outline width in 96dpi pixels.
  • fillColor : the fill color.

Rendering Points

The spatialPoint property is a symbol at a specific coordinate.

Legend properties :

  • symbolName : the name of a preset symbol.
  • symbolPath : the path of a symbol.
  • symbolSize : the size of the symbol in 96dpi pixels.
  • color : the symbol outline color.
  • lineWidth : the symbol outline width in 96dpi pixels.
  • fillColor : the symbol fill color.

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 :

  • circle : a filled circle.
 
Last modified:: 2019/03/25 11:36