0

After upgrading to OpenLayers 6.6.1 I'm receiving the error

Generic type 'VectorLayer' requires 1 type argument(s)

Generic type 'Feature' requires 1 type argument(s).

On this code...

 import olLayerVector from 'ol/layer/Vector';
 import olFeature from 'ol/Feature';

 public static highlightOverlay: olLayerVector = new olLayerVector({});
 const selectedFeatures: Array<olFeature> = 
 MapValues.highlightOverlay.getSource().getFeatures();

I've looked through https://github.com/openlayers/openlayers/releases and I cannot find reference to this being changed or what it should be changed to?

I have 77 errors to fix and no guide as to how to upgrade? Any help is greatly appreciated.

Funn_Bobby
  • 647
  • 1
  • 20
  • 57
  • Who throws these errors? I suppose this is typescript? Have you tried this: https://www.npmjs.com/package/@types/openlayers – Rob Jul 21 '21 at 14:50
  • So I found this thread from 2019 https://github.com/openlayers/openlayers/issues/8673 essentially it says use // @ts-ignore on typescript errors in OpenLayers...this is not a good solution when typescript is showing 100+ errors... – Funn_Bobby Jul 21 '21 at 16:18
  • yes this was 2019. Maybe the release notes for the Version 6.6.0 help: https://github.com/openlayers/openlayers/releases/ ol now has it's own types, you might need to update your `tsconfig.json` – Rob Jul 21 '21 at 18:45

0 Answers0