File tree Expand file tree Collapse file tree 1 file changed +5
-24
lines changed Expand file tree Collapse file tree 1 file changed +5
-24
lines changed Original file line number Diff line number Diff line change @@ -9,43 +9,24 @@ First of all you need to install Mapbox GL and Vue-mapbox. [See vue-mapbox doc](
99Install mabbox-gl-geocoder and vue-mapbox-geocoder:
1010
1111``` bash
12- npm i @mapbox/mapbox-gl-geocoder vue-mapbox-geocoder
13- ```
14-
15- Then, on plugin registration you need to add plugins option:
16-
17- ``` javascript
18- import Vue from ' vue'
19- import VueMapbox from ' vue-mapbox'
20- import Mapbox from ' mapbox-gl'
21- import MapboxGeocoder from ' @mapbox/mapbox-gl-geocoder'
22-
23- Vue .use (VueMapbox, {
24- mapboxgl: Mapbox,
25- plugins: [{ mapboxGeocoder: MapboxGeocoder }] // Notice plugins property
26- })
27-
28- new Vue ({
29- el: ' #app' ,
30- render : h => h (require (' ./App' ))
31- })
12+ npm i @mapbox/mapbox-gl-geocoder vue-mapbox vue-mapbox-geocoder
3213```
3314
3415Now you can add geocoder control like other controls:
3516
3617``` vue
3718<template>
38- <mgl-map
19+ <MglMap
3920 :accessToken="accessToken"
40- :mapStyle.sync ="mapStyle"
21+ :mapStyle="mapStyle"
4122 >
42- <mgl-geocoder-control
23+ <MglGeocoderControl
4324 <-- props needed for GeolocateControl -->
4425 :accessToken="accessToken"
4526 :input.sync="defaultInput"
4627 @results="handleSearch"
4728 />
48- </mgl-map >
29+ </MglMap >
4930</template>
5031
5132<script>
You can’t perform that action at this time.
0 commit comments