[OpenLayers-Dev] How to change displayProjection for MousePosition Control

"Bernd Grünefeld" bernd.gruenefeld at gmx.de
Fri Mar 28 06:22:06 EDT 2008


Thanks Christopher, that`s it.
I wasn`t aware that i need proj4js :-/

I must also  add the following snipped to my page to make things run:

Proj4js.defs["EPSG:31467"] = "+proj=tmerc +lat_0=0 +lon_0=9 +k=1.000000 +x_0=3500000 +y_0=0 +ellps=bessel +units=m +no_defs  no_defs";

Proj4js.defs["EPSG:4326"]  = "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs ";


greetings
Bernd

-------- Original-Nachricht --------
> Datum: Thu, 27 Mar 2008 17:51:31 -0400
> Von: Christopher Schmidt <crschmidt at metacarta.com>
> An: "Bernd Grünefeld" <bernd.gruenefeld at gmx.de>
> CC: dev at openlayers.org
> Betreff: Re: [OpenLayers-Dev] How to change displayProjection for MousePosition Control

> On Thu, Mar 27, 2008 at 03:42:51PM +0100, "Bernd Grünefeld" wrote:
> > Hi all,
> > I initialze my map with projection: "EPSG:31467".
> > 
> > In the MousePosition Control i want to display the coordinates in
> epsg:4326 in DD MM SS.
> > 
> > If I change the displayProjection of MousePosition to epsg:4326: 
> > 
> > mp=new OpenLayers.Control.MousePosition();
> > mp.displayProjection = new OpenLayers.Projection("EPSG:4326"); 		
> > map.addControl(mp);
> > 
> > the coordinates displayed are still in EPSG:31467.
> > Is this a bug or what i`m  doing wrong?
> 
> You probably don't have proj4js properly included in your page.
> 
> Regards,
> -- 
> Christopher Schmidt
> MetaCarta

-- 
Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten 
Browser-Versionen downloaden: http://www.gmx.net/de/go/browser



More information about the Dev mailing list