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 |
| 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 |
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 |
| 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() ¶ | API for feature clicking with extra properties. | ||
| 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() ¶ | Set mapbox styles | ||
| onClusterClick() ¶ | (event: MapBrowserEvent<PointerEvent | KeyboardEvent | WheelEvent>) => void | Clicking on cluster event Parameters
| |
| onFeatureHover() ¶ | (event: MapBrowserEvent<PointerEvent | KeyboardEvent | WheelEvent>) => void | On feature hovering show tooltip and change cursor style Parameters
| |
| onThemeSwitch() ¶ | | ||
| onThemeSwitchInternal() ¶ | | ||
| popoverOverlay ¶ | Overlay | ||
| refresh() ¶ | Refresh points with new set of points | ||
| select() ¶ | Selecting the certain point on map with API | ||
| selected optional ¶ | Feature<Geometry, { [x: string]: any; }> | ||
| setGeoJsonLayer() ¶ | () => void | Setting up the geoJson layer | |
| setMapStyle() ¶ | Set Map style | ||
| showClusterTooltipContent() ¶ | Sends data into cluster tooltip based on number of | ||
| showTooltipContent() ¶ | Show tooltip with content on hover over feature | ||
| targetFeature optional ¶ | Feature<Geometry, { [x: string]: any; }> | ||
| tooltipOverlay ¶ | Overlay | ||
| zoomCluster() ¶ | Zoom to cluster features | ||
| zoomToFeatures() ¶ | Zoom to features, gets coordinates of features and creates bounding extent | ||
| zoomToGeoJson() ¶ | (coordinate: Coordinate, zoomLevel: number, shouldAnimate?: boolean = true) => void | Zoom to GeoJson using coordinates of point of click Parameters
| |
| zoomToPoints() ¶ | Zoom to features, gets coordinates of points and creates bounding extent |
Types Documentation¶
import type { ColorPalette } from '@siemens/maps-ng';
Marker description, can be simple string or HTML as string description : Extra properties to be passed along (click function consumes it) extraProperties ? : 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 ? : Latitude value for marker Longitude value for marker Marker style marker ? : Marker name name : click ? Click functionality, do any extra staff when clicking on the point, just create needed logic for click functionality Inherited from MapPointMetaData extraProperties ? : import type { MapPoint } from '@siemens/maps-ng';
string Inherited from MapPointMetaData ¶ any Inherited from MapPointMetaData ¶ number Inherited from MapPointMetaData ¶ MarkerOptions Inherited from MapPointMetaData ¶ string Inherited from MapPointMetaData ¶
(extraProperties?: any) => void ¶
any ¶
import type { OverlayNativeProperties } from '@siemens/maps-ng';
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';
Color of the marker, HEX or css compliant color value. Only use when a semantic status isn't working for the use-case. Icon options icon ? : Semantic status for coloring. This is also theme-aware. status ? : Visual representation of markerimport type { MarkerOptions } from '@siemens/maps-ng';
IconMarkerOptions ¶ MarkerStatusType ¶
Marker description, can be simple string or HTML as string Extra properties to be passed along (click function consumes it) extraProperties ? : 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 Marker style marker ? : Marker nameimport type { MapPointMetaData } from '@siemens/maps-ng';
any ¶ MarkerOptions ¶
MarkerStatusType
'success' | 'info' | 'warning' | 'danger' | 'caution' | 'critical' | 'default' | 'unknown' ¶ import type { MarkerStatusType } from '@siemens/maps-ng';
Except where otherwise noted, content on this site is licensed under MIT License.