$.get("testgeom.osm", function(data, status){
console.info("Data: " + data + "\nStatus: " + status);
var test = osmtogeojson(data);
console.info(test);
});
osmtogeojson.js:1 Uncaught TypeError: Cannot read property 'length' of undefined
at osmtogeojson.js:1
at i (osmtogeojson.js:1)
at Object.success ((index):43) <- the line with: var test = osmtogeojson(data);
at fire (jquery-3.4.1.js:3291)
at Object.fireWith [as resolveWith] (jquery-3.4.1.js:3421)
at done (jquery-3.4.1.js:9533)
at XMLHttpRequest. (jquery-3.4.1.js:9785)
overpass.txt: http://overpass-api.de/api/interpreter?data=
$ wget "$(echo
cat overpass.txt
"[out:xml][timeout:25];area(3600052826)->.searchArea;(nwr"tourism"="alpine_hut";);out geom;")" -O ~/www/huts-and-shelters/testgeom.osm$.get("testgeom.osm", function(data, status){ console.info("Data: " + data + "\nStatus: " + status); var test = osmtogeojson(data); console.info(test); });
osmtogeojson.js:1 Uncaught TypeError: Cannot read property 'length' of undefined at osmtogeojson.js:1 at i (osmtogeojson.js:1) at Object.success ((index):43) <- the line with: var test = osmtogeojson(data); at fire (jquery-3.4.1.js:3291) at Object.fireWith [as resolveWith] (jquery-3.4.1.js:3421) at done (jquery-3.4.1.js:9533) at XMLHttpRequest. (jquery-3.4.1.js:9785)
See for yourself at: http://pangose.users.openstreetmap.se/huts-and-shelters/#63.83825,12.27722,7z