title: Openlayers how to zoom to wkt layer automatically in angular
body: <p>Im trying to follow along with this sort of idea <a href="https://openlayers.org/en/latest/examples/center.html" rel="nofollow noreferrer">https://openlayers.org/en/latest/examples/center.html</a> where I have a wkt feature created in this code</p>
  <pre><code>this.wkt = this.city.CityWKT;
  
  var wktFormat = new WKT();
  
  var wktFeature = wktFormat.readFeature(this.wkt, {
    dataProjection: 'EPSG:4326',
    featureProjection: 'EPSG:3857',
  }); 
  
  var wktLayer = new VectorLayer({
    source: new VectorSource({
      features: [wktFeature],
    })
  })
  </code></pre>
  <p>so I tried to set the map view to fit to it like such</p>
  <pre><code>const geometry = wktFeature.getGeometry();
  
  this.map.getView().fit(geometry, this.map.getSize());
  </code></pre>
  <p>but I get the following error on trying to pass geometry into .fit()</p>
  <p>Argument of type 'Geometry | undefined' is not assignable to parameter of type 'Extent | SimpleGeometry'.</p>
  <p>How can I resolve this? its so I can use this map multiple times and just pass in the wkt I want and for it to zoom to it.</p>