Open tedi4t opened 1 year ago
any update of this ?
Has anyone managed to make it work with mapbox-gl-draw v1.4.1 or v1.4.2?
Yeah that got chnaged a while ago you can still access these via the MapboxDraw
import.
import MapboxDraw from '@mapbox/mapbox-gl-draw';
console.log(MapboxDraw.lib);
eg.
The following code would replace the affected imports.
import MapboxDraw from '@mapbox/mapbox-gl-draw';
const Constants = MapboxDraw.constants;
const {
doubleClickZoom,
createSupplementaryPoints,
CommonSelectors,
moveFeatures,
} = MapboxDraw.lib;
...
When
@mapbox/mapbox-gl-draw v1.4.1
builds into the node_modules, there is nosrc
folder (Everything is into thedist
folder). At the same time, there areimport
s in your code from thesrc
folder, so it throws an error if we try to set@mapbox/mapbox-gl-draw
version greater than1.3.0
and install packages. That's because of@mapbox/mapbox-gl-draw
updates. In older version, there was asrc
folder but now they have removed it.