[OpenLayers-Dev] Strange behaviour in Layer.XYZ

Robert Sanson SansonR at asurequality.com
Wed Jun 2 17:32:42 EDT 2010


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.
 
Robert

>>> Alexei Peters <apeters at fargeo.com> 3/06/2010 6:31 a.m. >>>
I've used this patch submited by tschaub with good success:

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 )Cheers,
Alexei

On Tue, Jun 1, 2010 at 5:33 PM, Robert Sanson <SansonR at asurequality.com> wrote:


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. 
Here is my code snippet:
var mapoptions = {
//tileOrigin: new OpenLayers.LonLat(-4020900,19998100), //Origin as reported by ArcGIS
maxExtent: new OpenLayers.Bounds(-4020900, 4674128.11975, 2568710.79993, 19998100), //contains the AGS origin
restrictedExtent: new OpenLayers.Bounds(1018697.71047, 4674128.11975, 2568710.79993, 6296981.53325),
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),
tileSize: new OpenLayers.Size(256,256),
units: 'm',
projection: new OpenLayers.Projection('EPSG:2193'),
fractionalZoom: false
};
var map = new OpenLayers.Map( 'map',mapoptions );
var nzcoastwms = new OpenLayers.Layer.WMS( "Coastline",
"http://ws-esrimt/arcgis/services/mapservice_asurequality_prod/MapServer/WMSServer",
{layers: ['0'], format: "image/png"},
{isBaseLayer: true, singleTile:true, visibility: true,
attribution:"LINZ data Crown copyright reserved"} );
var topoxyz = new OpenLayers.Layer.XYZ( "Topo",
"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/$%7Bz%7D/$%7By%7D/$%7Bx )}",
{isBaseLayer: false, sphericalMercator: false//, tileOrigin: new OpenLayers.LonLat(-4020900,19998100)
});
map.addLayers([nzcoastwms,topoxyz]);

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.
Here are some numbers to show the problem based on relative locations of the same features on the map:
Layer zoom res pixel.x pixel.y x y relative px relative y (m) displacement
WMS 0 3175.00635 328 207 2022304.713 5641130.138 
XYZ 0 3175.00635 328 168 2022304.713 5764955.385 -39 123825.25 North
WMS 1 793.7515875 219 265 1764335.447 5478411.062 
XYZ 1 793.7515875 219 370 1764335.447 5395067.146 105 -83343.92 South
WMS 2 264.5838625 148 284 1765129.198 5478146.478 
XYZ 2 264.5838625 148 344 1765129.198 5462271.447 60 -15875.03 South
WMS 3 198.4378969 97 289 1762152.63 5479006.376 
XYZ 3 198.4378969 97 199 1762152.63 5496865.787 -90 17859.41 North
WMS 4 132.2919313 155 235 1762218.776 5479204.814 
XYZ 4 132.2919313 155 358 1762218.776 5462932.906 123 -16271.91 South
WMS 5 66.14596563 121 273 1757522.412 5473317.823 
XYZ 5 66.14596563 121 262 1757522.412 5473979.283 -11 661.46 North
WMS 6 26.45838625 103 307 1757509.183 5473317.823 
XYZ 6 26.45838625 103 408 1757509.183 5470645.526 101 -2672.30 South
Is this a bug?
Thanks,
Robert Sanson



This message has been scanned for malware by SurfControl plc. www.surfcontrol.com ( http://www.surfcontrol.com/ )

_______________________________________________
Dev mailing list
Dev at openlayers.org 
http://openlayers.org/mailman/listinfo/dev 






Click here ( https://www.mailcontrol.com/sr/S+7wVy5vMBDTndxI!oX7Unm7KfMvab2YZ2lg15i6iZcSosNgl5KmYDvLqYhnxVDlf1gBtNEgbXmDKU0CWBSjaQ== ) to report this email as spam.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-dev/attachments/20100603/8a8be2c3/attachment.html


More information about the Dev mailing list