Hi Ian,<div><br></div><div>Nice bug coaching on your end, and yes I can verify that I am experiencing similar behavior, though I&#39;m still not sure it&#39;s not something in my own config. I also discovered it while perusing the wiki printing code, and actually just posted a question to a thread discussing it before noticing your message.</div>
<div><br></div><div>Were you able to fix the problem or find a work-around?</div><div><br></div><div>Kind regards,</div><div>Gissur<br><br><div class="gmail_quote">On Mon, Nov 3, 2008 at 7:28 PM, Ian <span dir="ltr">&lt;<a href="mailto:iansgis@gmail.com">iansgis@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">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>&nbsp;function loadMap(){<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; map = new OpenLayers.Map( &#39;map&#39; );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var lon = -119.2;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var lat = 37;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var zoom = 4;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var lyrSw = new OpenLayers.Control.LayerSwitcher();<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; map.addControl(lyrSw);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var ol_wms = new OpenLayers.Layer.WMS(&quot;basic&quot;,&quot;<a href="http://labs.metacarta.com/wms/vmap0" target="_blank">http://labs.metacarta.com/wms/vmap0</a>&quot;,{layers: &#39;basic&#39;});<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var satellite = new OpenLayers.Layer.WMS(&quot;sat&quot;, &quot;<a href="http://hypercube.telascience.org/cgi-bin/landsat7" target="_blank">http://hypercube.telascience.org/cgi-bin/landsat7</a>?&quot;, {layers:&#39;landsat7&#39;}, {format: &#39;image/jpeg&#39;, wrapDateLine: false});<br>

<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; map.addLayers([ol_wms,satellite]);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; map.setCenter(new OpenLayers.LonLat(lon,lat),zoom);<br>&nbsp;&nbsp; }<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&#39;s url and x/y positions from printMap.php:<br>

<br>Pan the map and print:<br><br><a href="http://url?LAYERS=basic&amp;BBOX=-123.75,50.625,-118.125,56.25&amp;WIDTH=256&amp;HEIGHT=256" target="_blank">http://url?LAYERS=basic&amp;BBOX=-123.75,50.625,-118.125,56.25&amp;WIDTH=256&amp;HEIGHT=256</a>, x: 43, y: -626<br>

<a href="http://url?LAYERS=basic&amp;BBOX=-118.125,50.625,-112.5,56.25&amp;WIDTH=256&amp;HEIGHT=256" target="_blank">http://url?LAYERS=basic&amp;BBOX=-118.125,50.625,-112.5,56.25&amp;WIDTH=256&amp;HEIGHT=256</a>, x: 299, y: -626<br>
<a href="http://url?LAYERS=basic&amp;BBOX=-112.5,50.625,-106.875,56.25&amp;WIDTH=256&amp;HEIGHT=256" target="_blank">http://url?LAYERS=basic&amp;BBOX=-112.5,50.625,-106.875,56.25&amp;WIDTH=256&amp;HEIGHT=256</a>, x: 555, y: -626<br>

<a href="http://url?LAYERS=basic&amp;BBOX=-106.875,50.625,-101.25,56.25&amp;WIDTH=256&amp;HEIGHT=256" target="_blank">http://url?LAYERS=basic&amp;BBOX=-106.875,50.625,-101.25,56.25&amp;WIDTH=256&amp;HEIGHT=256</a>, x: 811, y: -626<br>
<a href="http://url?LAYERS=basic&amp;BBOX=-101.25,50.625,-95.625,56.25&amp;WIDTH=256&amp;HEIGHT=256" target="_blank">http://url?LAYERS=basic&amp;BBOX=-101.25,50.625,-95.625,56.25&amp;WIDTH=256&amp;HEIGHT=256</a>, x: 1067, y: -626<br>

<a href="http://url?LAYERS=basic&amp;BBOX=-95.625,50.625,-90,56.25&amp;WIDTH=256&amp;HEIGHT=256" target="_blank">http://url?LAYERS=basic&amp;BBOX=-95.625,50.625,-90,56.25&amp;WIDTH=256&amp;HEIGHT=256</a>, x: 1323, y: -626<br>
<a href="http://url?LAYERS=basic&amp;BBOX=-90,50.625,-84.375,56.25&amp;WIDTH=256&amp;HEIGHT=256" target="_blank">http://url?LAYERS=basic&amp;BBOX=-90,50.625,-84.375,56.25&amp;WIDTH=256&amp;HEIGHT=256</a>, x: 1579, y: -626<br>

<a href="http://url?LAYERS=basic&amp;BBOX=-123.75,45,-118.125,50.625&amp;WIDTH=256&amp;HEIGHT=256" target="_blank">http://url?LAYERS=basic&amp;BBOX=-123.75,45,-118.125,50.625&amp;WIDTH=256&amp;HEIGHT=256</a>, x: 43, y: -370<br>
<a href="http://url?LAYERS=basic&amp;BBOX=-118.125,45,-112.5,50.625&amp;WIDTH=256&amp;HEIGHT=256" target="_blank">http://url?LAYERS=basic&amp;BBOX=-118.125,45,-112.5,50.625&amp;WIDTH=256&amp;HEIGHT=256</a>, x: 299, y: -370<br>

<a href="http://url?LAYERS=basic&amp;BBOX=-112.5,45,-106.875,50.625&amp;WIDTH=256&amp;HEIGHT=256" target="_blank">http://url?LAYERS=basic&amp;BBOX=-112.5,45,-106.875,50.625&amp;WIDTH=256&amp;HEIGHT=256</a>, x: 555, y: -370<br>
<a href="http://url?LAYERS=basic&amp;BBOX=-106.875,45,-101.25,50.625&amp;WIDTH=256&amp;HEIGHT=256" target="_blank">http://url?LAYERS=basic&amp;BBOX=-106.875,45,-101.25,50.625&amp;WIDTH=256&amp;HEIGHT=256</a>, x: 811, y: -370<br>

<a href="http://url?LAYERS=basic&amp;BBOX=-101.25,45,-95.625,50.625&amp;WIDTH=256&amp;HEIGHT=256" target="_blank">http://url?LAYERS=basic&amp;BBOX=-101.25,45,-95.625,50.625&amp;WIDTH=256&amp;HEIGHT=256</a>, x: 1067, y: -370<br>
<a href="http://url?LAYERS=basic&amp;BBOX=-95.625,45,-90,50.625&amp;WIDTH=256&amp;HEIGHT=256" target="_blank">http://url?LAYERS=basic&amp;BBOX=-95.625,45,-90,50.625&amp;WIDTH=256&amp;HEIGHT=256</a>, x: 1323, y: -370<br>
<a href="http://url?LAYERS=basic&amp;BBOX=-90,45,-84.375,50.625&amp;WIDTH=256&amp;HEIGHT=256" target="_blank">http://url?LAYERS=basic&amp;BBOX=-90,45,-84.375,50.625&amp;WIDTH=256&amp;HEIGHT=256</a>, x: 1579, y: -370<br><br>
Switch base layer to sat and print:<br>
<br><a href="http://url?LAYERS=sat&amp;BBOX=-129.375,56.25,-123.75,61.875&amp;WIDTH=256&amp;HEIGHT=256" target="_blank">http://url?LAYERS=sat&amp;BBOX=-129.375,56.25,-123.75,61.875&amp;WIDTH=256&amp;HEIGHT=256</a>, x: -652, y: -762<br>
<a href="http://url?LAYERS=sat&amp;BBOX=-123.75,56.25,-118.125,61.875&amp;WIDTH=256&amp;HEIGHT=256" target="_blank">http://url?LAYERS=sat&amp;BBOX=-123.75,56.25,-118.125,61.875&amp;WIDTH=256&amp;HEIGHT=256</a>, x: -396, y: -762<br>

<a href="http://url?LAYERS=sat&amp;BBOX=-118.125,56.25,-112.5,61.875&amp;WIDTH=256&amp;HEIGHT=256" target="_blank">http://url?LAYERS=sat&amp;BBOX=-118.125,56.25,-112.5,61.875&amp;WIDTH=256&amp;HEIGHT=256</a>, x: -140, y: -762<br>
<a href="http://url?LAYERS=sat&amp;BBOX=-112.5,56.25,-106.875,61.875&amp;WIDTH=256&amp;HEIGHT=256" target="_blank">http://url?LAYERS=sat&amp;BBOX=-112.5,56.25,-106.875,61.875&amp;WIDTH=256&amp;HEIGHT=256</a>, x: 116, y: -762<br>

<a href="http://url?LAYERS=sat&amp;BBOX=-106.875,56.25,-101.25,61.875&amp;WIDTH=256&amp;HEIGHT=256" target="_blank">http://url?LAYERS=sat&amp;BBOX=-106.875,56.25,-101.25,61.875&amp;WIDTH=256&amp;HEIGHT=256</a>, x: 372, y: -762<br>
<a href="http://url?LAYERS=sat&amp;BBOX=-101.25,56.25,-95.625,61.875&amp;WIDTH=256&amp;HEIGHT=256" target="_blank">http://url?LAYERS=sat&amp;BBOX=-101.25,56.25,-95.625,61.875&amp;WIDTH=256&amp;HEIGHT=256</a>, x: 628, y: -762<br>

<a href="http://url?LAYERS=sat&amp;BBOX=-95.625,56.25,-90,61.875&amp;WIDTH=256&amp;HEIGHT=256" target="_blank">http://url?LAYERS=sat&amp;BBOX=-95.625,56.25,-90,61.875&amp;WIDTH=256&amp;HEIGHT=256</a>, x: 884, y: -762<br>
<a href="http://url?LAYERS=sat&amp;BOX=-129.375,50.625,-123.75,56.25&amp;WIDTH=256&amp;HEIGHT=256" target="_blank">http://url?LAYERS=sat&amp;BOX=-129.375,50.625,-123.75,56.25&amp;WIDTH=256&amp;HEIGHT=256</a>, x: -652, y: -506<br>

<a href="http://url?LAYERS=sat&amp;BBOX=-123.75,50.625,-118.125,56.25&amp;WIDTH=256&amp;HEIGHT=256" target="_blank">http://url?LAYERS=sat&amp;BBOX=-123.75,50.625,-118.125,56.25&amp;WIDTH=256&amp;HEIGHT=256</a>, x: -396, y: -506<br>
<a href="http://url?LAYERS=sat&amp;BBOX=-118.125,50.625,-112.5,56.25&amp;WIDTH=256&amp;HEIGHT=256" target="_blank">http://url?LAYERS=sat&amp;BBOX=-118.125,50.625,-112.5,56.25&amp;WIDTH=256&amp;HEIGHT=256</a>, x: -140, y: -506<br>

<a href="http://url?LAYERS=sat&amp;BBOX=-112.5,50.625,-106.875,56.25&amp;WIDTH=256&amp;HEIGHT=256" target="_blank">http://url?LAYERS=sat&amp;BBOX=-112.5,50.625,-106.875,56.25&amp;WIDTH=256&amp;HEIGHT=256</a>, x: 116, y: -506<br>
<a href="http://url?LAYERS=sat&amp;BBOX=-106.875,50.625,-101.25,56.25&amp;WIDTH=256&amp;HEIGHT=256" target="_blank">http://url?LAYERS=sat&amp;BBOX=-106.875,50.625,-101.25,56.25&amp;WIDTH=256&amp;HEIGHT=256</a>, x: 372, y: -506<br>

<a href="http://url?LAYERS=sat&amp;BBOX=-101.25,50.625,-95.625,56.25&amp;WIDTH=256&amp;HEIGHT=256" target="_blank">http://url?LAYERS=sat&amp;BBOX=-101.25,50.625,-95.625,56.25&amp;WIDTH=256&amp;HEIGHT=256</a>, x: 628, y: -506<br>
<a href="http://url?LAYERS=sat&amp;BBOX=-95.625,50.625,-90,56.25&amp;WIDTH=256&amp;HEIGHT=256" target="_blank">http://url?LAYERS=sat&amp;BBOX=-95.625,50.625,-90,56.25&amp;WIDTH=256&amp;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&amp;BBOX=-129.375,56.25,-123.75,61.875&amp;WIDTH=256&amp;HEIGHT=256" target="_blank">http://url?LAYERS=basic&amp;BBOX=-129.375,56.25,-123.75,61.875&amp;WIDTH=256&amp;HEIGHT=256</a>, x: -652, y: -762<br>

<a href="http://url?LAYERS=basic&amp;BBOX=-123.75,56.25,-118.125,61.875&amp;WIDTH=256&amp;HEIGHT=256" target="_blank">http://url?LAYERS=basic&amp;BBOX=-123.75,56.25,-118.125,61.875&amp;WIDTH=256&amp;HEIGHT=256</a>, x: -396, y: -762<br>
<a href="http://url?LAYERS=basic&amp;BBOX=-118.125,56.25,-112.5,61.875&amp;WIDTH=256&amp;HEIGHT=256" target="_blank">http://url?LAYERS=basic&amp;BBOX=-118.125,56.25,-112.5,61.875&amp;WIDTH=256&amp;HEIGHT=256</a>, x: -140, y: -762<br>

<a href="http://url?LAYERS=basic&amp;BBOX=-112.5,56.25,-106.875,61.875&amp;WIDTH=256&amp;HEIGHT=256" target="_blank">http://url?LAYERS=basic&amp;BBOX=-112.5,56.25,-106.875,61.875&amp;WIDTH=256&amp;HEIGHT=256</a>, x: 116, y: -762<br>
<a href="http://url?LAYERS=basic&amp;BBOX=-106.875,56.25,-101.25,61.875&amp;WIDTH=256&amp;HEIGHT=256" target="_blank">http://url?LAYERS=basic&amp;BBOX=-106.875,56.25,-101.25,61.875&amp;WIDTH=256&amp;HEIGHT=256</a>, x: 372, y: -762<br>

<a href="http://url?LAYERS=basic&amp;BBOX=-101.25,56.25,-95.625,61.875&amp;WIDTH=256&amp;HEIGHT=256" target="_blank">http://url?LAYERS=basic&amp;BBOX=-101.25,56.25,-95.625,61.875&amp;WIDTH=256&amp;HEIGHT=256</a>, x: 628, y: -762<br>
<a href="http://url?LAYERS=basic&amp;BBOX=-95.625,56.25,-90,61.875&amp;WIDTH=256&amp;HEIGHT=256" target="_blank">http://url?LAYERS=basic&amp;BBOX=-95.625,56.25,-90,61.875&amp;WIDTH=256&amp;HEIGHT=256</a>, x: 884, y: -762<br>

<a href="http://url?LAYERS=basic&amp;BBOX=-129.375,50.625,-123.75,56.25&amp;WIDTH=256&amp;HEIGHT=256" target="_blank">http://url?LAYERS=basic&amp;BBOX=-129.375,50.625,-123.75,56.25&amp;WIDTH=256&amp;HEIGHT=256</a>, x: -652, y: -506<br>
<a href="http://url?LAYERS=basic&amp;BBOX=-123.75,50.625,-118.125,56.25&amp;WIDTH=256&amp;HEIGHT=256" target="_blank">http://url?LAYERS=basic&amp;BBOX=-123.75,50.625,-118.125,56.25&amp;WIDTH=256&amp;HEIGHT=256</a>, x: -396, y: -506<br>

<a href="http://url?LAYERS=basic&amp;BBOX=-118.125,50.625,-112.5,56.25&amp;WIDTH=256&amp;HEIGHT=256" target="_blank">http://url?LAYERS=basic&amp;BBOX=-118.125,50.625,-112.5,56.25&amp;WIDTH=256&amp;HEIGHT=256</a>, x: -140, y: -506<br>
<a href="http://url?LAYERS=basic&amp;BBOX=-112.5,50.625,-106.875,56.25&amp;WIDTH=256&amp;HEIGHT=256" target="_blank">http://url?LAYERS=basic&amp;BBOX=-112.5,50.625,-106.875,56.25&amp;WIDTH=256&amp;HEIGHT=256</a>, x: 116, y: -506<br>

<a href="http://url?LAYERS=basic&amp;BBOX=-106.875,50.625,-101.25,56.25&amp;WIDTH=256&amp;HEIGHT=256" target="_blank">http://url?LAYERS=basic&amp;BBOX=-106.875,50.625,-101.25,56.25&amp;WIDTH=256&amp;HEIGHT=256</a>, x: 372, y: -506<br>
<a href="http://url?LAYERS=basic&amp;BBOX=-101.25,50.625,-95.625,56.25&amp;WIDTH=256&amp;HEIGHT=256" target="_blank">http://url?LAYERS=basic&amp;BBOX=-101.25,50.625,-95.625,56.25&amp;WIDTH=256&amp;HEIGHT=256</a>, x: 628, y: -506<br>

<a href="http://url?LAYERS=basic&amp;BBOX=-95.625,50.625,-90,56.25&amp;WIDTH=256&amp;HEIGHT=256" target="_blank">http://url?LAYERS=basic&amp;BBOX=-95.625,50.625,-90,56.25&amp;WIDTH=256&amp;HEIGHT=256</a>, x: 884, y: -506<br>
<br>I also noted that layer.getTilesBounds() gives different bounds for a layer before/after &quot;fixing&quot; 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&#39;t find anything along these lines.<br>

<br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@openlayers.org">Users@openlayers.org</a><br>
<a href="http://openlayers.org/mailman/listinfo/users" target="_blank">http://openlayers.org/mailman/listinfo/users</a><br>
<br></blockquote></div><br></div>