diff --git a/codekit-config.json b/codekit-config.json index 3f67dace61..092e6d675d 100644 --- a/codekit-config.json +++ b/codekit-config.json @@ -31,16 +31,16 @@ "outputAbbreviatedPath" : "No Output Path", "fileType" : 2048 }, - "\/dist\/images\/markers-shadow.png" : { + "\/dist\/leaflet.awesome-markers.min.js" : { "ignoreWasSetByUser" : 0, - "ignore" : 0, + "ignore" : 1, "hidden" : 0, "outputPathIsSetByUser" : 0, - "inputAbbreviatedPath" : "\/dist\/images\/markers-shadow.png", - "processed" : 0, - "outputAbbreviatedPath" : "\/dist\/images\/markers-shadow.png", - "initialSize" : 535, - "fileType" : 8192 + "inputAbbreviatedPath" : "\/dist\/leaflet.awesome-markers.min.js", + "outputStyle" : 1, + "syntaxCheckerStyle" : 1, + "outputAbbreviatedPath" : "\/dist\/leaflet.awesome-markers.min.min.js", + "fileType" : 64 }, "\/examples\/css\/font-awesome.min.css" : { "ignoreWasSetByUser" : 0, @@ -62,17 +62,6 @@ "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, @@ -82,6 +71,17 @@ "outputAbbreviatedPath" : "No Output Path", "fileType" : 2048 }, + "\/dist\/leaflet.awesome-markers.js" : { + "ignoreWasSetByUser" : 0, + "ignore" : 0, + "hidden" : 0, + "outputPathIsSetByUser" : 0, + "inputAbbreviatedPath" : "\/dist\/leaflet.awesome-markers.js", + "outputStyle" : 1, + "syntaxCheckerStyle" : 1, + "outputAbbreviatedPath" : "\/dist\/leaflet.awesome-markers.min.js", + "fileType" : 64 + }, "\/dist\/images\/markers-matte@2x.png" : { "ignoreWasSetByUser" : 0, "ignore" : 0, @@ -93,16 +93,16 @@ "initialSize" : 31113, "fileType" : 8192 }, - "\/dist\/leaflet.awesome-markers.js" : { + "\/dist\/images\/markers-shadow.png" : { "ignoreWasSetByUser" : 0, "ignore" : 0, "hidden" : 0, "outputPathIsSetByUser" : 0, - "inputAbbreviatedPath" : "\/dist\/leaflet.awesome-markers.js", - "outputStyle" : 1, - "syntaxCheckerStyle" : 1, - "outputAbbreviatedPath" : "\/dist\/leaflet.awesome-markers.min.js", - "fileType" : 64 + "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, @@ -126,16 +126,16 @@ "initialSize" : 7946, "fileType" : 8192 }, - "\/dist\/leaflet.awesome-markers.min.js" : { + "\/dist\/images\/markers-soft@2x.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-soft@2x.png", + "processed" : 0, + "outputAbbreviatedPath" : "\/dist\/images\/markers-soft@2x.png", + "initialSize" : 23106, + "fileType" : 8192 }, "\/examples\/random-markers.html" : { "ignoreWasSetByUser" : 0, diff --git a/dist/leaflet.awesome-markers.js b/dist/leaflet.awesome-markers.js index c7f0e39718..06d1f03582 100644 --- a/dist/leaflet.awesome-markers.js +++ b/dist/leaflet.awesome-markers.js @@ -55,15 +55,27 @@ }, _createInner: function() { - var iconClass, - options = this.options; + var iconClass, iconSpinClass = "", iconColorClass = "", iconColorStyle = "", options = this.options; if(options.icon.slice(0,options.prefix.length+1) === options.prefix + "-") { iconClass = options.icon; } else { iconClass = options.prefix + "-" + options.icon; } - return ""; + + if(options.spin && typeof options.spinClass === "string") { + iconSpinClass = options.spinClass; + } + + if(options.iconColor) { + if(options.iconColor === 'white' || options.iconColor === 'black') { + iconColorClass = "icon-" + options.iconColor; + } else { + iconColorStyle = "style='color: " + options.iconColor + "' "; + } + } + + return ""; }, _setIconStyles: function (img, name) { diff --git a/dist/leaflet.awesome-markers.min.js b/dist/leaflet.awesome-markers.min.js index 3b291f3090..cb0501bf10 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",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 +*//*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="",n="",r="",i=this.options;i.icon.slice(0,i.prefix.length+1)===i.prefix+"-"?e=i.icon:e=i.prefix+"-"+i.icon;i.spin&&typeof i.spinClass=="string"&&(t=i.spinClass);i.iconColor&&(i.iconColor==="white"||i.iconColor==="black"?n="icon-"+i.iconColor:r="style='color: "+i.iconColor+"' ");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 diff --git a/examples/basic-example.html b/examples/basic-example.html index 00c0c11e08..9139eaada7 100644 --- a/examples/basic-example.html +++ b/examples/basic-example.html @@ -7,22 +7,17 @@ - - -
- fa-camera-retro - diff --git a/examples/random-markers.html b/examples/random-markers.html index 06b4b742e5..9bdb5dd4f1 100644 --- a/examples/random-markers.html +++ b/examples/random-markers.html @@ -7,9 +7,7 @@ - -