You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+15-14Lines changed: 15 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,15 @@
2
2
3
3
A simple lightweight (9kb/3kb gzipped) Mapbox GL JS Vue component. Great for quick prototyping or smaller projects. For larger projects [VueMapbox](https://soal.github.io/vue-mapbox/) may be a better fit.
4
4
5
+
## [Demo](https://vue-mapbox-gl.peterhegman.com)
6
+
7
+
-[Installation](#installation)
8
+
-[Setup](#setup)
9
+
-[Props](#props)
10
+
-[Events](#map-events)
11
+
-[Plugins](#plugins)
12
+
-[Popups](#popups)
13
+
5
14
## Installation
6
15
7
16
### Yarn
@@ -62,15 +71,7 @@ module.exports = {
62
71
}
63
72
```
64
73
65
-
## Usage
66
-
67
-
-[Setup](#setup)
68
-
-[Props](#props)
69
-
-[Events](#map-events)
70
-
-[Plugins](#plugins)
71
-
-[Popups](#popups)
72
-
73
-
### Setup
74
+
## Setup
74
75
75
76
In the file you will be including the component:
76
77
@@ -114,7 +115,7 @@ CSS needs to be added for the map to show up. The `#map` container needs a heigh
@@ -208,7 +209,7 @@ More information about full screen control here: [https://docs.mapbox.com/mapbox
208
209
</template>
209
210
```
210
211
211
-
###Map Events
212
+
## Map Events
212
213
213
214
`@map-init` : This event is fired when the map is initialized. It can be used to integrate [plugins](https://docs.mapbox.com/mapbox-gl-js/plugins/).
214
215
@@ -218,7 +219,7 @@ Map events can be used by adding the `@map-` prefix to the beginning of the Mapb
218
219
219
220
For events that support specifying a `layerId` as documented here [https://docs.mapbox.com/mapbox-gl-js/api/#map#on](https://docs.mapbox.com/mapbox-gl-js/api/#map#on) the `layerId` can be specified by using a colon to separate the event from the `layerId`. For example if you have a layer with an id of `points` the `click` event can be registered like so: `@map-click:points`
220
221
221
-
###Geolocation Events
222
+
## Geolocation Events
222
223
223
224
Geolocation events are available for use by adding the `@geolocate-` prefix to the beginning of the Mapbox event name. A list of Geolocation events can be found here: [https://docs.mapbox.com/mapbox-gl-js/api/#geolocatecontrol.event:geolocate](https://docs.mapbox.com/mapbox-gl-js/api/#geolocatecontrol.event:geolocate)
224
225
@@ -325,7 +326,7 @@ export default {
325
326
</style>
326
327
```
327
328
328
-
###Plugins
329
+
## Plugins
329
330
330
331
Plugins ([https://www.mapbox.com/mapbox-gl-js/plugins/](https://www.mapbox.com/mapbox-gl-js/plugins/)) can be integrated using the `map-init` event that is fired when Mapbox is initialized. Below is an example:
331
332
@@ -378,7 +379,7 @@ export default {
378
379
</style>
379
380
```
380
381
381
-
###Popups
382
+
## Popups
382
383
383
384
Popups can be a bit tricky if you are trying to use Vue directives inside the popup content. This is because the popups are added to the DOM by Mapbox and not compiled by Vue. See below for one approach to solving this problem.
0 commit comments