Re: [OpenLayers-Users] Map Aspect Ratio Seems Off (Makes layers wide)
Andreas, Thank you for that information! You've solved my problem and even fixed one of my todo items of getting the MousePosition into UTM! Thanks Shawn Andreas Hocevar-2 wrote: > > Hi, > > On Fri, Jun 19, 2009 at 10:38 PM, soatley wrote: > > Your co-workers are right. Maps in geographic coordinates (EPSG:4326) > look like that. The further you get away from the equator, the more > the map will be shrunk in latitudinal direction. This is not a bug, > but a matter of choosing the appropriate map projection. > >> The GIS staff tell me that our data is projected in UTM 17N NAD83. > > The EPSG code for this projection is probably EPSG:26917. See > http://spatialreference.org/ref/epsg/26917/ > > So the two things to change in your code is that you set the > projection to EPSG:26917 instead of EPSG:4326, set units to "m" > (meters), and provide the maxExtent in projected coordinates. > > Regards, > Andreas. > > > > -- View this message in context: http://n2.nabble.com/Map-Aspect-Ratio-Seems-Off-%28Makes-layers-wide%29-tp3122010p3138291.html Sent from the OpenLayers Users mailing list archive at Nabble.com. ___ Users mailing list Users@openlayers.org http://openlayers.org/mailman/listinfo/users
Re: [OpenLayers-Users] Map Aspect Ratio Seems Off (Makes layers wide)
Hi, On Fri, Jun 19, 2009 at 10:38 PM, soatley wrote: > > 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. Your co-workers are right. Maps in geographic coordinates (EPSG:4326) look like that. The further you get away from the equator, the more the map will be shrunk in latitudinal direction. This is not a bug, but a matter of choosing the appropriate map projection. > The GIS staff tell me that our data is projected in UTM 17N NAD83. The EPSG code for this projection is probably EPSG:26917. See http://spatialreference.org/ref/epsg/26917/ So the two things to change in your code is that you set the projection to EPSG:26917 instead of EPSG:4326, set units to "m" (meters), and provide the maxExtent in projected coordinates. Regards, Andreas. > 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. > > ___ > Users mailing list > Users@openlayers.org > http://openlayers.org/mailman/listinfo/users > -- Andreas Hocevar OpenGeo - http://opengeo.org/ Expert service straight from the developers. ___ Users mailing list Users@openlayers.org http://openlayers.org/mailman/listinfo/users
[OpenLayers-Users] Map Aspect Ratio Seems Off (Makes layers wide)
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. ___ Users mailing list Users@openlayers.org http://openlayers.org/mailman/listinfo/users