Icon

HTML equivalent to L.icon function. Can be a child of l-marker element.

See Leaflet docs.

Example

A standard way to initialise with minimal options.

<l-icon icon-url="/icon.png"></l-icon>

A more detailed approach is to specify custom icon and shadow images.

<l-icon
    icon-url="/icons/leaf-green.png"
    shadow-url="/icons/leaf-shadow.png"
    icon-size="[38, 95]"
    shadow-size="[50, 64]" 
    icon-anchor="[22, 94]" 
    shadow-anchor="[4, 62]" 
    popup-anchor="[-3, -76]" 
  ></l-icon>

Parameters

Mandatory HTML properties to successfully instantiate.

AttributeExampleDescription

Properties

AttributeTypeDescription
class-namestringCustom class name
cross-originbool
icon-anchorPointCoordinates of the "tip" of the icon
icon-retina-urlstring
icon-sizePointSize of the icon in pixels
icon-urlstringURL to define icon image
popup-anchorPoint
shadow-anchorPoint
shadow-retina-urlstringCoordinates of the "tip" of the shadow
shadow-sizePointSize in pixels
shadow-urlstringUrl for shadow, no shadow if not specified
tooltip-anchorPointCoordinates relative to anchor

Events

Event keyDetailDescription
l:icon:connectedTriggered when connected to the document