diff --git a/data/core.yaml b/data/core.yaml index 7af8cba01..3d26200e9 100644 --- a/data/core.yaml +++ b/data/core.yaml @@ -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" diff --git a/dist/locales/en.json b/dist/locales/en.json index d263ffd20..c05233a8f 100644 --- a/dist/locales/en.json +++ b/dist/locales/en.json @@ -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": { diff --git a/js/id/ui/map_data.js b/js/id/ui/map_data.js index 3b59b361f..70b001eed 100644 --- a/js/id/ui/map_data.js +++ b/js/id/ui/map_data.js @@ -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();