From aa6cd254c75ecd57733789e58bf08bfc53e72042 Mon Sep 17 00:00:00 2001 From: Mark van der Wal Date: Wed, 19 Feb 2020 10:53:14 +0100 Subject: [PATCH 1/2] changed image api --- .../aol/item-layers/item-layers.component.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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 5c174f8..c03feca 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 @@ -87,15 +87,15 @@ export class ItemLayersComponent extends LayerGroupComponent implements OnChange } createLayer(itemLayer: IItemLayer): Layer { - var layer: Layer = null; + var layer: Layer = null; if (itemLayer.item.itemType == 'vnd.farmmaps.itemtype.geotiff.processed') { - let source = new XYZ({ maxZoom: 19, minZoom: 1, url: `${this._apiEndPoint}/api/v1/items/${itemLayer.item.code}/tiles/{z}/{x}/{y}.png?v=${itemLayer.item.updated.getTime()}` }); + let source = new XYZ({ maxZoom: 19, minZoom: 1, url: `${this._apiEndPoint}/api/v1/items/${itemLayer.item.code}/${itemLayer.layerIndex}/tiles/{z}/{x}/{y}.png?v=${itemLayer.item.updated.getTime()}` }); layer = new Tile({ source: source }); var data = itemLayer.item.data; var l = (data && data.layers && data.layers.length > 0) ? data.layers[0] : null; if (l && l.rendering && l.rendering.renderoutputType == "Tiles") { var rt = l.rendering as IRenderoutputTiles; - let source = new XYZ({ maxZoom: rt.maxzoom, minZoom: rt.minzoom, url: `${this._apiEndPoint}/api/v1/items/${itemLayer.item.code}/tiles/{z}/{x}/{y}.png?v=${itemLayer.item.updated.getTime()}` }); + let source = new XYZ({ maxZoom: rt.maxzoom, minZoom: rt.minzoom, url: `${this._apiEndPoint}/api/v1/items/${itemLayer.item.code}/${itemLayer.layerIndex}/tiles/{z}/{x}/{y}.png?v=${itemLayer.item.updated.getTime()}` }); layer = new Tile({ source: source }); } if (l && l.rendering && l.rendering.renderoutputType == "Image") { @@ -105,7 +105,7 @@ export class ItemLayersComponent extends LayerGroupComponent implements OnChange units: 'pixels', extent: ri.extent }); - let source = new ImageStatic({ imageExtent: ri.extent, projection: projection, url: `${this._apiEndPoint}/api/v1/items/${itemLayer.item.code}/mapimage?v=${itemLayer.item.updated.getTime()}` }); + let source = new ImageStatic({ imageExtent: ri.extent, projection: projection, url: `${this._apiEndPoint}/api/v1/items/${itemLayer.item.code}/${itemLayer.layerIndex}/mapimage?v=${itemLayer.item.updated.getTime()}` }); layer = new Image({ source: source }); } } else if (itemLayer.item.itemType == 'vnd.farmmaps.itemtype.shape.processed') { @@ -123,7 +123,7 @@ export class ItemLayersComponent extends LayerGroupComponent implements OnChange url: `${this._apiEndPoint}/api/v1/items/${itemLayer.item.code}/vectortiles/{z}/{x}/{y}.pbf?v=${itemLayer.item.updated.getTime()}` }), style: (feature) => { - return this.getColorFromGradient(l, feature); + return this.getColorFromGradient(l, feature); } }) } else if (l && l.rendering && l.rendering.renderoutputType == "Tiles") { @@ -184,7 +184,7 @@ export class ItemLayersComponent extends LayerGroupComponent implements OnChange return this.styleCache[key]; } }); - } + } } else if (itemLayer.item.itemType == 'vnd.farmmaps.itemtype.layer') { let data = itemLayer.item.data as ILayerData; switch (data.interfaceType) { @@ -255,7 +255,7 @@ export class ItemLayersComponent extends LayerGroupComponent implements OnChange olLayers.removeAt(i); } } - } + } } ngOnChanges(changes: SimpleChanges) { From 92c8b4c1b61a97ea25c4ffabb3e15726615a1c55 Mon Sep 17 00:00:00 2001 From: Mark van der Wal Date: Wed, 19 Feb 2020 10:57:11 +0100 Subject: [PATCH 2/2] changed selected item geotiff to show layer changer --- .../selected-item-geotiff.component.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/projects/common-map/src/fm-map/components/selected-item-geotiff/selected-item-geotiff.component.html b/projects/common-map/src/fm-map/components/selected-item-geotiff/selected-item-geotiff.component.html index 06df947..25e1951 100644 --- a/projects/common-map/src/fm-map/components/selected-item-geotiff/selected-item-geotiff.component.html +++ b/projects/common-map/src/fm-map/components/selected-item-geotiff/selected-item-geotiff.component.html @@ -8,6 +8,11 @@