From a134ed367d032ee8119aa3d3afece53cf44c77b9 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Wed, 11 Feb 2015 15:51:16 +0000 Subject: Add a workaround to allow the demos to be used without a webserver --- demo5.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'demo5.html') diff --git a/demo5.html b/demo5.html index 1e59063..d4f5f05 100644 --- a/demo5.html +++ b/demo5.html @@ -35,7 +35,13 @@ // Load some GeoJSON exported from OpenStreetMap using the OverpassAPI // (http://overpass-turbo.eu/s/7yI) - getJSON("cafes.json", function(cafes) { + var url = "cafes.json"; + + if (document.URL.indexOf("file") === 0) { + url = "http://cbaines.net/maptime/cafes.json"; + } + + getJSON(url, function(cafes) { L.geoJson(cafes).addTo(map); }); -- cgit v1.2.3