ngx-leaflet-tutorial-plugins icon indicating copy to clipboard operation
ngx-leaflet-tutorial-plugins copied to clipboard

" Import * as L from 'leaflet' " in typings.d.ts

Open Alexsius-t opened this issue 6 years ago • 1 comments

I've found a solution to this problem but i'm curious to know if anyone had the same situation. I tried to integrate leaflet-geoman with ngx-leaflet, i readed your guide and i added the import * as L from 'leaflet' into the src\typings.d.ts file and at first it worked. Then i had to reset my pc, and after that i had an error. error TS2304: Cannot find name 'tinymce'. I did some investigations and i found out typings.d.ts file was meant to be a global declaration file, but the import prevented this thing.

As i write this i found a workaround but the problem is still there. Anyone had the same problem?

Alexsius-t avatar Oct 22 '19 16:10 Alexsius-t

tinymce is an editor package that you were importing. I'm not sure I think that leaflet imports and tinymce are related.

The reason you would 'import * as L from 'leaflet' into the typings.d.ts file is so that you can reference the 'L' namespace in subsequent type definitions. You could alternatively do named imports (e.g., 'import { map } from 'leaflet';')

reblace avatar Nov 05 '19 14:11 reblace