// Load the dynamic json file for highways, etc. // Ref: https://codepen.io/KryptoniteDove/post/load-json-file-locally-using-pure-javascript function loadJSON(inFile, callback) { var xobj = new XMLHttpRequest(); // Assume XML unless filename ends with .json if (inFile.endsWith(".json")) { xobj.overrideMimeType("application/json"); } xobj.open('GET', inFile, true); xobj.onreadystatechange = function() { if (xobj.readyState == 4 && xobj.status == "200") { callback(xobj.responseText); } }; // We want ajax to ignore any cached responses xobj.setRequestHeader('If-Modified-Since', 'Sat, 01 Jan 2000 01:01:01 GMT') xobj.send(null); } function handleDialogClose(id) { // hide the display document.getElementById(id).style.display = 'none' }