Skip to content

Commit

Permalink
[Backport 4.4.x] GeoNode#1907: Legend filtering for GeoServer WMS layers
Browse files Browse the repository at this point in the history
  • Loading branch information
dsuren1 committed Jan 17, 2025
1 parent 2d2978a commit bec322b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
2 changes: 1 addition & 1 deletion geonode_mapstore_client/client/MapStore2
Submodule MapStore2 updated 83 files
+1 −0 .gitignore
+14 −0 CHANGELOG.md
+1 −1 package.json
+1 −1 pom.xml
+1 −1 project/standard/templates/web/pom.xml
+3 −9 web/client/api/WMS.js
+1 −0 web/client/components/I18N/IntlNumberFormControl.jsx
+3 −3 web/client/components/I18N/__tests__/IntlNumberFormatControl-test.jsx
+14 −2 web/client/components/TOC/fragments/settings/Display.jsx
+0 −8 web/client/components/catalog/__tests__/CatalogServiceEditor-test.jsx
+5 −5 web/client/components/catalog/editor/MainForm.jsx
+0 −21 web/client/components/catalog/editor/MainFormUtils.js
+1 −1 web/client/components/map/leaflet/Map.jsx
+31 −0 web/client/components/map/openlayers/__tests__/Layer-test.jsx
+7 −2 web/client/components/map/openlayers/plugins/WMSLayer.js
+3 −0 web/client/components/widgets/builder/wizard/map/TOC.jsx
+3 −0 web/client/components/widgets/builder/wizard/map/enhancers/nodeEditor.js
+66 −2 web/client/components/widgets/enhancers/__tests__/wpsCounter-test.js
+6 −2 web/client/components/widgets/enhancers/legendWidget.js
+64 −0 web/client/components/widgets/enhancers/wfsTable/__tests__/triggerFetch-test.js
+11 −1 web/client/components/widgets/enhancers/wfsTable/triggerFetch.js
+11 −1 web/client/components/widgets/enhancers/wpsCounter.js
+6 −1 web/client/components/widgets/widget/LegendView.jsx
+36 −0 web/client/epics/__tests__/identify-test.js
+8 −1 web/client/epics/__tests__/styleeditor-test.js
+1 −11 web/client/epics/featuregrid.js
+9 −3 web/client/epics/identify.js
+5 −2 web/client/epics/styleeditor.js
+10 −3 web/client/libs/numeric-input/NumericInput.jsx
+1 −0 web/client/plugins/Identify.jsx
+2 −1 web/client/plugins/Print.jsx
+24 −25 web/client/plugins/TOC/components/Legend.jsx
+98 −39 web/client/plugins/TOC/components/StyleBasedWMSJsonLegend.jsx
+12 −1 web/client/plugins/TOC/components/TOC.jsx
+12 −11 web/client/plugins/TOC/components/WMSLegend.jsx
+141 −29 web/client/plugins/TOC/components/__tests__/StyleBasedWMSJsonLegend-test.jsx
+4 −4 web/client/plugins/TOC/components/__tests__/WMSLegend-test.jsx
+13 −1 web/client/plugins/TOC/index.js
+1 −1 web/client/plugins/Widgets.jsx
+1 −1 web/client/plugins/tocitemssettings/defaultSettingsTabs.js
+13 −9 web/client/product/components/viewer/about/About.jsx
+2 −2 web/client/product/components/viewer/about/AboutContent.jsx
+1 −1 web/client/product/components/viewer/about/VersionInfo.jsx
+56 −0 web/client/product/components/viewer/about/__tests__/About-test.js
+2 −0 web/client/product/plugins/About.jsx
+4 −1 web/client/themes/default/less/version.less
+12 −0 web/client/translations/data.da-DK.json
+18 −1 web/client/translations/data.de-DE.json
+18 −1 web/client/translations/data.en-US.json
+18 −1 web/client/translations/data.es-ES.json
+12 −0 web/client/translations/data.fi-FI.json
+18 −1 web/client/translations/data.fr-FR.json
+12 −0 web/client/translations/data.hr-HR.json
+12 −0 web/client/translations/data.is-IS.json
+16 −1 web/client/translations/data.it-IT.json
+12 −0 web/client/translations/data.nl-NL.json
+11 −0 web/client/translations/data.pt-PT.json
+11 −0 web/client/translations/data.sk-SK.json
+11 −0 web/client/translations/data.sv-SE.json
+11 −0 web/client/translations/data.vi-VN.json
+11 −0 web/client/translations/data.zh-ZH.json
+15 −0 web/client/utils/FeatureGridUtils.js
+9 −7 web/client/utils/FilterUtils.js
+123 −0 web/client/utils/LegendUtils.js
+1 −1 web/client/utils/MarkerUtils.js
+24 −26 web/client/utils/PrintUtils.js
+13 −0 web/client/utils/WMSUtils.js
+46 −0 web/client/utils/WidgetsUtils.js
+56 −1 web/client/utils/__tests__/FeatureGridUtils-test.js
+10 −9 web/client/utils/__tests__/FilterUtils-test.js
+280 −0 web/client/utils/__tests__/LegendUtils-test.js
+10 −1 web/client/utils/__tests__/WMSUtils-test.js
+41 −1 web/client/utils/__tests__/WidgetsUtils-test.js
+1 −0 web/client/utils/cesium/WMSUtils.js
+11 −0 web/client/utils/cesium/__tests__/WMSUtils-test.js
+6 −0 web/client/utils/ogc/Filter/CQL/__tests__/parser-test.js
+1 −1 web/client/utils/ogc/Filter/CQL/parser.js
+1 −0 web/client/utils/ogc/Filter/FilterBuilder.js
+6 −1 web/client/utils/ogc/Filter/__tests__/FilterBuilder-test.js
+4 −0 web/client/utils/ogc/Filter/__tests__/fromObject-test.js
+5 −0 web/client/utils/ogc/Filter/__tests__/operators-test.js
+4 −4 web/client/utils/ogc/Filter/operators.js
+5 −1 web/client/utils/styleparser/StyleParserUtils.js
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, pick, difference } 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 @@ -89,7 +89,8 @@ export const resourceToLayerConfig = (resource) => {
has_time: hasTime,
default_style: defaultStyle,
ptype,
subtype
subtype,
sourcetype
} = resource;

const bbox = getExtentFromResource(resource);
Expand Down Expand Up @@ -191,7 +192,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

0 comments on commit bec322b

Please sign in to comment.