<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-15">
<META content="MSHTML 6.00.2900.3243" name=GENERATOR></HEAD>
<BODY style="MARGIN: 4px 4px 1px">
<DIV>Hi Karsten</DIV>
<DIV>&nbsp;</DIV>
<DIV>This code works for me:</DIV>
<DIV>&nbsp;</DIV>
<DIV>var src = new OpenLayers.Projection('EPSG:4326');<BR>var dest = new OpenLayers.Projection('EPSG:2193');</DIV>
<DIV>latitude = document.getElementById('lat').value;<BR>longitude = document.getElementById('llong').value;<BR>var markergeom = new OpenLayers.Geometry.Point(longitude,latitude);<BR>//now in-place re-projection<BR>OpenLayers.Projection.transform(markergeom, src, dest); <BR>gpsx = markergeom.x;<BR>gpsy = markergeom.y;</DIV>
<DIV>alert(alert('coordinates transformed:'+gpsx.toString()+','+gpsy.toString());<BR></DIV>
<DIV>regards,</DIV>
<DIV>&nbsp;</DIV>
<DIV>Robert Sanson<BR><BR>&gt;&gt;&gt; "karsten vennemann" &lt;karsten@terragis.net&gt; 6/10/2009 1:00 p.m. &gt;&gt;&gt;<BR>Thanks, now I do not get an error any more with this code:<BR><BR>var mapcenter = new OpenLayers.LonLat(-122.30785315739, 47.638080437239);<BR>Proj4js.defs["EPSG:102003"] = "+proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=37.5 +lon_0=-96 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs";<BR>var source = new OpenLayers.Projection("EPSG:4326");&nbsp;&nbsp; <BR>var dest = new OpenLayers.Projection("EPSG:102003");&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>OpenLayers.Projection.transform(mapcenter, source, dest);<BR>alert('coordinates transformed:'+mapcenter.toString());<BR><BR>However the coordinates are the same as the input values (-122.30785315739, 47.638080437239) and not transformed. <BR>What is still wrong ?<BR><BR>Karsten <BR><BR>_______________________________________________<BR>Users mailing list<BR>Users@openlayers.org<BR><A href="http://openlayers.org/mailman/listinfo/users">http://openlayers.org/mailman/listinfo/users</A><BR><BR></DIV><br><br><table bgcolor=white style="color:black"><tr><td><br>------------------------------------------------------------------<br>
The&nbsp;contents&nbsp;of&nbsp;this&nbsp;email&nbsp;are&nbsp;confidential&nbsp;to&nbsp;AsureQuality.&nbsp;If&nbsp;you&nbsp;have&nbsp;received&nbsp;this&nbsp;communication&nbsp;in&nbsp;error&nbsp;please&nbsp;notify&nbsp;the&nbsp;sender&nbsp;immediately&nbsp;and&nbsp;delete&nbsp;the&nbsp;message&nbsp;and&nbsp;any&nbsp;attachments.&nbsp;The&nbsp;opinions&nbsp;expressed&nbsp;in&nbsp;this&nbsp;email&nbsp;are&nbsp;not&nbsp;necessarily&nbsp;those&nbsp;of&nbsp;AsureQuality.&nbsp;This&nbsp;message&nbsp;has&nbsp;been&nbsp;scanned&nbsp;for&nbsp;known&nbsp;viruses&nbsp;before&nbsp;delivery.&nbsp;AsureQuality&nbsp;supports&nbsp;the&nbsp;Unsolicited&nbsp;Electronic&nbsp;Messages&nbsp;Act&nbsp;2007.&nbsp;If&nbsp;you&nbsp;do&nbsp;not&nbsp;wish&nbsp;to&nbsp;receive&nbsp;similar&nbsp;communications&nbsp;in&nbsp;future,&nbsp;please&nbsp;notify&nbsp;the&nbsp;sender&nbsp;of&nbsp;this&nbsp;message.<br>
------------------------------------------------------------------</td></tr></table><br><br>
<P align=center><FONT style="BACKGROUND-COLOR: #ffffff">This message has been scanned for malware by SurfControl plc.  </FONT><A href="http://www.surfcontrol.com/"><FONT style="BACKGROUND-COLOR: #ffffff" color=#000000>www.surfcontrol.com</FONT></A></P>
</body></HTML>