add local storage markers
This commit is contained in:
parent
26ac333c82
commit
e79f5facff
1 changed files with 6 additions and 0 deletions
|
@ -57,11 +57,17 @@ function initWebSocket() {
|
||||||
websocket.onopen = function (evt) {
|
websocket.onopen = function (evt) {
|
||||||
ConnectBut.value = 'Disconnect';
|
ConnectBut.value = 'Disconnect';
|
||||||
Connected.innerHTML = 'CONNECTED';
|
Connected.innerHTML = 'CONNECTED';
|
||||||
|
const stored = localStorage.getItem ('mark_store');
|
||||||
|
console.log (stored);
|
||||||
|
if (stored) {
|
||||||
|
gMark = JSON.parse (stored);
|
||||||
|
}
|
||||||
connected = true;
|
connected = true;
|
||||||
};
|
};
|
||||||
websocket.onclose = function (evt) {
|
websocket.onclose = function (evt) {
|
||||||
ConnectBut.value = 'Connect';
|
ConnectBut.value = 'Connect';
|
||||||
Connected.innerHTML = 'DISCONNECTED';
|
Connected.innerHTML = 'DISCONNECTED';
|
||||||
|
localStorage.setItem ('mark_store', JSON.stringify (gMark));
|
||||||
connected = false;
|
connected = false;
|
||||||
};
|
};
|
||||||
websocket.onmessage = function (evt) {
|
websocket.onmessage = function (evt) {
|
||||||
|
|
Loading…
Reference in a new issue