Skip to content

Instantly share code, notes, and snippets.

@etes
Forked from mourner/TileLayer.CloudMade.js
Created October 10, 2017 10:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save etes/798cdf7c7b73f1eeaa1613074c0f3fa4 to your computer and use it in GitHub Desktop.
Save etes/798cdf7c7b73f1eeaa1613074c0f3fa4 to your computer and use it in GitHub Desktop.
Basic CloudMade tile layer for Leaflet
L.TileLayer.CloudMade = L.TileLayer.extend({
options: {
maxZoom: 18,
attribution: 'Map data &copy; 2011 <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery &copy; 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