renamed color -> markerColor

This commit is contained in:
Lennard Voogdt
2013-10-26 13:59:18 +02:00
parent 3267149563
commit fc412a7aef
7 changed files with 50 additions and 50 deletions
+4 -4
View File
@@ -41,17 +41,17 @@ For Twitter bootstrap:
// Creates a red marker with the coffee icon
var redMarker = L.AwesomeMarkers.icon({
icon: 'coffee',
color: 'red'
markerColor: 'red'
})
L.marker([51.941196,4.512291], {icon: redMarker}).addTo(map);
````
### Supported colors:
### Supported marker colors:
**The following colors are supported**
The 'color' property currently supports these strings:
The 'markerColor' property currently supports these strings:
- 'red'
- 'darkred'
- 'orange'
@@ -79,7 +79,7 @@ You can make any icon spin by setting the spin option to true:
// Creates a red marker with the coffee icon
var redMarker = L.AwesomeMarkers.icon({
icon: 'spinner',
color: 'red',
markerColor: 'red',
spin: true
})
+18 -18
View File
@@ -11,15 +11,15 @@
"outputAbbreviatedPath" : "No Output Path",
"fileType" : 16
},
"\/dist\/images\/markers-shadow.png" : {
"\/dist\/images\/markers-matte.png" : {
"ignoreWasSetByUser" : 0,
"ignore" : 0,
"hidden" : 0,
"outputPathIsSetByUser" : 0,
"inputAbbreviatedPath" : "\/dist\/images\/markers-shadow.png",
"inputAbbreviatedPath" : "\/dist\/images\/markers-matte.png",
"processed" : 0,
"outputAbbreviatedPath" : "\/dist\/images\/markers-shadow.png",
"initialSize" : 535,
"outputAbbreviatedPath" : "\/dist\/images\/markers-matte.png",
"initialSize" : 14323,
"fileType" : 8192
},
"\/examples\/basic-example.html" : {
@@ -62,16 +62,14 @@
"initialSize" : 218197,
"fileType" : 8192
},
"\/dist\/images\/[email protected]" : {
"\/examples\/with-bootstrap.html" : {
"ignoreWasSetByUser" : 0,
"ignore" : 0,
"hidden" : 0,
"outputPathIsSetByUser" : 0,
"inputAbbreviatedPath" : "\/dist\/images\/[email protected]",
"processed" : 0,
"outputAbbreviatedPath" : "\/dist\/images\/[email protected]",
"initialSize" : 23106,
"fileType" : 8192
"inputAbbreviatedPath" : "\/examples\/with-bootstrap.html",
"outputAbbreviatedPath" : "No Output Path",
"fileType" : 2048
},
"\/dist\/images\/[email protected]" : {
"ignoreWasSetByUser" : 0,
@@ -95,14 +93,16 @@
"outputAbbreviatedPath" : "\/dist\/leaflet.awesome-markers.min.js",
"fileType" : 64
},
"\/examples\/with-bootstrap.html" : {
"\/dist\/images\/markers-shadow.png" : {
"ignoreWasSetByUser" : 0,
"ignore" : 0,
"hidden" : 0,
"outputPathIsSetByUser" : 0,
"inputAbbreviatedPath" : "\/examples\/with-bootstrap.html",
"outputAbbreviatedPath" : "No Output Path",
"fileType" : 2048
"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,15 +126,15 @@
"initialSize" : 7946,
"fileType" : 8192
},
"\/dist\/images\/markers-matte.png" : {
"\/dist\/images\/markers-soft@2x.png" : {
"ignoreWasSetByUser" : 0,
"ignore" : 0,
"hidden" : 0,
"outputPathIsSetByUser" : 0,
"inputAbbreviatedPath" : "\/dist\/images\/markers-matte.png",
"inputAbbreviatedPath" : "\/dist\/images\/markers-soft@2x.png",
"processed" : 0,
"outputAbbreviatedPath" : "\/dist\/images\/markers-matte.png",
"initialSize" : 14323,
"outputAbbreviatedPath" : "\/dist\/images\/markers-soft@2x.png",
"initialSize" : 23106,
"fileType" : 8192
},
"\/examples\/random-markers.html" : {
+2 -2
View File
@@ -27,7 +27,7 @@
shadowSize: [36, 16],
className: 'awesome-marker',
icon: 'home',
color: 'blue',
markerColor: 'blue',
iconColor: 'white'
},
@@ -48,7 +48,7 @@
(-options.bgPos.x) + 'px ' + (-options.bgPos.y) + 'px';
}
this._setIconStyles(div, 'icon-' + options.color);
this._setIconStyles(div, 'icon-' + options.markerColor);
return div;
},
+1 -1
View File
@@ -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",color:"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.color);return e},_createInner:function(){var e;e=this.options.icon;return"<i class='"+e+(this.options.spin?" icon-spin":"")+(this.options.iconColor?" icon-"+this.options.iconColor:"")+"'></i>"},_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);
*//*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"<i class='"+e+(this.options.spin?" icon-spin":"")+(this.options.iconColor?" icon-"+this.options.iconColor:"")+"'></i>"},_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);
+12 -12
View File
@@ -34,19 +34,19 @@
detectRetina: true
}).addTo(map);
L.marker([51.941196,4.512291], {icon: L.AwesomeMarkers.icon({icon: 'spinner', color: 'red', spin:true}) }).addTo(map);
L.marker([51.927913,4.521303], {icon: L.AwesomeMarkers.icon({icon: 'icon-coffee', color: 'red', iconColor: 'black'}) }).addTo(map);
L.marker([51.936063,4.502077], {icon: L.AwesomeMarkers.icon({icon: 'food', color: 'purple'}) }).addTo(map);
L.marker([51.932835,4.506969], {icon: L.AwesomeMarkers.icon({icon: 'glass', color: 'green'}) }).addTo(map);
L.marker([51.930295,4.515209], {icon: L.AwesomeMarkers.icon({icon: 'shopping-cart', color: 'blue'}) }).addTo(map);
L.marker([51.930083,4.507742], {icon: L.AwesomeMarkers.icon({icon: 'comments', color: 'orange'}) }).addTo(map);
L.marker([51.941196,4.512291], {icon: L.AwesomeMarkers.icon({icon: 'spinner', markerColor: 'red', spin:true}) }).addTo(map);
L.marker([51.927913,4.521303], {icon: L.AwesomeMarkers.icon({icon: 'icon-coffee', markerColor: 'red', markerColor: 'black'}) }).addTo(map);
L.marker([51.936063,4.502077], {icon: L.AwesomeMarkers.icon({icon: 'food', markerColor: 'purple'}) }).addTo(map);
L.marker([51.932835,4.506969], {icon: L.AwesomeMarkers.icon({icon: 'glass', markerColor: 'green'}) }).addTo(map);
L.marker([51.930295,4.515209], {icon: L.AwesomeMarkers.icon({icon: 'shopping-cart', markerColor: 'blue'}) }).addTo(map);
L.marker([51.930083,4.507742], {icon: L.AwesomeMarkers.icon({icon: 'comments', markerColor: 'orange'}) }).addTo(map);
L.marker([51.930454,4.527054], {icon: L.AwesomeMarkers.icon({icon: 'group', color: 'darkred'}) }).addTo(map);
L.marker([51.929607,4.527054], {icon: L.AwesomeMarkers.icon({icon: 'arrow-right', color: 'darkblue'}) }).addTo(map);
L.marker([51.928919,4.528856], {icon: L.AwesomeMarkers.icon({icon: 'twitter', color: 'cadetblue'}) }).addTo(map);
L.marker([51.930295,4.530745], {icon: L.AwesomeMarkers.icon({icon: 'phone', color: 'darkpurple'}) }).addTo(map);
L.marker([51.925055,4.512806], {icon: L.AwesomeMarkers.icon({icon: 'ambulance', color: 'darkgreen'}) }).addTo(map);
L.marker([51.925902,4.505768], {icon: L.AwesomeMarkers.icon({icon: 'medkit', color: 'darkblue'}) }).addTo(map);
L.marker([51.930454,4.527054], {icon: L.AwesomeMarkers.icon({icon: 'group', markerColor: 'darkred'}) }).addTo(map);
L.marker([51.929607,4.527054], {icon: L.AwesomeMarkers.icon({icon: 'arrow-right', markerColor: 'darkblue'}) }).addTo(map);
L.marker([51.928919,4.528856], {icon: L.AwesomeMarkers.icon({icon: 'twitter', markerColor: 'cadetblue'}) }).addTo(map);
L.marker([51.930295,4.530745], {icon: L.AwesomeMarkers.icon({icon: 'phone', markerColor: 'darkpurple'}) }).addTo(map);
L.marker([51.925055,4.512806], {icon: L.AwesomeMarkers.icon({icon: 'ambulance', markerColor: 'darkgreen'}) }).addTo(map);
L.marker([51.925902,4.505768], {icon: L.AwesomeMarkers.icon({icon: 'medkit', markerColor: 'darkblue'}) }).addTo(map);
</script>
</body>
</html>
+1 -1
View File
@@ -45,7 +45,7 @@
var awesomeIcon = awesomeIcons[Math.floor(Math.random()*awesomeIcons.length)];
var geo = [rndCoordinates(51.3,51.8, 3), rndCoordinates(0.3,-0.4,3)];
L.marker(geo, {icon: L.AwesomeMarkers.icon({icon: awesomeIcon, color: color}) }).addTo(map);
L.marker(geo, {icon: L.AwesomeMarkers.icon({icon: awesomeIcon, markerColor: color}) }).addTo(map);
}
</script>
</body>
+12 -12
View File
@@ -33,19 +33,19 @@
key: 'BC9A493B41014CAABB98F0471D759707'
}).addTo(map);
L.marker([51.941196,4.512291], {icon: L.AwesomeMarkers.icon({icon: 'fire', color: 'red', spin:true}) }).addTo(map);
L.marker([51.927913,4.521303], {icon: L.AwesomeMarkers.icon({icon: 'icon-briefcase', color: 'red'}) }).addTo(map);
L.marker([51.936063,4.502077], {icon: L.AwesomeMarkers.icon({icon: 'home', color: 'purple'}) }).addTo(map);
L.marker([51.932835,4.506969], {icon: L.AwesomeMarkers.icon({icon: 'glass', color: 'green'}) }).addTo(map);
L.marker([51.930295,4.515209], {icon: L.AwesomeMarkers.icon({icon: 'flag', color: 'blue', iconColor: 'black'}) }).addTo(map);
L.marker([51.930083,4.507742], {icon: L.AwesomeMarkers.icon({icon: 'tags', color: 'orange'}) }).addTo(map);
L.marker([51.941196,4.512291], {icon: L.AwesomeMarkers.icon({icon: 'fire', markerColor: 'red', spin:true}) }).addTo(map);
L.marker([51.927913,4.521303], {icon: L.AwesomeMarkers.icon({icon: 'icon-briefcase', markerColor: 'red'}) }).addTo(map);
L.marker([51.936063,4.502077], {icon: L.AwesomeMarkers.icon({icon: 'home', markerColor: 'purple'}) }).addTo(map);
L.marker([51.932835,4.506969], {icon: L.AwesomeMarkers.icon({icon: 'glass', markerColor: 'green'}) }).addTo(map);
L.marker([51.930295,4.515209], {icon: L.AwesomeMarkers.icon({icon: 'flag', markerColor: 'blue', markerColor: 'black'}) }).addTo(map);
L.marker([51.930083,4.507742], {icon: L.AwesomeMarkers.icon({icon: 'tags', markerColor: 'orange'}) }).addTo(map);
L.marker([51.930454,4.527054], {icon: L.AwesomeMarkers.icon({icon: 'bookmark', color: 'darkred'}) }).addTo(map);
L.marker([51.929607,4.527054], {icon: L.AwesomeMarkers.icon({icon: 'picture', color: 'darkblue'}) }).addTo(map);
L.marker([51.928919,4.528856], {icon: L.AwesomeMarkers.icon({icon: 'move', color: 'cadetblue'}) }).addTo(map);
L.marker([51.930295,4.530745], {icon: L.AwesomeMarkers.icon({icon: 'play', color: 'darkpurple'}) }).addTo(map);
L.marker([51.925055,4.512806], {icon: L.AwesomeMarkers.icon({icon: 'barcode', color: 'darkgreen'}) }).addTo(map);
L.marker([51.925902,4.505768], {icon: L.AwesomeMarkers.icon({icon: 'inbox', color: 'darkblue'}) }).addTo(map);
L.marker([51.930454,4.527054], {icon: L.AwesomeMarkers.icon({icon: 'bookmark', markerColor: 'darkred'}) }).addTo(map);
L.marker([51.929607,4.527054], {icon: L.AwesomeMarkers.icon({icon: 'picture', markerColor: 'darkblue'}) }).addTo(map);
L.marker([51.928919,4.528856], {icon: L.AwesomeMarkers.icon({icon: 'move', markerColor: 'cadetblue'}) }).addTo(map);
L.marker([51.930295,4.530745], {icon: L.AwesomeMarkers.icon({icon: 'play', markerColor: 'darkpurple'}) }).addTo(map);
L.marker([51.925055,4.512806], {icon: L.AwesomeMarkers.icon({icon: 'barcode', markerColor: 'darkgreen'}) }).addTo(map);
L.marker([51.925902,4.505768], {icon: L.AwesomeMarkers.icon({icon: 'inbox', markerColor: 'darkblue'}) }).addTo(map);
</script>
</body>
</html>