Wrld.rectangle(latLngBounds, options)

Extends: L.Rectangle

// Create a rectangle in San Francisco.
var rectangle = Wrld.rectangle([[37.767202, -122.456709], [37.766560, -122.455316]]).addTo(map);
Argument Type Description
latLngBounds Wrld.LatLngBounds The 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 identifier of the indoor map floor on which the Rectangle should be displayed. In the WRLD Indoor Map Format, this corresponds to the ‘z_order’ field of the Level object.
displayOption string ‘currentFloor’ Controls when the Rectangle should be displayed in an indoor map. Option ‘currentIndoorMap’ will draw the Rectangle in the appropriate indoor map when any floor is selected; ‘currentFloor’ will draw the Rectangle only on the specified floor.

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”).
v1.1.0
Props Wrld.Prop
Themes Wrld.themes
Heatmaps Wrld.Heatmap
Events Event objects
Services (Optional) WrldPoiApi