[OpenLayers-Users] map coordinates in different coordinate system

Andreas Hocevar ahocevar at opengeo.org
Mon Jun 29 15:09:13 EDT 2009


Hi,

although you may get a better reply to this question on the proj4js
mailing list [1], one thing that is obvious is that in your def string
for 2054 the following is missing:

+units=m

Your def string for 2054 still looks a bit short, so there may be more
things missing.

Regards,
Andreas.

On Mon, Jun 29, 2009 at 8:27 PM, stretch<andrew.deklerk at gmail.com> wrote:
>
> Hi all
>
> I am trying to display my map coordinates in a different coordinate system
> to what the map is in. I have followed the instructions with using proj4js
> and have the following setup:
>
> -------------------------------
> var options = { scales: [50000, 35000, 25000, 20000,
> 15000,10000,7500,5000,2500,1000,500],
>                            maxExtent: new
> OpenLayers.Bounds(-80999,-3309314,-74182,-3305038),
>                            'projection':'EPSG:2054',
>                            units:'m' };
>
>    map = new OpenLayers.Map( $('map'),options);
>
> var mp=new OpenLayers.Control.MousePosition({div:$('coordsdd')});
>    mp.displayProjection = new OpenLayers.Projection("EPSG:4148");
>    map.addControl(mp);
>
> --------------------------------
> I am referencing the proj4js combined and compressed js file, and I am
> referencing the two additional EPSG2054.js and EPSG4148.js, which contain:
>
> Proj4js.defs["EPSG:2054"] = "+proj=tmerc +lon_0=31 +datum=WGS84";
> and
> Proj4js.defs["EPSG:4148"]  = "+proj=longlat +ellps=WGS84
> +towgs84=0,0,0,0,0,0,0 +no_defs ";
>
> The coordinates are changed, but not correctly - i.e they are converted from
> metres to metres, where they should be displaying dd.
> The first thing you will notice is that 2054 is not a standard. Does this
> definition need to be included somewhere in the proj4js file.
>
> Thanks in advance
> Andrew
>
>
> --
> View this message in context: http://n2.nabble.com/map-coordinates-in-different-coordinate-system-tp3176189p3176189.html
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>



-- 
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.



More information about the Users mailing list