[OpenLayers-Users] weird thing with projections
toni hernández
tonidelacalle at gmail.com
Sat Apr 18 10:20:50 EDT 2009
Hi,
I need to reproject a point to a pre-defined projection
(Proj4js.defs["EPSG:23031"] = "+proj=utm +zone=31 +ellps=intl +units=m
+no_defs ";).
The weird thing is that the projection is not working unless I insert and
alert("stop for a while") after the line p = new
OpenLayers.Projection('EPSG:23031');
Without the stop alert the point is shown in 4326 projection.
Isn't it weird?
Any ideas.
I'm lost.
<script src="../proj4js/lib/defs/EPSG23031.js"></script>
<script src="../proj4js/lib/proj4js.js"></script>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
function init()
{
p = new OpenLayers.Projection('EPSG:23031');
//alert("stop for a while");
var proj = new OpenLayers.Projection("EPSG:4326");
var point = new OpenLayers.LonLat(-71, 42);
alert(point.transform(proj, p));
}
...
</script>
<body onload=init()">
....
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20090418/5cbf257b/attachment.html
More information about the Users
mailing list