Skip to content

Commit

Permalink
added slider for every provider, now shortcut greys out checkboxes
Browse files Browse the repository at this point in the history
  • Loading branch information
mattiapezzotti committed Aug 8, 2024
1 parent e7d0cc6 commit 93c35cf
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 29 deletions.
5 changes: 5 additions & 0 deletions css/60_photos.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ li.list-item-photos.active:after {
left: 0;
}

.disabled-panel {
pointer-events: none;
opacity: 0.5;
}

/* photo viewer div */
.photoviewer {
position: relative;
Expand Down
7 changes: 2 additions & 5 deletions modules/renderer/photos.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,12 @@ export function rendererPhotos(context) {
}

photos.shouldFilterByDate = function() {
return showsLayer('mapillary') || showsLayer('kartaview') || showsLayer('streetside') || showsLayer('vegbilder');
};

photos.shouldFilterByMaxAge = function(){
return false;
};

photos.shouldFilterDateBySlider = function(){
return showsLayer('panoramax');
return showsLayer('mapillary') || showsLayer('kartaview') || showsLayer('mapilio')
|| showsLayer('streetside') || showsLayer('vegbilder') || showsLayer('panoramax');
};

photos.shouldFilterByPhotoType = function() {
Expand Down
21 changes: 0 additions & 21 deletions modules/services/panoramax.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ let _planeFrame;
let _pannellumFrame;
let _currentFrame;

let _oldestDate;

let _currentScene = {
currentImage : null,
nextImage : null,
Expand Down Expand Up @@ -161,14 +159,6 @@ function loadTileDataToCache(data, tile, zoom) {
features.push({
minX: loc[0], minY: loc[1], maxX: loc[0], maxY: loc[1], data: d
});

if (_oldestDate){
if (d.capture_time < _oldestDate){
_oldestDate = d.capture_time;
}
} else {
_oldestDate = d.capture_time;
}
}
if (cache.rtree) {
cache.rtree.load(features);
Expand All @@ -190,13 +180,6 @@ function loadTileDataToCache(data, tile, zoom) {
} else {
cache.lineString[feature.properties.id] = [feature];
}
if (_oldestDate){
if (feature.properties.date < _oldestDate){
_oldestDate = feature.properties.date;
}
} else {
_oldestDate = feature.properties.date;
}
}
}
}
Expand Down Expand Up @@ -285,10 +268,6 @@ export default {
return data.flatMap((d, i) => d.features.filter(f => f.name === usernames[i]).map(f => f.id));
},

getOldestDate: function(){
return _oldestDate;
},

getActiveImage: function(){
return _activeImage;
},
Expand Down
9 changes: 6 additions & 3 deletions modules/ui/sections/photo_overlays.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,9 +355,9 @@ export function uiSectionPhotoOverlays(context) {
.classed('active', filterEnabled);

function yearSliderValue() {
var sliderValue = context.photos().yearSliderValue();
if (sliderValue) return sliderValue;
return 5;
var sliderValue = context.photos().yearSliderValue();
if (sliderValue) return sliderValue;
return 5;
}
}

Expand Down Expand Up @@ -534,18 +534,21 @@ export function uiSectionPhotoOverlays(context) {
}

function toggleStreetSide(){
let layerContainer = d3_select('.photo-overlay-container');
if (!_layersHidden){
layers.all().forEach(d => {
if (_streetLayerIDs.includes(d.id)) {
if (showsLayer(d.id)) _savedLayers.push(d.id);
setLayer(d.id, false);
}
});
layerContainer.classed('disabled-panel', true);
} else {
_savedLayers.forEach(d => {
setLayer(d, true);
});
_savedLayers = [];
layerContainer.classed('disabled-panel', false);
}
_layersHidden = !_layersHidden;
};
Expand Down
1 change: 1 addition & 0 deletions svg/fontawesome/fas-flag-checkered.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions svg/fontawesome/fas-water-ladder.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 93c35cf

Please sign in to comment.