Skip to content

Commit

Permalink
Leaflet.awesome-markers v2.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
mrohnstock committed Feb 24, 2015
0 parents commit 9edd836
Show file tree
Hide file tree
Showing 15 changed files with 352 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
leaflet-awesome-markers
=======================

Shim repository for http://github.com/lvoogdt/Leaflet.awesome-markers

Package Managers
----------------

* [npm](http://npmjs.org/package/drmonty-leaflet-awesome-markers): `drmonty-leaflet-awesome-markers`
* [Bower](http://twitter.github.com/bower/): `drmonty-leaflet-awesome-markers`
* [Composer](http://packagist.org/packages/drmonty/leaflet-awesome-markers): `drmonty/leaflet-awesome-markers`
* [Component](http://component.io): `drmonty/leaflet-awesome-markers`
16 changes: 16 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "drmonty-leaflet-awesome-markers",
"description": "Colorful, iconic & retina-proof markers for Leaflet, based on the Font Awesome/Twitter Bootstrap icons.",
"homepage": "http://github.com/lvoogdt/Leaflet.awesome-markers",
"version": "2.0.2",
"authors": [
"Lennard Voogdt <[email protected]>"
],
"license": "MIT",
"main": "js/leaflet.awesome-markers.js",
"ignore": [
"component.json",
"package.json",
"composer.json"
]
}
24 changes: 24 additions & 0 deletions component.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "drmonty-leaflet-awesome-markers",
"repo": "drmonty/leaflet-awesome-markers",
"description": "Colorful, iconic & retina-proof markers for Leaflet, based on the Font Awesome/Twitter Bootstrap icons.",
"version": "2.0.2",
"homepage": "http://github.com/lvoogdt/Leaflet.awesome-markers",
"license": "MIT",
"main": "js/leaflet.awesome-markers.js",
"scripts": [
"js/leaflet.awesome-markers.js"
],
"files": [
"js/leaflet.awesome-markers.js",
"js/leaflet.awesome-markers.min.js",
"css/leaflet.awesome-markers.css",
"css/images/markers-matte.png",
"css/images/[email protected]",
"css/images/markers-plain.png",
"css/images/markers-shadow.png",
"css/images/[email protected]",
"css/images/markers-soft.png",
"css/images/[email protected]"
]
}
26 changes: 26 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "drmonty/leaflet-awesome-markers",
"description": "Colorful, iconic & retina-proof markers for Leaflet, based on the Font Awesome/Twitter Bootstrap icons.",
"type": "component",
"homepage": "http://github.com/lvoogdt/Leaflet.awesome-markers",
"license": "MIT",
"author": {
"url": "http://github.com/lvoogdt/Leaflet.awesome-markers",
"name": "Lennard Voogdt <[email protected]>"
},
"require": {
"robloach/component-installer": "*"
},
"extra": {
"component": {
"scripts": [
"js/leaflet.awesome-markers.js"
],
"files": [
"js/leaflet.awesome-markers.min.js",
"css/leaflet.awesome-markers.css",
"css/images/*.png"
]
}
}
}
Binary file added css/images/markers-matte.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added css/images/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added css/images/markers-plain.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added css/images/markers-shadow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added css/images/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added css/images/markers-soft.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added css/images/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
124 changes: 124 additions & 0 deletions css/leaflet.awesome-markers.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
/*
Author: L. Voogdt
License: MIT
Version: 1.0
*/

/* Marker setup */
.awesome-marker {
background: url('images/markers-soft.png') no-repeat 0 0;
width: 35px;
height: 46px;
position:absolute;
left:0;
top:0;
display: block;
text-align: center;
}

.awesome-marker-shadow {
background: url('images/markers-shadow.png') no-repeat 0 0;
width: 36px;
height: 16px;
}

/* Retina displays */
@media (min--moz-device-pixel-ratio: 1.5),(-o-min-device-pixel-ratio: 3/2),
(-webkit-min-device-pixel-ratio: 1.5),(min-device-pixel-ratio: 1.5),(min-resolution: 1.5dppx) {
.awesome-marker {
background-image: url('images/[email protected]');
background-size: 720px 46px;
}
.awesome-marker-shadow {
background-image: url('images/[email protected]');
background-size: 35px 16px;
}
}

.awesome-marker i {
color: #333;
margin-top: 10px;
display: inline-block;
font-size: 14px;
}

.awesome-marker .icon-white {
color: #fff;
}

/* Colors */
.awesome-marker-icon-red {
background-position: 0 0;
}

.awesome-marker-icon-darkred {
background-position: -180px 0;
}

.awesome-marker-icon-lightred {
background-position: -360px 0;
}

.awesome-marker-icon-orange {
background-position: -36px 0;
}

.awesome-marker-icon-beige {
background-position: -396px 0;
}

.awesome-marker-icon-green {
background-position: -72px 0;
}

.awesome-marker-icon-darkgreen {
background-position: -252px 0;
}

.awesome-marker-icon-lightgreen {
background-position: -432px 0;
}

.awesome-marker-icon-blue {
background-position: -108px 0;
}

.awesome-marker-icon-darkblue {
background-position: -216px 0;
}

.awesome-marker-icon-lightblue {
background-position: -468px 0;
}

.awesome-marker-icon-purple {
background-position: -144px 0;
}

.awesome-marker-icon-darkpurple {
background-position: -288px 0;
}

.awesome-marker-icon-pink {
background-position: -504px 0;
}

.awesome-marker-icon-cadetblue {
background-position: -324px 0;
}

.awesome-marker-icon-white {
background-position: -574px 0;
}

.awesome-marker-icon-gray {
background-position: -648px 0;
}

.awesome-marker-icon-lightgray {
background-position: -612px 0;
}

.awesome-marker-icon-black {
background-position: -682px 0;
}
125 changes: 125 additions & 0 deletions js/leaflet.awesome-markers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
/*
Leaflet.AwesomeMarkers, a plugin that adds colorful iconic markers for Leaflet, based on the Font Awesome icons
(c) 2012-2013, Lennard Voogdt
http://leafletjs.com
https://github.com/lvoogdt
*/

/*global L*/

(function (window, document, undefined) {
"use strict";
/*
* Leaflet.AwesomeMarkers assumes that you have already included the Leaflet library.
*/

L.AwesomeMarkers = {};

L.AwesomeMarkers.version = '2.0.1';

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',
extraClasses: '',
icon: 'home',
markerColor: 'blue',
iconColor: 'white'
},

initialize: function (options) {
options = L.Util.setOptions(this, options);
},

createIcon: function () {
var div = document.createElement('div'),
options = this.options;

if (options.icon) {
div.innerHTML = this._createInner();
}

if (options.bgPos) {
div.style.backgroundPosition =
(-options.bgPos.x) + 'px ' + (-options.bgPos.y) + 'px';
}

this._setIconStyles(div, 'icon-' + options.markerColor);
return div;
},

_createInner: function() {
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;
}

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 "<i " + iconColorStyle + "class='" + options.extraClasses + " " + options.prefix + " " + iconClass + " " + iconSpinClass + " " + iconColorClass + "'></i>";
},

_setIconStyles: function (img, name) {
var options = this.options,
size = L.point(options[name === 'shadow' ? 'shadowSize' : 'iconSize']),
anchor;

if (name === 'shadow') {
anchor = L.point(options.shadowAnchor || options.iconAnchor);
} else {
anchor = L.point(options.iconAnchor);
}

if (!anchor && size) {
anchor = size.divideBy(2, true);
}

img.className = 'awesome-marker-' + name + ' ' + options.className;

if (anchor) {
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.AwesomeMarkers.icon = function (options) {
return new L.AwesomeMarkers.Icon(options);
};

}(this, document));



7 changes: 7 additions & 0 deletions js/leaflet.awesome-markers.min.js

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

18 changes: 18 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "drmonty-leaflet-awesome-markers",
"description": "Colorful, iconic & retina-proof markers for Leaflet, based on the Font Awesome/Twitter Bootstrap icons.",
"homepage": "http://github.com/lvoogdt/Leaflet.awesome-markers",
"version": "2.0.2",
"author": "Lennard Voogdt <[email protected]>",
"main": "js/leaflet.awesome-markers.js",
"repository": {
"type": "git",
"url": "https://github.com/drmonty/leaflet-awesome-markers.git"
},
"licenses": [
{
"type": "MIT",
"url": "http://github.com/lvoogdt/Leaflet.awesome-markers/blob/2.0/develop/LICENSE"
}
]
}

0 comments on commit 9edd836

Please sign in to comment.