From 6d902e6d08c3c9eb901a0315ecd55ffbbb39ad8b Mon Sep 17 00:00:00 2001 From: Cory Silva Date: Mon, 22 Feb 2016 08:46:24 -0800 Subject: [PATCH] bump 1.0.4 --- README.md | 44 ++++++++++------------ bower.json | 2 +- dist/css/leaflet.extra-markers.min.css | 2 +- dist/js/leaflet.extra-markers.min.js | 4 +- package.json | 2 +- src/assets/css/leaflet.extra-markers.css | 3 +- src/assets/js/leaflet.extra-markers.js | 39 +++++++++++++++---- src/assets/less/leaflet.extra-markers.less | 2 - 8 files changed, 57 insertions(+), 41 deletions(-) diff --git a/README.md b/README.md index d542b60..24cdd6f 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ -# Leaflet.extra-markers plugin v1.0.0 +# Leaflet.extra-markers plugin v1.0.4 Big Thanks to lvoogdt of Leaflet.awesome-markers -This plugin depends on either Bootstrap, Font-Awesome, or Semantic-UI for the rendering of the icons. See these urls above for more information. - +![ExtraMarkers screenshot](https://raw.github.com/coryasilva/Leaflet.ExtraMarkers/master/screenshot.png "Screenshot of ExtraMarkers") +### Demo -##Icons +## Icons Version 1.0 of Leaflet.extra-markers is designed for: - [Bootstrap 3 icons](http://twitter.github.com/bootstrap/) - [Getting Started Guide](http://getbootstrap.com/getting-started/) @@ -14,13 +14,8 @@ Version 1.0 of Leaflet.extra-markers is designed for: - [Ion Icons 2.0.1](http://ionicons.com/) - Leaflet 0.5-Latest -## Screenshots -![ExtraMarkers screenshot](https://raw.github.com/coryasilva/Leaflet.ExtraMarkers/master/screenshot.png "Screenshot of ExtraMarkers") - -Demo - -##Using the plugin +## Using the plugin ##### 1. Requirements ##### @@ -62,19 +57,20 @@ Now use the plugin to create a marker like this: ### Properties -| Property | Description | Default Value | Possible values | -| --------------- | ---------------------------- | ------------- | ---------------------------------------------------- | -| icon | Name of the icon WITH prefix | 'fa-home' | See glyphicons or font-awesome (must include prefix) | -| innerHTML | own HTML code | '' | can be used to use SVG or PNG files | -| prefix | Select de icon library | 'glyphicon' | 'fa' for font-awesome or 'glyphicon' for bootstrap 3 | -| markerColor | Color of the marker | 'blue' | 'red', 'orange-dark', 'orange', 'yellow', 'blue-dark', 'cyan', 'purple', 'violet', 'pink', 'green-dark', 'green', 'green-light', 'black', 'white' | -| shape | Shape of the marker | 'circle' | 'circle', 'square', 'star', 'penta' | -| iconColor | Color of the icon | 'white' | 'white', 'black' or css code (hex, rgba etc) | -| spin | REMOVED | false | true or false. Font-awesome required | -| extraClasses | Additional classes in the created tag | '' | 'fa-rotate90 myclass' eller other custom configuration | -| number | Add a text number to the icon| '' | any number, must use icon fa-number | +| Property | Description | Default Value | Possible values | +| --------------- | ----------------------------------------- | ------------- | ---------------------------------------------------- | +| extraClasses | Additional classes in the created tag | '' | 'fa-rotate90 myclass'; space delimited classes to add | +| bgPos | Background Position adjustment | '' | {x: 2px, y: -2px} +| icon | Name of the icon WITH prefix | 'fa-home' | see glyphicons or font-awesome (without prefix) | +| iconColor | Color of the icon | 'white' | 'white', 'black' or css code (hex, rgba etc) | +| innerHTML | own HTML code | '' | '', images, or other HTML; a truthy assignment will override the default html icon creation behavior | +| markerColor | Color of the marker | 'blue' | 'red', 'orange-dark', 'orange', 'yellow', 'blue-dark', 'cyan', 'purple', 'violet', 'pink', 'green-dark', 'green', 'green-light', 'black', or 'white' | +| number | Add a text number to the icon | '' | '1' or 'A', must use icon fa-number | +| prefix | Select de icon library | 'glyphicon' | 'fa' for font-awesome or 'glyphicon' for bootstrap 3 | +| shape | Shape of the marker | 'circle' | 'circle', 'square', 'star', or 'penta' | +| spin | REMOVED | false | true or false. Font-awesome required | + + ## License -- Leaflet.ExtraMarkers and colored markers are licensed under the MIT License - http://opensource.org/licenses/mit-license.html. -- Font Awesome: http://fortawesome.github.io/Font-Awesome/license/ -- Twitter Bootstrap: http://getbootstrap.com/ +- Leaflet.ExtraMarkers and colored markers are licensed under the MIT License - http://opensource.org/licenses/mit-license.html. \ No newline at end of file diff --git a/bower.json b/bower.json index e3c497a..28e4494 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "Leaflet.extra-markers", - "version": "1.0.3", + "version": "1.0.4", "homepage": "https://github.com/coryasilva/Leaflet.ExtraMarkers", "authors": [ "Cory Silva" diff --git a/dist/css/leaflet.extra-markers.min.css b/dist/css/leaflet.extra-markers.min.css index 7c8c8db..365cd0c 100644 --- a/dist/css/leaflet.extra-markers.min.css +++ b/dist/css/leaflet.extra-markers.min.css @@ -4,5 +4,5 @@ * Leaflet ExtraMarkers * https://github.com/coryasilva/Leaflet.ExtraMarkers/ * @author coryasilva - * @version 1.1.0 + * @version 1.0.4 */.extra-marker{background:url('images/markers_default.png') no-repeat 0 0;width:35px;height:46px;position:absolute;left:0;top:0;display:block;text-align:center}.extra-marker-shadow{background:url('images/markers_shadow.png') no-repeat 0 0;width:36px;height:16px}@media (min--moz-device-pixel-ratio:1.5),(-webkit-min-device-pixel-ratio:1.5),(min-device-pixel-ratio:1.5),(min-resolution:1.5dppx){.extra-marker{background-image:url('images/markers_default@2x.png');background-size:540px 184px}.extra-marker-shadow{background-image:url('images/markers_shadow@2x.png');background-size:35px 16px}}.extra-marker i{color:#fff;margin-top:10px;display:inline-block;font-size:14px}.extra-marker i.icon{margin-right:0;opacity:1}.extra-marker-circle-red{background-position:0 0}.extra-marker-circle-orange-dark{background-position:-36px 0}.extra-marker-circle-orange{background-position:-72px 0}.extra-marker-circle-yellow{background-position:-108px 0}.extra-marker-circle-blue-dark{background-position:-144px 0}.extra-marker-circle-blue{background-position:-180px 0}.extra-marker-circle-cyan{background-position:-216px 0}.extra-marker-circle-purple{background-position:-252px 0}.extra-marker-circle-violet{background-position:-288px 0}.extra-marker-circle-pink{background-position:-324px 0}.extra-marker-circle-green-dark{background-position:-360px 0}.extra-marker-circle-green{background-position:-396px 0}.extra-marker-circle-green-light{background-position:-432px 0}.extra-marker-circle-black{background-position:-468px 0}.extra-marker-circle-white{background-position:-504px 0}.extra-marker-square-red{background-position:0 -46px}.extra-marker-square-orange-dark{background-position:-36px -46px}.extra-marker-square-orange{background-position:-72px -46px}.extra-marker-square-yellow{background-position:-108px -46px}.extra-marker-square-blue-dark{background-position:-144px -46px}.extra-marker-square-blue{background-position:-180px -46px}.extra-marker-square-cyan{background-position:-216px -46px}.extra-marker-square-purple{background-position:-252px -46px}.extra-marker-square-violet{background-position:-288px -46px}.extra-marker-square-pink{background-position:-324px -46px}.extra-marker-square-green-dark{background-position:-360px -46px}.extra-marker-square-green{background-position:-396px -46px}.extra-marker-square-green-light{background-position:-432px -46px}.extra-marker-square-black{background-position:-468px -46px}.extra-marker-square-white{background-position:-504px -46px}.extra-marker-star-red{background-position:0 -92px}.extra-marker-star-orange-dark{background-position:-36px -92px}.extra-marker-star-orange{background-position:-72px -92px}.extra-marker-star-yellow{background-position:-108px -92px}.extra-marker-star-blue-dark{background-position:-144px -92px}.extra-marker-star-blue{background-position:-180px -92px}.extra-marker-star-cyan{background-position:-216px -92px}.extra-marker-star-purple{background-position:-252px -92px}.extra-marker-star-violet{background-position:-288px -92px}.extra-marker-star-pink{background-position:-324px -92px}.extra-marker-star-green-dark{background-position:-360px -92px}.extra-marker-star-green{background-position:-396px -92px}.extra-marker-star-green-light{background-position:-432px -92px}.extra-marker-star-black{background-position:-468px -92px}.extra-marker-star-white{background-position:-504px -92px}.extra-marker-penta-red{background-position:0 -138px}.extra-marker-penta-orange-dark{background-position:-36px -138px}.extra-marker-penta-orange{background-position:-72px -138px}.extra-marker-penta-yellow{background-position:-108px -138px}.extra-marker-penta-blue-dark{background-position:-144px -138px}.extra-marker-penta-blue{background-position:-180px -138px}.extra-marker-penta-cyan{background-position:-216px -138px}.extra-marker-penta-purple{background-position:-252px -138px}.extra-marker-penta-violet{background-position:-288px -138px}.extra-marker-penta-pink{background-position:-324px -138px}.extra-marker-penta-green-dark{background-position:-360px -138px}.extra-marker-penta-green{background-position:-396px -138px}.extra-marker-penta-green-light{background-position:-432px -138px}.extra-marker-penta-black{background-position:-468px -138px}.extra-marker-penta-white{background-position:-504px -138px}.extra-marker .fa-number:before{content:attr(number)} \ No newline at end of file diff --git a/dist/js/leaflet.extra-markers.min.js b/dist/js/leaflet.extra-markers.min.js index d166c0d..ff0ef6b 100644 --- a/dist/js/leaflet.extra-markers.min.js +++ b/dist/js/leaflet.extra-markers.min.js @@ -4,6 +4,6 @@ * Leaflet ExtraMarkers * https://github.com/coryasilva/Leaflet.ExtraMarkers/ * @author coryasilva - * @version 1.1.0 + * @version 1.0.4 */ -!function(a,b){"use strict";L.ExtraMarkers={},L.ExtraMarkers.version="1.0.1",L.ExtraMarkers.Icon=L.Icon.extend({options:{iconSize:[35,45],iconAnchor:[17,42],popupAnchor:[1,-32],shadowAnchor:[10,12],shadowSize:[36,16],className:"extra-marker",prefix:"",extraClasses:"",shape:"circle",icon:"",markerColor:"red",iconColor:"#fff",number:""},initialize:function(a){a=L.Util.setOptions(this,a)},createIcon:function(){var a=b.createElement("div"),c=this.options;return c.icon&&(a.innerHTML=this._createInner()),c.bgPos&&(a.style.backgroundPosition=-c.bgPos.x+"px "+-c.bgPos.y+"px"),this._setIconStyles(a,c.shape+"-"+c.markerColor),a},_createInner:function(){var a="",b="",c=this.options;return c.iconColor&&(a="style='color: "+c.iconColor+"' "),c.number&&(b="number='"+c.number+"' "),""},_setIconStyles:function(a,b){var c,d,e=this.options,f=L.point(e["shadow"===b?"shadowSize":"iconSize"]);"shadow"===b?(c=L.point(e.shadowAnchor||e.iconAnchor),d="shadow"):(c=L.point(e.iconAnchor),d="icon"),!c&&f&&(c=f.divideBy(2,!0)),a.className="leaflet-marker-"+d+" extra-marker-"+b+" "+e.className,c&&(a.style.marginLeft=-c.x+"px",a.style.marginTop=-c.y+"px"),f&&(a.style.width=f.x+"px",a.style.height=f.y+"px")},createShadow:function(){var a=b.createElement("div");return this._setIconStyles(a,"shadow"),a}}),L.ExtraMarkers.icon=function(a){return new L.ExtraMarkers.Icon(a)}}(window,document); \ No newline at end of file +!function(a,b){"use strict";L.ExtraMarkers={},L.ExtraMarkers.version="1.0.1",L.ExtraMarkers.Icon=L.Icon.extend({options:{iconSize:[35,45],iconAnchor:[17,42],popupAnchor:[1,-32],shadowAnchor:[10,12],shadowSize:[36,16],className:"extra-marker",prefix:"",extraClasses:"",shape:"circle",icon:"",innerHTML:"",markerColor:"red",iconColor:"#fff",number:""},initialize:function(a){a=L.Util.setOptions(this,a)},createIcon:function(){var a=b.createElement("div"),c=this.options;return c.icon&&(a.innerHTML=this._createInner()),c.innerHTML&&(a.innerHTML=c.innerHTML),c.bgPos&&(a.style.backgroundPosition=-c.bgPos.x+"px "+-c.bgPos.y+"px"),this._setIconStyles(a,c.shape+"-"+c.markerColor),a},_createInner:function(){var a="",b="",c=this.options;return c.iconColor&&(a="style='color: "+c.iconColor+"' "),c.number&&(b="number='"+c.number+"' "),""},_setIconStyles:function(a,b){var c,d,e=this.options,f=L.point(e["shadow"===b?"shadowSize":"iconSize"]);"shadow"===b?(c=L.point(e.shadowAnchor||e.iconAnchor),d="shadow"):(c=L.point(e.iconAnchor),d="icon"),!c&&f&&(c=f.divideBy(2,!0)),a.className="leaflet-marker-"+d+" extra-marker-"+b+" "+e.className,c&&(a.style.marginLeft=-c.x+"px",a.style.marginTop=-c.y+"px"),f&&(a.style.width=f.x+"px",a.style.height=f.y+"px")},createShadow:function(){var a=b.createElement("div");return this._setIconStyles(a,"shadow"),a}}),L.ExtraMarkers.icon=function(a){return new L.ExtraMarkers.Icon(a)}}(window,document); \ No newline at end of file diff --git a/package.json b/package.json index 92a0591..0cfeedb 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "Leaflet.extra-markers", "title": "Leaflet ExtraMarkers", "url": "https://github.com/coryasilva/Leaflet.ExtraMarkers/", - "version": "1.1.0", + "version": "1.0.4", "description": "Custom Markers for Leaflet JS based on Awesome Markers", "author": "coryasilva ", "repository": { diff --git a/src/assets/css/leaflet.extra-markers.css b/src/assets/css/leaflet.extra-markers.css index e276813..ef6af0a 100644 --- a/src/assets/css/leaflet.extra-markers.css +++ b/src/assets/css/leaflet.extra-markers.css @@ -4,9 +4,8 @@ * Leaflet ExtraMarkers * https://github.com/coryasilva/Leaflet.ExtraMarkers/ * @author coryasilva - * @version 1.1.0 + * @version 1.0.4 */ -/* Version 1.1.0 */ /* Marker setup */ .extra-marker { background: url('images/markers_default.png') no-repeat 0 0; diff --git a/src/assets/js/leaflet.extra-markers.js b/src/assets/js/leaflet.extra-markers.js index 181a9a9..5ee2d9b 100644 --- a/src/assets/js/leaflet.extra-markers.js +++ b/src/assets/js/leaflet.extra-markers.js @@ -4,7 +4,7 @@ * Leaflet ExtraMarkers * https://github.com/coryasilva/Leaflet.ExtraMarkers/ * @author coryasilva - * @version 1.1.0 + * @version 1.0.4 */ (function(window, document, undefined) { "use strict"; @@ -31,46 +31,65 @@ options = L.Util.setOptions(this, options); }, createIcon: function() { - var div = document.createElement("div"), options = this.options; + var div = document.createElement("div"), + options = this.options; + if (options.icon) { div.innerHTML = this._createInner(); } + if (options.innerHTML) { div.innerHTML = options.innerHTML; } + if (options.bgPos) { - div.style.backgroundPosition = -options.bgPos.x + "px " + -options.bgPos.y + "px"; + div.style.backgroundPosition = (-options.bgPos.x) + "px " + (-options.bgPos.y) + "px"; } + this._setIconStyles(div, options.shape + "-" + options.markerColor); return div; }, _createInner: function() { - var iconClass, iconSpinClass = "", iconColorClass = "", iconColorStyle = "", iconNumber = "", options = this.options; + var iconColorStyle = "", + iconNumber = "", + options = this.options; + if (options.iconColor) { iconColorStyle = "style='color: " + options.iconColor + "' "; } + if (options.number) { iconNumber = "number='" + options.number + "' "; } + return ""; }, _setIconStyles: function(img, name) { - var options = this.options, size = L.point(options[name === "shadow" ? "shadowSize" : "iconSize"]), anchor, leafletName; + var options = this.options, + size = L.point(options[name === "shadow" ? "shadowSize" : "iconSize"]), + anchor, + leafletName; + if (name === "shadow") { anchor = L.point(options.shadowAnchor || options.iconAnchor); leafletName = "shadow"; - } else { + } + else { anchor = L.point(options.iconAnchor); leafletName = "icon"; } + if (!anchor && size) { anchor = size.divideBy(2, true); } + img.className = "leaflet-marker-" + leafletName + " extra-marker-" + name + " " + options.className; + if (anchor) { - img.style.marginLeft = -anchor.x + "px"; - img.style.marginTop = -anchor.y + "px"; + img.style.marginLeft = (-anchor.x) + "px"; + img.style.marginTop = (-anchor.y) + "px"; } + if (size) { img.style.width = size.x + "px"; img.style.height = size.y + "px"; @@ -78,11 +97,15 @@ }, createShadow: function() { var div = document.createElement("div"); + this._setIconStyles(div, "shadow"); + return div; } }); + L.ExtraMarkers.icon = function(options) { return new L.ExtraMarkers.Icon(options); }; + })(window, document); \ No newline at end of file diff --git a/src/assets/less/leaflet.extra-markers.less b/src/assets/less/leaflet.extra-markers.less index 21eb6bf..17a05cd 100644 --- a/src/assets/less/leaflet.extra-markers.less +++ b/src/assets/less/leaflet.extra-markers.less @@ -1,5 +1,3 @@ -/* Version 1.1.0 */ - /* Marker setup */ .extra-marker { background: url('images/markers_default.png') no-repeat 0 0;