Skip to content

Commit abcffcc

Browse files
Merge pull request #79 from geospoc/fix/no-mapbox-gl-detected-issue
2 parents 108b1df + 63b0d9d commit abcffcc

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff 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: {

src/GeocoderControl.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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);

0 commit comments

Comments
 (0)