From bc9971076d1ca3e94ab0afe2e16cc7ab0ae327c8 Mon Sep 17 00:00:00 2001 From: Arne Hamann Date: Wed, 29 Jan 2020 12:20:38 +0100 Subject: [PATCH 1/2] Fixed time filter for photos. In the introduction of the Viewer the date value was refactored to datetaken. This was not done in the photosController.js Hence the Photo loading Icon was spinning forever and the timefilter was not working for the photos. This should be fixed now. Signed-off-by: Arne Hamann --- src/photosController.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/photosController.js b/src/photosController.js index 8c4511f04..44ec84878 100644 --- a/src/photosController.js +++ b/src/photosController.js @@ -86,8 +86,8 @@ PhotosController.prototype = { updateMyFirstLastDates: function() { var nbMarkers = this.photoMarkers.length; var layerVisible = this.map.hasLayer(this.photoLayer); - this.photoMarkersOldest = (layerVisible && nbMarkers > 0) ? this.photoMarkers[0].data.date : null; - this.photoMarkersNewest = (layerVisible && nbMarkers > 0) ? this.photoMarkers[nbMarkers - 1].data.date : null; + this.photoMarkersOldest = (layerVisible && nbMarkers > 0) ? this.photoMarkers[0].data.dateTaken : null; + this.photoMarkersNewest = (layerVisible && nbMarkers > 0) ? this.photoMarkers[nbMarkers - 1].data.dateTaken : null; }, showLayer: function() { @@ -205,7 +205,7 @@ PhotosController.prototype = { addPhotosToMap : function(photos) { var markers = this.preparePhotoMarkers(photos); this.photoMarkers.push.apply(this.photoMarkers, markers); - this.photoMarkers.sort(function (a, b) { return a.data.date - b.data.date;}); + this.photoMarkers.sort(function (a, b) { return a.data.dateTaken - b.data.dateTaken;}); // we update the counter var catCounter = $('#navigation-photos .app-navigation-entry-utils-counter'); @@ -302,14 +302,14 @@ PhotosController.prototype = { var i = this.photoMarkersFirstVisible; if (date < this.timeFilterBegin) { i = i-1; - while (i >= 0 && i <= this.photoMarkersLastVisible && this.photoMarkers[i].data.date >= date) { + while (i >= 0 && i <= this.photoMarkersLastVisible && this.photoMarkers[i].data.dateTaken >= date) { this.photoLayer.addLayer(this.photoMarkers[i]); i = i-1; } this.photoMarkersFirstVisible = i + 1; } else { - while (i < this.photoMarkers.length && i >= 0 && i <= this.photoMarkersLastVisible && this.photoMarkers[i].data.date < date) { + while (i < this.photoMarkers.length && i >= 0 && i <= this.photoMarkersLastVisible && this.photoMarkers[i].data.dateTaken < date) { this.photoLayer.removeLayer(this.photoMarkers[i]); i = i + 1; } @@ -326,7 +326,7 @@ PhotosController.prototype = { if (date >= this.timeFilterBegin) { var i = this.photoMarkersLastVisible; if (date < this.timeFilterEnd) { - while (i >= 0 && i >= this.photoMarkersFirstVisible && this.photoMarkers[i].data.date > date ) { + while (i >= 0 && i >= this.photoMarkersFirstVisible && this.photoMarkers[i].data.dateTaken > date ) { this.photoLayer.removeLayer(this.photoMarkers[i]); i = i-1; } @@ -334,7 +334,7 @@ PhotosController.prototype = { } else { i = i+1; - while (i >= this.photoMarkersFirstVisible && i < this.photoMarkers.length && this.photoMarkers[i].data.date <= date) { + while (i >= this.photoMarkersFirstVisible && i < this.photoMarkers.length && this.photoMarkers[i].data.dateTaken <= date) { this.photoLayer.addLayer(this.photoMarkers[i]); i = i+1; } From fd16aac255b7094efb7600f69487a8dd7467bf20 Mon Sep 17 00:00:00 2001 From: Arne Hamann Date: Wed, 29 Jan 2020 12:43:12 +0100 Subject: [PATCH 2/2] Fixed a typo in the detection if webgl is supported Signed-off-by: Arne Hamann --- src/script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/script.js b/src/script.js index f784ac927..fb54288fd 100644 --- a/src/script.js +++ b/src/script.js @@ -273,7 +273,7 @@ import { brify, getUrlParameter, formatAddress } from './utils'; catch (x) { gl = null; } } - if (optionsValues.hasOwnProperty('mapboxAPIKEY') && optionsValues.mapboxAPIKEY !== '' && gl == null) { + if (optionsValues.hasOwnProperty('mapboxAPIKEY') && optionsValues.mapboxAPIKEY !== '' && gl != null) { // change "button" layers delete mapController.baseLayers['OpenStreetMap']; delete mapController.baseLayers['ESRI Aerial'];