| Revision 327,
836 bytes
checked in by jdalbey, 7 years ago
(diff) |
|
Add HAR layer.
|
| Line | |
|---|
| 1 | // Load the dynamic json file for highways, etc. |
|---|
| 2 | // Ref: https://codepen.io/KryptoniteDove/post/load-json-file-locally-using-pure-javascript |
|---|
| 3 | function loadJSON(inFile, callback) |
|---|
| 4 | { |
|---|
| 5 | var xobj = new XMLHttpRequest(); |
|---|
| 6 | xobj.overrideMimeType("application/json"); |
|---|
| 7 | xobj.open('GET', inFile, true); |
|---|
| 8 | xobj.onreadystatechange = function() |
|---|
| 9 | { |
|---|
| 10 | if (xobj.readyState == 4 && xobj.status == "200") |
|---|
| 11 | { |
|---|
| 12 | callback(xobj.responseText); |
|---|
| 13 | } |
|---|
| 14 | }; |
|---|
| 15 | // We want ajax to ignore any cached responses |
|---|
| 16 | xobj.setRequestHeader('If-Modified-Since', 'Sat, 01 Jan 2000 01:01:01 GMT') |
|---|
| 17 | xobj.send(null); |
|---|
| 18 | } |
|---|
| 19 | |
|---|
| 20 | |
|---|
| 21 | function handleDialogClose(id) |
|---|
| 22 | { |
|---|
| 23 | // hide the display |
|---|
| 24 | document.getElementById(id).style.display = 'none' |
|---|
| 25 | } |
|---|
| 26 | |
|---|
| 27 | |
|---|
Note: See
TracBrowser
for help on using the repository browser.