1 line
2.1 KiB
JavaScript
1 line
2.1 KiB
JavaScript
/*! Leaflet.vector-markers - v0.0.3 - 2015-01-23 */(function(){!function(a,b){"use strict";return L.VectorMarkers={},L.VectorMarkers.version="1.0.0",L.VectorMarkers.MAP_PIN="M16,1 C7.7146,1 1,7.65636364 1,15.8648485 C1,24.0760606 16,51 16,51 C16,51 31,24.0760606 31,15.8648485 C31,7.65636364 24.2815,1 16,1 L16,1 Z",L.VectorMarkers.Icon=L.Icon.extend({options:{iconSize:[30,50],iconAnchor:[15,50],popupAnchor:[2,-40],shadowAnchor:[7,45],shadowSize:[54,51],className:"vector-marker",prefix:"fa",spinClass:"fa-spin",extraClasses:"",icon:"home",markerColor:"blue",iconColor:"white"},initialize:function(a){return a=L.Util.setOptions(this,a)},createIcon:function(a){var c,d,e,f;return c=a&&"DIV"===a.tagName?a:b.createElement("div"),e=this.options,e.icon&&(d=this._createInner()),f=L.VectorMarkers.MAP_PIN,c.innerHTML='<svg width="32px" height="52px" viewBox="0 0 32 52" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="'+f+'" fill="'+e.markerColor+'"></path>'+d+"</svg>",this._setIconStyles(c,"icon"),this._setIconStyles(c,"icon-"+e.markerColor),c},_createInner:function(){var a,b,c,d,e;return a=void 0,d="",b="",c="",e=this.options,a=""===e.prefix||e.icon.slice(0,e.prefix.length+1)===e.prefix+"-"?e.icon:e.prefix+"-"+e.icon,e.spin&&"string"==typeof e.spinClass&&(d=e.spinClass),e.iconColor&&("white"===e.iconColor||"black"===e.iconColor?b="icon-"+e.iconColor:c="style='color: "+e.iconColor+"' "),"<i "+c+"class='"+e.extraClasses+" "+e.prefix+" "+a+" "+d+" "+b+"'></i>"},_setIconStyles:function(a,b){var c,d,e;return d=this.options,e=L.point(d["shadow"===b?"shadowSize":"iconSize"]),c=void 0,c=L.point("shadow"===b?d.shadowAnchor||d.iconAnchor:d.iconAnchor),!c&&e&&(c=e.divideBy(2,!0)),a.className="vector-marker-"+b+" "+d.className,c&&(a.style.marginLeft=-c.x+"px",a.style.marginTop=-c.y+"px"),e?(a.style.width=e.x+"px",a.style.height=e.y+"px"):void 0},createShadow:function(){var a;return a=b.createElement("div"),this._setIconStyles(a,"shadow"),a}}),L.VectorMarkers.icon=function(a){return new L.VectorMarkers.Icon(a)}}(this,document)}).call(this); |