leaflet-fa-markers
Very simple vector markers with FontAwesome icons, compatible with Leaflet v1.
Use:
var blueMarker = L.marker([lat, lon], {
icon: L.icon.fontAwesome({
iconClasses: "fa fa-info-circle",
markerColor: "#00a9ce",
markerFillOpacity: 0.2,
markerStrokeWidth: 1,
markerStrokeColor: "grey",
iconColor: "#FFF"
})
}).addTo(map);
var spinningMarker = L.marker([lat, lon], {
icon: L.icon.fontAwesome({
iconClasses: "fa fa-circle-o-notch fa-spin",
markerColor: "#ff89b5",
iconColor: "#FFF",
iconXOffset: -2,
iconYOffset: 0
})
}).addTo(map);
blueMarker.options.icon.setStyle({ markerColor: "#F00" });
Public methods
method | params | description |
---|
setStyle | {Object} | update the icon with new style config |