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

AttributeValuesMeaning
modeplace, view, search, directionsThe embed URL’s mode. Default: directions with origin and destination, place with q, else view.
qaddress, place name or "lat,lng"What to show (place) or look for (search).
originaddress or "lat,lng"Start of a route.
destinationaddress or "lat,lng"End of a route.
waypointsplaces separated by |Stops between origin and destination.
travelmodedriving, walkingThe embed URL’s mode parameter for routes.
avoidtolls|ferriesShapes driving routes.
unitsmetric, imperialDistance units in the card.
regionCLDR region, e.g. deBiases the geocoder.
languageBCP 47 tagLabel and card language.
maptyperoadmap, satellite, hybridStreet map or imagery.
map-stylesiemens, minimal, contrast, boldThe style, like the embed URL’s style. HTML owns style, hence map-style; React prop mapStyle.
color-schemeauto, light, darkauto (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.
zoom0 to 21Google’s zoom scale, default 15. Changing it moves the map.
labeltextAccessible name of the map. Default: what it shows.
cardoffoff hides the place card.
hostURLThe maps host, default https://maps.siemens-cdn.com.
worker-urlURLA self-hosted MapLibre worker, for worker-src ’self’ (read once, not observed).

Give the element a height through CSS (default 400 px).

Events

Eventdetail
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

main.js
import { createMapsClient } from '@siemens/maps/clients';

const maps = createMapsClient(); // { host } to point at another host
const place = await maps.geocode('Siemens Campus Erlangen');
CallAnswer
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.