wrld.js

L.marker(latLng, options)

wrld.js requires that users create instances of L.Marker via the standard Leaflet factory (see creation example below).

// Create a marker 260m from the ground (the top of the Transamerica Pyramid)
L.marker([37.7952, -122.4028], { elevation: 260.0 }).addTo(map);
Argument Type Description
latLng L.LatLng The location to create the marker at.
options object These are the same options you would pass to L.Marker, plus additional wrld.js entries.

Options

Options Type Default Description
elevation number 0.0 Altitude of the marker above ground or sea level in meters.
elevationMode string ‘heightAboveGround’ Whether altitude is measured above ground level (“heightAboveGround”) or sea level (“heightAboveSeaLevel”).
indoorMapId string ’’ The id of the indoor map with which the Marker will be associated.
indoorMapFloorId number 0 The identifier of the indoor map floor on which the marker should be displayed. In the WRLD Indoor Map Format, this corresponds to the ‘z_order’ field of the Level object.

Methods

getElevation()

Returns the elevation in meters.

setElevation(elevation)

Set the elevation in meters.

Argument Type Description
elevation number The elevation in meters.

getElevationMode()

Returns the elevation mode.

setElevationMode(elevationMode)

Set the elevation mode.

Argument Type Description
elevationMode string Whether altitude is measured above ground level (“heightAboveGround”) or sea level (“heightAboveSeaLevel”).
v0.1.1396