Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion web/client/components/map/cesium/plugins/WFSLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ const createLayer = (options, map) => {
id: options?.id,
map: map,
opacity: options.opacity,
queryable: options.queryable === undefined || options.queryable
queryable: options.queryable === undefined || options.queryable,
styleRules: options?.style?.body?.rules || []
});
let loader;
let loadingBbox;
Expand Down Expand Up @@ -187,6 +188,11 @@ Layers.registerType('wfs', {
return createLayer(newOptions, map);
}
if (layer?.styledFeatures && !isEqual(newOptions.style, oldOptions.style)) {
// update style rules here
if (!isEqual(newOptions?.style?.body?.rules, oldOptions?.style?.body?.rules)) {
let styleRules = newOptions?.style?.body?.rules || [];
layer.styledFeatures._setStyleRules(styleRules);
}
layerToGeoStylerStyle(newOptions)
.then((style) => {
getStyle(applyDefaultStyleToVectorLayer({
Expand Down
13 changes: 8 additions & 5 deletions web/client/plugins/styleeditor/VectorStyleEditor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import { classifyGeoJSON, availableMethods } from '../../api/GeoJSONClassificati
import { getLayerJSONFeature } from '../../observables/wfs';
import { connect } from 'react-redux';
import { createSelector } from 'reselect';
import { scalesSelector } from '../../selectors/map';
import { currentZoomLevelSelector, scalesSelector } from '../../selectors/map';

const { getColors } = SLDService;

Expand Down Expand Up @@ -88,7 +88,8 @@ function VectorStyleEditor({
'Brush Script MT'
],
onUpdateNode = () => {},
scales = []
scales = [],
zoom = 0
}) {

const request = capabilitiesRequest[layer?.type];
Expand Down Expand Up @@ -258,12 +259,14 @@ function VectorStyleEditor({
supportedSymbolizerMenuOptions: ['Simple', 'Extrusion', 'Classification'],
fonts,
enableFieldExpression: ['vector', 'wfs'].includes(layer.type),
scales
scales,
zoom // passing this for showing arrow of current scale for ScaleDenominator
}}
/>
);
}
const ConnectedVectorStyleEditor = connect(createSelector([scalesSelector], (scales) => ({
scales: scales.map(scale => Math.round(scale))
const ConnectedVectorStyleEditor = connect(createSelector([scalesSelector, currentZoomLevelSelector], (scales, zoom) => ({
scales: scales.map(scale => Math.round(scale)),
zoom
})))(VectorStyleEditor);
export default ConnectedVectorStyleEditor;
Loading