Skip to content

Map

The VMap component is used to create a map. This base component contains and wraps all other components.

Basic usage

API

Attributes

Use map options from leaflet documentation.

NameDescriptionTypeDefault
centerInitial geographic center of the map.LatLngExpression[0, 0]
zoomInitial map zoom level.number0
boundsInitial geographic bounds of the map.LatLngBoundsExpression
useFlyInitial center, zoom and bounds use fly methods.booleanfalse
idThe id global attribute of HTML Element.any
themeThe color theme of the map. There are two built-in themes light and dark. The 'auto' value automatically determines the light or dark theme.string | 'light' | 'dark' | 'auto''light'
zoomControlWhether a zoom control is added to the map by default. Disabled by default.booleanfalse
attributionControlWhether a attribution control is added to the map by default. Disabled by default.booleanfalse
classThe CSS class value. You can pass the object, array and string value.any

Events

Use map events from leaflet documentation.

NameDescriptionType
view-changedTriggers when moved map view.ViewChangedEvent

Slots

NameDescription
defaultThe default slot is used for all map component.

Exposes

NameDescriptionType
mapLeaflet map instance.Ref<Map | null>
containerMap container element.Ref<HTMLElement | null>

Released under the MIT License.