Skip to content

Commit

Permalink
Trigger featureChanged on feature props change (#1196)
Browse files Browse the repository at this point in the history
  • Loading branch information
wyozi authored Aug 22, 2023
1 parent ff3dc5d commit 357ede0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ export default function(ctx, api) {
// If a feature of that id has already been created, and we are swapping it out ...
const internalFeature = ctx.store.get(feature.id);
internalFeature.properties = feature.properties;
if (!isEqual(internalFeature.properties, feature.properties)) {
ctx.store.featureChanged(internalFeature.id);
}
if (!isEqual(internalFeature.getCoordinates(), feature.geometry.coordinates)) {
internalFeature.incomingCoords(feature.geometry.coordinates);
}
Expand Down

0 comments on commit 357ede0

Please sign in to comment.