これは古い質問ですが、誰かが回答されたもの以外の別の可能なオプションを探している場合に備えて.
L.marker([coord.latitude, coord.longitude], {
color: 'red',
icon: getIcon(),
data: coord
}).addTo(myMap).on("click", circleClick);
function getIcon(total_dead_and_missing) {
var icon_size = [50, 50]; //for dynamic icon size,
var image_url = '1.png'; //for dynamic images
L.icon({
iconUrl: image_url,
shadowUrl: 'leaf-shadow.png',
iconSize: icon_size , // size of the icon
shadowSize: [50, 64], // size of the shadow
iconAnchor: [22, 94], // point of the icon which will correspond to marker's location
shadowAnchor: [4, 62], // the same for the shadow
popupAnchor: [-3, -76] // point from which the popup should open relative to the iconAnchor
});
}
リソース: https://leafletjs.com/examples/custom-icons/