Persist the photo overlay layers via the URL query string (re: #5813)

This commit is contained in:
Quincy Morgan
2019-03-14 16:48:08 -04:00
parent c65a4d038e
commit 7d0080a642
14 changed files with 68 additions and 34 deletions
+6 -7
View File
@@ -117,7 +117,7 @@ export function uiMapData(context) {
function drawPhotoItems(selection) {
var photoKeys = ['streetside', 'mapillary-images', 'mapillary-signs', 'openstreetcam-images'];
var photoKeys = context.photos().overlayLayerIDs();
var photoLayers = layers.all().filter(function(obj) { return photoKeys.indexOf(obj.id) !== -1; });
var data = photoLayers.filter(function(obj) { return obj.layer.supported(); });
@@ -156,10 +156,11 @@ export function uiMapData(context) {
var labelEnter = liEnter
.append('label')
.each(function(d) {
var titleID = d.id.replace('-', '_') + '.tooltip';
if (d.id === 'mapillary-signs') {
titleID = 'mapillary.signs.tooltip';
}
var titleID;
if (d.id === 'mapillary-signs') titleID = 'mapillary.signs.tooltip';
else if (d.id === 'mapillary') titleID = 'mapillary_images.tooltip';
else if (d.id === 'openstreetcam') titleID = 'openstreetcam_images.tooltip';
else titleID = d.id.replace('-', '_') + '.tooltip';
d3_select(this)
.call(tooltip()
.title(t(titleID))
@@ -176,8 +177,6 @@ export function uiMapData(context) {
.append('span')
.text(function(d) {
var id = d.id;
if (id === 'mapillary-images') id = 'mapillary';
if (id === 'openstreetcam-images') id = 'openstreetcam';
if (id === 'mapillary-signs') id = 'photo_overlays.traffic_signs';
return t(id.replace('-', '_') + '.title');
});