Some fixes
This commit is contained in:
parent
1a1cd7a81c
commit
80fec7ccaa
@ -129,7 +129,7 @@ export class ItemLayersComponent extends LayerGroupComponent implements OnChange
|
|||||||
source: new VectorTileSource({
|
source: new VectorTileSource({
|
||||||
maxZoom: rt.maxzoom,
|
maxZoom: rt.maxzoom,
|
||||||
minZoom: rt.minzoom,
|
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)}`
|
url: `${this._apiEndPoint}/api/v1/items/${item.code}/vectortiles/{z}/{x}/{y}.pbf?v=${Date.parse(item.updated)}`
|
||||||
}),
|
}),
|
||||||
style: (feature) => {
|
style: (feature) => {
|
||||||
@ -196,7 +196,7 @@ export class ItemLayersComponent extends LayerGroupComponent implements OnChange
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
if(l.minzoom) {
|
if(l.minzoom) {
|
||||||
layer.setMinZoom(14);
|
layer.setMinZoom(l.minzoom);
|
||||||
}
|
}
|
||||||
if(l.maxzoom) {
|
if(l.maxzoom) {
|
||||||
layer.setMaxZoom(l.maxzoom);
|
layer.setMaxZoom(l.maxzoom);
|
||||||
@ -219,12 +219,9 @@ export class ItemLayersComponent extends LayerGroupComponent implements OnChange
|
|||||||
|
|
||||||
return new style.Style(
|
return new style.Style(
|
||||||
{
|
{
|
||||||
fill: new style.Fill({
|
|
||||||
color: 'red'
|
|
||||||
}),
|
|
||||||
stroke: new style.Stroke({
|
stroke: new style.Stroke({
|
||||||
color: 'red',
|
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 === 'click' && !this.onFeatureSelected.observers.length) return;
|
||||||
//if(event.type === 'pointermode' && !this.onFeatureHover.observers.length) return;
|
//if(event.type === 'pointermode' && !this.onFeatureHover.observers.length) return;
|
||||||
if(this.itemLayer && this.itemLayer.layer) {
|
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;
|
if(!features.length) return;
|
||||||
let fid = features[0].getId();
|
let fid = features[0].getId();
|
||||||
this.selectedFeatures[fid] = features[0];
|
this.selectedFeatures[fid] = features[0];
|
||||||
console.debug(features[0]);
|
console.debug(features[0]);
|
||||||
if(this.selectionLayer) this.selectionLayer.changed();
|
|
||||||
})
|
})
|
||||||
|
if(this.selectionLayer) this.selectionLayer.changed();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user