Svelte Maplibre

API / Layers

MarkerLayer

Manages a set of HTML markers for the features in a source. This acts similar to a Layer component, but is not actually registered with the map as a layer. Markers for non-point features are placed at the geometry's center.

For pin-shaped custom HTML, set anchor="bottom" (and optional offset) so the tip stays on the coordinate when zooming—same as standalone Marker and typical MapLibre custom-marker examples.

import { MarkerLayer } from 'svelte-maplibre';

Generic parameters: FEATURE extends Feature = Feature

Examples

Props

Source: src/lib/MarkerLayer.svelte