Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
203 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
/* | ||
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 | ||
*/ | ||
(function (window, document, undefined) { | ||
/* | ||
* Leaflet.AwesomeMarkers assumes that you have already included the Leaflet library. | ||
*/ | ||
|
||
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 (options) { | ||
options = L.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.color); | ||
return div; | ||
}, | ||
|
||
_createInner: function() { | ||
var iconClass; | ||
if(this.options.icon.slice(0,5)==="icon-"){ | ||
iconClass=this.options.icon; | ||
}else{ | ||
iconClass="icon-"+this.options.icon; | ||
} | ||
return "<i class='" + iconClass | ||
+ (this.options.spin ? " icon-spin" :"") | ||
+ (this.options.iconColor ? " icon-" + this.options.iconColor :"") + "'></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'), | ||
options = this.options; | ||
|
||
this._setIconStyles(div, 'shadow'); | ||
return div; | ||
} | ||
}); | ||
|
||
L.AwesomeMarkers.icon = function (options) { | ||
return new L.AwesomeMarkers.Icon(options); | ||
}; | ||
|
||
}(this, document)); |
88 changes: 88 additions & 0 deletions
88
vendor/assets/stylesheets/leaflet.awesome-markers.css.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
/* | ||
Author: L. Voogdt | ||
License: MIT | ||
Version: 1.0 | ||
*/ | ||
|
||
/* Marker setup */ | ||
.awesome-marker { | ||
background: image-url('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: image-url('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: image-url('markers-soft@2x.png'); | ||
background-size: 360px 46px; | ||
} | ||
.awesome-marker-shadow { | ||
background-image: image-url('markers-shadow@2x.png'); | ||
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-orange { | ||
background-position: -36px 0; | ||
} | ||
|
||
.awesome-marker-icon-green { | ||
background-position: -72px 0; | ||
} | ||
|
||
.awesome-marker-icon-darkgreen { | ||
background-position: -252px 0; | ||
} | ||
|
||
.awesome-marker-icon-blue { | ||
background-position: -108px 0; | ||
} | ||
|
||
.awesome-marker-icon-darkblue { | ||
background-position: -216px 0; | ||
} | ||
|
||
.awesome-marker-icon-purple { | ||
background-position: -144px 0; | ||
} | ||
|
||
.awesome-marker-icon-darkpurple { | ||
background-position: -288px 0; | ||
} | ||
|
||
.awesome-marker-icon-cadetblue { | ||
background-position: -324px 0; | ||
} |