AW: [OpenLayers-Users] Re: Writing KML - Reprojection problem

Arnd Wippermann arnd.wippermann at web.de
Thu Jul 14 12:54:08 EDT 2011


Hi,

I can confirm the behaviour for OpenLayers 2.11.

In OpenLayers 2.11 the format KML has changed in function buildGeometryNode.

The transformation are done only for geometries, that are not instanceof
OpenLayers.Geometry.Collection. 
Only points seems not to be instanceof OpenLayers.Geometry.Collection, so
they will transformed.

Most likely it's a bug in 2.11.

OpenLayers 2.10 : KML.js 

    buildGeometryNode: function(geometry) {
        if (this.internalProjection && this.externalProjection) {
            geometry = geometry.clone();
            geometry.transform(this.internalProjection, 
                               this.externalProjection);
        }                       

OpenLayers 2.11 RC1 : KML.js 

    buildGeometryNode: function(geometry) {
        if (this.internalProjection && this.externalProjection && 
            !(geometry instanceof OpenLayers.Geometry.Collection)) {
            geometry = geometry.clone();
            geometry.transform(this.internalProjection, 
                               this.externalProjection);
        }                       

Arnd 

-----Ursprüngliche Nachricht-----
Von: openlayers-users-bounces at lists.osgeo.org
[mailto:openlayers-users-bounces at lists.osgeo.org] Im Auftrag von jllodra
Gesendet: Mittwoch, 13. Juli 2011 12:39
An: users at openlayers.org
Betreff: [OpenLayers-Users] Re: Writing KML - Reprojection problem

Hi again, just uploaded a test which demonstrates this bug.

http://socib.es/~jllodra/workspace/cdrift/write_features_google.html

Left textarea shows output in KML,
right textarea shows output in GeoJSON.

If you draw a point, coords appear in "degrees" both for KML and GeoJSON
(correct).
If you draw a linestring or poly, coords appear in "m x/y" for the KML
(wrong!) but in "degrees" for the GeoJSON (correct).

Please can anyone confirm?

--
View this message in context:
http://osgeo-org.1803224.n2.nabble.com/Writing-KML-Reprojection-problem-tp65
78255p6578521.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
Users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-users



More information about the Users mailing list