#92 fixed
parent
8cc7d4e90c
commit
62de567e2f
|
@ -62,7 +62,8 @@ function toggleMaps(loc) {
|
|||
$('#map').hide();
|
||||
$('#pano').hide();
|
||||
$('#notset').show();
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$('#map').show();
|
||||
$('#pano').show();
|
||||
$('#notset').hide();
|
||||
|
@ -83,6 +84,7 @@ window.gmapsCb = function() {
|
|||
// Create map
|
||||
if (disp!=='1') {
|
||||
//console.log("Creating map...");
|
||||
|
||||
map = new google.maps.Map( mapElem, {
|
||||
center: new google.maps.LatLng( mapuser.last.lat, mapuser.last.lon ),
|
||||
panControl: false,
|
||||
|
@ -185,17 +187,15 @@ socket.on('get', function(loc) {
|
|||
|
||||
// Parse location
|
||||
loc = parseLoc(loc);
|
||||
|
||||
|
||||
// Update map
|
||||
if (disp!=='1') {
|
||||
|
||||
|
||||
// Update time
|
||||
$('#timestamp').text('location updated '+loc.tim);
|
||||
|
||||
// Show or hide map
|
||||
toggleMaps(loc);
|
||||
|
||||
// Update marker and map center
|
||||
google.maps.event.trigger(map,'resize');
|
||||
map.setCenter({ lat:loc.lat, lng:loc.lon });
|
||||
marker.setPosition({ lat:loc.lat, lng:loc.lon });
|
||||
|
||||
|
|
Loading…
Reference in New Issue