Fix static image layer
This commit is contained in:
parent
15d1f14ee1
commit
c606e02673
@ -104,7 +104,9 @@ export class ItemLayersComponent extends LayerGroupComponent implements OnChange
|
|||||||
}
|
}
|
||||||
if (l && l.rendering && l.rendering.renderoutputType == "Image") {
|
if (l && l.rendering && l.rendering.renderoutputType == "Image") {
|
||||||
var ri = l.rendering as IRenderoutputImage;
|
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)}` });
|
// 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 });
|
layer = new Image({ source: source });
|
||||||
}
|
}
|
||||||
return layer;
|
return layer;
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { Component, OnInit,Input,Host } from '@angular/core';
|
import { Component, OnInit,Input,Host } from '@angular/core';
|
||||||
import { MapComponent } from 'ngx-openlayers';
|
import { MapComponent } from 'ngx-openlayers';
|
||||||
import OLCesium from 'ol-cesium';
|
import OLCesium from 'ol-cesium';
|
||||||
|
//import OLCesium from '../../../../../../../../ol-cesium/src/olcs/OLCesium.js';
|
||||||
|
|
||||||
declare var olcs: any;
|
declare var olcs: any;
|
||||||
|
|
||||||
@ -30,13 +31,14 @@ export class Switch2D3DComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.ol3d = new OLCesium({ map: this.map.instance,createSynchronizers: (map,scene) => {
|
createSynchronizers: (map,scene) => {
|
||||||
this.synchronizers = [
|
this.synchronizers = [
|
||||||
new olcs.RasterSynchronizer(map,scene),
|
new olcs.RasterSynchronizer(map,scene),
|
||||||
new olcs.VectorSynchronizer(map,scene)
|
new olcs.VectorSynchronizer(map,scene)
|
||||||
];
|
];
|
||||||
return this.synchronizers;
|
return this.synchronizers;
|
||||||
},stopOpenLayersEventsPropagation:true});
|
}
|
||||||
|
this.ol3d = new OLCesium({ map: this.map.instance,stopOpenLayersEventsPropagation:true});
|
||||||
}
|
}
|
||||||
|
|
||||||
synchronize() {
|
synchronize() {
|
||||||
|
Loading…
Reference in New Issue
Block a user