2
votes

Is there a way to tell openLayers not to request tiles out of particular bounds for a specific WMS Layer?

I want the rest of map and other layers still accessible, so maxExtent on map is not an option for me. I just want to restrict one WMS layer to particular bounds. If view port is inside the bounds and user zooms in fine, openlayer requests new tiles! but if viewport is outside, the WMS should only fill the bounded area with tiles from that WMS layer.

Does that make sense or is that even possible?


Update:

  1. I have tried maxExtent on Layer (WMS object extends from Layer), but that still doesn't stop OpenLayers from requesting tiles outside the maxExtent.

  2. No I am not trying to address the 'pink tile issue'.

  3. I need this for performance reasons. This particular WMS layer is vector intensive. and TileCache is not an option as I am using dynamic SLD's each time.

2
you can limit that from your tile serverMySqlError

2 Answers

2
votes

Okay I solved it.It was silly really, setting 'maxExtent' on WMS Layer does work, but only when 'singleTile' option is set to 'false'. When Single tile is set to true, for some reason OpenLayers ignores the maxExtent on the WMS Layer, and just requests the a single tile with bounds same as view port bounds! I am not sure if its a bug or what, because it sure doesn't make sense.

0
votes

I think you need to overwrite the method OpenLayers.Layer.WMS.getURL. Determine whether the requested area enters into the BBOX and return a reference to the WMS or the empty tile.