[OpenLayers-Users] multiple epsg coordinates display

Christopher Schmidt crschmidt at metacarta.com
Wed Apr 23 08:18:38 EDT 2008


On Wed, Apr 23, 2008 at 02:08:11PM +0200, Alessio Di Lorenzo wrote:
> Hi,
> as explained I need to show the MousePosition coordinates values in epsg 
> 4326 even if my map is in epsg 32633.
> Well, this topic seems aswer my needs.
> http://www.nabble.com/How-to-change-displayProjection-for-MousePosition-Control-td16331163.html#a16340730
> 
> So, I tried to do the following:
> 
> 1) First, I downloaded proj4js from svn and I added it in my page's header
> 
> <script src="OpenLayers-2.6/OpenLayers.js" type="text/javascript"></script>
> <script scr="proj4js/lib/proj4js.js" type="text/javascript"></script>
> <script scr="proj4js/lib/defs/EPSG32633.js" type="text/javascript"></script>
> <script scr="proj4js/lib/defs/EPSG4326.js" type="text/javascript"></script>
> 
> the EPSG32633.js and EPSG4326.js files (not included in the downloaded 
> package) contains, respectively, these strings:
> 
> Proj4js.defs["EPSG:32633"] = "+proj=utm +zone=33 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ";
> 
> Proj4js.defs["EPSG:4326"] = "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs ";
> 
> 
> 2) Then I added this code to my page
> 
> mp = new OpenLayers.Control.MousePosition();
> 
> 	mp.displayProjection = new OpenLayers.Projection("EPSG:4326");

I'm assuming this is a typo?

> 	map.addControl(mp);
> 
> 
> but the displayed coordinates are always 32633...
> may you help me to understand the problem?

With a full HTML example, probably someone could.

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list