title: OpenLayers/Angular . In the my map i am trying to change the style when i click on a Feature. How do i change the style of the Vector
body: <p>Here create my Feature:</p>
  <p>Typescript--</p>
  <pre><code>  addScanLayer(data: [number, number][][]) {
          let id = 1
          for (let scan of data) {
            let multigon = new MultiPolygon([[scan]]) // Does there exist a better way than saying [[data]]?
            let scanFeature = new Feature({ geometry: multigon, id: id })
            let scanLayer = new Vector({
              source: new VectorSource({ features: [scanFeature] }),
              style: this.scanLayerStyle
      
            })
            this.Map.addLayer(scanLayer)
            id++;
          }
        }
  </code></pre>
  <p>As you can see I apply a style to the new Vector. I use a for loop to draw my shapes.</p>
  <p>Then I use event to get data for click:</p>
  <p>HTML--</p>
  <pre><code>&lt;div (click)=&quot;getCoord($event)&quot; class=&quot;map-container&quot; id=&quot;map&quot;&gt;&lt;/div&gt;
  </code></pre>
  <p>Typescript--</p>
  <pre><code>  getCoord(event: any){
     this.Map.forEachFeatureAtPixel(this.Map.getEventPixel(event), (data, rem) =&gt; {
       var getId = data.getProperties()
       if(getId.id){
       this._passDataTimelineToZgsMapsService.sendDataIndex(getId.id)
      }
      })
   }
  </code></pre>
  <p>Now in the documentation it gives a example: <a href="https://openlayers.org/en/latest/examples/select-hover-features.html" rel="nofollow noreferrer">https://openlayers.org/en/latest/examples/select-hover-features.html</a></p>
  <p>The Example:</p>
  <p>Javascript--</p>
  <pre><code>let selected = null;
  map.on('pointermove', function (e) {
    if (selected !== null) {
      selected.setStyle(undefined);
      selected = null;
    }
  
    map.forEachFeatureAtPixel(e.pixel, function (f) {
      selected = f;
      selectStyle.getFill().setColor(f.get('COLOR') || '#eeeeee');
      f.setStyle(selectStyle);
      return true;
    });
  
    if (selected) {
      status.innerHTML = selected.get('ECO_NAME');
    } else {
      status.innerHTML = '&amp;nbsp;';
    }
  });
  </code></pre>
  <p>but when I do it I get error</p>
  <p>typescript--</p>
  <pre><code> getCoord(event: any){
     this.Map.forEachFeatureAtPixel(this.Map.getEventPixel(event), (data, rem) =&gt; {
       var getId = data.getProperties()
       data.setStyle(this.scanLayerStyleSelected)
       if(getId.id){
       this._passDataTimelineToZgsMapsService.sendDataIndex(getId.id)
      }
      })
   }
  </code></pre>
  <p>The error:</p>
  <pre><code>Property 'setStyle' does not exist on type 'RenderFeature | Feature&lt;Geometry&gt;'.
    Property 'setStyle' does not exist on type 'RenderFeature'.ts(2339)
  </code></pre>
  <p>So how do I change a specific vector style ?</p>