Answer the question
In order to leave comments, you need to log in
How to add an icon to a marker vector in a leaflet?
as when changing the layer in canvas , add svg or png to the marker or a class with backgroundImage. In general, any of the methods will do. And nothing works. Already tried everything possible. Do not offer DivIcon. I have more than 50k markers, and clustering can not be used. so just canvas.
const markerOptions = {
radius: 14,
fillColor: '#016699',
color: '#fbfbfb',
weight: 1,
opacity: 1,
fillOpacity: 1,
width: 28,
height: 28,
className: 'wayEvent-marker',
renderer: L.canvas(),
preferCanvas: true
};
events.map(_event => {
L.circleMarker([_event.coordinates.lat, _event.coordinates.lon], markerOptions)
})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question