Skip to content

Instantly share code, notes, and snippets.

@stevage
Last active August 29, 2015 14:01
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 stevage/3c1ae0045dc0d61f465c to your computer and use it in GitHub Desktop.
Save stevage/3c1ae0045dc0d61f465c to your computer and use it in GitHub Desktop.
var pois = new XMLHttpRequest();
pois.open("GET","http://cycletour.org/testosrm/map.geojson",true);
pois.onreadystatechange = function() {
if (pois.readyState === 4) { // Makes sure the document is ready to parse.
if (pois.status === 200) { // Makes sure it's found the file.
geojson = JSON.parse(pois.responseText);
L.geoJson(geojson, {
onEachFeature: function (feature, layer) {
layer.bindPopup(feature.properties.description);
}
}).addTo(OSRM.G.map);
}
}
}
pois.send(null);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment