wrld.js

L.rectangle(latLngBounds, options)

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

// Create a rectangle in San Francisco.
var rectangle = L.rectangle([[37.767202, -122.456709], [37.766560, -122.455316]]).addTo(map);
Argument Type Description
latLngBounds L.LatLngBounds bounds of the rectangle.
options object Accepts all of the options to L.rectangle, plus additional wrld.js entries.

Options

Options Type Default Description
elevation number 0.0 Altitude 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 Rectangle will be associated.
indoorMapFloorId number 0 The id of the indoor map floor with which the Rectangle 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