Describe the bug
I have run into a problem where I want to update properties purely for dynamic style changes.
Property updates count as a feature change and updates the undo/redo store. For example, I have code that sets some default properties to drawings right after their creation, which updates the undo/redo store twice (shown in repro).
Another use case is if I want to highlight a feature by adding a property highligted, each highlight toggle (property update) causes undo/redo store to be updated.
I'm running version:
Terra Draw npm version
"terra-draw": "1.31.1",
"terra-draw-maplibre-gl-adapter": "1.4.1",
To Reproduce
Reproduction sandbox: https://stackblitz.com/edit/baiadyvr?file=src%2Fapp%2Fapp.ts
Steps to reproduce the behavior:
- Draw a feature
- Use
updateFeatureProperties() to change a property
- Check undo/redo store
- See Undo size increase
Expected behavior
I'm expecting regular property updates not to cause updates for undo/redo store. I understand that this could be an actual feature for some specific cases or maybe some people already use this feature, therefore some sort of opt-in or opt-out, could be useful.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: linux mint
- Browser: chrome
- Version [e.g. 22]
Describe the bug
I have run into a problem where I want to update properties purely for dynamic style changes.
Property updates count as a feature change and updates the undo/redo store. For example, I have code that sets some default properties to drawings right after their creation, which updates the undo/redo store twice (shown in repro).
Another use case is if I want to highlight a feature by adding a property
highligted, each highlight toggle (property update) causes undo/redo store to be updated.I'm running version:
Terra Draw npm version
"terra-draw": "1.31.1",
"terra-draw-maplibre-gl-adapter": "1.4.1",
To Reproduce
Reproduction sandbox: https://stackblitz.com/edit/baiadyvr?file=src%2Fapp%2Fapp.ts
Steps to reproduce the behavior:
updateFeatureProperties()to change a propertyExpected behavior
I'm expecting regular property updates not to cause updates for undo/redo store. I understand that this could be an actual feature for some specific cases or maybe some people already use this feature, therefore some sort of opt-in or opt-out, could be useful.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):