I'm getting some problems using openlayers with TypeScript, there are some errors in the .on use, can you help me giving some tips?

Argument of type '(event: Event) => void' is not assignable to parameter of type 'EventsListenerFunctionType'.
Type '(event: Event) => void' is not assignable to type '(evt: Event) => boolean'.
 Types of parameters 'event' and 'evt' are incompatible.
  Type 'ol.events.Event' is not assignable to type 'ol.render.Event'.
    Property 'vectorContext' is missing in type 'Event'.

PS: I need to use the event.context but the function() only receives l.events.Event type.

My Component

 this.imagery.on("precompose", (event: ol.render.Event) => {});

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.