diff --git a/projects/common-map/src/fm-map/components/aol/item-layers/item-layers.component.ts b/projects/common-map/src/fm-map/components/aol/item-layers/item-layers.component.ts index bed4b90..468bbac 100644 --- a/projects/common-map/src/fm-map/components/aol/item-layers/item-layers.component.ts +++ b/projects/common-map/src/fm-map/components/aol/item-layers/item-layers.component.ts @@ -103,8 +103,10 @@ export class ItemLayersComponent extends LayerGroupComponent implements OnChange layer = new Tile({ source: source }); } if (l && l.rendering && l.rendering.renderoutputType == "Image") { - var ri = l.rendering as IRenderoutputImage; - let source = new ImageStatic({ imageExtent: ri.extent, crossOrigin: 'use-credentials',projection: "EPSG:3857", url: `${this._apiEndPoint}/api/v1/items/${item.code}/mapimage/${layerIndex}?v=${Date.parse(item.updated)}` }); + var ri = l.rendering as IRenderoutputImage; + // convert to EPSG:4326 asworkaround for cesium + var projectedExtent = proj.transformExtent( ri.extent, 'EPSG:3857','EPSG:4326'); + let source = new ImageStatic({ imageExtent:projectedExtent,projection:'EPSG:4326', crossOrigin: 'use-credentials', url: `${this._apiEndPoint}/api/v1/items/${item.code}/mapimage/${layerIndex}?v=${Date.parse(item.updated)}` }); layer = new Image({ source: source }); } return layer; diff --git a/projects/common-map/src/fm-map/components/aol/switch2d3d/switch2d3d.component.ts b/projects/common-map/src/fm-map/components/aol/switch2d3d/switch2d3d.component.ts index 7c11286..71de7f4 100644 --- a/projects/common-map/src/fm-map/components/aol/switch2d3d/switch2d3d.component.ts +++ b/projects/common-map/src/fm-map/components/aol/switch2d3d/switch2d3d.component.ts @@ -1,6 +1,7 @@ import { Component, OnInit,Input,Host } from '@angular/core'; import { MapComponent } from 'ngx-openlayers'; import OLCesium from 'ol-cesium'; +//import OLCesium from '../../../../../../../../ol-cesium/src/olcs/OLCesium.js'; declare var olcs: any; @@ -30,13 +31,14 @@ export class Switch2D3DComponent { } ngOnInit() { - this.ol3d = new OLCesium({ map: this.map.instance,createSynchronizers: (map,scene) => { + createSynchronizers: (map,scene) => { this.synchronizers = [ new olcs.RasterSynchronizer(map,scene), new olcs.VectorSynchronizer(map,scene) ]; return this.synchronizers; - },stopOpenLayersEventsPropagation:true}); + } + this.ol3d = new OLCesium({ map: this.map.instance,stopOpenLayersEventsPropagation:true}); } synchronize() {