[OpenLayers-Users] [Geoserver-users] Problem with GWC and tile alignment but only affecting some zoom levels.
Phil Scadden
p.scadden at gns.cri.nz
Tue Sep 18 20:05:06 PDT 2012
This is SEEMS to beOpenLayers issue not a Geoserver issue. I have
reported bug complete with minimal code for reproducing it.
However, this URL
http://maps.gns.cri.nz/geoserver/wms?LAYERS=gns%3APETROLEUM.IWI_BOUNDARIES&FORMAT=image%2Fpng&TRANSPARENT=TRUE&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&SRS=EPSG%3A900913&BBOX=18785164.06875,-4642705.18625,19411336.204375,-4016533.050625&WIDTH=256&HEIGHT=256
produces a different image to this one (identical BBOX)
http://maps.gns.cri.nz/geoserver/wms?LAYERS=gns%3APETROLEUM.IWI_BOUNDARIES&FORMAT=image%2Fpng&TILED=TRUE&TILESORIGIN=-20037508.34%2C-20037508.34&TRANSPARENT=TRUE&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&SRS=EPSG%3A900913&BBOX=18785164.06875,-4642705.18625,19411336.204375,-4016533.050625&WIDTH=256&HEIGHT=256
Ie the lower one has tiled=true (and tile origin stated though it
produces exactly the same image whether tileorigin parameter is present
or not).
Its a public geoserver instance. This one is 2.1.3, but I get identical
behaviour 2.1.4 server.
https://github.com/openlayers/openlayers/issues/688
Minimal HTML for reproducing bug.
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="imagetoolbar" content="no">
<title>test:PETROLEUM.IWI_BOUNDARIES EPSG:900913 image/png</title>
<style type="text/css">
body { font-family: sans-serif; font-weight: bold; font-size: .8em; }
body { border: 0px; margin: 0px; padding: 0px; }
#map { width: 85%; height: 85%; border: 0px; padding: 0px; }
</style>
<script
src="http://data-uat/JsLibrary/OpenLayers-2.12/OpenLayers.js"></script>
<script src="http://maps.google.com/maps/api/js?v=3&sensor=false"></script>
<script type="text/javascript">
var map, demolayer;
// sets the chosen modifiable parameter
function setParam(name, value){
str = "demolayer.mergeNewParams({" + name + ": '" + value + "'})"
// alert(str);
eval(str);
}
OpenLayers.DOTS_PER_INCH = 90.71428571428572;
OpenLayers.Util.onImageLoadErrorColor = 'transparent';
function init(){
var mapOptions = {
resolutions: [156543.03390625, 78271.516953125, 39135.7584765625,
19567.87923828125, 9783.939619140625, 4891.9698095703125,
2445.9849047851562, 1222.9924523925781, 611.4962261962891,
305.74811309814453, 152.87405654907226, 76.43702827453613,
38.218514137268066, 19.109257068634033, 9.554628534317017,
4.777314267158508, 2.388657133579254, 1.194328566789627,
0.5971642833948135, 0.29858214169740677, 0.14929107084870338,
0.07464553542435169, 0.037322767712175846, 0.018661383856087923,
0.009330691928043961, 0.004665345964021981, 0.0023326729820109904,
0.0011663364910054952, 5.831682455027476E-4, 2.915841227513738E-4,
1.457920613756869E-4],
units: "m",
projection: new OpenLayers.Projection('EPSG:900913'),
maxExtent: new
OpenLayers.Bounds(-2.003750834E7,-2.003750834E7,2.003750834E7,2.003750834E7),
controls: []
};
msex = new OpenLayers.Bounds(-20037508.34, -8399738, 20037508.34,
20037508.34);
map = new OpenLayers.Map('map', mapOptions );
map.addControl(new OpenLayers.Control.PanZoomBar({
position: new OpenLayers.Pixel(2, 15)
}));
map.addControl(new OpenLayers.Control.Navigation());
map.addLayer(new OpenLayers.Layer.Google("Google Street", {
type: google.maps.MapTypeId.ROADMAP,
sphericalMercator: true,
numZoomLevels: 20,
wrapDateLine: true,
visible:true,
isBaseLayer:true
}));
demolayer = new OpenLayers.Layer.WMS(
"gns:PETROLEUM.IWI_BOUNDARIES","http://maps.gns.cri.nz/geoserver/wms",
{layers: 'gns:PETROLEUM.IWI_BOUNDARIES', format: 'image/png',
tiled:true, tilesOrigin : map.maxExtent.left + ',' + map.maxExtent.bottom,
transparent:true },
{
tileSize: new OpenLayers.Size(256,256),
wrapDateLine: true,
isBaseLayer: false,
displayOutsideMaxExtent: false,
maxExtent:msex,
displayInLayerSwitcher: true,
});
map.addLayer(demolayer);
var p4326 = new OpenLayers.Projection("EPSG:4326");
var p900913 = new OpenLayers.Projection("EPSG:900913");
nzArea = new OpenLayers.Bounds(161.0, -50.0, 179.99, -31.0);
nzArea.transform(p4326, p900913);
map.zoomToExtent(nzArea);
}
</script>
</head>
<body onload="init()">
<div id="params"></div>
<div id="map"></div>
<div id="nodelist"></div>
</body>
</html>
Notice: This email and any attachments are confidential. If received in error please destroy and immediately notify us. Do not copy or disclose the contents.
More information about the Users
mailing list