<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-15">
<META content="MSHTML 6.00.2900.3243" name=GENERATOR></HEAD>
<BODY defanghtml_style="MARGIN: 4px 4px 1px">
<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">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/${z}/${y}/${x">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/"><FONT style="BACKGROUND-COLOR: #ffffff" color=#000000>www.surfcontrol.com</FONT></A></P>
</body></HTML>