These are my packages:
"@types/leaflet": "^1.8.0",
"@types/leaflet-draw": "^1.0.5",
"leaflet-canvas-markers": "^1.0.7",
"leaflet": "^1.9.1",
"leaflet-draw": "^1.0.4",
These are my imports a the top of my Angular service file:
import * as L from 'leaflet';
import 'leaflet-canvas-markers';
import 'leaflet-draw';
In Angular 13 (Typescript 4.6.4) it was ok, but now I'm moving to Angular 14 (Typescript 4.7.4) and I'm getting this error:
Error: export 'Draw' (imported as 'L') was not found in 'leaflet' (possible exports: ...)
I've got the same behavior with "canvasMarker" npm library.
Error: export 'canvasMarker' (imported as 'L') was not found in 'leaflet' (possible exports: ...)
The code that raise the error within my Angular service is:
const leafletDrawPolyline = new L.Draw.Polyline(map, options);
After reading this, I tried in the following without success:
const leafletDrawPolyline = new (L.Draw as any).Polyline(map, options);
I understand it's a kind of import issue at Typescript level, but I don't know how to solve. Any suggestion?