[OpenLayers-Users] Layer.XYZ tiles from ArcGIS Server not
lining up with other layers
Zac Spitzer
zac.spitzer at ennoble.com.au
Mon May 31 02:29:21 EDT 2010
have you included proj4js? otherwise I'm pretty sure setting the
projection doesn't do anything
On 31 May 2010 09:34, Robert Sanson <SansonR at asurequality.com> wrote:
> This is a resend, as I have not had any responses. Tiles I request from an
> ArcGIS Server cache using Layer.XYZ are not lining up with other layers
> requested from the same server via Layer.WMS or Layer.ArcGIS93Rest.
>
> Instead of making use of tileOrigin (which doesn't seem to get used), 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:
>
> 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}",
> {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. The displacement seems
> different depending on zoom level. 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.
>
> Many thanks,
>
> Robert Sanson
>
> This message has been scanned for malware by SurfControl plc.
> www.surfcontrol.com
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>
>
--
Zac Spitzer
Solution Architect / Director
Ennoble Consultancy Australia
http://www.ennoble.com.au
http://zacster.blogspot.com
+61 405 847 168
More information about the Users
mailing list