Open csimpi opened 4 years ago
What does your import
look like?
With 1.2.0 I see they switched to ES6 style modules. I believe the following
import * as MapboxDraw from '@mapbox/mapbox-gl-draw';
should be changed to
import MapboxDraw from '@mapbox/mapbox-gl-draw';
However matters may be more complicated if you rolled your own type definitions. I haven't figured that out yet.
@jfoshee Thank you!
I don't even remember what was this. I guess I've solved it on my own. Mapbox support is super bad, unfortunately. They are not lazy only when they're sending the USD 2000 invoice per month :) I have never got proper support to my issues not here, not at the official support.
Try With this--->>>
import as mapboxgl from 'mapbox-gl'; import as MapboxDraw from "@mapbox/mapbox-gl-draw";
this.mapDraw = new MapboxDraw.default({
displayControlsDefault: false,
controls: {
polygon: false,
line_string: false,
point: true,
trash: true
},
defaultMode: 'draw_point'
});
It will work definately..For me working with angular 15.... By using '.default'
mapbox-gl-js version: 1.12.0 mapbox-gl-draw version: 1.2.0
Framework: Angular 9
Steps to Trigger Behavior
Expected Behavior
Loads and works
Actual Behavior
I'm getting several error messages and it doesn't even load at all.
I saw some suggestions to change angular.json file or using old versions but those feel very ugly workarounds for me.