With leaflet-swoopy it's pretty easy to add customizable swoopy arrows on top of maps.
Annotations can help you to highlight the most important parts of a visualisation or tool. This is especially useful when there is a lot of information but you want to point out essential findings.
import L from 'leaflet';
import 'leaflet-swoopy';
const map = L.map('map', {
center: [52.52, 13.4],
zoom: 4,
});
new L.SwoopyArrow([56, 1], [52.52, 13.4], {
text: 'Hi, I am swoopy arrow.',
color: '#64A7D9',
textClassName: 'swoopy-arrow',
minZoom: 4,
maxZoom: 10,
}).addTo(map);
Besides
color
,
weight
and
opacity
you can define a
minZoom
and
maxZoom
in order to show the swoopy annotation only in a specific zoom range. If you want to add custom CSS you can use the
textClassName
option. A list of all options can be found in the
docs.