{"id":1842,"date":"2014-03-19T02:10:00","date_gmt":"2014-03-19T06:10:00","guid":{"rendered":"http:\/\/www.rexfeng.com\/blog\/?p=1842"},"modified":"2014-03-19T02:10:00","modified_gmt":"2014-03-19T06:10:00","slug":"leaflet-js-with-open-mapquest-tiles","status":"publish","type":"post","link":"https:\/\/www.rexfeng.com\/blog\/2014\/03\/leaflet-js-with-open-mapquest-tiles\/","title":{"rendered":"Leaflet JS with Open MapQuest Tiles"},"content":{"rendered":"<p>With <a href=\"cloudmade.com\">CloudMade<\/a> changing their API to focus on enterprise customers, I had to find an alternative for hosted map tiles.<\/p>\n<p>There&#8217;s a good gist from\u00a0<a href=\"https:\/\/gist.github.com\/mourner\">mourner<\/a> that shows <a href=\"leafletjs.com\">Leaflet.js<\/a>\u00a0TileLayer shortcuts at\u00a0<a href=\"https:\/\/gist.github.com\/mourner\/1804938\">https:\/\/gist.github.com\/mourner\/1804938<\/a><\/p>\n<p>Instead of the <a href=\"http:\/\/leafletjs.com\/examples\/quick-start.html\">old CloudMade tile tutorial used on Leaflet<\/a>:<\/p>\n<p>[cc]<\/p>\n<p>L.tileLayer(&#8216;http:\/\/{s}.tile.cloudmade.com\/API-key\/997\/256\/{z}\/{x}\/{y}.png&#8217;, {<br \/>\nattribution: &#8216;proper attribution goes here&#8217;<br \/>\n}).addTo(map);<\/p>\n<p>[\/cc]<\/p>\n<p>You can use <a href=\"open.mapquest.com\">Open MapQuest<\/a>:<\/p>\n<p>[cc]<\/p>\n<p>L.tileLayer(&#8216;http:\/\/{s}.mqcdn.com\/tiles\/1.0.0\/osm\/{z}\/{x}\/{y}.png&#8217;, {<br \/>\nattribution: &#8216;proper attribution goes here&#8217;,<br \/>\nsubdomains: [&#8216;otile1&#8217;, &#8216;otile2&#8217;, &#8216;otile3&#8217;, &#8216;otile4&#8217;]<br \/>\n}).addTo(map);<\/p>\n<p>[\/cc]<\/p>\n<p>Just make sure your\u00a0attribution properly reflects all your sources.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>With CloudMade changing their API to focus on enterprise customers, I had to find an alternative for hosted map tiles. There&#8217;s a good gist from\u00a0mourner that shows Leaflet.js\u00a0TileLayer shortcuts at\u00a0https:\/\/gist.github.com\/mourner\/1804938 Instead of the old CloudMade tile tutorial used on Leaflet: [cc] L.tileLayer(&#8216;http:\/\/{s}.tile.cloudmade.com\/API-key\/997\/256\/{z}\/{x}\/{y}.png&#8217;, { attribution: &#8216;proper attribution goes here&#8217; }).addTo(map); [\/cc] You can use Open MapQuest: [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1029],"tags":[1108,1054,1111,1112,1110,1109,1113],"class_list":["post-1842","post","type-post","status-publish","format-standard","hentry","category-programming","tag-cloudmade","tag-js","tag-leaflet","tag-leafletjs","tag-mapquest","tag-open","tag-tile"],"_links":{"self":[{"href":"https:\/\/www.rexfeng.com\/blog\/wp-json\/wp\/v2\/posts\/1842","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rexfeng.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rexfeng.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rexfeng.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rexfeng.com\/blog\/wp-json\/wp\/v2\/comments?post=1842"}],"version-history":[{"count":4,"href":"https:\/\/www.rexfeng.com\/blog\/wp-json\/wp\/v2\/posts\/1842\/revisions"}],"predecessor-version":[{"id":1846,"href":"https:\/\/www.rexfeng.com\/blog\/wp-json\/wp\/v2\/posts\/1842\/revisions\/1846"}],"wp:attachment":[{"href":"https:\/\/www.rexfeng.com\/blog\/wp-json\/wp\/v2\/media?parent=1842"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rexfeng.com\/blog\/wp-json\/wp\/v2\/categories?post=1842"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rexfeng.com\/blog\/wp-json\/wp\/v2\/tags?post=1842"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}