(objId, direction)
| 91 | // and object id. So we do not have any actions to take |
| 92 | // in the onreadystatechange method, actually. |
| 93 | function objMove(objId, direction) { |
| 94 | // Re-establish the webSocket if it has |
| 95 | // been broken (system sleep, usually) |
| 96 | if (wsError) { |
| 97 | ws = setupWebSocket(wsUrl); |
| 98 | wsError = false; |
| 99 | } |
| 100 | //console.log(`move ${objId}! ${direction}`); |
| 101 | var xmlhttp = new XMLHttpRequest(); |
| 102 | xmlhttp.onreadystatechange = function() { |
| 103 | if (xmlhttp.readyState == XMLHttpRequest.DONE) { // XMLHttpRequest.DONE == 4 |
| 104 | if (xmlhttp.status == 200) { |
| 105 | // processed move |
| 106 | } |
| 107 | else { |
| 108 | // move failed |
| 109 | } |
| 110 | } |
| 111 | }; |
| 112 | var objMoveUrl = `${fsHost}/functions/postgisftw.object_move/items.json?direction=${direction}&move_id=${objId}`; |
| 113 | xmlhttp.open("GET", objMoveUrl, true); |
| 114 | xmlhttp.send(); |
| 115 | } |
| 116 | |
| 117 | |
| 118 | // Get current set of geofences from the |
nothing calls this directly
no test coverage detected