Created
October 27, 2011 14:18
-
-
Save mourner/1319664 to your computer and use it in GitHub Desktop.
Basic CloudMade tile layer for Leaflet
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
L.TileLayer.CloudMade = L.TileLayer.extend({ | |
options: { | |
maxZoom: 18, | |
attribution: 'Map data © 2011 <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © 2011 <a href="http://cloudmade.com">CloudMade</a>' | |
}, | |
initialize: function(key, styleId, options) { | |
var url = 'http://{s}.tile.cloudmade.com/{key}/{styleId}/256/{z}/{x}/{y}.png', | |
urlParams = {key: key, styleId: styleId || 997}; | |
L.TileLayer.prototype.initialize.call(this, url, options, urlParams); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage example: