[OpenLayers-Users] multiple epsg coordinates display

Alessio Di Lorenzo alessio.dilorenzo at gmail.com
Wed Apr 23 08:08:11 EDT 2008


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");

	map.addControl(mp);


but the displayed coordinates are always 32633...
may you help me to understand the problem?


thx, alessio



More information about the Users mailing list