committed by
Frederic Junod
parent
5f5bc2ecdb
commit
71ebed07bf
@@ -719,9 +719,9 @@ describe('ol.format.KML', function() {
|
||||
|
||||
it('can write XYZM Polygon geometries', function() {
|
||||
var layout = 'XYZM';
|
||||
var polygon = new ol.geom.Polygon(
|
||||
[[[0, 0, 1, 1], [0, 2, 2, 1], [2, 2, 3, 1],
|
||||
[2, 0, 4, 1], [0, 0, 5, 1]]], layout);
|
||||
var polygon = new ol.geom.Polygon([
|
||||
[[0, 0, 1, 1], [0, 2, 2, 1], [2, 2, 3, 1], [2, 0, 4, 1], [0, 0, 5, 1]]
|
||||
], layout);
|
||||
var features = [new ol.Feature(polygon)];
|
||||
var node = format.writeFeaturesNode(features);
|
||||
var text =
|
||||
@@ -772,18 +772,20 @@ describe('ol.format.KML', function() {
|
||||
expect(f).to.be.an(ol.Feature);
|
||||
var g = f.getGeometry();
|
||||
expect(g).to.be.an(ol.geom.Polygon);
|
||||
expect(g.getCoordinates()).to.eql(
|
||||
[[[0, 0, 1], [0, 5, 1], [5, 5, 2], [5, 0, 3]],
|
||||
[[1, 1, 0], [1, 2, 0], [2, 2, 0], [2, 1, 0]],
|
||||
[[3, 3, 0], [3, 4, 0], [4, 4, 0], [4, 3, 0]]]);
|
||||
expect(g.getCoordinates()).to.eql([
|
||||
[[0, 0, 1], [0, 5, 1], [5, 5, 2], [5, 0, 3]],
|
||||
[[1, 1, 0], [1, 2, 0], [2, 2, 0], [2, 1, 0]],
|
||||
[[3, 3, 0], [3, 4, 0], [4, 4, 0], [4, 3, 0]]
|
||||
]);
|
||||
});
|
||||
|
||||
it('can write complex Polygon geometries', function() {
|
||||
var layout = 'XYZ';
|
||||
var polygon = new ol.geom.Polygon(
|
||||
[[[0, 0, 1], [0, 5, 1], [5, 5, 2], [5, 0, 3]],
|
||||
[[1, 1, 0], [1, 2, 0], [2, 2, 0], [2, 1, 0]],
|
||||
[[3, 3, 0], [3, 4, 0], [4, 4, 0], [4, 3, 0]]], layout);
|
||||
var polygon = new ol.geom.Polygon([
|
||||
[[0, 0, 1], [0, 5, 1], [5, 5, 2], [5, 0, 3]],
|
||||
[[1, 1, 0], [1, 2, 0], [2, 2, 0], [2, 1, 0]],
|
||||
[[3, 3, 0], [3, 4, 0], [4, 4, 0], [4, 3, 0]]
|
||||
], layout);
|
||||
var features = [new ol.Feature(polygon)];
|
||||
var node = format.writeFeaturesNode(features);
|
||||
var text =
|
||||
@@ -966,9 +968,10 @@ describe('ol.format.KML', function() {
|
||||
expect(f).to.be.an(ol.Feature);
|
||||
var g = f.getGeometry();
|
||||
expect(g).to.be.an(ol.geom.MultiPolygon);
|
||||
expect(g.getCoordinates()).to.eql(
|
||||
[[[[0, 0, 0], [0, 1, 0], [1, 1, 0], [1, 0, 0]]],
|
||||
[[[3, 0, 0], [3, 1, 0], [4, 1, 0], [4, 0, 0]]]]);
|
||||
expect(g.getCoordinates()).to.eql([
|
||||
[[[0, 0, 0], [0, 1, 0], [1, 1, 0], [1, 0, 0]]],
|
||||
[[[3, 0, 0], [3, 1, 0], [4, 1, 0], [4, 0, 0]]]
|
||||
]);
|
||||
expect(g.get('extrude')).to.be.an('array');
|
||||
expect(g.get('extrude')).to.have.length(2);
|
||||
expect(g.get('extrude')[0]).to.be(false);
|
||||
@@ -981,9 +984,10 @@ describe('ol.format.KML', function() {
|
||||
|
||||
it('can write MultiPolygon geometries', function() {
|
||||
var layout = 'XYZ';
|
||||
var multiPolygon = new ol.geom.MultiPolygon(
|
||||
[[[[0, 0, 0], [0, 1, 0], [1, 1, 0], [1, 0, 0]]],
|
||||
[[[3, 0, 0], [3, 1, 0], [4, 1, 0], [4, 0, 0]]]], layout);
|
||||
var multiPolygon = new ol.geom.MultiPolygon([
|
||||
[[[0, 0, 0], [0, 1, 0], [1, 1, 0], [1, 0, 0]]],
|
||||
[[[3, 0, 0], [3, 1, 0], [4, 1, 0], [4, 0, 0]]]
|
||||
], layout);
|
||||
var features = [new ol.Feature(multiPolygon)];
|
||||
var node = format.writeFeaturesNode(features);
|
||||
var text =
|
||||
|
||||
Reference in New Issue
Block a user