drykovanov / mapbox-gl-draw-rotate-scale-rect-mode

MIT License
25 stars 17 forks source link

Doesn't work with @mapbox/mapbox-gl-draw v1.4.1 #39

Open tedi4t opened 1 year ago

tedi4t commented 1 year ago

When @mapbox/mapbox-gl-draw v1.4.1 builds into the node_modules, there is no src folder (Everything is into the dist folder). At the same time, there are imports in your code from the src folder, so it throws an error if we try to set @mapbox/mapbox-gl-draw version greater than 1.3.0 and install packages. That's because of @mapbox/mapbox-gl-draw updates. In older version, there was a src folder but now they have removed it.

mfnash commented 1 year ago

any update of this ?

ghost commented 1 year ago

Has anyone managed to make it work with mapbox-gl-draw v1.4.1 or v1.4.2?

joseph-sm commented 8 months ago

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);
image

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;

...