Skip to content

Commit 7223045

Browse files
author
Peter Hegman
committed
Adjust README formatting and add demo link
1 parent 559d80a commit 7223045

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

README.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

33
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.
44

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+
514
## Installation
615

716
### Yarn
@@ -62,15 +71,7 @@ module.exports = {
6271
}
6372
```
6473

65-
## Usage
66-
67-
- [Setup](#setup)
68-
- [Props](#props)
69-
- [Events](#map-events)
70-
- [Plugins](#plugins)
71-
- [Popups](#popups)
72-
73-
### Setup
74+
## Setup
7475

7576
In the file you will be including the component:
7677

@@ -114,7 +115,7 @@ CSS needs to be added for the map to show up. The `#map` container needs a heigh
114115
</style>
115116
```
116117

117-
### Props
118+
## Props
118119

119120
Vue.js Documentation [https://vuejs.org/v2/guide/components.html#Props](https://vuejs.org/v2/guide/components.html#Props)
120121

@@ -208,7 +209,7 @@ More information about full screen control here: [https://docs.mapbox.com/mapbox
208209
</template>
209210
```
210211

211-
### Map Events
212+
## Map Events
212213

213214
`@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/).
214215

@@ -218,7 +219,7 @@ Map events can be used by adding the `@map-` prefix to the beginning of the Mapb
218219

219220
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`
220221

221-
### Geolocation Events
222+
## Geolocation Events
222223

223224
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)
224225

@@ -325,7 +326,7 @@ export default {
325326
</style>
326327
```
327328

328-
### Plugins
329+
## Plugins
329330

330331
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:
331332

@@ -378,7 +379,7 @@ export default {
378379
</style>
379380
```
380381

381-
### Popups
382+
## Popups
382383

383384
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.
384385

0 commit comments

Comments
 (0)