Remove deprecated empty project detection

This commit is contained in:
2021-05-24 18:49:44 +02:00
parent e1640ff199
commit bd2c7c4ce0
3 changed files with 9 additions and 11 deletions

View File

@@ -222,7 +222,7 @@ function initProject(sProjectCodeName, oFocusPost){
).done(function(aoMessages, aoTracks) {
var asData = aoMessages[0]['data'];
setMapLayers(asData['maps']);
initSpotMessages(asData['messages'] || [], aoTracks[0], asData['empty_project']);
initSpotMessages(asData['messages'], aoTracks[0]);
updateSettingsPanel(asData['last_update']);
});
@@ -359,7 +359,7 @@ function setMapLayers(asLayers) {
});
}
function initSpotMessages(aoMessages, aoTracks, bNoFeed) {
function initSpotMessages(aoMessages, aoTracks) {
//Map
var oMap = L.map(self.tmp('$Map')[0], {
layers: [oSpot.tmp('layers')[oSpot.lang('map_satellite')]],
@@ -546,7 +546,7 @@ function initSpotMessages(aoMessages, aoTracks, bNoFeed) {
}).addTo(oMap));
//Centering map
var bWithFeedPanel = (!bNoFeed && !isMobile());
var iPanelWidth = isMobile()?0:parseInt(self.tmp('$Feed').outerWidth(true));
if(
self.vars(['project', 'mode']) == self.consts.modes.blog &&
aoMessages.length > 0 &&
@@ -555,9 +555,9 @@ function initSpotMessages(aoMessages, aoTracks, bNoFeed) {
//Zoom on last message
var oLastMsg = aoMessages[aoMessages.length-1];
oMap.setView(L.latLng(oLastMsg.latitude, oLastMsg.longitude), 15);
oMap.panBy([(bWithFeedPanel?1:0)*self.tmp('$Feed').outerWidth(true)/2, 0]);
oMap.panBy([iPanelWidth/2, 0]);
}
else oMap.fitBounds(self.tmp('track').getBounds(), {paddingTopLeft: L.point(5, self.tmp('marker_size').height + 5), paddingBottomRight: L.point(5 + parseInt(bWithFeedPanel?self.tmp('$Feed').outerWidth(true):0), 5)});
else oMap.fitBounds(self.tmp('track').getBounds(), {paddingTopLeft: L.point(5, self.tmp('marker_size').height + 5), paddingBottomRight: L.point(5 + iPanelWidth, 5)});
//Spot Messages
$.each(aoMessages, function(iKey, oMsg){