Skip to content

Commit

Permalink
[Fixes GeoNode#1072] Dataset legend must show the dataset's title ins…
Browse files Browse the repository at this point in the history
…tead of Geoserver's layername (GeoNode#1075)
  • Loading branch information
DavidQuartz committed Jul 14, 2022
1 parent 1578b55 commit 77404f8
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 2 deletions.
5 changes: 3 additions & 2 deletions geonode_mapstore_client/client/js/plugins/Legend.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { layersSelector } from '@mapstore/framework/selectors/layers';
import OpacitySlider from '@mapstore/framework/components/TOC/fragments/OpacitySlider';
import { updateNode } from '@mapstore/framework/actions/layers';
import VisibilityCheck from '@mapstore/framework/components/TOC/fragments/VisibilityCheck';
import Message from '@mapstore/framework/components/I18N/HTML';

function Legend({
layers,
Expand All @@ -30,14 +31,14 @@ function Legend({
return layers.length > 0 && <div className="shadow gn-legend-wrapper" style={{width: expandLegend ? 'auto' : '80px'}}>
<div onClick={expand} className="gn-legend-head">
<span role="button" className={`identify-icon glyphicon glyphicon-chevron-${expandLegend ? 'down' : 'right'}`} title="Expand layer legend" />
<span className="gn-legend-list-item">Legend</span>
<span className="gn-legend-list-item"><Message msgId="gnviewer.legend" /></span>
</div>
<ul className="gn-legend-list" style={{display: expandLegend ? 'inline-block' : 'none'}}>
{layers.map((layer, ind) => <Fragment key={ind}>
<li className="gn-legend-list-item"><VisibilityCheck key="visibilitycheck"
tooltip={layer.loadingError === 'Warning' ? 'toc.toggleLayerVisibilityWarning' : 'toc.toggleLayerVisibility'}
node={layer}
propertiesChangeHandler={(id, options) => onUpdateNode(id, 'layers', options)} /><p>{layer.name || layer.title}</p></li>
propertiesChangeHandler={(id, options) => onUpdateNode(id, 'layers', options)} /><p>{layer.title}</p></li>
<li className="gn-legend-bottom">
<OpacitySlider
opacity={layer.opacity}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@
"legendWidth": "Legendensymbolbreite",
"legendHeight": "Höhe des Legendensymbols",
"legendPreview": "Legendenvorschau",
"legend": "Legende",
"nodeTooltipContent": "Tooltip-Inhalt",
"nodeTooltipPlacement": "Tooltip-Platzierung",

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@
"legendWidth": "Legend symbol width",
"legendHeight": "Legend symbol height",
"legendPreview": "Legend preview",
"legend": "Legend",
"nodeTooltipContent": "Tooltip content",
"nodeTooltipPlacement": "Tooltip placement",

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@
"legendWidth": "Ancho del símbolo de leyenda",
"legendHeight": "Altura del símbolo de leyenda",
"legendPreview": "Vista previa de la leyenda",
"legend": "Leyenda",
"nodeTooltipContent": "Contenido de la información sobre herramientas",
"nodeTooltipPlacement": "Ubicación de información sobre herramientas",
"zoomToLayer": "Zoom a la extensión de la capa",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@
"legendWidth": "Largeur du symbole de la légende",
"legendHeight": "Hauteur du symbole de la légende",
"legendPreview": "Aperçu de la légende",
"legend": "Légende",
"nodeTooltipContent": "Contenu de l'info-bulle",
"nodeTooltipPlacement": "Placement de l'info-bulle",

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@
"legendWidth": "Larghezza simbolo legenda",
"legendHeight": "Altezza simbolo legenda",
"legendPreview": "Anteprima legenda",
"legend": "Legenda",
"nodeTooltipContent": "Contenuto tooltip",
"nodeTooltipPlacement": "Posizionamento tooltip",

Expand Down

0 comments on commit 77404f8

Please sign in to comment.