Jelmer Baas
Jelmer Baas

Reputation: 131

Disable interim tiles for tile layer

When creating a map like this:

var map = new ol.Map({
   loadTilesWhileAnimating: true,
   loadTilesWhileInteracting: true
})

OpenLayers 3 uses interim tiles (i.e., previously loaded lower resolution tiles) when zooming and panning until it has finished loading the new tiles. The interim tiles are placed behind the real tiles. Which is very clever, and is great for opaque layers, but much not so great for mostly transparent layers.

We currently have a layer which consists of just a few lines, only a few pixels think. Slightly panning the map makes these into huge blobs, causes a lot of flicker.

Is there a way to disable creating of these interim tiles, just for a specific layer? It would be disappointing if I'd need to disable both loadTilesWhile* properties just because of a single layer.

For an example, see: https://i.sstatic.net/jTdoD.jpg The left is normal (the red line is mine), right is after panning slightly.

This is with cacheSize 0 on the source and useInterimTilesOnError false.

Update: OpenLayers 3.12 behaves differently. In that version, only unloaded tiles are blurry (which is to be expected), but already loaded tiles are left alone. Starting from 3.13 or 3.14, this behavior changed.

Upvotes: 3

Views: 800

Answers (1)

Jelmer Baas
Jelmer Baas

Reputation: 131

See my pull request in the OpenLayers GitHub repository for a solution / workaround: https://github.com/openlayers/ol3/issues/5251#issuecomment-212322292

Upvotes: 0

Related Questions