Skip to content

image

Stable

An image of your own on the map for symbol layers to draw: an icon from a URL, one icon in any colour with sdf, or a pulsing dot.

Generated from the component's definition in the library, so it always matches the version this demo runs.

Attribute Type Default Description
id required string — The image's name on the map, which layers give in icon-image; also the id of the component's element. Read at mount.
map_id required string — ID of the map to put the image on. Read at mount.
url string nil The URL of the image: PNG, JPEG, WebP, or SVG with width and height. A url or an animation is required, and not both. positive integers, both or neither. Needed for an SVG.
width integer nil Not documented by the library.
height integer nil Not documented by the library.
sdf boolean false true for an image a layer paints with icon-color; false by default.
animation atom nil :pulse
color string nil The pulse's colour, in hexadecimal; "#3FB1CE" by default.
size integer nil The pulse's side, in CSS pixels: an integer from 1 to 512; 64 by default.
period any nil milliseconds, a number over 0
pixel_ratio any 1 a number over 0
events any [] a list of event names, or :all