Web component reference
<siemens-map> and the typed clients of @siemens/maps. Version 1.2.0 Generated from the element’s source.
Versions
Each release lives at https://maps.siemens-cdn.com/sdk/<version>/ and never changes; https://maps.siemens-cdn.com/sdk/v1/ follows the latest release of the major. This reference describes 1.2.0. Released: 1.2.0, 1.1.2, 1.1.1, 1.1.0, 1.0.2, 1.0.1, 1.0.0.
Attributes
| Attribute | Values | Meaning |
|---|---|---|
mode | place, view, search, directions | The embed URL’s mode. Default: directions with origin and destination, place with q, else view. |
q | address, place name or "lat,lng" | What to show (place) or look for (search). |
origin | address or "lat,lng" | Start of a route. |
destination | address or "lat,lng" | End of a route. |
waypoints | places separated by | | Stops between origin and destination. |
travelmode | driving, walking | The embed URL’s mode parameter for routes. |
avoid | tolls|ferries | Shapes driving routes. |
units | metric, imperial | Distance units in the card. |
region | CLDR region, e.g. de | Biases the geocoder. |
language | BCP 47 tag | Label and card language. |
maptype | roadmap, satellite, hybrid | Street map or imagery. |
map-style | siemens, minimal, contrast, bold | The style, like the embed URL’s style. HTML owns style, hence map-style; React prop mapStyle. |
color-scheme | auto, light, dark | auto (default) follows the visitor live. React prop colorScheme. element.scheme reads the scheme drawn now. |
center | "lat,lng" | View center. Changing it moves the map. |
zoom | 0 to 21 | Google’s zoom scale, default 15. Changing it moves the map. |
label | text | Accessible name of the map. Default: what it shows. |
card | off | off hides the place card. |
host | URL | The maps host, default https://maps.siemens-cdn.com. |
worker-url | URL | A self-hosted MapLibre worker, for worker-src ’self’ (read once, not observed). |
Give the element a height through CSS (default 400 px).
Events
| Event | detail |
|---|---|
map-ready | { center, zoom } once the content is drawn |
map-error | { message } when the map cannot load |
map-move | { center, zoom } after every move |
map-select | { index, place } when a person picks a search result |
element.view reads or sets { center: { lat, lng }, zoom }. To keep the view in your page URL, write it on map-move and set center and zoom from the URL on load.
Typed clients
import { createMapsClient } from '@siemens/maps/clients';
const maps = createMapsClient(); // { host } to point at another host
const place = await maps.geocode('Siemens Campus Erlangen');
| Call | Answer |
|---|---|
geocode(q, { region }) | One position for an address, a place name or "lat,lng", or null. |
search(q, { region }) | Up to 10 places, each with name and category. |
directions({ points, mode, avoid }) | A route through 2 to 22 positions, by car or on foot, or null. |
isolines({ origin, mode, minutes }) | Areas reachable within up to three time bands (5 to 60 minutes). |
staticMapUrl({ width, height, center, zoom, markers }) | URL of a static map image. |
embedUrl(mode, params) | URL of the iframe embed. |
A refused or failed call throws MapsApiError with status and the API’s code; “nothing found” is null or an empty list.
Setup and live examples: web component.