openlayers: updateWhileInteracting not working in VectorImageLayer
Features in VectorImageLayer are not updated when interacting with the map (dragging, zooming etc…).
Steps to reproduce:
- create a feature and update its coordinate every interval.
- create a new
VectorSourceand add thefeatureto it. - create a new
VectorImageLayerwithupdateWhileInteracting: trueand add thevectorSourceto it - Open the application and start zooming and dragging the map.
- The feature will only update its coordinates when the map is not interacted with
Expected behavior
Like in VectorLayer, I expect the feature to update even the map is been interacted with.
const source = new VectorSource({});
const layer = new VectorImageLayer({ // bug will not happen if using VectorLayer
source,
updateWhileInteracting: true,
updateWhileAnimating: true,
)};
map.addLayer(layer);
const feature = new Feature(new Point(randomLocation());
source.addFeature(feature);
setInterval(() => {
feature.getGeomtry().setCoordinates(randomLocation());
}, 500);
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 1
- Comments: 18 (9 by maintainers)
Well, I guess you need to set
updateWhileAnimating/Interactingto true to have it update during a pan…