[OpenLayers-Users] Tiles outside maxExtent being loaded
Jon Blower
jdb at mail.nerc-essc.ac.uk
Mon Jun 2 07:06:40 EDT 2008
Hi Chris,
Thanks for the clarification. FYI, I worked around this issue by
creating a subclass of OpenLayers.Layer.WMS and overriding the
getURL() method. The new method checks the latitude bounds, setting
the URL to that of a fixed blank image if out of bounds. This blank
image is cached by the browser, reducing server round-trips
significantly.
See http://behemoth.nerc-essc.ac.uk/ncWMS/js/WMS1_1_1.js. (You might
also notice that I've added a little extra sophistication to allow
different values of the key used for SRS. WMS1.1.1 uses "SRS" while
WMS1.3.0 uses "CRS". I also have a WMS1_3 class that subclasses
WMS1_1_1 and takes advantage of this).
Cheers, Jon
On Sun, Jun 1, 2008 at 7:34 PM, Eric Lemoine <eric.c2c at gmail.com> wrote:
> On Sun, Jun 1, 2008 at 3:53 PM, Christopher Schmidt
> <crschmidt at metacarta.com> wrote:
>> On Sun, Jun 01, 2008 at 02:10:46PM +0200, Eric Lemoine wrote:
>>> On Fri, May 30, 2008 at 4:24 PM, Christopher Schmidt
>>> <crschmidt at metacarta.com> wrote:
>>> > On Fri, May 30, 2008 at 01:48:36PM +0100, Jon Blower wrote:
>>> >> I've noticed that in my application OpenLayers is requesting tiles
>>> >> outside the maximum extent of my overlay layer (which is in EPSG:4326
>>> >> and hence has a maxExtent of -180,-90,180,90). I've checked using the
>>> >> Firebug console that the maxExtent is correctly set. wrapDateLine is
>>> >> set true.
>>> >
>>> > wrapDateLine forces displayOutsideMaxExtent, which is why you are seeing
>>> > the behavior you are seeing.
>>>
>>> Chris, sorry for the stupid question but why does wrapDateLine force
>>> displayOutsideMaxExtent? What would not function if one creates a
>>> layer with wrapeDateLine:true and then does
>>> layer.displayOutsideMaxExtent = false? One will end up with missing
>>> tiles?
>>
>> The 'wrapped' tiles are, in actuality, still going from (for example)
>> -360 to -180 in the 'mind' of OpenLayers. We just fake the *request*
>> bbox, not the place the tile actually thinks of itself as being: without
>> displayOutsideMaxExtent, this obviously wouldn't work.
>
> I'm not familiar with the wrapdateline code, thanks for the explanation Chris.
>
> Cheers,
>
> --
> Eric
>
--
--------------------------------------------------------------
Dr Jon Blower Tel: +44 118 378 5213 (direct line)
Technical Director Tel: +44 118 378 8741 (ESSC)
Reading e-Science Centre Fax: +44 118 378 6413
ESSC Email: jdb at mail.nerc-essc.ac.uk
University of Reading
3 Earley Gate
Reading RG6 6AL, UK
--------------------------------------------------------------
More information about the Users
mailing list