openlayers / ol2

OpenLayers v2 - deprecated!
Other
1.48k stars 771 forks source link

Layer MaxExtent property does not play well with geoserver GWC. #688

Open scaddenp opened 12 years ago

scaddenp commented 12 years ago

Below is minimal code (based on GWC demo) to show the bug. Change link to openlayers.js to make it work (the layer used is on public geoserver instance). To see the problem, open the page and zoom in one level. The tiles are displaced. To see that this is a problem with maxExtent for a layer, comment out: maxExtent:msex,

To see that this is problem with GWC, put the maxExtent back in but comment out: tiled:true, tilesOrigin : map.maxExtent.left + ',' + map.maxExtent.bottom,

The problem appears to be with coords of grid but it is very confusing. Using Firebug and looking at the tile returned which covers the northern tip of NZ, you get different BBOX depending on what code is commented out above.

With maxExtent in, (BAD), the bbox is: 18785164.06875,-4642705.18625,19411336.204375,-4016533.050625 with maxExtent commented out, (GOOD) you get 18785164.06875,-4383204.949375,19411336.204375,-3757032.81375

If you put maxExtent in and tiled commented out, you get: 18785164.06875,-4642705.18625,19411336.204375,-4016533.050625

I'm confused, very confused. (I want layer maxExtent so as to mask out data below 60S)

scaddenp commented 12 years ago
test:PETROLEUM.IWI_BOUNDARIES EPSG:900913 image/png
scaddenp commented 12 years ago

Comment above has the code, but it doesnt display well. Should be extractable however.