File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ Now you can add geocoder control like other controls:
2424 <MglGeocoderControl
2525 :accessToken =" accessToken"
2626 :input.sync =" defaultInput"
27+ :mapboxgl =" mapbox"
2728 container =" geocoder_container_id"
2829 position =" top-left"
2930 @results =" handleSearch"
@@ -32,6 +33,7 @@ Now you can add geocoder control like other controls:
3233</template >
3334
3435<script >
36+ import mapboxgl from ' mapbox-gl' ;
3537 import { MglMap } from ' v-mapbox' ;
3638 import MglGeocoderControl from ' @geospoc/v-mapbox-geocoder' ;
3739 // you can also import this in your main.js or nuxt.config.js
@@ -48,7 +50,8 @@ Now you can add geocoder control like other controls:
4850 return {
4951 accessToken: ' YOUR_ACCESS_TOKEN' ,
5052 mapStyle: ' YOUR_MAP_STYLE' ,
51- defaultInput: ' Bodhgaya'
53+ defaultInput: ' Bodhgaya' ,
54+ mapbox: mapboxgl,
5255 }
5356 },
5457 methods: {
Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ export default {
4040 } ,
4141 mapboxgl : {
4242 type : Object ,
43+ required : true ,
4344 default : null ,
4445 } ,
4546 } ,
@@ -76,6 +77,7 @@ export default {
7677 ...this . $attrs ,
7778 proximity : this . proximity ,
7879 accessToken : this . accessToken ,
80+ mapboxgl : this . mapboxgl ,
7981 } ) ;
8082
8183 this . control . on ( 'results' , this . $_updateInput ) ;
You can’t perform that action at this time.
0 commit comments