soal / vue-mapbox-geocoder

Wrapper for vue-mapbox-geocoder
13 stars 22 forks source link

No mapboxgl detected in options. Map markers are disabled. Please set options.mapboxgl. #17

Open janyx-cenan opened 4 years ago

janyx-cenan commented 4 years ago

I am a new programmer. Thank you very much for this package.

I have been running into the No mapboxgl detected error and therefore not receiving markers. I tried to pass on the object but still did not work.

I went into the GeocoderControl.js in src and saw that there was no prop to receive the mapboxgl so I added a null object after creating that prop. props: { // Mapbox-geocoder options accessToken: { type: String, required: true }, zoom: { type: Number, default: 16 }, ... // Component options input: { type: String, default: null }, mapboxgl:{ type: Object, default: null }, },

It seems to have worked. Now I can pass the mapboxgl object.

The error is gone but I wonder if I did something terribly wrong.

RonAlmog commented 4 years ago

i believe its a bug. it happens when you do exactly as described here: https://soal.github.io/vue-mapbox/plugin_components/#using-plugin-components a hint on the root cause can be found here: https://github.com/mapbox/mapbox-gl-geocoder/issues/252 but i don't know enough of this family of components to fix that. we'll have to wait for @soal . only he can save us from this ;)