Hi,

What is the right way to reproject vectordata with proj4js?
 
I'm using OL 2.5 with proj4js and want reproject vector-files (KML, GML,
etc.), when I add these files on the fly into a map with a different
projection. I have managed this for tests, that I have patched the Point.js.

        if(fromProjection!=toProjection)
        {
            var csFrom = projHash[fromProjection];
            var csTo   = projHash[toProjection];

            var p = new Proj4js.Point(parseFloat(x),parseFloat(y));
            Proj4js.transform(csFrom, csTo, p);

            this.x = p.x;
            this.y = p.y;
        }
        else
        {
            this.x = parseFloat(x);
            this.y = parseFloat(y);
        }

and also for the vector formats the function buildCoordinatesNode. It works,
but I hope there is better way to do this. 

As a side effect I experienced WFS-layers are reprojected, when the BBOX of
the actual map projection (toProjection) have values, that match the
fromProjection as well.

Is there clean way to reproject WFS-layers?


Mit freundlichen GrĂ¼ssen

Arnd Wippermann
http://gis.ibbeck.de/


_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users

Reply via email to