Skip to content

Commit

Permalink
bump 1.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
coryasilva committed Feb 22, 2016
1 parent 463e67d commit 6d902e6
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 41 deletions.
44 changes: 20 additions & 24 deletions README.md
@@ -1,10 +1,10 @@
# Leaflet.extra-markers plugin v1.0.0
# Leaflet.extra-markers plugin v1.0.4
<a href="https://github.com/lvoogdt/Leaflet.awesome-markers">Big Thanks to lvoogdt of Leaflet.awesome-markers</a>

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")
### <a href="http://coryasilva.github.io/Leaflet.ExtraMarkers/" target="_blank">Demo</a>

##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/)
Expand All @@ -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")

<a href="http://coryasilva.github.io/Leaflet.ExtraMarkers/" target="_blank">Demo</a>


##Using the plugin
## Using the plugin


##### 1. Requirements #####
Expand Down Expand Up @@ -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 <i> 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 <i> 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 | '' | '<svg>', 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.
2 changes: 1 addition & 1 deletion 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"
Expand Down
2 changes: 1 addition & 1 deletion dist/css/leaflet.extra-markers.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/js/leaflet.extra-markers.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -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 <https://github.com/coryasilva>",
"repository": {
Expand Down
3 changes: 1 addition & 2 deletions src/assets/css/leaflet.extra-markers.css
Expand Up @@ -4,9 +4,8 @@
* Leaflet ExtraMarkers
* https://github.com/coryasilva/Leaflet.ExtraMarkers/
* @author coryasilva <https://github.com/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;
Expand Down
39 changes: 31 additions & 8 deletions src/assets/js/leaflet.extra-markers.js
Expand Up @@ -4,7 +4,7 @@
* Leaflet ExtraMarkers
* https://github.com/coryasilva/Leaflet.ExtraMarkers/
* @author coryasilva <https://github.com/coryasilva>
* @version 1.1.0
* @version 1.0.4
*/
(function(window, document, undefined) {
"use strict";
Expand All @@ -31,58 +31,81 @@
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 "<i " + iconNumber + iconColorStyle + "class='" + options.extraClasses + " " + options.prefix + " " + options.icon + "'></i>";
},
_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";
}
},
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);
2 changes: 0 additions & 2 deletions 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;
Expand Down

0 comments on commit 6d902e6

Please sign in to comment.