Changeset 426 in tmcsimulator for trunk/webapps/cptms/js/harLayer.js
- Timestamp:
- 06/26/2019 02:00:51 PM (7 years ago)
- File:
-
- 1 edited
-
trunk/webapps/cptms/js/harLayer.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/webapps/cptms/js/harLayer.js
r413 r426 113 113 } 114 114 harLayer.overrideStyle(harLayer.getFeatureById(harID), currentIcon) 115 // convert messasge to json string116 jsonstring = JSON.stringify(Object.values(HARmessageDict));117 outString = "{\"data\":" + jsonstring + "}";118 115 119 //var xhttp = new XMLHttpRequest(); 120 //xhttp.open("GET", "../cgi-bin/saveHARmessage.py?msg=" + outString, true); 121 //xhttp.send(); 116 // Examine each message in the dict and convert to json format 117 var lineOut = ""; 118 for (var id in HARmessageDict) 119 { 120 // convert and append to output string 121 lineOut += JSON.stringify(HARmessageDict[id]) + ',\n'; 122 } 123 // remove trailing comma 124 lineOut = lineOut.substring(0,lineOut.length-2); 125 outString = "{\"data\":[\n" + lineOut + "\n]}"; 126 122 127 // Using POST to send the data 123 128 var xhr = new XMLHttpRequest();
Note: See TracChangeset
for help on using the changeset viewer.
