Wrld.marker(latLng, options)
Extends: L.Marker
// Create a marker 260m from the ground (the top of the Transamerica Pyramid)
Wrld.marker([37.7952, -122.4028], { elevation: 260.0 }).addTo(map);
Argument | Type | Description |
---|---|---|
latLng | Wrld.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”). |
setIndoorMapWithFloorId(indoorMapId, indoorMapFloorId)
Places a marker in an indoor map floor. Useful for updating the floor, or moving an outdoor marker into an indoor map.
Argument | Type | Description |
---|---|---|
indoorMapId | string | The id of the indoor map with which the Marker will be associated. |
indoorMapFloorId | number | 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. |
setIndoorMapWithFloorIndex(indoorMapId, indoorMapFloorIndex)
Same as setIndoorMapWithFloorId
but uses floor index instead of floor id.
Argument | Type | Description |
---|---|---|
indoorMapId | string | The id of the indoor map with which the Marker will be associated. |
indoorMapFloorIndex | number | The index of the indoor map floor on which the marker should be displayed. This corresponds to the ordinal index of the array returned by IndoorMap.getFloors() . |
setOutdoor()
Positions an indoor marker outdoors.
setLatLng(latLng)
Sets the marker’s location coordinates.
Argument | Type | Description |
---|---|---|
latLng | Wrld.LatLng | The location to place the marker at. |
bindPopup(content, options)
Assigns a popup to the marker.
Argument | Type | Description |
---|---|---|
content | string | The content of the popup. |
options | object | The popup’s options. See Wrld.Popup. |