diff --git a/src/my-map.ts b/src/my-map.ts index ef249d7..f9b0920 100644 --- a/src/my-map.ts +++ b/src/my-map.ts @@ -138,7 +138,7 @@ export class MyMap extends LitElement { if (this.showFeaturesAtPoint) { const extent = featureSource.getExtent(); map.getView().fit(buffer(extent, this.featureBuffer)); - } else if (this.geojsonData.features.length > 0) { + } else if (outlineSource.getFeatures().length > 0) { const extent = outlineSource.getExtent(); map.getView().fit(buffer(extent, this.geojsonBuffer)); } else {