diff --git a/codekit-config.json b/codekit-config.json index 8238e3350..3f67dace6 100644 --- a/codekit-config.json +++ b/codekit-config.json @@ -31,16 +31,16 @@ "outputAbbreviatedPath" : "No Output Path", "fileType" : 2048 }, - "\/dist\/leaflet.awesome-markers.min.js" : { + "\/dist\/images\/markers-shadow.png" : { "ignoreWasSetByUser" : 0, - "ignore" : 1, + "ignore" : 0, "hidden" : 0, "outputPathIsSetByUser" : 0, - "inputAbbreviatedPath" : "\/dist\/leaflet.awesome-markers.min.js", - "outputStyle" : 1, - "syntaxCheckerStyle" : 1, - "outputAbbreviatedPath" : "\/dist\/leaflet.awesome-markers.min.min.js", - "fileType" : 64 + "inputAbbreviatedPath" : "\/dist\/images\/markers-shadow.png", + "processed" : 0, + "outputAbbreviatedPath" : "\/dist\/images\/markers-shadow.png", + "initialSize" : 535, + "fileType" : 8192 }, "\/examples\/css\/font-awesome.min.css" : { "ignoreWasSetByUser" : 0, @@ -62,6 +62,17 @@ "initialSize" : 218197, "fileType" : 8192 }, + "\/dist\/images\/markers-soft@2x.png" : { + "ignoreWasSetByUser" : 0, + "ignore" : 0, + "hidden" : 0, + "outputPathIsSetByUser" : 0, + "inputAbbreviatedPath" : "\/dist\/images\/markers-soft@2x.png", + "processed" : 0, + "outputAbbreviatedPath" : "\/dist\/images\/markers-soft@2x.png", + "initialSize" : 23106, + "fileType" : 8192 + }, "\/examples\/with-bootstrap.html" : { "ignoreWasSetByUser" : 0, "ignore" : 0, @@ -93,17 +104,6 @@ "outputAbbreviatedPath" : "\/dist\/leaflet.awesome-markers.min.js", "fileType" : 64 }, - "\/dist\/images\/markers-shadow.png" : { - "ignoreWasSetByUser" : 0, - "ignore" : 0, - "hidden" : 0, - "outputPathIsSetByUser" : 0, - "inputAbbreviatedPath" : "\/dist\/images\/markers-shadow.png", - "processed" : 0, - "outputAbbreviatedPath" : "\/dist\/images\/markers-shadow.png", - "initialSize" : 535, - "fileType" : 8192 - }, "\/dist\/images\/markers-soft.png" : { "ignoreWasSetByUser" : 0, "ignore" : 0, @@ -126,16 +126,16 @@ "initialSize" : 7946, "fileType" : 8192 }, - "\/dist\/images\/markers-soft@2x.png" : { + "\/dist\/leaflet.awesome-markers.min.js" : { "ignoreWasSetByUser" : 0, - "ignore" : 0, + "ignore" : 1, "hidden" : 0, "outputPathIsSetByUser" : 0, - "inputAbbreviatedPath" : "\/dist\/images\/markers-soft@2x.png", - "processed" : 0, - "outputAbbreviatedPath" : "\/dist\/images\/markers-soft@2x.png", - "initialSize" : 23106, - "fileType" : 8192 + "inputAbbreviatedPath" : "\/dist\/leaflet.awesome-markers.min.js", + "outputStyle" : 1, + "syntaxCheckerStyle" : 1, + "outputAbbreviatedPath" : "\/dist\/leaflet.awesome-markers.min.min.js", + "fileType" : 64 }, "\/examples\/random-markers.html" : { "ignoreWasSetByUser" : 0, diff --git a/dist/leaflet.awesome-markers.js b/dist/leaflet.awesome-markers.js index 31f572661..c7f0e3971 100644 --- a/dist/leaflet.awesome-markers.js +++ b/dist/leaflet.awesome-markers.js @@ -26,6 +26,8 @@ shadowAnchor: [10, 12], shadowSize: [36, 16], className: 'awesome-marker', + prefix: 'glyphicon', + spinClass: 'fa-spin', icon: 'home', markerColor: 'blue', iconColor: 'white' @@ -53,13 +55,15 @@ }, _createInner: function() { - var iconClass; - // if(this.options.icon.slice(0,5)==="icon-"){ - iconClass=this.options.icon; - // }else{ - // iconClass="icon-"+this.options.icon; - // } - return ""; + var iconClass, + options = this.options; + + if(options.icon.slice(0,options.prefix.length+1) === options.prefix + "-") { + iconClass = options.icon; + } else { + iconClass = options.prefix + "-" + options.icon; + } + return ""; }, _setIconStyles: function (img, name) { diff --git a/dist/leaflet.awesome-markers.min.js b/dist/leaflet.awesome-markers.min.js index ebe09d6fe..3b291f309 100644 --- a/dist/leaflet.awesome-markers.min.js +++ b/dist/leaflet.awesome-markers.min.js @@ -4,4 +4,4 @@ http://leafletjs.com https://github.com/lvoogdt -*//*global L*/(function(e,t,n){"use strict";L.AwesomeMarkers={};L.AwesomeMarkers.version="1.0";L.AwesomeMarkers.Icon=L.Icon.extend({options:{iconSize:[35,45],iconAnchor:[17,42],popupAnchor:[1,-32],shadowAnchor:[10,12],shadowSize:[36,16],className:"awesome-marker",icon:"home",markerColor:"blue",iconColor:"white"},initialize:function(e){e=L.setOptions(this,e)},createIcon:function(){var e=t.createElement("div"),n=this.options;n.icon&&(e.innerHTML=this._createInner());n.bgPos&&(e.style.backgroundPosition=-n.bgPos.x+"px "+ -n.bgPos.y+"px");this._setIconStyles(e,"icon-"+n.markerColor);return e},_createInner:function(){var e;e=this.options.icon;return""},_setIconStyles:function(e,t){var n=this.options,r=L.point(n[t==="shadow"?"shadowSize":"iconSize"]),i;t==="shadow"?i=L.point(n.shadowAnchor||n.iconAnchor):i=L.point(n.iconAnchor);!i&&r&&(i=r.divideBy(2,!0));e.className="awesome-marker-"+t+" "+n.className;if(i){e.style.marginLeft=-i.x+"px";e.style.marginTop=-i.y+"px"}if(r){e.style.width=r.x+"px";e.style.height=r.y+"px"}},createShadow:function(){var e=t.createElement("div");this._setIconStyles(e,"shadow");return e}});L.AwesomeMarkers.icon=function(e){return new L.AwesomeMarkers.Icon(e)}})(this,document); \ No newline at end of file +*//*global L*/(function(e,t,n){"use strict";L.AwesomeMarkers={};L.AwesomeMarkers.version="1.0";L.AwesomeMarkers.Icon=L.Icon.extend({options:{iconSize:[35,45],iconAnchor:[17,42],popupAnchor:[1,-32],shadowAnchor:[10,12],shadowSize:[36,16],className:"awesome-marker",prefix:"glyphicon",spinClass:"fa-spin",icon:"home",markerColor:"blue",iconColor:"white"},initialize:function(e){e=L.setOptions(this,e)},createIcon:function(){var e=t.createElement("div"),n=this.options;n.icon&&(e.innerHTML=this._createInner());n.bgPos&&(e.style.backgroundPosition=-n.bgPos.x+"px "+ -n.bgPos.y+"px");this._setIconStyles(e,"icon-"+n.markerColor);return e},_createInner:function(){var e,t=this.options;t.icon.slice(0,t.prefix.length+1)===t.prefix+"-"?e=t.icon:e=t.prefix+"-"+t.icon;return""},_setIconStyles:function(e,t){var n=this.options,r=L.point(n[t==="shadow"?"shadowSize":"iconSize"]),i;t==="shadow"?i=L.point(n.shadowAnchor||n.iconAnchor):i=L.point(n.iconAnchor);!i&&r&&(i=r.divideBy(2,!0));e.className="awesome-marker-"+t+" "+n.className;if(i){e.style.marginLeft=-i.x+"px";e.style.marginTop=-i.y+"px"}if(r){e.style.width=r.x+"px";e.style.height=r.y+"px"}},createShadow:function(){var e=t.createElement("div");this._setIconStyles(e,"shadow");return e}});L.AwesomeMarkers.icon=function(e){return new L.AwesomeMarkers.Icon(e)}})(this,document); \ No newline at end of file