question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

updateWhileInteracting not working in VectorImageLayer

See original GitHub issue

Features in VectorImageLayer are not updated when interacting with the map (dragging, zooming etc…).

Steps to reproduce:

  1. create a feature and update its coordinate every interval.
  2. create a new VectorSource and add the feature to it.
  3. create a new VectorImageLayer with updateWhileInteracting: true and add the vectorSource to it
  4. Open the application and start zooming and dragging the map.
  5. 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);

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:18 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
jahowcommented, Jul 13, 2020

Well, I guess you need to set updateWhileAnimating/Interacting to true to have it update during a pan…

0reactions
yonzathujicommented, Jul 10, 2020

To have a map continously rendering, you can use a loop like this

It didn’t work for me… Could please edit my moving feature fiddle so I see what you mean exactly? The feature should continue changing its location every 500 ms even if the user is dragging the map.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ol/layer/Vector~VectorLayer - OpenLayers
The map will not manage this layer in its layers collection, and the layer will be rendered on top. ... updateWhileInteracting, boolean (defaults...
Read more >
Vector layer visibility using min/maxResolution is not working ...
I want to change the vector layers' visibility at certain zoom levels, by using min/maxScale or min/maxResolution, but it doesn't seem to work....
Read more >
OpenLayers v7.1.0 API - Class: BaseVectorLayer
The map will not manage this layer in its layers collection, and the layer will be rendered on top. ... updateWhileInteracting, boolean (defaults...
Read more >
OpenLayers v6.1.1 API - Class: BaseVectorLayer
The bounding extent for layer rendering. The layer will not be rendered outside of this extent. ... updateWhileInteracting, boolean (defaults to false).
Read more >
performance issue when adding vector layers to openLayers ...
I tried using vector image layer rather than vector layer, ... @IanTurton my problem is not with geoserver or the time it takes...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found