Monday, 4 December 2017

web mapping - Make OpenLayers request WMS tiles only within a certain bounds


Is there a way to actually tell OpenLayers not to request tiles out of particular bounds?


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, OpenLayers 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?




Answer



You should use maxExtent option on layer level.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...