You might also keep in mind, that they are using <a href="http://arcgis.com">arcgis.com</a> now. Perhaps some more info is there?<br><br><div class="gmail_quote">On Mon, Jul 19, 2010 at 9:17 PM, Vadim Bokin <span dir="ltr"><<a href="mailto:vbokin@gmail.com">vbokin@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Robert,<br>
<br>
I've made good progress with your suggestion. I created a new class<br>
and just extended XYZ.js with the 2 methods you provided. But I still<br>
have a problem.<br>
<br>
Old Code: locations where close, but kept jumping around north or<br>
south of the right location<br>
<br>
New code: locations are almost exactly 41.0 miles North of where they<br>
should be. But they are off by a fixed amount. So when I zoom in and<br>
out they are staying put where they are, but they are still off. So<br>
if I try to put a point on the beach in Santa Monica, on the map it<br>
looks to be between Santa Clarita and Palmdale. As soon as I change<br>
base maps to Google or a epsg:4326 map, all is well and points are in<br>
perfect location.<br>
<br>
So it's 1 step forward (locations don't jump) and 1 step back<br>
(locations are pretty far north).<br>
<br>
I read tileOrigin from the AGS layer spec, e.g.<br>
<a href="http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" target="_blank">http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer</a>.<br>
And I've made sure it is correct by testing in firebug and just<br>
dumping out map.baseLayer.tileOrigin.<br>
<br>
Did you do anything else to modify XYZ to make this work? Does 41.0<br>
miles mean anything? to me it doesn't look like 1 degree, or anything<br>
else. But it's a fixed distance difference between plotted and viewed<br>
points. Some kind of error in calculation or my setup of the layer?<br>
<br>
Thank you!<br>
<br>
-Vadim<br>
<br>
<br>
On Mon, Jul 19, 2010 at 6:24 PM, Robert Sanson<br>
<<a href="mailto:Robert.Sanson@asurequality.com">Robert.Sanson@asurequality.com</a>> wrote:<br>
> Hi Vadim<br>
><br>
> What layer type are you using? ArcGIS tilecaches have a tile origin in the<br>
> top left. The standard layer.XYZ in OpenLayers is built to support a lower<br>
> left tile origin. You need a patched XYZ.js with setMap and<br>
> calculateGridLayout copied from Zoomify.js:<br>
><br>
> * APIMethod: setMap<br>
> * When the layer is added to a map, then we can fetch our origin<br>
> * (if we don't have one.)<br>
> *<br>
> * Parameters:<br>
> * map - {<OpenLayers.Map>}<br>
> */<br>
> setMap: function(map) {<br>
> OpenLayers.Layer.Grid.prototype.setMap.apply(this, arguments);<br>
> if (!this.tileOrigin) {<br>
> this.tileOrigin = new OpenLayers.LonLat(this.maxExtent.left,<br>
> //this.maxExtent.bottom);<br>
> this.map.maxExtent.top);<br>
> //patched to be similar to Zoomify<br>
> }<br>
> },<br>
><br>
> /**<br>
> * Method: calculateGridLayout //patched from Zoomify<br>
> * Generate parameters for the grid layout. This<br>
> *<br>
> * Parameters:<br>
> * bounds - {<OpenLayers.Bound>}<br>
> * extent - {<OpenLayers.Bounds>}<br>
> * resolution - {Number}<br>
> *<br>
> * Returns:<br>
> * Object containing properties tilelon, tilelat, tileoffsetlat,<br>
> * tileoffsetlat, tileoffsetx, tileoffsety<br>
> */<br>
> calculateGridLayout: function(bounds, extent, resolution) {<br>
> var tilelon = resolution * this.tileSize.w;<br>
> var tilelat = resolution * this.tileSize.h;<br>
><br>
> var offsetlon = bounds.left - extent.left;<br>
> var tilecol = Math.floor(offsetlon/tilelon) - this.buffer;<br>
> var tilecolremain = offsetlon/tilelon - tilecol;<br>
> var tileoffsetx = -tilecolremain * this.tileSize.w;<br>
> var tileoffsetlon = extent.left + tilecol * tilelon;<br>
><br>
> var offsetlat = extent.top - bounds.top + tilelat;<br>
> var tilerow = Math.floor(offsetlat/tilelat) - this.buffer;<br>
> var tilerowremain = tilerow - offsetlat/tilelat;<br>
> var tileoffsety = tilerowremain * this.tileSize.h;<br>
> var tileoffsetlat = extent.top - tilelat*tilerow;<br>
><br>
> return {<br>
> tilelon: tilelon, tilelat: tilelat,<br>
> tileoffsetlon: tileoffsetlon, tileoffsetlat: tileoffsetlat,<br>
> tileoffsetx: tileoffsetx, tileoffsety: tileoffsety<br>
> };<br>
> },<br>
><br>
> Using the above works perfectly.<br>
><br>
> regards,<br>
><br>
> Robert Sanson<br>
><br>
>>>> Vadim Bokin <<a href="mailto:vbokin@gmail.com">vbokin@gmail.com</a>> 20/07/2010 11:53 a.m. >>><br>
<div><div></div><div class="h5">><br>
> Hi,<br>
><br>
> Does anyone have the _exact_ proj4js definition for ESRI projections<br>
> EPSG:102100 and the older EPSG:102113?<br>
><br>
> My maps have a y-coordinate shift (both north and south at different zooms)<br>
> off by many map pixels. Always close, but no cigar. X-coordinate is always<br>
> dead on.<br>
><br>
> I can add in ArcGIS online content as dynamic layer without any problems.<br>
> But when adding cached tiles, there's always this shift. Has anyone seen<br>
> this before and/or been able to resolve it? I need to be able to use the<br>
> cached tiles.<br>
><br>
> I've used the one from <a href="http://spatialreference.org" target="_blank">spatialreference.org</a>, as well as set it directly to<br>
> be equal to Google's EPSG:900913 but there's always a shift. I've tried<br>
> many different variations with +a and +rf and others but I feel like the<br>
> definition is missing a +towgs84=... adjustment to properly correct for the<br>
> shift on the map but I have no way of knowing what those parameters should<br>
> be and whether it should be the 3-parameter adjustment or the 7-parameter<br>
> one.<br>
><br>
> Here's my current definition:<br>
><br>
> Proj4js.defs["EPSG:102100"] = "+proj=merc +lon_0=0 +x_0=0 +y_0=0 +a=6378137<br>
> +b=6378137 +units=m +nadgrids=@null";<br>
><br>
> +towgs84=0,0,0,0,0,0,0 doesn't help, but I feel like the right values in<br>
> there will fix the problem.<br>
><br>
> Thank you,<br>
><br>
> -Vadim<br>
><br>
><br>
> --<br>
> View this message in context:<br>
> <a href="http://osgeo-org.1803224.n2.nabble.com/ArcGIS-Online-Cached-tiles-datum-shift-tp5314596p5314596.html" target="_blank">http://osgeo-org.1803224.n2.nabble.com/ArcGIS-Online-Cached-tiles-datum-shift-tp5314596p5314596.html</a><br>
> Sent from the OpenLayers Users mailing list archive at Nabble.com.<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>
><br>
><br>
</div></div>> This message has been scanned for malware by SurfControl plc.<br>
> <a href="http://www.surfcontrol.com" target="_blank">www.surfcontrol.com</a><br>
<div><div></div><div class="h5">_______________________________________________<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>
</div></div></blockquote></div><br>