[OpenLayers-Users] Map Aspect Ratio Seems Off (Makes layers wide)

soatley shawn at niagarafalls.ca
Fri Jun 19 16:38:24 EDT 2009


I am having an issue with the aspect ratio of my map and my knowledge of
projections is not that good, but my GIS co-workers are telling me that is
probably the cause.  The attached image(
http://n2.nabble.com/file/n3122010/example.jpg example.jpg ) shows what the
map should look like (our existing mapping software) and how OL is
displaying it.

Here is how I instantiate my map object:

OpenLayers.Layer.cWMS = OpenLayers.Class(OpenLayers.Layer.WMS, {
    isClickable: false

});


 options = {
    projection: new OpenLayers.Projection("EPSG:4326"),
        maxExtent: new OpenLayers.Bounds(-79.287519, 42.920835, -78.956522,
43.156),
        tileSize: new OpenLayers.Size(256, 256),
        maxResolution: 2 / 256,
        numZoomLevels: 15,

        controls: [new OpenLayers.Control.LayerSwitcher(),
                            new OpenLayers.Control.MouseDefaults(),
                            new OpenLayers.Control.PanZoomBar(),
                            new OpenLayers.Control.OverviewMap(),
                            new OpenLayers.Control.KeyboardDefaults(),
                            new OpenLayers.Control.Navigation(),
                            new OpenLayers.Control.MousePosition({ div:
$j("#position").get(0) }),
                            new OpenLayers.Control.LoadingPanel(),
                            new OpenLayers.Control.ScaleBar()
                            ]
    };


    map = new OpenLayers.Map('map', options);

var BaseMap = new OpenLayers.Layer.cWMS("Base Map",
		["http://wmsServer/wms.png","http://wmsServer2/wms.png"],
		{ 
			 layers: "BaseW Drawing,Background Colour,RoadCL Drawing,Surrounding
Lands Labels",
			 format: "image/png",
			 transparent: false
		},
		{ 
			 visibility: true,
			 isClickable: false
		}
	);

	map.addLayers([BaseMap]);





You can see that I've extended the WMS layer just so that I can add the
'isClickable' property.  The map was skewed before I created that, so that
is not the issue.

The GIS staff tell me that our data is projected in UTM 17N NAD83.  

I hope I have provided enough information for someone to help me.

Thanks!
Shawn
-- 
View this message in context: http://n2.nabble.com/Map-Aspect-Ratio-Seems-Off-%28Makes-layers-wide%29-tp3122010p3122010.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.




More information about the Users mailing list