Leaflet.Icon 使用记录

 NormalIcon = L.icon.pulse({
            iconSize: [20, 20],
            color: ‘#4169E1’,
            animate: false,
            heartbeat:0
        });
  WarningIcon = L.icon.pulse({
            iconSize: [20, 20],
            color: ‘#E3170D’,
            animate: true,
            heartbeat: 1
        });

L.marker([ 坐标x,坐标y  ], { icon: WarningIcon }).addTo(map)

 

var pulseIcon = L.icon({
    iconUrl: ‘my-icon.png’,
    iconSize: [38, 95],
    iconAnchor: [22, 94],
    popupAnchor: [-3, -76],
    shadowUrl: ‘my-icon-shadow.png’,
    shadowSize: [68, 95],
    shadowAnchor: [22, 94]
});
 

转载自:https://blog.csdn.net/zynevermore/article/details/84938099

You may also like...

退出移动版