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 id of the indoor map floor with which the Marker will be associated.

Methods

getElevation()

Returns the elevation in meters.

setElevation(elevation)

Set the elevation in meters.

Argument Type Description
elevation number The elevation in meters
v0.1.1335