diff --git a/force_osm_live.html b/force_osm_live.html new file mode 100644 index 0000000..e85049e --- /dev/null +++ b/force_osm_live.html @@ -0,0 +1,721 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/index.html b/index.html index 3b7441d..bbfcd77 100644 --- a/index.html +++ b/index.html @@ -134,10 +134,6 @@ var bbox = "" + (position[0]-bbox_limit/2) + "," + (position[1]-bbox_limit/2) + "," + (position[0]+bbox_limit-bbox_limit/2) + "," + (position[1]+bbox_limit-bbox_limit/2) -var queryOSM = `https://overpass-api.de/api/interpreter?data=[out:json];nwr(${bbox});out;` -// format https://overpass-api.de/output_formats.html#json -// bounding box https://dev.overpass-api.de/overpass-doc/en/full_data/bbox.html - // testing https://overpass-turbo.eu var queryOSMgeom = `https://overpass-api.de/api/interpreter?data=[out:json];nwr(${bbox});out geom;` @@ -421,8 +417,11 @@ AFRAME.registerComponent('osm', { init: function () { var el = this.el if (!osmDataFromCache){ - console.log("no osm data from cache, querying") - fetch(queryOSMgeom).then(response => response.json()).then(data => fromOSMTo3DElements( data, el ) ) + //console.log("no osm data from cache, querying") + //fetch(queryOSMgeom).then(response => response.json()).then(data => fromOSMTo3DElements( data, el ) ) + console.log("no osm data from cache, querying locally for demo") + fetch("cached_osm_request.json").then(response => response.json()).then(data => fromOSMTo3DElements( data, el ) ) + // for demo safety, cached locally on 6/1/2023 as cached_osm_request.json } else { console.log("osm data from cache") fromOSMTo3DElements( JSON.parse( osmDataFromCache ), el )