Remove deprecated empty project detection

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

View File

@@ -245,8 +245,6 @@ class Spot extends Main
public function getMarkers()
{
$asMessages = $this->getSpotMessages();
$bEmptyProject = empty($this->getMedias('posted_on') + $asMessages + $this->getPosts());
$sDesc = '';
//Add medias
if(!empty($asMessages)) {
@@ -274,11 +272,10 @@ class Spot extends Main
$asLastUpdate = array();
$this->addTimeStamp($asLastUpdate, $this->oProject->getLastUpdate());
return self::getJsonResult(true, $sDesc, array(
return self::getJsonResult(true, '', array(
'messages' => $asMessages,
'maps' => $this->oProject->getMaps(),
'last_update' => $asLastUpdate,
'empty_project' => $bEmptyProject
'last_update' => $asLastUpdate
));
}

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){

View File

@@ -9,7 +9,8 @@
## Getting started
1. Clone Git onto web server
2. Copy settings-sample.php to settings.php and populate
3. Go to #admin and create a new project
3. Go to #admin and create a new project & feed
4. Add a GPX file named <project_codename>.gpx to /geo/
## To Do List
* ECMA import/export
* Reset zoom on image closing (lightbox)