var url ='https://www.aviationweather.gov/adds/dataserver_current/httpparam?dataSource=metars&requestType=retrieve&format=xml&minLat=25&minLon=-125&maxLat=50&maxLon=-66&hoursBeforeNow=1&stationstring=K*&fields=station_id,latitude,longitude,flight_category';
var airportData;
var xml;
function preload() {
xml = loadXML(url, gotData); //if I comment out this line it runs without error
}
function setup() {
createCanvas(1280,564); //equidistant
}
function gotData(xml){
airportData=xml.getChildren('METAR');
}
Get the following error,
Uncaught TypeError: Cannot read property ‘split’ of undefined (: line 56)
loadXML is part of the core library of P5.js is it not?
Yes, I saw that link before and tried copying and pasting (substituting my url for his being careful to remove the https:// as that appears to be concatenated onto the string passed in the loadXML command.), and still did not work. Still get the error on line 56.
I used the same proxy as he. Any benefit going to a different proxy. Its just an ASCII response, don’t understand why a proxy is necessary and not documented within the p5.js reference material. Did have to make changes tot he index.html file?
I tried proxy and it worked for a while then it stopped working. Are they limited use proxies or something. I don’t understand still why we have to use a proxy. I can enter the url straight in a browser and it returns data.