soal / vue-mapbox-geocoder

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

Attaching to an external DOM #1

Closed system123 closed 6 years ago

system123 commented 6 years ago

How can I attach this to an external DOM element? My search bar is located outside of my map, and I would like the geocoder to do the same. So far I have tried the following:

Searchbar.vue

But I get the following error when calling the query() method:

[Vue warn]: Error in callback for watcher "defaultInput": "TypeError: this._loadingEl is undefined"

found in

---> at src/components/Searchbar.vue

at src/App.vue vue.esm.js:591 TypeError: this._loadingEl is undefined Stack trace: _geocode@webpack-internal:///./node_modules/@mapbox/mapbox-gl-geocoder/lib/index.js:167:5 query@webpack-internal:///./node_modules/@mapbox/mapbox-gl-geocoder/lib/index.js:264:5 defaultInput@webpack-internal:///./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/components/Searchbar.vue:46:25 run@webpack-internal:///./node_modules/vue/dist/vue.esm.js:3232:11 flushSchedulerQueue@webpack-internal:///./node_modules/vue/dist/vue.esm.js:2980:5 nextTick/<@webpack-internal:///./node_modules/vue/dist/vue.esm.js:1836:9 flushCallbacks@webpack-internal:///./node_modules/vue/dist/vue.esm.js:1757:5
system123 commented 6 years ago

I implemented a stand-alone geocoder for this.

petemolinero commented 5 years ago

@system123 How did you end up doing this? I'd like to do a standalone geocoder as well, without the map.