mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 05:30:35 +02:00
Allow Mapillary signs layer only if image layer is already enabled
This commit is contained in:
+1
-1
@@ -425,7 +425,7 @@ en:
|
||||
tooltip: "Street-level photos from Mapillary"
|
||||
title: "Photo Overlay (Mapillary)"
|
||||
mapillary_signs:
|
||||
tooltip: "Traffic signs from Mapillary"
|
||||
tooltip: "Traffic signs from Mapillary (must enable Photo Overlay)"
|
||||
title: "Traffic Sign Overlay (Mapillary)"
|
||||
mapillary:
|
||||
view_on_mapillary: "View this image on Mapillary"
|
||||
|
||||
Vendored
+1
-1
@@ -512,7 +512,7 @@
|
||||
"title": "Photo Overlay (Mapillary)"
|
||||
},
|
||||
"mapillary_signs": {
|
||||
"tooltip": "Traffic signs from Mapillary",
|
||||
"tooltip": "Traffic signs from Mapillary (must enable Photo Overlay)",
|
||||
"title": "Traffic Sign Overlay (Mapillary)"
|
||||
},
|
||||
"mapillary": {
|
||||
|
||||
+26
-2
@@ -39,20 +39,35 @@ iD.ui.MapData = function(context) {
|
||||
update();
|
||||
}
|
||||
|
||||
function toggleLayer(which) {
|
||||
function showsLayer(which) {
|
||||
var layer = layers.layer(which);
|
||||
if (layer) {
|
||||
layer.enabled(!layer.enabled());
|
||||
return layer.enabled();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function setLayer(which, enabled) {
|
||||
var layer = layers.layer(which);
|
||||
if (layer) {
|
||||
layer.enabled(enabled);
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
function toggleLayer(which) {
|
||||
setLayer(which, !showsLayer(which));
|
||||
}
|
||||
|
||||
function clickGpx() {
|
||||
toggleLayer('gpx');
|
||||
}
|
||||
|
||||
function clickMapillaryImages() {
|
||||
toggleLayer('mapillary-images');
|
||||
if (!showsLayer('mapillary-images')) {
|
||||
setLayer('mapillary-signs', false);
|
||||
}
|
||||
}
|
||||
|
||||
function clickMapillarySigns() {
|
||||
@@ -128,8 +143,13 @@ iD.ui.MapData = function(context) {
|
||||
mapillarySignLayerItem
|
||||
.classed('active', showsMapillarySigns)
|
||||
.selectAll('input')
|
||||
.property('disabled', !showsMapillaryImages)
|
||||
.property('checked', showsMapillarySigns);
|
||||
|
||||
mapillarySignLayerItem
|
||||
.selectAll('label')
|
||||
.classed('deemphasize', !showsMapillaryImages);
|
||||
|
||||
// Exit
|
||||
mapillaryImageLayerItem.exit()
|
||||
.remove();
|
||||
@@ -200,6 +220,10 @@ iD.ui.MapData = function(context) {
|
||||
.property('disabled', !hasGpx)
|
||||
.property('checked', showsGpx);
|
||||
|
||||
gpxLayerItem
|
||||
.selectAll('label')
|
||||
.classed('deemphasize', !hasGpx);
|
||||
|
||||
// Exit
|
||||
gpxLayerItem.exit()
|
||||
.remove();
|
||||
|
||||
Reference in New Issue
Block a user