I've used this patch submited by <span class="Apple-style-span" style="font-family: verdana, arial, 'Bitstream Vera Sans', helvetica, sans-serif; font-size: 12px; border-collapse: collapse; font-weight: bold; white-space: nowrap; ">tschaub </span>with good success:<div>
<br></div><div><a href="http://trac.openlayers.org/browser/sandbox/tschaub/arcgiscache/lib/OpenLayers/Layer/ArcGISCache.js?rev=9918">http://trac.openlayers.org/browser/sandbox/tschaub/arcgiscache/lib/OpenLayers/Layer/ArcGISCache.js?rev=9918</a></div>
<div><br></div><div><a href="http://trac.openlayers.org/browser/sandbox/tschaub/arcgiscache/lib/OpenLayers/Layer/ArcGISCache.js?rev=9918"></a>Cheers,</div><div>Alexei<br><br><div class="gmail_quote">On Tue, Jun 1, 2010 at 5:33 PM, Robert Sanson <span dir="ltr"><<a href="mailto:SansonR@asurequality.com">SansonR@asurequality.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div>
<div>Tiles I request from an ArcGIS Server tile cache using Layer.XYZ are not lining up with other layers requested from the same server via Layer.WMS or Layer.ArcGIS93Rest. </div>
<div> </div>
<div>Here is my code snippet:</div>
<div> </div>
<div>var mapoptions = {</div>
<div> //tileOrigin: new OpenLayers.LonLat(-4020900,19998100), //Origin as reported by ArcGIS<br> maxExtent: new OpenLayers.Bounds(-4020900, 4674128.11975, 2568710.79993, 19998100), //contains the AGS origin<br> restrictedExtent: new OpenLayers.Bounds(1018697.71047, 4674128.11975, 2568710.79993, 6296981.53325),<br>
resolutions: new Array(3175.0063500127, 793.751587503175, 264.583862501058, 198.437896875794, 132.291931250529, 66.1459656252646, 26.4583862501058, 19.8437896875794, 13.2291931250529, 9.26043518753704, 6.61459656252646, 5.29167725002117, 3.96875793751588, 2.64583862501058, 1.98437896875794, 1.32291931250529),<br>
tileSize: new OpenLayers.Size(256,256),<br> units: 'm',<br> projection: new OpenLayers.Projection('EPSG:2193'),<br> fractionalZoom: false<br>};<br>var map = new OpenLayers.Map( 'map',mapoptions );</div>
<div>var nzcoastwms = new OpenLayers.Layer.WMS( "Coastline",<br> "<a href="http://ws-esrimt/arcgis/services/mapservice_asurequality_prod/MapServer/WMSServer" target="_blank">http://ws-esrimt/arcgis/services/mapservice_asurequality_prod/MapServer/WMSServer</a>",<br>
{layers: ['0'], format: "image/png"},<br> {isBaseLayer: true, singleTile:true, visibility: true,<br> attribution:"LINZ data Crown copyright reserved"} );</div>
<div>var topoxyz = new OpenLayers.Layer.XYZ( "Topo",<br> "<a href="http://ws-esrimt/ArcGIS/rest/services/mapservice_topography_vector_prod/MapServer/tile/$%7Bz%7D/$%7By%7D/$%7Bx" target="_blank">http://ws-esrimt/ArcGIS/rest/services/mapservice_topography_vector_prod/MapServer/tile/${z}/${y}/${x</a>}",<br>
{isBaseLayer: false, sphericalMercator: false//, tileOrigin: new OpenLayers.LonLat(-4020900,19998100)<br>});</div>
<div>map.addLayers([nzcoastwms,topoxyz]);</div>
<div><br>Doing this above, requests the correct tiles, but it seems the requested tiles are displaced in a north-south direction, depending on Zoom level. I have previously verified the WMS layer is in the correct location. All the data and the map are in NZ Transverse Mercator (EPSG:2193), so there is no projection.</div>
<div> </div>
<div>Here are some numbers to show the problem based on relative locations of the same features on the map:</div>
<div>Layer zoom res pixel.x pixel.y x y relative px relative y (m) displacement<br>WMS 0 3175.00635 328 207 2022304.713 5641130.138 <br>XYZ 0 3175.00635 328 168 2022304.713 5764955.385 -39 123825.25 North</div>
<div> </div>
<div>WMS 1 793.7515875 219 265 1764335.447 5478411.062 <br>XYZ 1 793.7515875 219 370 1764335.447 5395067.146 105 -83343.92 South</div>
<div> </div>
<div>WMS 2 264.5838625 148 284 1765129.198 5478146.478 <br>XYZ 2 264.5838625 148 344 1765129.198 5462271.447 60 -15875.03 South</div>
<div> </div>
<div>WMS 3 198.4378969 97 289 1762152.63 5479006.376 <br>XYZ 3 198.4378969 97 199 1762152.63 5496865.787 -90 17859.41 North</div>
<div> </div>
<div>WMS 4 132.2919313 155 235 1762218.776 5479204.814 <br>XYZ 4 132.2919313 155 358 1762218.776 5462932.906 123 -16271.91 South</div>
<div> </div>
<div>WMS 5 66.14596563 121 273 1757522.412 5473317.823 <br>XYZ 5 66.14596563 121 262 1757522.412 5473979.283 -11 661.46 North</div>
<div> </div>
<div>WMS 6 26.45838625 103 307 1757509.183 5473317.823 <br>XYZ 6 26.45838625 103 408 1757509.183 5470645.526 101 -2672.30 South</div>
<div> </div>
<div>Is this a bug?</div>
<div> </div>
<div>Thanks,</div>
<div> </div>
<div>Robert Sanson</div><br><br>
<p align="center"><font style="background-color:#ffffff">This message has been scanned for malware by SurfControl plc. </font><a href="http://www.surfcontrol.com/" target="_blank"><font style="background-color:#ffffff" color="#000000">www.surfcontrol.com</font></a></p>
</div>
<br>_______________________________________________<br>
Dev mailing list<br>
<a href="mailto:Dev@openlayers.org">Dev@openlayers.org</a><br>
<a href="http://openlayers.org/mailman/listinfo/dev" target="_blank">http://openlayers.org/mailman/listinfo/dev</a><br>
<br></blockquote></div><br></div>