Did you know projection is in built into OpenLayers trunk?<br><br>see <a href="http://www.nabble.com/KML-and-Popup-window-problem-to16007328.html#a16007328">http://www.nabble.com/KML-and-Popup-window-problem-to16007328.html#a16007328</a><br>
<br><br><br><div><span class="gmail_quote">On 24/03/2008, <b class="gmail_sendername">Arnd Wippermann</b> <<a href="mailto:arnd.wippermann@web.de">arnd.wippermann@web.de</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br> <br> What is the right way to reproject vectordata with proj4js?<br> <br> I'm using OL 2.5 with proj4js and want reproject vector-files (KML, GML,<br> etc.), when I add these files on the fly into a map with a different<br>
projection. I have managed this for tests, that I have patched the Point.js.<br> <br> if(fromProjection!=toProjection)<br> {<br> var csFrom = projHash[fromProjection];<br> var csTo = projHash[toProjection];<br>
<br> var p = new Proj4js.Point(parseFloat(x),parseFloat(y));<br> Proj4js.transform(csFrom, csTo, p);<br> <br> this.x = p.x;<br> this.y = p.y;<br> }<br> else<br> {<br>
this.x = parseFloat(x);<br> this.y = parseFloat(y);<br> }<br> <br> and also for the vector formats the function buildCoordinatesNode. It works,<br> but I hope there is better way to do this.<br>
<br> As a side effect I experienced WFS-layers are reprojected, when the BBOX of<br> the actual map projection (toProjection) have values, that match the<br> fromProjection as well.<br> <br> Is there clean way to reproject WFS-layers?<br>
<br> <br> Mit freundlichen Grüssen<br> <br> Arnd Wippermann<br> <a href="http://gis.ibbeck.de/">http://gis.ibbeck.de/</a><br> <br> <br> _______________________________________________<br> Users mailing list<br> <a href="mailto:Users@openlayers.org">Users@openlayers.org</a><br>
<a href="http://openlayers.org/mailman/listinfo/users">http://openlayers.org/mailman/listinfo/users</a><br> </blockquote></div><br>