<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1106" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=359482215-29062008>Hi Matt,</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=359482215-29062008></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=359482215-29062008>you must load the proj4js library and if you use IE
also the other projection declarations. Otherwise is the OpenLayers.Projection
only an empty function.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=359482215-29062008></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=359482215-29062008>I use this to work with proj4js and it's wonderful to
see how it works.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT size=2><FONT face=Arial><FONT color=#0000ff><SPAN
class=359482215-29062008></SPAN></FONT><FONT color=#0000ff><SPAN
class=359482215-29062008></SPAN></FONT></FONT></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><script
type="text/javascript"
src="proj4js/proj4js-compressed.js"></script><BR></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff><FONT face=Arial size=2><SCRIPT
type="text/javascript"
src="proj4js/projCode/tmerc.js"></SCRIPT><BR><SCRIPT
type="text/javascript"
src="proj4js/projCode/merc.js"></SCRIPT><BR><SCRIPT
type="text/javascript"
src="proj4js/defs/EPSG31466.js"></SCRIPT><BR><SCRIPT
type="text/javascript"
src="proj4js/defs/EPSG31467.js"></SCRIPT><BR><SCRIPT
type="text/javascript"
src="proj4js/defs/EPSG900913.js"></SCRIPT><BR></FONT></DIV></FONT><!-- Converted from text/plain format -->
<P><FONT face=Arial size=2>Mit freundlichen Grüssen<BR><BR>Arnd
Wippermann<BR></FONT><A href="http://gis.ibbeck.de/ginfo/"><FONT face=Arial
size=2>http://gis.ibbeck.de/ginfo/</FONT></A><BR><BR></P><BR>
<DIV class=OutlookMessageHeader lang=de dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>Von:</B> users-bounces@openlayers.org
[mailto:users-bounces@openlayers.org] <B>Im Auftrag von </B>Matthew
Pettis<BR><B>Gesendet:</B> Samstag, 28. Juni 2008 23:20<BR><B>An:</B>
users@openlayers.org<BR><B>Betreff:</B> [OpenLayers-Users] OpenLayers.Projection
and proj4js.js<BR></FONT><BR></DIV>
<DIV></DIV>Hi,<BR><BR>I'm trying to cast a point in one projection into another,
and I think I have some issues with OpenLayers.Projection. Below is
html/javascript code I'm using and the rendered browser ouput. In this
example, I'm trying to cast the point (184056.505, 4809728.250) in epsg:26915 to
epgs:4326. My expectation is that point p, which is this point in
epsg:26915, should display as something on the order of (-100,43), or something
close to that range. However, as the output shows, the point is not
changed. Can someone explain why?<BR><BR>Thanks,<BR>matt<BR><BR>P.S. - Is
there an error in the documentation for the constructor of OpenLayers.Projection
(at: <A
href="http://dev.openlayers.org/releases/OpenLayers-2.6/doc/apidocs/files/OpenLayers/Projection-js.html#OpenLayers.Projection.OpenLayers.Projection">http://dev.openlayers.org/releases/OpenLayers-2.6/doc/apidocs/files/OpenLayers/Projection-js.html#OpenLayers.Projection.OpenLayers.Projection</A>)?
It says that the constructor takes an object to set parameters, but every
example I see of the constructor is passing a string in the way I am setting it
here. Am I not understanding the documentation conventions correctly, or
is this not correctly or completely documented?<BR><BR><BR>=== html/javascript
code ===<BR><html xmlns="<A
href="http://www.w3.org/1999/xhtml">http://www.w3.org/1999/xhtml</A>"><BR>
<head><BR> <title>OpenLayers
Example</title><BR><!-- <script src="<A
href="http://www.openlayers.org/api/OpenLayers.js">http://www.openlayers.org/api/OpenLayers.js</A>"></script>
--><BR> <script src="<A
href="http://localhost/_common//OpenLayers-2.6/OpenLayers.js">http://localhost/_common//OpenLayers-2.6/OpenLayers.js</A>"></script><BR>
</head><BR><BR> <body><BR><BR>
<pre><BR> <script
type="text/javascript"><BR> var p =
new OpenLayers.Geometry.Point(184056.505,
4809728.250);<BR> var proj_src = new
OpenLayers.Projection("EPSG:26915");<BR>
var proj_tgt = new
OpenLayers.Projection("EPSG:4326");<BR><BR>
document.writeln();<BR>
document.writeln("Point p [before OpenLayers.Projection.transform] is: " +
p);<BR>
OpenLayers.Projection.transform(p,proj_src,proj_tgt);<BR>
document.writeln("Point p [after OpenLayers.Projection.transform] is: " +
p);<BR> document.writeln("proj_src is:
" + proj_src);<BR>
document.writeln();<BR>
<BR> document.writeln("prj_src walk of
properties is:");<BR>
document.writeln("------------------------------");<BR>
for (prop in proj_src)
{<BR>
document.writeln(prop + " => " +
proj_src[prop]);<BR>
};<BR>
document.writeln("------------------------------");<BR>
</script><BR> </pre><BR>
</body><BR><BR></html><BR>========================================================================<BR><BR>===
browser rendered output ===<BR><PRE> <BR>Point p [before OpenLayers.Projection.transform] is: POINT(184056.505 4809728.25)<BR>Point p [after OpenLayers.Projection.transform] is: POINT(184056.505 4809728.25)<BR>proj_src is: EPSG:26915<BR><BR>prj_src walk of properties is:<BR>
------------------------------<BR>projCode => EPSG:26915<BR>proj => null<BR>initialize => function (projCode, options) {<BR> OpenLayers.Util.extend(this, options);<BR> this.projCode = projCode;<BR> if (window.Proj4js) {<BR>
this.proj = new Proj4js.Proj(projCode);<BR> }<BR>}<BR>getCode => function () {<BR> return this.proj ? this.proj.srsCode : this.projCode;<BR>}<BR>getUnits => function () {<BR> return this.proj ? this.proj.units : null;<BR>
}<BR>toString => function () {<BR> return this.getCode();<BR>}<BR>equals => function (projection) {<BR> if (projection && projection.getCode) {<BR> return this.getCode() == projection.getCode();<BR>
} else {<BR> return false;<BR> }<BR>}<BR>destroy => function () {<BR> delete this.proj;<BR> delete this.projCode;<BR>}<BR>CLASS_NAME => OpenLayers.Projection<BR>------------------------------<BR>
</PRE>========================================================================<BR><BR></BODY></HTML>