The bounding box and extent of the viewport seems to be corrupted when panning the map. The actual display of the data is fine, however the underlying bbox and x/y values for tiles corrupt printed images when using the Wiki Printing code. While panning the map and then printing will give an incorrect image result, switching the base layer after panning fixes the bbox and x/y values and any base layer will print correctly thereafter. Additional panning does require additional base layer switches to fix the extent again. <br>
<br>Test map:<br><br> function loadMap(){<br> map = new OpenLayers.Map( 'map' );<br> var lon = -119.2;<br> var lat = 37;<br> var zoom = 4;<br> var lyrSw = new OpenLayers.Control.LayerSwitcher();<br>
map.addControl(lyrSw);<br> var ol_wms = new OpenLayers.Layer.WMS("basic","<a href="http://labs.metacarta.com/wms/vmap0">http://labs.metacarta.com/wms/vmap0</a>",{layers: 'basic'});<br>
var satellite = new OpenLayers.Layer.WMS("sat", "<a href="http://hypercube.telascience.org/cgi-bin/landsat7">http://hypercube.telascience.org/cgi-bin/landsat7</a>?", {layers:'landsat7'}, {format: 'image/jpeg', wrapDateLine: false});<br>
<br> map.addLayers([ol_wms,satellite]);<br> map.setCenter(new OpenLayers.LonLat(lon,lat),zoom);<br> }<br><br><br>To reproduce this behavior:<br>1. Print the initial map (works correctly)<br>2. Pan the map and print (incorrect map extent with vertical black band on left side of image)<br>
3. Switch the base layer and print (works correctly)<br>4. Switch back to initial base layer and print (now works correctly)<br><br>Following are debugging excerpts of each tile's url and x/y positions from printMap.php:<br>
<br>Pan the map and print:<br><br><a href="http://url?LAYERS=basic&BBOX=-123.75,50.625,-118.125,56.25&WIDTH=256&HEIGHT=256">http://url?LAYERS=basic&BBOX=-123.75,50.625,-118.125,56.25&WIDTH=256&HEIGHT=256</a>, x: 43, y: -626<br>
<a href="http://url?LAYERS=basic&BBOX=-118.125,50.625,-112.5,56.25&WIDTH=256&HEIGHT=256">http://url?LAYERS=basic&BBOX=-118.125,50.625,-112.5,56.25&WIDTH=256&HEIGHT=256</a>, x: 299, y: -626<br><a href="http://url?LAYERS=basic&BBOX=-112.5,50.625,-106.875,56.25&WIDTH=256&HEIGHT=256">http://url?LAYERS=basic&BBOX=-112.5,50.625,-106.875,56.25&WIDTH=256&HEIGHT=256</a>, x: 555, y: -626<br>
<a href="http://url?LAYERS=basic&BBOX=-106.875,50.625,-101.25,56.25&WIDTH=256&HEIGHT=256">http://url?LAYERS=basic&BBOX=-106.875,50.625,-101.25,56.25&WIDTH=256&HEIGHT=256</a>, x: 811, y: -626<br><a href="http://url?LAYERS=basic&BBOX=-101.25,50.625,-95.625,56.25&WIDTH=256&HEIGHT=256">http://url?LAYERS=basic&BBOX=-101.25,50.625,-95.625,56.25&WIDTH=256&HEIGHT=256</a>, x: 1067, y: -626<br>
<a href="http://url?LAYERS=basic&BBOX=-95.625,50.625,-90,56.25&WIDTH=256&HEIGHT=256">http://url?LAYERS=basic&BBOX=-95.625,50.625,-90,56.25&WIDTH=256&HEIGHT=256</a>, x: 1323, y: -626<br><a href="http://url?LAYERS=basic&BBOX=-90,50.625,-84.375,56.25&WIDTH=256&HEIGHT=256">http://url?LAYERS=basic&BBOX=-90,50.625,-84.375,56.25&WIDTH=256&HEIGHT=256</a>, x: 1579, y: -626<br>
<a href="http://url?LAYERS=basic&BBOX=-123.75,45,-118.125,50.625&WIDTH=256&HEIGHT=256">http://url?LAYERS=basic&BBOX=-123.75,45,-118.125,50.625&WIDTH=256&HEIGHT=256</a>, x: 43, y: -370<br><a href="http://url?LAYERS=basic&BBOX=-118.125,45,-112.5,50.625&WIDTH=256&HEIGHT=256">http://url?LAYERS=basic&BBOX=-118.125,45,-112.5,50.625&WIDTH=256&HEIGHT=256</a>, x: 299, y: -370<br>
<a href="http://url?LAYERS=basic&BBOX=-112.5,45,-106.875,50.625&WIDTH=256&HEIGHT=256">http://url?LAYERS=basic&BBOX=-112.5,45,-106.875,50.625&WIDTH=256&HEIGHT=256</a>, x: 555, y: -370<br><a href="http://url?LAYERS=basic&BBOX=-106.875,45,-101.25,50.625&WIDTH=256&HEIGHT=256">http://url?LAYERS=basic&BBOX=-106.875,45,-101.25,50.625&WIDTH=256&HEIGHT=256</a>, x: 811, y: -370<br>
<a href="http://url?LAYERS=basic&BBOX=-101.25,45,-95.625,50.625&WIDTH=256&HEIGHT=256">http://url?LAYERS=basic&BBOX=-101.25,45,-95.625,50.625&WIDTH=256&HEIGHT=256</a>, x: 1067, y: -370<br><a href="http://url?LAYERS=basic&BBOX=-95.625,45,-90,50.625&WIDTH=256&HEIGHT=256">http://url?LAYERS=basic&BBOX=-95.625,45,-90,50.625&WIDTH=256&HEIGHT=256</a>, x: 1323, y: -370<br>
<a href="http://url?LAYERS=basic&BBOX=-90,45,-84.375,50.625&WIDTH=256&HEIGHT=256">http://url?LAYERS=basic&BBOX=-90,45,-84.375,50.625&WIDTH=256&HEIGHT=256</a>, x: 1579, y: -370<br><br>Switch base layer to sat and print:<br>
<br><a href="http://url?LAYERS=sat&BBOX=-129.375,56.25,-123.75,61.875&WIDTH=256&HEIGHT=256">http://url?LAYERS=sat&BBOX=-129.375,56.25,-123.75,61.875&WIDTH=256&HEIGHT=256</a>, x: -652, y: -762<br><a href="http://url?LAYERS=sat&BBOX=-123.75,56.25,-118.125,61.875&WIDTH=256&HEIGHT=256">http://url?LAYERS=sat&BBOX=-123.75,56.25,-118.125,61.875&WIDTH=256&HEIGHT=256</a>, x: -396, y: -762<br>
<a href="http://url?LAYERS=sat&BBOX=-118.125,56.25,-112.5,61.875&WIDTH=256&HEIGHT=256">http://url?LAYERS=sat&BBOX=-118.125,56.25,-112.5,61.875&WIDTH=256&HEIGHT=256</a>, x: -140, y: -762<br><a href="http://url?LAYERS=sat&BBOX=-112.5,56.25,-106.875,61.875&WIDTH=256&HEIGHT=256">http://url?LAYERS=sat&BBOX=-112.5,56.25,-106.875,61.875&WIDTH=256&HEIGHT=256</a>, x: 116, y: -762<br>
<a href="http://url?LAYERS=sat&BBOX=-106.875,56.25,-101.25,61.875&WIDTH=256&HEIGHT=256">http://url?LAYERS=sat&BBOX=-106.875,56.25,-101.25,61.875&WIDTH=256&HEIGHT=256</a>, x: 372, y: -762<br><a href="http://url?LAYERS=sat&BBOX=-101.25,56.25,-95.625,61.875&WIDTH=256&HEIGHT=256">http://url?LAYERS=sat&BBOX=-101.25,56.25,-95.625,61.875&WIDTH=256&HEIGHT=256</a>, x: 628, y: -762<br>
<a href="http://url?LAYERS=sat&BBOX=-95.625,56.25,-90,61.875&WIDTH=256&HEIGHT=256">http://url?LAYERS=sat&BBOX=-95.625,56.25,-90,61.875&WIDTH=256&HEIGHT=256</a>, x: 884, y: -762<br><a href="http://url?LAYERS=sat&BOX=-129.375,50.625,-123.75,56.25&WIDTH=256&HEIGHT=256">http://url?LAYERS=sat&BOX=-129.375,50.625,-123.75,56.25&WIDTH=256&HEIGHT=256</a>, x: -652, y: -506<br>
<a href="http://url?LAYERS=sat&BBOX=-123.75,50.625,-118.125,56.25&WIDTH=256&HEIGHT=256">http://url?LAYERS=sat&BBOX=-123.75,50.625,-118.125,56.25&WIDTH=256&HEIGHT=256</a>, x: -396, y: -506<br><a href="http://url?LAYERS=sat&BBOX=-118.125,50.625,-112.5,56.25&WIDTH=256&HEIGHT=256">http://url?LAYERS=sat&BBOX=-118.125,50.625,-112.5,56.25&WIDTH=256&HEIGHT=256</a>, x: -140, y: -506<br>
<a href="http://url?LAYERS=sat&BBOX=-112.5,50.625,-106.875,56.25&WIDTH=256&HEIGHT=256">http://url?LAYERS=sat&BBOX=-112.5,50.625,-106.875,56.25&WIDTH=256&HEIGHT=256</a>, x: 116, y: -506<br><a href="http://url?LAYERS=sat&BBOX=-106.875,50.625,-101.25,56.25&WIDTH=256&HEIGHT=256">http://url?LAYERS=sat&BBOX=-106.875,50.625,-101.25,56.25&WIDTH=256&HEIGHT=256</a>, x: 372, y: -506<br>
<a href="http://url?LAYERS=sat&BBOX=-101.25,50.625,-95.625,56.25&WIDTH=256&HEIGHT=256">http://url?LAYERS=sat&BBOX=-101.25,50.625,-95.625,56.25&WIDTH=256&HEIGHT=256</a>, x: 628, y: -506<br><a href="http://url?LAYERS=sat&BBOX=-95.625,50.625,-90,56.25&WIDTH=256&HEIGHT=256">http://url?LAYERS=sat&BBOX=-95.625,50.625,-90,56.25&WIDTH=256&HEIGHT=256</a>, x: 884, y: -506<br>
<br>Switch base layer back to basic and print:<br><br><a href="http://url?LAYERS=basic&BBOX=-129.375,56.25,-123.75,61.875&WIDTH=256&HEIGHT=256">http://url?LAYERS=basic&BBOX=-129.375,56.25,-123.75,61.875&WIDTH=256&HEIGHT=256</a>, x: -652, y: -762<br>
<a href="http://url?LAYERS=basic&BBOX=-123.75,56.25,-118.125,61.875&WIDTH=256&HEIGHT=256">http://url?LAYERS=basic&BBOX=-123.75,56.25,-118.125,61.875&WIDTH=256&HEIGHT=256</a>, x: -396, y: -762<br><a href="http://url?LAYERS=basic&BBOX=-118.125,56.25,-112.5,61.875&WIDTH=256&HEIGHT=256">http://url?LAYERS=basic&BBOX=-118.125,56.25,-112.5,61.875&WIDTH=256&HEIGHT=256</a>, x: -140, y: -762<br>
<a href="http://url?LAYERS=basic&BBOX=-112.5,56.25,-106.875,61.875&WIDTH=256&HEIGHT=256">http://url?LAYERS=basic&BBOX=-112.5,56.25,-106.875,61.875&WIDTH=256&HEIGHT=256</a>, x: 116, y: -762<br><a href="http://url?LAYERS=basic&BBOX=-106.875,56.25,-101.25,61.875&WIDTH=256&HEIGHT=256">http://url?LAYERS=basic&BBOX=-106.875,56.25,-101.25,61.875&WIDTH=256&HEIGHT=256</a>, x: 372, y: -762<br>
<a href="http://url?LAYERS=basic&BBOX=-101.25,56.25,-95.625,61.875&WIDTH=256&HEIGHT=256">http://url?LAYERS=basic&BBOX=-101.25,56.25,-95.625,61.875&WIDTH=256&HEIGHT=256</a>, x: 628, y: -762<br><a href="http://url?LAYERS=basic&BBOX=-95.625,56.25,-90,61.875&WIDTH=256&HEIGHT=256">http://url?LAYERS=basic&BBOX=-95.625,56.25,-90,61.875&WIDTH=256&HEIGHT=256</a>, x: 884, y: -762<br>
<a href="http://url?LAYERS=basic&BBOX=-129.375,50.625,-123.75,56.25&WIDTH=256&HEIGHT=256">http://url?LAYERS=basic&BBOX=-129.375,50.625,-123.75,56.25&WIDTH=256&HEIGHT=256</a>, x: -652, y: -506<br><a href="http://url?LAYERS=basic&BBOX=-123.75,50.625,-118.125,56.25&WIDTH=256&HEIGHT=256">http://url?LAYERS=basic&BBOX=-123.75,50.625,-118.125,56.25&WIDTH=256&HEIGHT=256</a>, x: -396, y: -506<br>
<a href="http://url?LAYERS=basic&BBOX=-118.125,50.625,-112.5,56.25&WIDTH=256&HEIGHT=256">http://url?LAYERS=basic&BBOX=-118.125,50.625,-112.5,56.25&WIDTH=256&HEIGHT=256</a>, x: -140, y: -506<br><a href="http://url?LAYERS=basic&BBOX=-112.5,50.625,-106.875,56.25&WIDTH=256&HEIGHT=256">http://url?LAYERS=basic&BBOX=-112.5,50.625,-106.875,56.25&WIDTH=256&HEIGHT=256</a>, x: 116, y: -506<br>
<a href="http://url?LAYERS=basic&BBOX=-106.875,50.625,-101.25,56.25&WIDTH=256&HEIGHT=256">http://url?LAYERS=basic&BBOX=-106.875,50.625,-101.25,56.25&WIDTH=256&HEIGHT=256</a>, x: 372, y: -506<br><a href="http://url?LAYERS=basic&BBOX=-101.25,50.625,-95.625,56.25&WIDTH=256&HEIGHT=256">http://url?LAYERS=basic&BBOX=-101.25,50.625,-95.625,56.25&WIDTH=256&HEIGHT=256</a>, x: 628, y: -506<br>
<a href="http://url?LAYERS=basic&BBOX=-95.625,50.625,-90,56.25&WIDTH=256&HEIGHT=256">http://url?LAYERS=basic&BBOX=-95.625,50.625,-90,56.25&WIDTH=256&HEIGHT=256</a>, x: 884, y: -506<br><br>I also noted that layer.getTilesBounds() gives different bounds for a layer before/after "fixing" it via a base layer switch. If someone will confirm that this is a bug and not the result of a glaring omission on my part, I will file it. A quick look through known bugs didn't find anything along these lines.<br>