AW-6046 Fix open layers 8 issues
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good

This commit is contained in:
2024-04-09 15:50:03 +02:00
parent 023048a5bb
commit 97d6d569a0
4 changed files with 8 additions and 6 deletions

View File

@@ -19,6 +19,7 @@ import VectorTileLayer from 'ol/layer/VectorTile';
import {GeoJSON,MVT} from 'ol/format';
import { Geometry } from 'ol/geom';
import BaseLayer from 'ol/layer/Base';
import Feature from 'ol/Feature';
@Component({
selector: 'fm-map-item-layers',
@@ -180,9 +181,9 @@ export class ItemLayersComponent extends LayerGroupComponent implements OnChange
const source = new VectorSource({
strategy: loadingstrategy.bbox,
loader: function (extent: Extent, resolution: number, projection: Projection) {
const source = this as VectorSource<Geometry>;
const source = this as VectorSource<Feature<Geometry>>;
__this.itemService.getItemFeatures(item.code, extent, projection.getCode(), layerIndex).subscribe(function (data) {
const features = format.readFeatures(data);
const features = format.readFeatures(data).filter(feature => feature instanceof Feature) as Feature[];
for (const f of features) {
if (f.get("code")) {
f.setId(f.get("code"));