[OpenLayers-Users] Changing map projections for WMS layers
Eric Lemoine
eric.c2c at gmail.com
Sun May 4 08:34:08 EDT 2008
On Fri, May 2, 2008 at 5:14 PM, Jon Blower <jdb at mail.nerc-essc.ac.uk> wrote:
> Hi all,
>
> I am developing a WMS-based visualization site using OpenLayers and
> I'd like to have the capability to change the projection of the map.
> The map is created using EPSG:4326 but I'd like to be able to change
> this dynamically to EPSG:32661 (north polar stereographic). (so that
> I can display layers from NSIDC, amongst others:
> http://nsidc.org/data/atlas/ogc_services.html).
>
> I've tried changing the projection like this:
>
> map.setOptions({
> projection: "EPSG:32661",
> maxExtent: new OpenLayers.Bounds(-10700000, -10700000, 14700000, 14700000)
> });
>
> but nothing seems to happen. The map doesn't change at all, even if I
> zoom or pan. Images are still requested using EPSG:4326 and the
> extent remains unchanged. (The base layer WMS can accept either
> EPSG:4326 or EPSG:32661.)
>
> All the layers on my map are WMS layers.
>
> Do I need to change the projection of all the layers I'm viewing
> individually?
yes, I think so.
> If so, what is the purpose of the projection of the map
> object?
If a layer is created without a projection specified, its projection
is taken from what's specified in the map object.
--
Eric
More information about the Users
mailing list