Namespace leaflet.Draw has no exported member 'Control'
tmpacifitech opened this issue · 2 comments
tmpacifitech commented
<div
leaflet
leafletDraw
[leafletOptions]="options"
(leafletMapReady)="onMapReady($event)"
(leafletDrawCreated)="onMapDrawCreated($event)"
class="map h-100"></div>
onMapDrawCreated(drawControl: Draw.Control) {
console.log('add layer');
}
Here Draw.Control not found
reblace commented
This will depend on how you imported the leaflet-draw plugin. If you did something like:
import * as L from 'leaflet';
import 'leaflet-draw';
Then, you'd reference it as L.Draw.Control
.
benboughton1 commented
Or try
import {
...
Draw,
Control,
DrawEvents
} from 'leaflet';
onMapDrawCreated(drawControl: Control.Draw) {
console.log('add layer');
}