Skip to content

mapx

const mapx: object

Namespace-Objekt: mapx.map({...}), mapx.directions(...).

Type declaration

departures()

departures: (stop, o) => Promise<Departure[]>

Abfahrten (Soll-Fahrplan) an einer Haltestelle (at:49:1320) oder rund um eine Koordinate.

Parameters

• stop: string | LL

• o: DeparturesOptions = {}

Returns

Promise<Departure[]>

DeparturesPopup

DeparturesPopup: typeof DeparturesPopup

directions()

directions: (profile, waypoints, o) => Promise<DirectionsResponse>

Routing (Mapbox-Directions-Antwort, Geometrie als GeoJSON). Profile: driving, driving-traffic, driving-truck, cycling, cycling-mtb, walking.

Parameters

• profile: Profile

• waypoints: LL[]

• o: DirectionsOptions = {}

Returns

Promise<DirectionsResponse>

elevation()

elevation: (points, model) => Promise<number | null | (number | null)[]>

Höhe (m) für einen oder mehrere Punkte; null außerhalb der Daten. dsm = Oberflächenmodell.

Parameters

• points: LL | LL[]

• model: "dtm" | "dsm" = 'dtm'

Returns

Promise<number | null | (number | null)[]>

elevationProfile()

elevationProfile: (line, samples, model, signal?) => Promise<ElevationProfile>

Höhenprofil entlang einer Linie (2 bis 512 Stützpunkte).

Parameters

• line: LL[]

• samples: number = 100

• model: "dtm" | "dsm" = 'dtm'

• signal?: AbortSignal

Returns

Promise<ElevationProfile>

ElevationProfileControl

ElevationProfileControl: typeof ElevationProfileControl

geocode()

geocode: (q, o) => Promise<GeocodeFeature[]>

Geocoding: Adressen, Orte, Gipfel und mit types: ['parcel'] Grundstücke (KG 14105 Gst 102/3).

Parameters

• q: string

• o: GeocodeOptions = {}

Returns

Promise<GeocodeFeature[]>

geojsonOverlay()

geojsonOverlay: (g) => string

GeoJSON-Overlay (Simplestyle: stroke, stroke-width, fill, fill-opacity, marker-color).

Parameters

• g: GeoJSON<Geometry, GeoJsonProperties>

Returns

string

isochrone()

isochrone: (profile, center, o) => Promise<GeoJSON.FeatureCollection>

Isochronen als GeoJSON-FeatureCollection (größte Fläche zuerst).

Parameters

• profile: Profile

• center: LL

• o: IsochroneOptions = {}

Returns

Promise<GeoJSON.FeatureCollection>

LayerControl

LayerControl: typeof LayerControl

map()

map: (o) => maplibregl.Map = createMap

Karte mit mapx-Style anlegen. Registriert das pmtiles-Protokoll.

Parameters

• o: MapxOptions

Returns

maplibregl.Map

MapxError

MapxError: typeof MapxError

matrix()

matrix: (profile, points, o) => Promise<MatrixResponse>

Fahrzeit-/Distanzmatrix für mehrere Punkte in einer Anfrage.

Parameters

• profile: Profile

• points: LL[]

• o: MatrixOptions = {}

Returns

Promise<MatrixResponse>

MeasureControl

MeasureControl: typeof MeasureControl

optimization()

optimization: (body, signal?) => Promise<OptimizationResponse>

Tourenplanung (Fahrzeuge, Aufträge, Zeitfenster). Höchstens 10 Fahrzeuge und 50 Aufträge; Zeiten in Sekunden.

Parameters

• body: OptimizationRequest

• signal?: AbortSignal

Returns

Promise<OptimizationResponse>

parcel()

parcel: (point, o) => Promise<GeoJSON.FeatureCollection & object>(point, o?) => Promise<GeoJSON.FeatureCollection & object>

Grundstück an einem Punkt (BEV DKM). Mit dossier: true liefert jedes Feature das volle Dossier.

Parameters

• point: LL

• o: ParcelOptions & object

Returns

Promise<GeoJSON.FeatureCollection & object>

Parameters

• point: LL

• o?: ParcelOptions & object

Returns

Promise<GeoJSON.FeatureCollection & object>

parcelDossier()

parcelDossier: (id, signal?) => Promise<Dossier>

Parzellen-Dossier: Fläche, Nutzung, Gebäude, Gelände, Adressen, nächste Haltestelle, Flugjahr, Static-Image-Link. ID aus parcel_id, z. B. 14143-473_1.

Parameters

• id: string

• signal?: AbortSignal

Returns

Promise<Dossier>

ParcelPopup

ParcelPopup: typeof ParcelPopup

pin()

pin: (at, o) => string

Marker-Overlay: pin([16.37,48.2], { color: 'e11d48', size: 'l' }).

Parameters

• at: LL

• o = {}

• o.color?: string

• o.size?: "s" | "m" | "l"

Returns

string

reverse()

reverse: (point, o) => Promise<GeocodeFeature[]>

Reverse Geocoding: nächstes Objekt zu einem Punkt (lon,lat).

Parameters

• point: LL

• o: ReverseOptions = {}

Returns

Promise<GeocodeFeature[]>

RouteControl

RouteControl: typeof RouteControl

SearchControl

SearchControl: typeof SearchControl

searchRetrieve()

searchRetrieve: (id, o) => Promise<GeoJSON.FeatureCollection<GeoJSON.Point>>

Search Box, Schritt 2: Koordinate und Details zu einem Vorschlag (mapbox_id).

Parameters

• id: string

• o: Pick<SearchOptions, "proximity" | "sessionToken" | "signal"> = {}

Returns

Promise<GeoJSON.FeatureCollection<GeoJSON.Point>>

searchSuggest()

searchSuggest: (q, o) => Promise<Suggestion[]>

Search Box, Schritt 1: Vorschläge während der Eingabe. Dasselbe sessionToken für suggest und retrieve verwenden.

Parameters

• q: string

• o: SearchOptions = {}

Returns

Promise<Suggestion[]>

setAccessToken()

setAccessToken: (token) => void

Zugriffstoken setzen (mx_pk_… im Browser, auf account.mapx.at erzeugt). Alle API-Anfragen senden ihn als Authorization: Bearer, Karten (Style, Kacheln, Schriften, Sprites) als access_token-Query, Static-Image-URLs ebenfalls. Er geht nur an mapx.at-Hosts.

Parameters

• token: undefined | null | string

Returns

void

setApiBase()

setApiBase: (url) => void

Basis-URL der API ändern (z. B. Staging).

Parameters

• url: string

Returns

void

setTerrain()

setTerrain: (map, on, exaggeration) => void

3D-Gelände (neu) setzen; bleibt auch nach Style-Wechsel aktiv.

Parameters

• map: Map$1

• on: boolean

• exaggeration: number = 1.4

Returns

void

staticImageUrl()

staticImageUrl: (o) => string

URL eines Static Image (für <img src>, E-Mail, Exposé). Kein Request, nur Zeichenketten. Mit gesetztem Token enthält sie access_token (öffentlicher mx_pk_-Token, an Origins gebunden).

Parameters

• o: StaticOptions

Returns

string

stops()

stops: (o) => Promise<Stop[]>

Haltestellen im Fenster oder um einen Punkt.

Parameters

• o: StopsOptions = {}

Returns

Promise<Stop[]>

styles

styles: readonly ["streets", "streets-dawn", "streets-dusk", "streets-night", "satellite", "outdoors"] = STYLE_IDS

StyleSwitcherControl

StyleSwitcherControl: typeof StyleSwitcherControl

styleUrl()

styleUrl: (s) => string

Kurzname -> Style-URL; volle URLs und Style-Objekte bleiben unverändert.

Parameters

• s: string | string & object

Returns

string

Terrain3DControl

Terrain3DControl: typeof Terrain3DControl

tilequery()

tilequery: (tilesets, point, o) => Promise<GeoJSON.FeatureCollection>

Vektorkachel-Abfrage: nächste Objekte um einen Punkt (radius bis 2000 m). tilesets z. B. ['streets','cadastre'].

Parameters

• tilesets: string[]

• point: LL

• o: TilequeryOptions = {}

Returns

Promise<GeoJSON.FeatureCollection>

trafficIncidents()

trafficIncidents: (o) => Promise<GeoJSON.FeatureCollection<GeoJSON.Geometry, Incident>>

Verkehrsmeldungen (ASFINAG/EVIS), gefiltert nach Fenster, Straße, Typ.

Parameters

• o: IncidentOptions = {}

Returns

Promise<GeoJSON.FeatureCollection<GeoJSON.Geometry, Incident>>

transformRequest()

transformRequest: (url) => object

transformRequest für MapLibre: hängt den Token an mapx.at-Anfragen. Verträgt eigene Funktionen über createMap({ transformRequest }).

Parameters

• url: string

Returns

object

url

url: string

transitDirections()

transitDirections: (from, to, o) => Promise<any>

ÖV-Verbindung (zu Fuß oder mit Rad zur Haltestelle). Zeit als ISO 8601 in Wiener Ortszeit.

Parameters

• from: LL

• to: LL

• o: TransitOptions = {}

Returns

Promise<any>

weatherCurrent()

weatherCurrent: (point, o) => Promise<WeatherStation[]>

Aktuelle Messwerte der nächsten Stationen.

Parameters

• point: LL

• o: Common & object = {}

Returns

Promise<WeatherStation[]>

weatherForecast()

weatherForecast: (point, o) => Promise<object>

Stundenvorhersage (AROME 1 km) für einen Punkt.

Parameters

• point: LL

• o: Common & object = {}

Returns

Promise<object>

hours

hours: WeatherHour[]

model

model: string

reference_time

reference_time: string

withToken()

withToken: (u, token) => string

URL mit access_token versehen, wenn ein Token gesetzt ist, die URL zu mapx.at gehört und noch keinen Token trägt. Bei pmtiles://…/{z}/{x}/{y} kommt er vor den Kachelpfad, bei Archiv-URLs ans Ende.

Parameters

• u: string

• token: string = API.token

Returns

string