Layer render buffer

40 views
Skip to first unread message

phil

unread,
Feb 22, 2018, 9:29:50 AM2/22/18
to OpenLayers Dev
I'm using openlayers 4 and have some ol.layer.Tile Layers.
I'm loading WMS-Tiles from my Server with a Size of 256x256px.

Everything works fine so far.

Right now I have a use case, where I would like to load more Tiles than it needs to fill the current ViewPort. I would like to define a buffer, say 500m around the current ViewPort. Therefore, the user can drag around this extended area, without the need of loading this tiles (better user experience if working on a small area and same zoom level).

Is there some PreRender or PreCompose hook, where I can buffer the frameState.extent?

Something like following:

layer.addPreComposeFunction(frameState => {
  var extent = frameState.extent;
  extent = ol.extent.buffer(extent, 500);
  famreState.extent = extent;
});

Or is there another way to accomplish this?


Reply all
Reply to author
Forward
0 new messages