Skip to content

Icon

The VMapIcon component is used to represent the icon that will be provided when the marker is created.

Basic usage

API

Attributes

Use icon options from leaflet documentation.

NameDescriptionTypeDefault
* iconUrlThe URL to the icon image (absolute or relative to your script path). If you pass null then the icon will not be created until the value appears. Requiredstring | null
iconRetinaUrlThe URL to a retina sized version of the icon image (absolute or relative to your script path). Used for Retina screen devices.string
iconSizeSize of the icon image 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
shadowUrlThe URL to the icon shadow image. If not specified, no shadow image will be created.string
shadowRetinaUrlThe URL to a retina sized version of the icon shadow image (absolute or relative to your script path). Used for Retina screen devices.string
shadowSizeSize of the shadow image in pixels.PointExpression
shadowAnchorThe coordinates of the "tip" of the shadow (relative to its top left corner) (the same as iconAnchor if not specified).PointExpression
knownClassesHere 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[]
classNameA 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
classThe CSS class value. You can pass the object, array and string value.any

Events

No events.

Slots

NameDescription
defaultThe default slot can be used to extend behavior.

Exposes

NameDescriptionType
iconLeaflet icon instance.Ref<Icon | null>

Released under the MIT License.