[OpenLayers-Dev] ArcGIS server 9.2 support for OL

Michael Östling michael.ostling at metagis.se
Mon Sep 17 06:11:40 EDT 2007


Hi,
I have problems using the AGS mapcache component.
I'm getting problems fitting the map correctly.

I have tried to calculate the mapextent but does not get correct results
anyway. (se below)
I have struggled with this in a couple of weeks now and would be very happy
if someone  just could veryfy my way of calculating the extent.
Over the map I'm getting errors from 10-20 meter up to several 1000 meters.
Also when I zoomin by doubleclicking the map is not centered where I
clicked.

Regards
Michael
**********************************************

Have I understood it correctly when I'm doing the following.

I have a mapcache that have a origin (Upper Left)  at 1 200 000, 7 700 000

In my most detalied level of the cache  I have 384 rows and 170 columns.
Pixelsize is 512x512. Resolution in this level is 8.46668360003387
(meter)

My total extentsize is therefore
East-West      512 * 170 * 8.46668360003387 = 736940,1405469480000
North-South   512 * 384 * 8.46668360003387  = 1664617,7292354600000

My extentborder in west is therefore 1 200 000 + 736940,1405469480000  =
1936940.1405469500000
My extentborder in south is 7 700 000 - 1664617,7292354600000 =
6035382,0088900200000

In my code I have written:
       var lon = 1600000;
        var lat = 6700000;
        var zoom = 6;
        var map, layer,layer2;

        function init(){
            map = new OpenLayers.Map( 'map', {
	maxExtent: new
OpenLayers.Bounds(1200000,6035382.00889002,1936940.14054695,7700000),
		maxResolution: 2116.67090000847,resolutions: new
Array(2116.67090000847, 1058.33545000423, 529.167725002117,
264.583862501058, 132.291931250529, 66.1459656252646,
33.0729828126323, 16.9333672000677, 8.46668360003387), 
		tileSize : new OpenLayers.Size(512,512),
		tileOrigin: new OpenLayers.LonLat(1200000,7700000),units:
'm'} );
            layer = new OpenLayers.Layer.AGS( "AGS",
                    "http://metaport3/OL_AGS/Layers", {layername:
'_alllayers', type:'png',
                    tileOrigin: new OpenLayers.LonLat(1200000,7700000)
                    } );

            map.addLayer(layer);

            map.addControl(new OpenLayers.Control.LayerSwitcher());
            map.addControl(new OpenLayers.Control.MousePosition());
            map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
        }
        function addAGS() {
            l = new OpenLayers.Layer.AGS(
                OpenLayers.Util.getElement('layer').value,
                OpenLayers.Util.getElement('url').value,
                {
                    'layername': OpenLayers.Util.getElement('layer').value,
                    'type': OpenLayers.Util.getElement('type').value
            });
            map.addLayer(l);
            map.setBaseLayer(l);
        }


mvh
Michael

------------------------------------------------------------------
MetaGIS AB 
Michael Östling
Mob: 070-279 19 76
Tel: 023 - 702 20 10
ePost: michael.ostling at metagis.se
Adress: Britsarvsvägen 28a, 791 36 FALUN
Org Nr: 556638-7170
------------------------------------------------------------------


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-dev/attachments/20070917/7355cf22/attachment.html


More information about the Dev mailing list