[OpenLayers-Users] Problem Setting maxExtent for Polar Projection (EPSG:3995)
ScottCh
scottchilcote at yahoo.com
Tue Nov 19 09:16:08 PST 2013
Hello OpenLayers Users,
I appear to be setting the maxExtent values for my EPSG:3995 projection
incorrectly.
According to http://spatialreference.org/ref/epsg/3995/
<http://spatialreference.org/ref/epsg/3995/> , the bounds for this
projection in degrees are "everything north of 60 degrees north latitude" or
bounds -180, 60 and 180, 90.
I used the Earth Point online calculator (
http://www.earthpoint.us/convert.aspx
<http://www.earthpoint.us/convert.aspx> ) to convert this to UTM. This
gave me 332705mE 6655205mN and 2000000mE 2000000mN.
Does this mean that I need to use 332705, 6655205, 2000000, 2000000 as the
bounds in meters?
This seems incorrect to me, in part because of this OpenLayers
implementation example:
http://dev.openlayers.org/releases/OpenLayers-2.13.1/examples/polar-projections.html
<http://dev.openlayers.org/releases/OpenLayers-2.13.1/examples/polar-projections.html>
The bounds used for each polar projection it provides are -5505054,
-5505054, 5505054, 5505054.
I looked up EPSG:3576 (which it uses), and it uses "everything above 45
degrees" for its bounds. This suggests that my guess (to use UTM
conversion) is wrong.
I decided to try using the same maxExtent values as the polar projection
demo.
This gave me:
map0 = new OpenLayers.Map(
"Map", {
controls:[
new OpenLayers.Control.PanZoomBarMod({zoomWorldIcon:true,
forceFixedZoomLevel:true}),
new OpenLayers.Control.ArgParser(),
new OpenLayers.Control.Navigation(),
new OpenLayers.Control.Attribution()
],
projection: new OpenLayers.Projection('EPSG:3995'),
units: 'm',
//maxExtent:new OpenLayers.Bounds(-180,60,180,90),
maxExtent:new OpenLayers.Bounds(-5505054, -5505054, 5505054,
5505054),
numZoomLevels: 7
}
);
I show the bounds in degrees commented out as a form of documentation. The
problem with this code is that it does not work properly. When I display my
map in Firefox, it takes several seconds before showing a blank rectangle
for the map. Then I get an "unresponsive script" alert box. The map never
draws.
I have experimented with other values for the maxExtent, and the results
vary a lot. If I use the degree values on the commented out line, I get a
map that looks like this:
<http://osgeo-org.1560.x6.nabble.com/file/n5089954/olprojection.jpg>
This map rendering has several problems. You can see from the edges of the
graticule that the extents are not set correctly. The graticule is supposed
to be radial with the center at the north pole instead of rectangular.
At this point I have tried several different sets of values - admittedly
guesses - as the maxExtent bounds, and the results are always similar to
these two situations. Either it times out and does not draw, or it draws
something similar to the standard EPSG:4326 projection over my base layer
map. I have looked through a lot of documentation, but haven't found enough
clues yet. Can someone point me in the right direction where to find out
how to correctly set the maxExtent bounds for my projection?
Thanks for your help,
Scott C.
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Problem-Setting-maxExtent-for-Polar-Projection-EPSG-3995-tp5089954.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
More information about the Users
mailing list