var m = L.map('map').setView([42.2, -71], 8); var stamenBase = L.tileLayer("http://{s}.tile.stamen.com/terrain-background/{z}/{x}/{y}.png",{minZoom:4,maxZoom:18,attribution:'Map tiles by Stamen Design, CC BY 3.0 — Map data © OpenStreetMap contributors, CC-BY-SA'}); stamenBase.addTo(m); var tileJSON = L.tileLayer.canvas(); tileJSON.drawTile = function(canvas, tilePoint, zoom) { var onEachFeature=function(feature, layer) { if (feature.properties) { layer.bindPopup(Object.keys(feature.properties).map(function(k){ return k + ": " + feature.properties[k] ; }).join("
")); } } L.geoJson.ajax(L.Util.template("http://tile.openstreetmap.us/vectiles-highroad/{z}/{x}/{y}.json",{z:zoom,x:tilePoint.x,y:tilePoint.y}),{dataType:"jsonp",onEachFeature:onEachFeature}).addTo(m); }; tileJSON.addTo(m);