Property 'utm' does not exist on type 'typeof

Asked

Viewed 69 times

1

Greetings,

I am beginner in both Angular and Typescript I come from java. I’m doing the front-end of a project using Angular 10, in it use leaflet to display maps but a need to install dependency has arisen (leaflet.utm), but I have no idea how to distinguish the "L" from the two libraries (leaflet and leatlet.utm).

installation of the module:

>  npm i [email protected]

my import

...
import * as L from 'leaflet';
...

Code line I intend to use

var item = L.utm({x: 467486.3, y: 4101149.3, zone: 30, band: 'S'});

I have the exception

> Property 'utm' does not exist on type 'typeof import("../node_modules/@types/leaflet/index")'.ts(2339)

  • 1

    You have installed the types of this plugin utm? npm install --save @types/leaflet.utm

  • Thanks brother, it worked. you deserve a statue.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.