OpenLayers and custom Proj4 Projection

المشرف العام

Administrator
طاقم الإدارة
ok so I'm a newbee in using OpenLayers. I try to map some planetary data on my webMap server using OpenLayers. I defined a proj4 projection as follow:

Proj4js.defs["MYDATUM"] = "+proj=longlat +a=1740000 +b=1740000 +units=m +no_defs";In the html file I also call the proj4js.js, and then I added the following lines:

map = new OpenLayers.Map('map', { controls: [ new OpenLayers.Control.Navigation(), new OpenLayers.Control.PanZoomBar(), new OpenLayers.Control.ScaleLine({bottomOutUnits: ''}), new OpenLayers.Control.MousePosition(), new OpenLayers.Control.Graticule() ], Projection: new OpenLayers.Projection("MYDATUM") });My issue is that the scaleline does not show the correct distance and seems not to take into account my own projection. Actually I tried a couple of example and it seems that the line

projection: new OpenLayers.Projection("MYDATUM")does not have any effect on the ScaleLine size. How can I display correctly a scale bar using my own projection/datum ? Again, I'm not working with terrestrial data, so I do not want wgs84 or any of it's friend.

thank you for any ideas/feedbacks/help

A.



أكثر...
 
أعلى