Map

HTML equivalent to L.map function. Can call methods, e.g. map.fitWorld().

Example

A standard way to initialise a map is with a center and a zoom level.

<l-map center="[0,0]" zoom="0"></l-map>

To detect mobile device location, zoom to it and enable location event handlers.

<l-map fit-world locate='{"setView": true, "maxZoom": 16}' on="locationfound locationerror">
  ...
</l-map>

Parameters

Mandatory HTML properties to successfully instantiate a map.

AttributeExampleDescription
center[0, 0]LatLng position
zoom0Zoom level

OR

AttributeExampleDescription
fit-worldExistence of this property calls map.fitWorld()

Properties

AttributeValueDescription
fit-worldAuto-fits map to world extent
onUsed to connect map.on Leaflet event handler to HTML CusomEvent
locatemap.locate method call options

Events

Event keyDetailDescription
readyTriggered by map.whenReady method
l:layer:connectedTriggered by child elements when a layer is connected to the document