remove useless variable

This commit is contained in:
j 2016-01-26 16:47:10 +05:30
parent 2751576a02
commit 3ac3cf8c13
1 changed files with 3 additions and 5 deletions

View File

@ -1,7 +1,6 @@
window.app = (function() {
var that = {},
coords,
foundLocation = false,
map,
marker,
username = localStorage.username || 'Anonymous',
@ -136,7 +135,7 @@ window.app = (function() {
removeUser(data[1]);
} else if (data[0] == 'update') {
data[2].id = data[1];
updateUserLocation(data[2]);
updateUser(data[2]);
}
};
that.ws.onclose = function (event) {
@ -162,7 +161,7 @@ window.app = (function() {
})
})
};
if (!foundLocation) {
if (!marker) {
if (!map) {
L.mapbox.accessToken = config.mapboxAccessToken;
map = L.mapbox.map('map', 'mapbox.streets')
@ -172,7 +171,6 @@ window.app = (function() {
.bindPopup(options.title)
.addTo(map);
map.setView(coords, zoomLevel);
foundLocation = true;
updateUserList();
} else {
map.removeLayer(marker);
@ -186,7 +184,7 @@ window.app = (function() {
});
}
function updateUserLocation(data) {
function updateUser(data) {
var user = getUserById(data.id);
if (!user) {
user = createUser(data);