code Snippetlanguage CDNpackage_2 NPM
content_copy Copyopen_in_new Open
const map = new maplibregl. Map ({
container: 'map' ,
style: 'https://api.maptiler.com/maps/dataviz-dark/style.json?key=YOUR_MAPTILER_KEY' ,
center: [ 14.42 , 50.08 ],
zoom: 10
});
const points = [
{ coords: [ 14.42 , 50.08 ], label: 'Prague' },
{ coords: [ 16.61 , 49.20 ], label: 'Brno' },
{ coords: [ 18.26 , 49.82 ], label: 'Ostrava' }
];
map. on ( 'load' , () => {
map. addSource ( 'pulses' , { type: 'geojson' , data: { type: 'FeatureCollection' ,
features: points. map ( p => ({ type: 'Feature' , geometry: { type: 'Point' , coordinates: p.coords }, properties: { label: p.label } })) } });
map. addLayer ({ id: 'pulse-ring' , type: 'circle' , source: 'pulses' ,
paint: { 'circle-radius' : 10 , 'circle-color' : 'transparent' , 'circle-stroke-width' : 2 , 'circle-stroke-color' : '#2196F3' , 'circle-opacity' : 1 } });
map. addLayer ({ id: 'pulse-center' , type: 'circle' , source: 'pulses' ,
paint: { 'circle-radius' : 5 , 'circle-color' : '#2196F3' } });
let t = 0 ;
function animate () {
t = (t + 1 ) % 120 ;
const r = 10 + (t / 120 ) * 40 ;
const o = 1 - t / 120 ;
map. setPaintProperty ( 'pulse-ring' , 'circle-radius' , r);
map. setPaintProperty ( 'pulse-ring' , 'circle-stroke-opacity' , o);
requestAnimationFrame (animate);
}
animate ();
}); content_copy Copyopen_in_new Open
<! DOCTYPE html >
< html >
< head >
< meta charset = "utf-8" />
< meta name = "viewport" content = "width=device-width, initial-scale=1.0" />
< link rel = "stylesheet" href = "https://unpkg.com/maplibre-gl@6.11.2/dist/maplibre-gl.css" />
< style >
body { margin : 0 ; padding : 0 ; }
#map { width : 100 % ; height : 100 vh ; }
</ style >
</ head >
< body >
< div id = "map" ></ div >
< script type = "module" >
import * as maplibregl from 'https://unpkg.com/maplibre-gl@6.11.2/dist/maplibre-gl.mjs' ;
const map = new maplibregl. Map ({
container: 'map' ,
style: 'https://api.maptiler.com/maps/dataviz-dark/style.json?key=YOUR_MAPTILER_KEY' ,
center: [ 14.42 , 50.08 ],
zoom: 10
});
const points = [
{ coords: [ 14.42 , 50.08 ], label: 'Prague' },
{ coords: [ 16.61 , 49.20 ], label: 'Brno' },
{ coords: [ 18.26 , 49.82 ], label: 'Ostrava' }
];
map. on ( 'load' , () => {
map. addSource ( 'pulses' , { type: 'geojson' , data: { type: 'FeatureCollection' ,
features: points. map ( p => ({ type: 'Feature' , geometry: { type: 'Point' , coordinates: p.coords }, properties: { label: p.label } })) } });
map. addLayer ({ id: 'pulse-ring' , type: 'circle' , source: 'pulses' ,
paint: { 'circle-radius' : 10 , 'circle-color' : 'transparent' , 'circle-stroke-width' : 2 , 'circle-stroke-color' : '#2196F3' , 'circle-opacity' : 1 } });
map. addLayer ({ id: 'pulse-center' , type: 'circle' , source: 'pulses' ,
paint: { 'circle-radius' : 5 , 'circle-color' : '#2196F3' } });
let t = 0 ;
function animate () {
t = (t + 1 ) % 120 ;
const r = 10 + (t / 120 ) * 40 ;
const o = 1 - t / 120 ;
map. setPaintProperty ( 'pulse-ring' , 'circle-radius' , r);
map. setPaintProperty ( 'pulse-ring' , 'circle-stroke-opacity' , o);
requestAnimationFrame (animate);
}
animate ();
});
</ script >
</ body >
</ html > content_copy Copyopen_in_new Open
import maplibregl from 'maplibre-gl' ;
import 'maplibre-gl/dist/maplibre-gl.css' ;
const map = new maplibregl. Map ({
container: 'map' ,
style: 'https://api.maptiler.com/maps/dataviz-dark/style.json?key=YOUR_MAPTILER_KEY' ,
center: [ 14.42 , 50.08 ],
zoom: 10
});
const points = [
{ coords: [ 14.42 , 50.08 ], label: 'Prague' },
{ coords: [ 16.61 , 49.20 ], label: 'Brno' },
{ coords: [ 18.26 , 49.82 ], label: 'Ostrava' }
];
map. on ( 'load' , () => {
map. addSource ( 'pulses' , { type: 'geojson' , data: { type: 'FeatureCollection' ,
features: points. map ( p => ({ type: 'Feature' , geometry: { type: 'Point' , coordinates: p.coords }, properties: { label: p.label } })) } });
map. addLayer ({ id: 'pulse-ring' , type: 'circle' , source: 'pulses' ,
paint: { 'circle-radius' : 10 , 'circle-color' : 'transparent' , 'circle-stroke-width' : 2 , 'circle-stroke-color' : '#2196F3' , 'circle-opacity' : 1 } });
map. addLayer ({ id: 'pulse-center' , type: 'circle' , source: 'pulses' ,
paint: { 'circle-radius' : 5 , 'circle-color' : '#2196F3' } });
let t = 0 ;
function animate () {
t = (t + 1 ) % 120 ;
const r = 10 + (t / 120 ) * 40 ;
const o = 1 - t / 120 ;
map. setPaintProperty ( 'pulse-ring' , 'circle-radius' , r);
map. setPaintProperty ( 'pulse-ring' , 'circle-stroke-opacity' , o);
requestAnimationFrame (animate);
}
animate ();
});
const map = new maplibregl.Map({
container: 'map',
style: 'https://api.maptiler.com/maps/dataviz-dark/style.json?key=YOUR_MAPTILER_KEY',
center: [14.42, 50.08],
zoom: 10
});
const points = [
{ coords: [14.42, 50.08], label: 'Prague' },
{ coords: [16.61, 49.20], label: 'Brno' },
{ coords: [18.26, 49.82], label: 'Ostrava' }
];
map.on('load', () => {
map.addSource('pulses', { type: 'geojson', data: { type: 'FeatureCollection',
features: points.map(p => ({ type: 'Feature', geometry: { type: 'Point', coordinates: p.coords }, properties: { label: p.label } })) } });
map.addLayer({ id: 'pulse-ring', type: 'circle', source: 'pulses',
paint: { 'circle-radius': 10, 'circle-color': 'transparent', 'circle-stroke-width': 2, 'circle-stroke-color': '#2196F3', 'circle-opacity': 1 } });
map.addLayer({ id: 'pulse-center', type: 'circle', source: 'pulses',
paint: { 'circle-radius': 5, 'circle-color': '#2196F3' } });
let t = 0;
function animate() {
t = (t + 1) % 120;
const r = 10 + (t / 120) * 40;
const o = 1 - t / 120;
map.setPaintProperty('pulse-ring', 'circle-radius', r);
map.setPaintProperty('pulse-ring', 'circle-stroke-opacity', o);
requestAnimationFrame(animate);
}
animate();
}); <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="https://unpkg.com/maplibre-gl@6.11.2/dist/maplibre-gl.css" />
<style>
body { margin: 0; padding: 0; }
#map { width: 100%; height: 100vh; }
</style>
</head>
<body>
<div id="map"></div>
<script type="module">
import * as maplibregl from 'https://unpkg.com/maplibre-gl@6.11.2/dist/maplibre-gl.mjs';
const map = new maplibregl.Map({
container: 'map',
style: 'https://api.maptiler.com/maps/dataviz-dark/style.json?key=YOUR_MAPTILER_KEY',
center: [14.42, 50.08],
zoom: 10
});
const points = [
{ coords: [14.42, 50.08], label: 'Prague' },
{ coords: [16.61, 49.20], label: 'Brno' },
{ coords: [18.26, 49.82], label: 'Ostrava' }
];
map.on('load', () => {
map.addSource('pulses', { type: 'geojson', data: { type: 'FeatureCollection',
features: points.map(p => ({ type: 'Feature', geometry: { type: 'Point', coordinates: p.coords }, properties: { label: p.label } })) } });
map.addLayer({ id: 'pulse-ring', type: 'circle', source: 'pulses',
paint: { 'circle-radius': 10, 'circle-color': 'transparent', 'circle-stroke-width': 2, 'circle-stroke-color': '#2196F3', 'circle-opacity': 1 } });
map.addLayer({ id: 'pulse-center', type: 'circle', source: 'pulses',
paint: { 'circle-radius': 5, 'circle-color': '#2196F3' } });
let t = 0;
function animate() {
t = (t + 1) % 120;
const r = 10 + (t / 120) * 40;
const o = 1 - t / 120;
map.setPaintProperty('pulse-ring', 'circle-radius', r);
map.setPaintProperty('pulse-ring', 'circle-stroke-opacity', o);
requestAnimationFrame(animate);
}
animate();
});
</script>
</body>
</html> import maplibregl from 'maplibre-gl';
import 'maplibre-gl/dist/maplibre-gl.css';
const map = new maplibregl.Map({
container: 'map',
style: 'https://api.maptiler.com/maps/dataviz-dark/style.json?key=YOUR_MAPTILER_KEY',
center: [14.42, 50.08],
zoom: 10
});
const points = [
{ coords: [14.42, 50.08], label: 'Prague' },
{ coords: [16.61, 49.20], label: 'Brno' },
{ coords: [18.26, 49.82], label: 'Ostrava' }
];
map.on('load', () => {
map.addSource('pulses', { type: 'geojson', data: { type: 'FeatureCollection',
features: points.map(p => ({ type: 'Feature', geometry: { type: 'Point', coordinates: p.coords }, properties: { label: p.label } })) } });
map.addLayer({ id: 'pulse-ring', type: 'circle', source: 'pulses',
paint: { 'circle-radius': 10, 'circle-color': 'transparent', 'circle-stroke-width': 2, 'circle-stroke-color': '#2196F3', 'circle-opacity': 1 } });
map.addLayer({ id: 'pulse-center', type: 'circle', source: 'pulses',
paint: { 'circle-radius': 5, 'circle-color': '#2196F3' } });
let t = 0;
function animate() {
t = (t + 1) % 120;
const r = 10 + (t / 120) * 40;
const o = 1 - t / 120;
map.setPaintProperty('pulse-ring', 'circle-radius', r);
map.setPaintProperty('pulse-ring', 'circle-stroke-opacity', o);
requestAnimationFrame(animate);
}
animate();
});