[OpenLayers-Users] OpenLayers.Projection and transform offeatures

Arnd Wippermann arnd.wippermann at web.de
Wed Jun 25 07:10:04 EDT 2008


Hi

as a workaround I overwrite Proj4js.transform(). I declared a property
Proj4js.readTransformed and if this is set to false, the transformation
takes place.

changed part in Proj4js.transform():

    if (point.transformed && Proj4js.readTransformed) {
      this.log("point already transformed");
      return;
    }

I don't know, if there are sideeffects, because I have no clue, what the
reason is for the property transformed.


Also I have seen, it is possibly to declare projections for the format
parser 

read:

    var theParser = formats[type];
    theParser.internalProjection = new OpenLayers.Projection(toProjection);
    theParser.externalProjection = new
OpenLayers.Projection(fromProjection);
    var features = theParser.read(element.value);

write:
    var theParser = formats[type];
    theParser.internalProjection = new
OpenLayers.Projection(fromProjection);
    theParser.externalProjection = new OpenLayers.Projection(toProjection);
    var derString = theParser.write(features, true);


The projection transformation is a great enhancement for OpenLayers and I
like it. I'm always astonished of the large capabilities of OpenLayers and
the relative easy use of it.

Thanks to all the developers.

Mit freundlichen Grüssen

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





More information about the Users mailing list