leaflet-plugins
Version:
Miscellaneous plugins for Leaflet library for services that need to display route information and need satellite imagery from different providers
25 lines (22 loc) • 479 B
JavaScript
L.Icon.Canvas = L.Icon.extend({
options: {
iconSize: new L.Point(20, 20), // Have to be supplied
/*
iconAnchor: (Point)
popupAnchor: (Point)
*/
className: 'leaflet-canvas-icon'
},
createIcon: function () {
var e = document.createElement('canvas');
this._setIconStyles(e, 'icon');
var s = this.options.iconSize;
e.width = s.x;
e.height = s.y;
this.draw(e.getContext('2d'), s.x, s.y);
return e;
},
createShadow: function () {
return null;
}
});