Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #9654 updates of feature styles #9659

Merged
merged 1 commit into from
Oct 27, 2023
Merged
Changes from all commits
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
14 changes: 13 additions & 1 deletion web/client/components/map/openlayers/plugins/VectorLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,19 @@ Layers.registerType('vector', {
});
}

if (!isEqual(oldOptions.style, newOptions.style) || oldOptions.styleName !== newOptions.styleName) {
/**
* we need to also check when features changes because there could be styles depending of features
* so when the latter changes we have to redraw to redo the checks and apply correct style based on new feature props
*/
const areFeaturesChanged = !isEqual(oldOptions.features, newOptions.features);

const isStyleChanged = !isEqual(oldOptions.style, newOptions.style);
const isStyleNameChanged = oldOptions.styleName !== newOptions.styleName;
if (
isStyleChanged ||
isStyleNameChanged ||
areFeaturesChanged
) {
getStyle(applyDefaultStyleToVectorLayer({ ...newOptions, asPromise: true }))
.then((style) => {
if (style) {
Expand Down
Loading