[OpenLayers-Users] base maps and projections

Jon Blower jdb at mail.nerc-essc.ac.uk
Wed Nov 15 08:56:02 EST 2006


Dear all,

I've a feeling this question may have been asked on this list before
but the archives are only showing Oct and Nov of this year, so I
haven't been able to find out.

I would like to use different base maps in my openlayers app.  On top
of these base maps I will be overlaying data from various WMSs.
Different base layers will have different map projections.  When the
user changes the base map, and hence changes the map projection, I
want to reload all the WMS tiles in the new projection.  A concrete
use case of this is switching between the OpenLayers WMS (in
EPSG:4326, i.e. standard lat-lon Plate Carree) to a Google Maps layer
(in Mercator projection).

I can register an event to fire when the base layer changes:

  map.events.register("changebaselayer", map, function() {
alert(this.projection) });

My question is, how do I find out what projection the new base layer
is in?  I tried using the map.projection property as above, but this
always seems to return "EPSG:4326", even if the base layer is a Google
Map.

Thanks in advance for any help,
Jon


-- 
--------------------------------------------------------------
Dr Jon Blower              Tel: +44 118 378 5213 (direct line)
Technical Director         Tel: +44 118 378 8741 (ESSC)
Reading e-Science Centre   Fax: +44 118 378 6413
ESSC                       Email: jdb at mail.nerc-essc.ac.uk
University of Reading
3 Earley Gate
Reading RG6 6AL, UK
--------------------------------------------------------------



More information about the Users mailing list