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.
| Name | Description | Type | Default |
|---|---|---|---|
| center | Initial geographic center of the map. | LatLngExpression | [0, 0] |
| zoom | Initial map zoom level. | number | 0 |
| bounds | Initial geographic bounds of the map. | LatLngBoundsExpression | — |
| useFly | Initial center, zoom and bounds use fly methods. | boolean | false |
| id | The id global attribute of HTML Element. | any | — |
| theme | The 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' |
| zoomControl | Whether a zoom control is added to the map by default. Disabled by default. | boolean | false |
| attributionControl | Whether a attribution control is added to the map by default. Disabled by default. | boolean | false |
| class | The CSS class value. You can pass the object, array and string value. | any | — |
Events
Use map events from leaflet documentation.
| Name | Description | Type |
|---|---|---|
| view-changed | Triggers when moved map view. | ViewChangedEvent |
Slots
| Name | Description |
|---|---|
| default | The default slot is used for all map component. |
Exposes
| Name | Description | Type |
|---|---|---|
| map | Leaflet map instance. | Ref<Map | null> |
| container | Map container element. | Ref<HTMLElement | null> |