Open
Description
Angular 18 esbuild:
Cannot read properties of undefined (reading 'Event')
Draw is not defined
map.on(Draw.Event.CREATED, (e: any) => LeafletUtil.handleEvent(this.zone, this.onDrawCreated, e));
Fix:
projects/ngx-leaflet-draw/src/lib/core/leaflet-draw.directive.ts
Change imports order:
import { Control, Draw, DrawEvents, drawLocal } from 'leaflet';
import 'leaflet-draw';
To:
import 'leaflet-draw';
import { Control, Draw, DrawEvents, drawLocal } from 'leaflet';
Then Draw will be defined, and it solves the problem.
Metadata
Metadata
Assignees
Labels
No labels