Skip to content

SiMapComponent documentation

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

Input Properties

Name Type Default Description
alwaysShowLabels
boolean false

Show the label permanently next to the point. Normally the label is shown on hover or click. By enabling this it will always be visible next to the marker.

autoZoomClusterClick
boolean true

When disabled, clusters will no longer automatically be zoomed to on click.

autoZoomFeatureClick
boolean false

When enabled, features will be automatically zoom to on click.

cluster
boolean false

Enable or disable clustering of points on the map.

clusterClickZoom
number DEFAULT_CLUSTER_CLICK_ZOOM

Max zoom level for clicking on a cluster on the map. Defaults to 15.

clusterDistance
number DEFAULT_CLUSTER_DISTANCE

Defines range in which points are clustered. In pixels.

clusterPopoverComponent
Type<any> | undefined

Custom popover component for clustering

displayPopoverOnClick
boolean true

Option to switch on/off the display of popover when clicked. Default set to true (on).

displayPopoverOnHover
boolean false

Option to switch on/off popover when hovered. Default is set to false (off)

displayTooltipOnClusterHover
boolean false

Option to switch on/off the display of tooltip while hovering over cluster.

displayTooltipOnHover
boolean false

Option to switch on/off the display of tooltip while hovering over single point.

featureClickZoom
number DEFAULT_FEATURE_CLICK_ZOOM

Max zoom level which is used when clicking on feature on the map. Defaults to 15.

featureSelectZoom
number DEFAULT_FEATURE_SELECT_ZOOM

Zoom level when calling the select() method on the component. Defaults to 10.

fitClusterPadding
[number, number, number, number] [20, 20, 20, 20]

Padding (in pixels) applied to the map view when zooming to a cluster, preventing points from being clipped at the edges. Specified as [top, right, bottom, left].

fitGeoJsonPadding
number[] [20, 20, 20, 20]

For GeoJson, padding (in pixels) to be cleared to fit the GeoJson inside the view after a click on it. Values in the array are: [top, right, bottom, left].

fitPointPadding
number[] [20, 20, 20, 20]

For Point geometry, padding (in pixels) to be cleared to fit the point inside the view after a click on it. Values in the array are: [top, right, bottom, left].

geoJson
any

Payload of a geo-JSON object.

geoJsonProjection
string 'EPSG:3857'

Projection format used to render the geo-JSON payload.

globalZoom
number DEFAULT_GLOBAL_ZOOM

Max zoom level on load or when clicking the reset button. Defaults to 5.

groupColors
Record<number, string> | ColorPalette 'status'

Defines which colors should be used when points are grouped. Grouping means that points are painted with their group color and they are displayed as series in donut chart inside cluster.

maptilerKey
string | undefined

Provide your key for MapTiler, this will use the default siemens element styles which can be used in both light and dark mode. Shouldn't be used together with styleJson.

markerAnimation
boolean false

Enable or disable animation of markers.

maxLabelLineLength
number 20

Maximum number of characters per line for always displayed labels of a point. If the label exceeds this limit, it will be wrapped or trimmed. If set to 0, label trimming will be disabled. This setting is effective only when alwaysShowLabels is enabled. Important: Changing this is not recommended in most cases and may cause issues with positioning of the labels.

maxLabelLines
number 3

Maximum number of lines for always displayed labels of a point. If the label exceeds this limit, it will be trimmed. This setting is effective only when alwaysShowLabels is enabled and maxLabelLineLength is not 0. Important: Changing this is not recommended in most cases and may cause issues with positioning of the labels.

multiWorld
boolean true

Show multiple worlds, including points that cross the 180th meridian.

nativeProperties
OverlayNativeProperties | undefined

• overlay: Layer for popup element, an element to be displayed over the map and attached to a single map location.

• controls: List of controls to activate for map, additional controls like full screen, etc. can be added here.

points
MapPoint[] | undefined

Points to be rendered on the map as features.

popoverCloseOnClick
boolean true

Close the popover on click

popoverComponent
Type<any> | undefined

Custom popover component

popoverComponentProps
any

Custom popover component

styleFunction
StyleLike | undefined

Callback function to add custom styling to the drawn geo-JSON features.

styleJson
any

Type of background map, for example 'https://api.maptiler.com/maps/voyager/style.json?key=xxx' (Token key is required). The styleJson defines the tiler source and the used styles for different layers, should only be used if the siemens default styles by using maptilerKey isn't good enough.

Output Properties

Name Type Description
pointsChange
MapPoint[] | undefined

Points to be rendered on the map as features.

pointsRefreshed
void

Emitted when the points are available as features. So consumers can call methods like zoomToPoints() on the actual point list.

pointsSelected
MapPoint[]

Emitted when points on the map are selected or de-selected

Attributes and Methods

Name Type Default Description
clear()
() => void
closePopup()
() => boolean

Close popup

createOverlay()
(container: HTMLElement, position: Positioning, nativeProperties?: OverlayNativeProperties, isTooltip?: boolean) => Overlay

Create overlay for tooltip and popover

Parameters
displayTooltip()
(feats: FeatureLike[]) => void

Display tooltip on hovering over feature type of Feature.

Parameters
featureCallback()
(feat: FeatureLike, clusterHolder?: ClusterHolder) => Feature<Geometry, { [x: string]: any; }>[] | undefined

Return features inside feature object in case of cluster enabled/disabled

Parameters
featureClick()
(feature: Feature<Geometry, { [x: string]: any; }>, event?: any, zoom?: boolean) => void

API for feature clicking with extra properties.

Parameters
features
Feature<Geometry, { [x: string]: any; }>[] []
hideOverlays()
() => void
init()
() => void

Initialize map and it's layers

isClicked
boolean false
map optional
Map

OpenLayers map instance.

mapboxStyles()
(styleJSON: any) => void

Set mapbox styles

Parameters
onClusterClick()

Clicking on cluster event

Parameters
onFeatureHover()

On feature hovering show tooltip and change cursor style

Parameters
onThemeSwitch()
(dark: boolean) => void
Parameters
onThemeSwitchInternal()
(event: Event) => void
Parameters
popoverOverlay
Overlay
refresh()
(points: MapPoint[], zoomToFeatures?: boolean = true) => void

Refresh points with new set of points

Parameters
select()
(point: MapPoint, maxZoomLevel?: number) => void

Selecting the certain point on map with API

Parameters
selected optional
Feature<Geometry, { [x: string]: any; }>
setGeoJsonLayer()
() => void

Setting up the geoJson layer

setMapStyle()
(dark?: boolean, key?: string, styleJSON?: string) => void

Set Map style

Parameters
  • • boolean if dark theme should be active or not

    dark ? : boolean

  • • the api key for the maptiler styleJSON

    key ? : string

  • • a preexisting styleJSON as url with key already provided

    styleJSON ? : string

showClusterTooltipContent()
(features: Feature<Geometry, { [x: string]: any; }>[], cluster?: Feature<Geometry, { [x: string]: any; }>) => boolean

Sends data into cluster tooltip based on number of

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

Show tooltip with content on hover over feature

Parameters
targetFeature optional
Feature<Geometry, { [x: string]: any; }>
tooltipOverlay
Overlay
zoomCluster()
(clusterFeatures: Feature<Geometry, { [x: string]: any; }>[]) => void

Zoom to cluster features

Parameters
zoomToFeatures()
(features: Feature<Geometry, { [x: string]: any; }>[], zoomLevel: number, shouldAnimate?: boolean = true) => void

Zoom to features, gets coordinates of features and creates bounding extent

Parameters
zoomToGeoJson()
(coordinate: Coordinate, zoomLevel: number, shouldAnimate?: boolean = true) => void

Zoom to GeoJson using coordinates of point of click

Parameters
zoomToPoints()
(points: MapPoint[], zoomLevel: number, shouldAnimate?: boolean = true) => void

Zoom to features, gets coordinates of points and creates bounding extent

Parameters

Types Documentation

ColorPalette

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

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

import type { OverlayNativeProperties } from '@siemens/maps-ng';
Properties
  • List of controls to activate for map, additional controls like full screen, etc. can be added here Defaults are zoom in and out

    controls ? : Control[]

  • Layer for popup element, an element to be displayed over the map and attached to a single map location.

    overlay ? : Overlay

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

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

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

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

import { DEFAULT_GLOBAL_ZOOM } 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

MarkerStatusType

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

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


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