<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 style="MARGIN: 4px 4px 1px">
<DIV>Thanks Chris. So instead of making use of tileOrigin, we make sure the Origin as reported by ArcGIS is contained within the maxExtent, and then use restrictedExtent to constrain the map area to the are we want OL to work within:</DIV>
<DIV>&nbsp;</DIV>
<DIV>var mapoptions = {</DIV>
<DIV>&nbsp;&nbsp;//tileOrigin: new OpenLayers.LonLat(-4020900,19998100), //Origin as reported by ArcGIS<BR>&nbsp;&nbsp;&nbsp;&nbsp;maxExtent: new OpenLayers.Bounds(-4020900, 4674128.11975, 2568710.79993, 19998100),<BR>&nbsp;&nbsp;&nbsp;&nbsp;restrictedExtent: new OpenLayers.Bounds(1018697.71047, 4674128.11975, 2568710.79993, 6296981.53325),<BR>&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;&nbsp;&nbsp;&nbsp;tileSize: new OpenLayers.Size(256,256),<BR>&nbsp;&nbsp;&nbsp;&nbsp;units: 'm',<BR>&nbsp;&nbsp;&nbsp;&nbsp;projection: new OpenLayers.Projection('EPSG:2193'),<BR>&nbsp;&nbsp;&nbsp;&nbsp;fractionalZoom: false<BR>};<BR>var map = new OpenLayers.Map( 'map',mapoptions );</DIV>
<DIV>var topoxyz = new OpenLayers.Layer.XYZ( "Topo",<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "<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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {isBaseLayer: false, sphericalMercator: false//, tileOrigin: new OpenLayers.LonLat(-4020900,19998100)<BR>});</DIV>
<DIV><BR>Doing this above, requests the correct tiles, but it seems the requested tiles are displaced in a north-south direction. I have created a test web site that has two "identical" layers from the same ArcGIS Server - one is called using Layer.WMS, the other Layer.XYZ. The latter is sometimes displaced to the north, and sometimes to the south, depending on Zoom level. I have previously verified the WMS layer is in the correct location. </DIV>
<DIV>&nbsp;</DIV>
<DIV>Many thanks,</DIV>
<DIV>&nbsp;</DIV>
<DIV>Robert Sanson</DIV>
<DIV>&nbsp;</DIV>
<DIV><BR>&gt;&gt;&gt; &lt;christopher.schmidt@nokia.com&gt; 18/05/2010 1:26 a.m. &gt;&gt;&gt;<BR><BR>On May 16, 2010, at 5:01 PM, ext Robert Sanson wrote:<BR><BR>&gt; On a related matter, I have discovered that ArcGIS Server default tile cache origin is top left, not bottom left as it is for other cache schemas. Is there any way to tell OpenLayers.Layer.XYZ to work out tiles to request when tile origin is top left? Setting tileOrigin on the map object and the layer property seems to make no difference.<BR><BR>This should already be the case?<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var y = Math.round((this.maxExtent.top - bounds.top)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; / (res * this.tileSize.h));<BR><BR>-- Chris<BR></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>