我在我的项目中使用 OpenstreetMap 和 Leaflet。 添加图层:
L.tileLayer("http://{s}.tile.cloudmade.com/{my_key}/997/256/{z}/{x}/{y}.png",
attribution: "Map data © <a href=\"http://openstreetmap.org\">OpenStreetMap</a> contributors, <a href=\"http://creativecommons.org/licenses/by-sa/2.0/\">CC-BY-SA</a>, Imagery © <a href=\"http://cloudmade.com\">CloudMade</a>"
).addTo map
但是今天我收到了CloudMade的来信.....
As of May 1st we’ll be stopping service to your API key. This means that CloudMade services like Map Tiles, Geocoding and Routing that you maybe using in your apps or websites will stop working.
以及如何在没有此 API 的情况下添加 map ?
最佳答案
Cloudmade 已决定从 2014 年 5 月起撤销对其非企业客户的访问权限。OSM 的 wiki 页面 here 上列出了其他可用的切片集.
例如,您可以使用默认的 OSM 瓦片集,如下所示:
L.tileLayer(
"http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
....
).addTo('map');
关于OpenstreetMap + Leaflet 和 CloudMade,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22782176/