Closed whittakergroupinc closed 6 years ago
NVM! I figured it out...
npm install @mapbox/mapbox-gl-draw --save if using webpack add to webpack.config: node: { fs: "empty" }
Then import Mapbox from 'mapbox-gl-vue'; import MapboxDraw from '@mapbox/mapbox-gl-draw'
const app = new Vue({ el: '#app', components: { Mapbox }, methods: { mapInitialized(map) { const Draw = new MapboxDraw();
map.addControl(Draw);
}
} });
Im getting 'MapboxDraw' is not defined when using the code snippet provided. Any ideas where I may be going wrong?
`import Mapbox from 'mapbox-gl-vue'; const app = new Vue({ el: '#app', components: { Mapbox }, methods: { mapInitialized(map) { const Draw = new MapboxDraw();
} });`