wrld.js

L.popup(options, source)

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

// Create a popup with the text "Transamerica Pyramid" above the Transamerica Pyramid
L.popup({ elevation: 260.0 })
       .setLatLng([37.7952, -122.4028])
       .setContent("Transamerica Pyramid")
       .addTo(map);

// Alternatively:
map.openPopup("Transamerica Pyramid", [37.7952, -122.4028], { elevation: 260.0 });
Argument Type Description
options object These are the same options you would pass to L.Popup, plus additional wrld.js entries.
source L.ILayer An optional ILayer to associate this popup with.

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 Popup will be associated.
indoorMapFloorId number 0 The identifier of the indoor map floor on which the Popup should be displayed. In the WRLD Indoor Map Format, this corresponds to the ‘z_order’ field of the Level object.

Methods

popup.getElevation()

Returns the elevation of the popup in meters.

popup.setElevation(elevation)

Set the elevation of the popup.

Argument Type Description
elevation number The elevation of the popup in meters.
v0.1.1452