[OpenLayers-Users] MousePosition displayProjection problem ortho- >epsg:4326

Heiko Schröter schroete at iup.physik.uni-bremen.de
Wed Apr 21 10:02:50 EDT 2010


Am Mittwoch 21 April 2010 15:39:36 schrieben Sie:

Mike, 

thanks a lot for the info. This ortho proj seems to be the problem.
Will try again when Proj4js has it fixed.

Thanks JamSquad for your hint. It gave me the direction where to look further.

Regards
Heiko

> Heiko,
> 
> The problem might be that the implementation of the ortho code in 
> Proj4js hasn't been validated yet (see the bottom of this page 
> http://trac.osgeo.org/proj4js/wiki/UserGuide).  However there is a bug 
> report with a proposed fix in the trac system 
> (http://trac.osgeo.org/proj4js/ticket/42) that I haven't got to 
> implementing and testing yet. 
> 
> Mike
> 
> 
> 
> Heiko Schröter wrote:
> > Hello,
> >
> > i have a problem with the MousePosition Control. The relevant code snippets are as follows: 
> >
> >
> > Proj4js.defs["EPSG:4326"] = "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs";
> > Proj4js.defs["EPSG:0815"] = "+proj=ortho +lon_0=0 +lat_0=90";
> > Proj4js.defs["EPSG:0816"] = "+proj=ortho +lon_0=0 +lat_0=-90";
> >
> >     var myoptions = {
> > 	eventListeners: {
> > 	    "changebaselayer": hd_mapBaseLayerChanged
> > 	},
> > 	units: "dd",
> > 	maxResolution: 'auto',
> > 	maxExtent: new OpenLayers.Bounds(-180,-90,180,90),
> > 	controls: [
> > 		   new OpenLayers.Control.PanZoom(),
> > 		   new OpenLayers.Control.Navigation(),
> > 		   new OpenLayers.Control.MousePosition({"numDigits": 2,
> > 							 displayProjection: new OpenLayers.Projection("EPSG:4326")}),
> > 		   new OpenLayers.Control.LayerSwitcher({"ascending": true}),
> > 		   new OpenLayers.Control.Attribution()
> > 		   ],
> >
> > 	numZoomLevels: 5
> >     };
> >     map = new OpenLayers.Map('map', myoptions);
> >
> > The MousePosition works ok in EPSG:4326. Changing to 0815/0816 stalls the output of the MousePosition. Changing back to EPSG:4326 everything is ok again.
> > Omitting the "displayProjection" Option displays the MousePosition in meters in the 0815/0816 projection and in degrees in EPSG:4326 projection.
> >
> > So what i want is to display the MousePosition in "degrees" in the 0815/0816 projection as in EPSG:4326.
> > As far as i understand the docs the transformation should be done automatically when proj4js is used.
> > What do i do wrong ?
> >
> > Thanks and Regards
> > Heiko
> > _______________________________________________
> > Users mailing list
> > Users at openlayers.org
> > http://openlayers.org/mailman/listinfo/users
> >
> >   
> 
> 

-- 
-----------------------------------------------------------------------
Dipl.-Ing. Heiko Schröter
Institute of Environmental Physics (IUP)    phone: ++49-(0)421-218-62092
Institute of Remote Sensing (IFE)           fax:   ++49-(0)421-218-4555
University of Bremen (FB1)
P.O. Box 330440               email:  schroete at iup.physik.uni-bremen.de
Otto-Hahn-Allee 1           
28359 Bremen                
Germany
-----------------------------------------------------------------------



More information about the Users mailing list