remove useless variable

This commit is contained in:
j 2016-01-26 16:47:10 +05:30
parent 2751576a02
commit 3ac3cf8c13

View file

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