Last active
December 22, 2015 15:48
-
-
Save tnoworyta/6494381 to your computer and use it in GitHub Desktop.
leaflet icon
This file contains hidden or 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
var leafletConfig = (function() | |
{ | |
//--- private --- | |
var providerUrl = 'http://{s}.tiles.mapbox.com/v3/uniquecustomerkey/{z}/{x}/{y}.png'; | |
var attributionText = 'Map data © <a href="http://openstreetmap.org" target="_blank">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/" target="_blank">CC-BY-SA</a>, Imagery © <a href="http://mapbox.com/about/maps/" target="_blank">MapBox</a>'; | |
var maxZoom = 17; | |
//--- public --- | |
return { | |
getProviderUrl: function() { return providerUrl }, | |
getAttributionText: function() { return attributionText }, | |
getIcon: function(color) { | |
color = !!color ? "-"+color : "-icon"; | |
return L.icon({ | |
iconUrl: '/assets/map-leaflet-controls/marker'+ color + '.png', | |
iconRetinaUrl: '/assets/map-leaflet-controls/[email protected]', | |
iconSize: [25, 41], | |
iconAnchor: [14, 40], | |
shadowUrl: '/assets/map-leaflet-controls/marker-shadow.png', | |
shadowRetinaUrl: '/assets/map-leaflet-controls/[email protected]', | |
shadowSize: [41, 41], | |
popupAnchor: [0, -35] | |
}); | |
}, | |
getMaxZoom:function(){ | |
return maxZoom; | |
} | |
} | |
}()); |
This file contains hidden or 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
selectedMarker = L.marker([lat, lon], {icon: leafletConfig.getIcon()}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment