[OpenLayers-Users] Proj4js and IE
Gilles Bassière
gilles.bassiere at makina-corpus.com
Fri Jun 20 09:36:00 EDT 2008
Hi Damien,
Have you tried setting the displayProjection in the MousePosition
control instead?
Something like :
var extent = new OpenLayers.Bounds(-5,40,8,52 );
var options = {theme: null, maxResolution:'auto', maxExtent: extent, numZoomLevels:12, controls:[], projection: 'EPSG:4326', units:"m"};
map = new OpenLayers.Map('map',options);
controlMP = new OpenLayers.MousePosition({displayProjection: 'EPSG:27582'})
map.addControls([controlMP]);
OpenLayers API doc may be useful (though incomplete sometimes...). See:
http://dev.openlayers.org/releases/OpenLayers-2.6/doc/apidocs/files/OpenLayers/Control/MousePosition-js.html
Regards
Gilles
Damien Lécole wrote:
> Hi list,
>
> I have a map in EPSG:4326. I would like the coordinates displayed by my
> Control.MousePosition in EPSG:27582. So I am using Proj4js and I have
> written the following code :
>
>
> var pop = new OpenLayers.Projection('EPSG:4326');
> var dpop = new OpenLayers.Projection('EPSG:27582');
> var extent = new OpenLayers.Bounds(-5,40,8,52 );
> var options = {theme: null, maxResolution:'auto', maxExtent: extent,
> numZoomLevels:12, controls:[], projection: pop, displayProjection: dpop,
> units:"m"};
> map = new OpenLayers.Map('map',options);
>
> This works fine with Firefox but not with Internet Explorer : coordinates
> are still in EPSG:4326. Am I missing something? Thanks.
>
> Regards,
> Damien Lécole
>
--
Gilles Bassiere
MAKINA CORPUS
30 rue des Jeuneurs
FR-75002 PARIS
+33 (0) 1 44 82 00 80
http://www.makina-corpus.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gilles_bassiere.vcf
Type: text/x-vcard
Size: 368 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/openlayers-users/attachments/20080620/953bd8c7/gilles_bassiere.vcf
More information about the Users
mailing list