m
maplibre-image-plugins
Animated map icons drawn on the GPU
Maintained by Lucas Wojciechowski
Animated style images for MapLibre GL JS v6: icons from GIF, animated WebP, APNG or AVIF files, and a pulsing location dot, drawn on the GPU.
Live demo
maplibre-image-plugins running on MapLibre GL JS in your browser
Loading the map…
Demo code
import { PulsingDotStyleImage } from "maplibre-image-plugins";
import type { PluginDemo } from "../types";
export default {
center: [-122.4194, 37.7749], // San Francisco
zoom: 12,
run({ map }) {
// An animated style image, drawn on the GPU: a pulsing location dot.
map.addImage("pulsing-dot", new PulsingDotStyleImage({ dotColor: "tomato", haloRadius: 75 }), {
pixelRatio: 2,
});
map.addSource("here", {
type: "geojson",
data: { type: "Point", coordinates: [-122.4194, 37.7749] },
});
map.addLayer({
id: "here",
type: "symbol",
source: "here",
layout: { "icon-image": "pulsing-dot" },
});
},
} satisfies PluginDemo;