Last active
August 29, 2015 14:01
-
-
Save stevage/3c1ae0045dc0d61f465c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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