Skip to content

Commit 1a5a5ff

Browse files
Merge pull request #81 from geospoc/fix/use-updated-mapbox-gl
fix: use injected mapbox or props mapbox-gl object
2 parents 9eee96a + 0ff46f0 commit 1a5a5ff

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/GeocoderControl.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ export default {
4040
},
4141
mapboxgl: {
4242
type: Object,
43-
required: true,
4443
default: null,
4544
},
4645
},
@@ -68,16 +67,19 @@ export default {
6867
},
6968

7069
created() {
70+
let mapboxgl = this.mapbox;
7171
this.control = null;
7272
if (this.accessToken && !this.mapbox.accessToken) {
7373
this.mapbox.accessToken = this.accessToken;
7474
}
75-
75+
if (this.mapboxgl) {
76+
mapboxgl = this.mapboxgl;
77+
}
7678
this.control = new MapboxGeocoder({
7779
...this.$attrs,
7880
proximity: this.proximity,
7981
accessToken: this.accessToken,
80-
mapboxgl: this.mapboxgl,
82+
mapboxgl,
8183
});
8284

8385
this.control.on('results', this.$_updateInput);

0 commit comments

Comments
 (0)