Skip to content

MapService documentation

import { MapService } from '@siemens/maps-ng';

Attributes and Methods

Name Type Description
clusterLayer()
(features: Feature<Geometry, { [x: string]: any; }>[], markerAnimation: boolean, clusterDistance: number, multiWorld: boolean) => Layer<Source, default<any>, { [x: string]: any; }>

Initialize animated cluster layer for points if clustering is enabled

Parameters
createFeatures()
(points: MapPoint[], alwaysShowLabels?: boolean = false) => Feature<Geometry, { [x: string]: any; }>[]

Create feature with parameters

Parameters
getClusterStyle()
(feature: Feature<Geometry, { [x: string]: any; }>) => Style[]

Cluster styling

Parameters
getFeatureStyle()
(feature: Feature<Geometry, { [x: string]: any; }>, cluster: boolean, features: Feature<Geometry, { [x: string]: any; }>[], dummy?: boolean = false) => Style[]

Separate feature styling with icon

Parameters
getLabelStyle()
(feature: Feature<Point, { [x: string]: any; }>, features: Feature<Point, { [x: string]: any; }>[], maxLabelLength: number, maxLines: number, clusterSource?: Cluster<Feature<Point, { [x: string]: any; }>>, dummy?: boolean = false) => Style[]
Parameters
getMarkerOffset()
(feature: Feature<Geometry, { [x: string]: any; }>) => [number, number]
Parameters
getMarkerSize()
(feature: Feature<Geometry, { [x: string]: any; }>) => [number, number]
Parameters
labelLayer()
(features: Feature<Geometry, { [x: string]: any; }>[], multiWorld: boolean, maxLabelLength: number, maxLines: number, clusterLayer?: Layer<Source, default<any>, { [x: string]: any; }> | undefined) => VectorLayer<VectorSource<Feature<Geometry, { [x: string]: any; }>>, Feature<Geometry, { [x: string]: any; }>>
Parameters
resetCaches()
() => void
setTheme()
(groupColors: Record<number, string> | ColorPalette | undefined) => void
Parameters
setZoomCallback()
(callback?: (() => number | undefined)) => void
Parameters
(readonly)theme
{ fillColor: string; strokeColor: string; textColor: string; defaultMarkerColor: string; status: Record<MarkerStatusType, string>; colorPalette: ColorPalettes; }
vectorLayer()
(features: Feature<Geometry, { [x: string]: any; }>[], multiWorld: boolean, defaultStyle?: boolean = false) => VectorLayer<VectorSource<Feature<Geometry, { [x: string]: any; }>>, Feature<Geometry, { [x: string]: any; }>>

Create vector layer when clustering is disabled

Parameters

Types Documentation

ColorPalette

'status' | 'element'
type alias
import type { ColorPalette } from '@siemens/maps-ng';

import type { ColorPalettes } from '@siemens/maps-ng';

import type { MapPoint } from '@siemens/maps-ng';
Properties
Methods

MarkerStatusType

'success' | 'info' | 'warning' | 'danger' | 'caution' | 'critical' | 'default' | 'unknown'
type alias
import type { MarkerStatusType } from '@siemens/maps-ng';

import type { MarkerOptions } from '@siemens/maps-ng';
Properties
  • Color of the marker, HEX or css compliant color value. Only use when a semantic status isn't working for the use-case.

    color ? : string

  • Icon options

    icon ? : IconMarkerOptions

  • Semantic status for coloring. This is also theme-aware.

    status ? : MarkerStatusType

  • Visual representation of marker

    type : "status" | "icon" | "dot"

import type { MapPointMetaData } from '@siemens/maps-ng';
Properties
  • Marker description, can be simple string or HTML as string

    description : string

  • Extra properties to be passed along (click function consumes it)

    extraProperties ? : any

  • If you want your point to be clustered by it's group, you need to set the group id here for this point Color with the same id will be assigned. Must be higher than 0

    group ? : number

  • Marker style

    marker ? : MarkerOptions

  • Marker name

    name : string

Methods
  • click ?(extraProperties?: any) => void

    Click functionality, do any extra staff when clicking on the point, just create needed logic for click functionality

    Parameters

import type { IconMarkerOptions } from '@siemens/maps-ng';
Properties


Except where otherwise noted, content on this site is licensed under MIT License.