Parse KML extrude and altitudeMode of simple geometries
Point, LineString and Polygon are handled. LinearRing properties are not handled. An 'extrude' boolean property is set in the geometry properties. An 'altitudeMode' string property is set in the geometry properties.
This commit is contained in:
1 parent
ea8ee16f49
commit
5bd63f7e2c
2 files changed
+40
No files matched your search
@@ -133,6 +133,8 @@ describe('ol.format.KML', function() {
|
||||
' <Placemark>' +
|
||||
' <Point>' +
|
||||
' <coordinates>1,2,3</coordinates>' +
|
||||
' <extrude>0</extrude>' +
|
||||
' <altitudeMode>absolute</altitudeMode>' +
|
||||
' </Point>' +
|
||||
' </Placemark>' +
|
||||
'</kml>';
|
||||
@@ -143,6 +145,8 @@ describe('ol.format.KML', function() {
|
||||
var g = f.getGeometry();
|
||||
expect(g).to.be.an(ol.geom.Point);
|
||||
expect(g.getCoordinates()).to.eql([1, 2, 3]);
|
||||
expect(g.get('extrude')).to.be(false);
|
||||
expect(g.get('altitudeMode')).to.be('absolute');
|
||||
});
|
||||
|
||||
it('can transform and read Point geometries', function() {
|
||||
@@ -338,6 +342,8 @@ describe('ol.format.KML', function() {
|
||||
' <Placemark>' +
|
||||
' <LineString>' +
|
||||
' <coordinates>1,2,3 4,5,6</coordinates>' +
|
||||
' <extrude>0</extrude>' +
|
||||
' <altitudeMode>absolute</altitudeMode>' +
|
||||
' </LineString>' +
|
||||
' </Placemark>' +
|
||||
'</kml>';
|
||||
@@ -348,6 +354,8 @@ describe('ol.format.KML', function() {
|
||||
var g = f.getGeometry();
|
||||
expect(g).to.be.an(ol.geom.LineString);
|
||||
expect(g.getCoordinates()).to.eql([[1, 2, 3], [4, 5, 6]]);
|
||||
expect(g.get('extrude')).to.be(false);
|
||||
expect(g.get('altitudeMode')).to.be('absolute');
|
||||
});
|
||||
|
||||
it('can write XY LineString geometries', function() {
|
||||
@@ -540,6 +548,8 @@ describe('ol.format.KML', function() {
|
||||
'<kml xmlns="http://earth.google.com/kml/2.2">' +
|
||||
' <Placemark>' +
|
||||
' <Polygon>' +
|
||||
' <extrude>0</extrude>' +
|
||||
' <altitudeMode>absolute</altitudeMode>' +
|
||||
' <outerBoundaryIs>' +
|
||||
' <LinearRing>' +
|
||||
' <coordinates>0,0,1 0,5,1 5,5,2 5,0,3</coordinates>' +
|
||||
@@ -556,6 +566,8 @@ describe('ol.format.KML', function() {
|
||||
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]]]);
|
||||
expect(g.get('extrude')).to.be(false);
|
||||
expect(g.get('altitudeMode')).to.be('absolute');
|
||||
});
|
||||
|
||||
it('can write XY Polygon geometries', function() {
|
||||
|
||||
Reference in new issue
Block a user