Skip to content

Commit

Permalink
#1907: Legend filtering for GeoServer WMS layers (#1934)
Browse files Browse the repository at this point in the history
---------

Co-authored-by: allyoucanmap <[email protected]>
  • Loading branch information
dsuren1 and allyoucanmap authored Jan 15, 2025
1 parent 33cfaee commit 15cb0ee
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 8 deletions.
2 changes: 1 addition & 1 deletion geonode_mapstore_client/client/MapStore2
Submodule MapStore2 updated 132 files
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
10 changes: 7 additions & 3 deletions geonode_mapstore_client/client/js/utils/ResourceUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { getConfigProp, convertFromLegacy, normalizeConfig } from '@mapstore/fra
import { getGeoNodeLocalConfig, parseDevHostname } from '@js/utils/APIUtils';
import { ProcessTypes, ProcessStatus } from '@js/utils/ResourceServiceUtils';
import { uniqBy, orderBy, isString, isObject } from 'lodash';
import { excludeGoogleBackground, extractTileMatrixFromSources } from '@mapstore/framework/utils/LayersUtils';
import { excludeGoogleBackground, extractTileMatrixFromSources, ServerTypes } from '@mapstore/framework/utils/LayersUtils';
import { determineResourceType } from '@js/utils/FileUtils';
import { isImageServerUrl } from '@mapstore/framework/utils/ArcGISUtils';

Expand Down Expand Up @@ -117,7 +117,8 @@ export const resourceToLayerConfig = (resource) => {
has_time: hasTime,
default_style: defaultStyle,
ptype,
subtype
subtype,
sourcetype
} = resource;

const bbox = getExtentFromResource(resource);
Expand Down Expand Up @@ -219,7 +220,10 @@ export const resourceToLayerConfig = (resource) => {
...(params && { params }),
...(dimensions.length > 0 && ({ dimensions })),
extendedParams,
...(fields && { fields })
...(fields && { fields }),
...(sourcetype === 'REMOTE' && !wmsUrl.includes('/geoserver/') && {
serverType: ServerTypes.NO_VENDOR
})
};
}
};
Expand Down
2 changes: 1 addition & 1 deletion geonode_mapstore_client/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"author": "GeoSolutions",
"license": "BSD-2-Clause",
"devDependencies": {
"@mapstore/project": "git+https://github.com/geosolutions-it/mapstore-project.git#2024.02.xx",
"@mapstore/project": "git+https://github.com/geosolutions-it/mapstore-project.git#master",
"dotenv": "10.0.0",
"jsdoc": "4.0.0"
},
Expand Down

0 comments on commit 15cb0ee

Please sign in to comment.