diff --git a/projects/cesium-test-app/src/app/app.component.ts b/projects/cesium-test-app/src/app/app.component.ts index 6a6fed537e..446309ead4 100644 --- a/projects/cesium-test-app/src/app/app.component.ts +++ b/projects/cesium-test-app/src/app/app.component.ts @@ -7,7 +7,7 @@ import { HeadingPitchRoll, Transforms, } from 'cesium'; -import {GeoJSON} from 'ol/format'; +import {GeoJSON, KML} from 'ol/format'; import {Image as ImageLayer, Tile, Vector as VectorLayer} from 'ol/layer'; import {OSM, Vector as VectorSource, XYZ} from 'ol/source'; import {View} from 'ol'; @@ -44,6 +44,15 @@ export class AppComponent implements OnInit { format: new GeoJSON(), }) as VectorSource, //FIXME: Type-cast shall be automatically inferred after OL >8.2 }); + const polygon25dKml = new VectorLayer({ + properties: { + title: '2.5D polygon surface as KML', + }, + source: new VectorSource({ + url: '../assets/polygon2.5d.kml', + format: new KML(), + }) as VectorSource, //FIXME: Type-cast shall be automatically inferred after OL >8.2 + }); const geojsonObject2d = { 'type': 'FeatureCollection', 'crs': { @@ -203,8 +212,8 @@ export class AppComponent implements OnInit { ], popUpDisplay: 'hover', default_view: new View({ - center: transform([17.474129, 52.574], 'EPSG:4326', 'EPSG:3857'), //Latitude longitude to Spherical Mercator - zoom: 4, + center: transform([13.3, 49.7], 'EPSG:4326', 'EPSG:3857'), //Latitude longitude to Spherical Mercator + zoom: 12, }), default_layers: [ new Tile({ @@ -263,6 +272,7 @@ export class AppComponent implements OnInit { }) as VectorSource, //FIXME: Type-cast shall be automatically inferred after OL >8.2 }), polygon25d, + polygon25dKml, opticalMap, ], }); diff --git a/projects/cesium-test-app/src/assets/polygon2.5d.kml b/projects/cesium-test-app/src/assets/polygon2.5d.kml new file mode 100644 index 0000000000..0cdea7ff7e --- /dev/null +++ b/projects/cesium-test-app/src/assets/polygon2.5d.kml @@ -0,0 +1,17 @@ + + + + + + +polygon2.5d + + Polygon with height higher than its Z-coords + + + 800 + + 13.365,49.74,350 13.363,49.735,400 13.37,49.735,450 13.373,49.74,500 13.372,49.74,650 13.368,49.738,700 13.365,49.74,350 + + +