I want to add the mapbox geocoding feature to my web app but when I try to initialize it the error comes in.
I've tried searching almost on every library inside the node_modules/mapbox-gl-geocoder for some constructor or something to see if I'm importing the wrong library but no success, If tried reading in the documentation but nothing either.
import { MapboxGeocoder } from "mapbox-gl-geocoder";
.
.
.
this.map.addControl(new MapboxGeocoder({
accessToken: mapboxgl.accessToken
}));
import * as MapboxGeocoder from '@mapbox/mapbox-gl-geocoder';
Solved the problem by replacing the current import with the one above.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With