<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>
<DIV>Thanks Alexei. I presume this was for earlier ArcGIS caches? At v9.3.1, the zoom, row and column numbers don't have L/R/C prefixes, are all in base 10, and are not zero-padded. I modified the code to make these changes, and tried it out. I get the tiles, but as before (with Layer.XYZ) they are still offset in the north-south direction, which changes with zoom level.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Robert<BR><BR>&gt;&gt;&gt; Alexei Peters &lt;apeters@fargeo.com&gt; 3/06/2010 6:31 a.m. &gt;&gt;&gt;<BR>I've used this patch submited by <DEFANGHTML_SPAN class=Apple-style-span style="FONT-WEIGHT: bold; FONT-SIZE: 12px; FONT-FAMILY: verdana, arial, 'Bitstream Vera Sans', helvetica, sans-serif; WHITE-SPACE: nowrap; BORDER-COLLAPSE: collapse">tschaub </DEFANGHTML_SPAN>with good success:</DIV>
<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 <DEFANGHTML_SPAN dir=ltr>&lt;<A href="mailto:SansonR@asurequality.com">SansonR@asurequality.com</A>&gt;</DEFANGHTML_SPAN> wrote:<BR>
<BLOCKQUOTE class=gmail_quote defanghtml_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/${z}/${y}/${x" 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><BR><BR><FONT style="BACKGROUND-COLOR: #ffffff">
<P align=center><FONT style="BACKGROUND-COLOR: #ffffff">Click <A href="https://www.mailcontrol.com/sr/S+7wVy5vMBDTndxI!oX7Unm7KfMvab2YZ2lg15i6iZcSosNgl5KmYDvLqYhnxVDlf1gBtNEgbXmDKU0CWBSjaQ==">here</A> to report this email as spam.</FONT></P></FONT></BODY></HTML>