elfalem / Leaflet.curve

A Leaflet plugin for drawing Bézier curves and other complex shapes.
Other
218 stars 52 forks source link

Using this plugin with angular doesn't draw curves #66

Closed benb545 closed 1 year ago

benb545 commented 1 year ago

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.

benb545 commented 1 year ago

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.