Skip to content

Commit

Permalink
review dataset legend
Browse files Browse the repository at this point in the history
  • Loading branch information
allyoucanmap committed Jan 15, 2025
1 parent 3155cb1 commit f5aed83
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
15 changes: 12 additions & 3 deletions geonode_mapstore_client/client/js/plugins/Legend.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ function Legend({
currentZoomLvl,
scales,
language,
currentLocale
currentLocale,
projection,
mapSize,
mapBbox
}) {

const [expandLegend, setExpandLegend] = useState(false);
Expand All @@ -54,7 +57,10 @@ function Legend({
<TOC
map={{
layers: layers.map(applyVersionParamToLegend),
groups: []
groups: [],
bbox: mapBbox,
size: mapSize,
projection
}}
theme="legend"
config={{
Expand Down Expand Up @@ -97,7 +103,10 @@ const ConnectedLegend = connect(
map && map.mapOptions && map.mapOptions.view && map.mapOptions.view.DPI || null
),
language: isLocalizedLayerStylesEnabled ? currentLocaleLanguage : null,
currentLocale
currentLocale,
projection: map?.projection || 'EPSG:3857',
mapSize: map?.size,
mapBbox: map?.bbox
})),
{
onUpdateNode: updateNode
Expand Down
4 changes: 3 additions & 1 deletion geonode_mapstore_client/client/js/utils/ResourceUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,9 @@ export const resourceToLayerConfig = (resource) => {
...(dimensions.length > 0 && ({ dimensions })),
extendedParams,
...(fields && { fields }),
serverType: sourcetype === 'LOCAL' || wmsUrl.includes('/geoserver/') ? ServerTypes.GEOSERVER : ServerTypes.NO_VENDOR
...(sourcetype === 'REMOTE' && !wmsUrl.includes('/geoserver/') && {
serverType: ServerTypes.NO_VENDOR
})
};
}
};
Expand Down

0 comments on commit f5aed83

Please sign in to comment.