From 80fec7ccaa5f2f552c2ef6866f4a77b0044c5a02 Mon Sep 17 00:00:00 2001 From: Willem Dantuma Date: Fri, 18 Dec 2020 20:16:22 +0100 Subject: [PATCH] Some fixes --- .../aol/item-layers/item-layers.component.ts | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 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 cf99c6e..92342c1 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 @@ -129,7 +129,7 @@ export class ItemLayersComponent extends LayerGroupComponent implements OnChange source: new VectorTileSource({ maxZoom: rt.maxzoom, minZoom: rt.minzoom, - format: new MVT(), + format: new MVT({idProperty:'OBJECTID'}), url: `${this._apiEndPoint}/api/v1/items/${item.code}/vectortiles/{z}/{x}/{y}.pbf?v=${Date.parse(item.updated)}` }), style: (feature) => { @@ -196,7 +196,7 @@ export class ItemLayersComponent extends LayerGroupComponent implements OnChange }); } if(l.minzoom) { - layer.setMinZoom(14); + layer.setMinZoom(l.minzoom); } if(l.maxzoom) { layer.setMaxZoom(l.maxzoom); @@ -218,13 +218,10 @@ export class ItemLayersComponent extends LayerGroupComponent implements OnChange if (feature.getId() in this.selectedFeatures) { return new style.Style( - { - fill: new style.Fill({ - color: 'red' - }), + { stroke: new style.Stroke({ color: 'red', - width: 1.25 + width: 2 }) } ); @@ -392,14 +389,14 @@ export class ItemLayersComponent extends LayerGroupComponent implements OnChange //if(event.type === 'click' && !this.onFeatureSelected.observers.length) return; //if(event.type === 'pointermode' && !this.onFeatureHover.observers.length) return; if(this.itemLayer && this.itemLayer.layer) { - this.itemLayer.layer.getFeatures(event.pixel).then((features) => { - this.selectedFeatures = {}; + this.selectedFeatures = {}; + this.itemLayer.layer.getFeatures(event.pixel).then((features) => { if(!features.length) return; let fid = features[0].getId(); this.selectedFeatures[fid] = features[0]; console.debug(features[0]); - if(this.selectionLayer) this.selectionLayer.changed(); }) + if(this.selectionLayer) this.selectionLayer.changed(); } }