The map-component renderes geometries given to it by the datamodel. The component expects an array of objects { data: string; label?: string; }.
When objects are added to the array, the map component renderes them properly. On the other hand, if you change the data/polygon part of a geometry that has previously been rendered on the map, the map moves to the new geometry location, but the geometry itself remains unchanged. Since the map moves to the new placement, that means the geometry bounds are recalculated, showing that the datamodel has been updated correctly. It seems like this happens as long as the data/gemoetry object has the same index and label in the datamodel array as it had on previous renders/updates. Reversing the list in the app before storing it in the datamodel so the index of the object has been changed since last update makes the geometry behave correctly/as expected.
The problem is propably with the key of the geojson components in the map component.
Geometry is placed in datamodel and rendered in map. When the geometry is changed in the datamodel, the geometry remains in place on the map, instead of moving where it should.
What should have happened
Map should have moved to the new placement of the geometry, and the geometry object should have moved and adapted to the changed geometry data.
Steps To Reproduce
Make an app with a map and geometries that can be changed by the user.
Place geometries in the datamodel/map
Watch them render on the map
Change/update the data prop/field of one of the geometries
The map should move the view to the updated placement of the geometry, while the geometry stays in place.
Additional Information
Placed geometry on map, and rendered correctly
Changed the data of a geometry, but kept same label and placement in the array. The map moves but geometry does not.
Expected behavior is that the geometry updates to new place:
Description of the bug
The map-component renderes geometries given to it by the datamodel. The component expects an array of objects
{ data: string; label?: string; }
. When objects are added to the array, the map component renderes them properly. On the other hand, if you change the data/polygon part of a geometry that has previously been rendered on the map, the map moves to the new geometry location, but the geometry itself remains unchanged. Since the map moves to the new placement, that means the geometry bounds are recalculated, showing that the datamodel has been updated correctly. It seems like this happens as long as the data/gemoetry object has the same index and label in the datamodel array as it had on previous renders/updates. Reversing the list in the app before storing it in the datamodel so the index of the object has been changed since last update makes the geometry behave correctly/as expected.The problem is propably with the key of the geojson components in the map component.
What happened
Geometry is placed in datamodel and rendered in map. When the geometry is changed in the datamodel, the geometry remains in place on the map, instead of moving where it should.
What should have happened
Map should have moved to the new placement of the geometry, and the geometry object should have moved and adapted to the changed geometry data.
Steps To Reproduce
Additional Information
Placed geometry on map, and rendered correctly
Changed the data of a geometry, but kept same label and placement in the array. The map moves but geometry does not.
Expected behavior is that the geometry updates to new place: