Fix the double-reprojection of components of a collection in KML, and write a

test for it in both GeoJSON and KML to demonstrate that it works. r=bartvde,
(Closes #2040)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@11644 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2011-03-07 11:15:20 +00:00
parent 105351995e
commit ce4ff521b0
3 changed files with 30 additions and 3 deletions

View File

@@ -95,6 +95,19 @@
t.eq(data.components[1].y, 1, "y of second component is right");
}
function test_Format_GeoJSON_multipoint_projected(t) {
t.plan(1);
var f = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiPoint([
new OpenLayers.Geometry.Point(15555162, 4247484)]));
var format = new OpenLayers.Format.GeoJSON({
internalProjection: new OpenLayers.Projection("EPSG:900913"),
externalProjection: new OpenLayers.Projection("EPSG:4326")
});
var data = format.write(f);
var found = (data.search('139.734') != -1);
t.ok(found, "Found 139.734 (correct reprojection) in data output.");
}
function test_Format_GeoJSON_multiline(t) {
t.plan(3);