-
-
Save bartek/cccfe38a8c33ebec4c02 to your computer and use it in GitHub Desktop.
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
// Simple helper function for setting up a leaflet map. | |
var Leaflet = { | |
defaults: { | |
zoom: 13, | |
attributionControl: false | |
}, | |
map: function(mapId, options) { | |
options = (options || {}); | |
options = _.defaults(options, this.defaults); | |
var map = L.map(mapId).setView([ | |
options.lat, options.lon], options.zoom); | |
L.tileLayer('http://{s}.tile.cloudmade.com/' + app.leaflet.apiKey + '/997/256/{z}/{x}/{y}.png', { | |
maxZoom: 18 | |
}).addTo(map); | |
var marker = L.marker( | |
[options.lat, options.lon], | |
{icon: new L.Icon.Default()} | |
).addTo(map); | |
return map; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment