相关文章推荐
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

open layers & typescript : Type error: Generic type 'MapBrowserEvent<EVENT>' requires 1 type argument(s)

Ask Question

trying to add an on click handler : function OnMapClick(Event : MapBrowserEvent )

typescript complains with : Type error: Generic type 'MapBrowserEvent' requires 1 type argument(s).

Can anyone help with this? thank you mmomtchev, Can you please also share how you reached this solution ? ( how can I figure this out myself next time I encounter a similar problem?) omer brandis Feb 5 at 9:48 The error message is very explicit: MapBrowserEvent is a generic type and requires one type argument mmomtchev Feb 5 at 17:41 I'll rephrase my question, how did you know which type ("UIEvent") needs to be supplied as a parameter? omer brandis Feb 6 at 11:06 Indeed, it is not documented anywhere. You can probably bug the Openlayers team to explicitly state it somewhere. The type is the type of the original browser event which happens to be UIEvent . mmomtchev Feb 6 at 14:28

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question . Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers .

 
推荐文章