elfalem / Leaflet.curve

A Leaflet plugin for drawing Bézier curves and other complex shapes.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using this plugin with angular doesn't draw curves

benb545 opened this issue · comments

Hello,

First of all awesome plugins, I can see by the demo and it is exactly what I need.
However, I can't get it to work with Angular 10.

I am using the following packages:

"@asymmetrik/ngx-leaflet": "^13.0.0",
"@elfalem/leaflet-curve": "^0.9.2",
"leaflet": "^1.9.3",

I use @asymmetrik/ngx-leaflet for the types.

I get the following error after importing import '@elfalem/leaflet-curve';:

Invalid module name in augmentation. Module 'leaflet' resolves to an untyped module at '/node_modules/leaflet/dist/leaflet-src.js', which cannot be augmented.

When I added the following to tsconfig compilerOptions:

"skipLibCheck": true

It didn't show the error, however, it did not render any curves I added from the demos.

Any idea how can I get this to work?
Thanks a lot.

Fixed.

First of all, I need to keep this in tsconfig:

"skipLibCheck": true

Otherwise I can't use it, no idea how to fix, probably something to do with typescript types.

As for why it was not rendering, I tried to render the curves before the geoJSON map initialized, I had to do setTimeout and do it on the next frame.