Skip to content

DivMarker

The VMapDivMarker component is used to represent marker and div icon in one component.

Basic usage

API

Attributes

Use marker options from leaflet documentation.

NameDescriptionTypeDefault
* latlng / v-modelPosition of the marker as a geographic point on the map. If you pass null then the marker will not be created until the value appears. RequiredLatLngExpression | null
iconHtmlCustom HTML code to put inside the div element, empty by default. Alternatively, an instance of HTMLElement.string | HTMLElement | false
iconBgPosOptional relative position of the background, in pixels.PointExpression
iconSizeSize of the icon div in pixels.PointExpression
iconAnchorThe coordinates of the "tip" of the icon (relative to its top left corner). The icon will be aligned so that this point is at the marker's geographical position. Centered by default if size is specified, also can be set in CSS with negative margins.PointExpression
iconCrossOriginWhether the crossOrigin attribute will be added to the tiles. If a String is provided, all tiles will have their crossOrigin attribute set to the String provided. This is needed if you want to access tile pixel data. Refer to CORS Settings for valid String values.CrossOrigin | boolean
iconPopupAnchorThe coordinates of the point from which popups will "open", relative to the icon anchor.PointExpression
iconTooltipAnchorThe coordinates of the point from which tooltips will "open", relative to the icon anchor.PointExpression
iconRenderModeRendering mode of the content passed in the default slot. Values: html, node, portal, none.string'html'
iconRootClassRoot element css class in node and portal rendering mode. You can pass the same value as in the vue class property.any
iconKnownClassesHere you can specify a list of classes that the leaflet library adds. This is necessary for the properties className and class to work correctly. By default, the list of internal classes of the leaflet library is used.string[]
iconClassNameA custom class name to assign to both icon and shadow images. Empty by default. The value of this property is combined with and is equivalent to the class property.any
iconClassThe CSS class value. You can pass the object, array and string value.any

Events

Use marker events from leaflet documentation.

Slots

NameDescription
defaultThe default slot can be used to extend behavior.

Exposes

NameDescriptionType
markerLeaflet marker instance.Ref<Marker | null>
iconLeaflet div icon instance.Ref<Icon | null>

Released under the MIT License.