realtime improvement
This commit is contained in:
parent
ac8c589a77
commit
3d35d44c3f
1 changed files with 5 additions and 8 deletions
|
@ -1414,7 +1414,7 @@ Metamaps.Realtime = {
|
|||
});
|
||||
$('body').click(self.close);
|
||||
|
||||
self.socket = io.connect('http://gentle-savannah-1303.herokuapp.com');
|
||||
self.socket = io.connect('http://localhost:5001');
|
||||
self.startActiveMap();
|
||||
},
|
||||
toggleBox: function (event) {
|
||||
|
@ -1462,15 +1462,12 @@ Metamaps.Realtime = {
|
|||
}
|
||||
}
|
||||
|
||||
if (!self.socket) {
|
||||
if (!self.socket.connected) {
|
||||
self.socket.socket.connect();
|
||||
}
|
||||
self.socket.on('connect', function () {
|
||||
start();
|
||||
});
|
||||
}
|
||||
else if (self.socket) {
|
||||
self.socket.socket.connect();
|
||||
start();
|
||||
}
|
||||
},
|
||||
endActiveMap: function () {
|
||||
var self = Metamaps.Realtime;
|
||||
|
|
Loading…
Reference in a new issue