| | 219 | function test_Format_WKT_read_projection(t) { |
|---|
| | 220 | t.plan(1); |
|---|
| | 221 | |
|---|
| | 222 | var projections = { |
|---|
| | 223 | src: new OpenLayers.Projection("EPSG:4326"), |
|---|
| | 224 | dest: new OpenLayers.Projection("EPSG:900913") |
|---|
| | 225 | }; |
|---|
| | 226 | |
|---|
| | 227 | var points = { |
|---|
| | 228 | src: new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(-87.9, 41.9)), |
|---|
| | 229 | dest: new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(-9784983.239366667, 5146011.678566458)) |
|---|
| | 230 | }; |
|---|
| | 231 | |
|---|
| | 232 | var format = new OpenLayers.Format.WKT({ |
|---|
| | 233 | externalProjection: projections["src"], |
|---|
| | 234 | internalProjection: projections["dest"], |
|---|
| | 235 | }); |
|---|
| | 236 | var feature = format.read("GEOMETRYCOLLECTION(POINT(" + points["src"].geometry.x + " " + points["src"].geometry.y + "))")[0]; |
|---|
| | 237 | t.eq(feature.geometry.toString(), points["dest"].geometry.toString(), |
|---|
| | 238 | "Geometry collections aren't transformed twice when reprojection."); |
|---|
| | 239 | } |
|---|