Skip to content

Commit 1b0ba65

Browse files
authored
Development (#19)
* Travis config updated Moved to to node 8.9 * Removes junk * GlMap stop() method now returns Promise * Adding docsify-managed documentation (#13) * Documentation updated * Readme and webpack config update * Readme updated * Added standart 'added' event for all components * Updated documenation about component composition * 0.0.12 * Minor fixes * Fixed misspelling * Fixes map breaking on mapbox 0.44 * Version bump * 0.0.14 * New build * new build
1 parent 0c00bc5 commit 1b0ba65

21 files changed

+170
-902
lines changed

.eslintrc.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ module.exports = {
2121
"rules": {
2222
"jsx-quotes": 1,
2323
"no-debugger": process.env.NODE_ENV === "production" ? 2 : 1,
24-
"camelcase": 0,
2524
"comma-dangle": [2, "never"],
2625
"complexity": 2,
2726
"space-before-function-paren": [0, "never"],

dist/vue-mapbox.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vue-mapbox.min.js.gz

83 Bytes
Binary file not shown.

docs/composition.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export default {
8080
}
8181
```
8282

83-
Vue-mapbox component will work even if it wrapped in another component as long they in components sub-tree of base map component.
83+
Vue-mapbox component will work even if it wrapped in another component as long as they in components sub-tree of base map component.
8484

8585
For example:
8686

@@ -141,4 +141,4 @@ export default {
141141
}
142142
```
143143

144-
After successful mount all components emits 'added' envent with map object, Vue component object and additional data, such as corresponding Mapbox GL JS object or obhect contining layer id in payload.
144+
After successful mount all components emits 'added' envent with map object, Vue component object and additional data, such as corresponding Mapbox GL JS object or object containing layer id in payload.

docs/controls.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# Map controls
22
## Overview
3-
Controls is UI elemtns for controling view of the map, such as scale or bearing.
3+
Controls is UI elemetns for controling view of the map, such as scale or bearing.
44
You can check them out in Mapbox GL JS [documentation](https://www.mapbox.com/mapbox-gl-js/api/#user%20interface)
55
In Vue-mapbox they exposed as Vue components, so you can control they properties and behavior dynamically by changing props.
66
See list of controls and they properties in [API docs](api/controls.md)
77
<!-- If you just want add controls with default parameters on map initialization you can set corresponfing prop on GlMap.
88
Take note that you should not use MglMap prop and control component simultaniesly. For exmaple, you should use `<mgl-map> -->
99

1010
### Attribution control
11+
Due to Mapbox [policy](https://www.mapbox.com/help/how-attribution-works/) attribution control is enabled by default. Yo can disable default attributions by setting `attributionControl` prop of MglMap to `false` and set your own attribution using AttributionControl component.

docs/introduction.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/layers_and_sources.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,49 @@
11
# Layers and sources
2+
Geographic features on the map draws as layers. Every layer must have a source which contains data for layer (for exmaple, GeoJSON object). You can read more about sources in Mapbox GL JS [documentation](https://www.mapbox.com/mapbox-gl-js/api/#sources).
3+
4+
Vue-mapbox exposes layers as Vue components and source passed to layer as prop. There is several layers types for drawning different types of sources.
5+
For example adding a layer with GeoJSON data:
6+
7+
```html
8+
<template>
9+
<mgl-map
10+
:accessToken="accessToken"
11+
:mapStyle.sync="mapStyle"
12+
>
13+
<mgl-navigation-contol position="top-right"/> <!-- Adding navigation control-->
14+
<mgl-geojson-layer
15+
:type="fill"
16+
:layerId="geoJsonSource.properties.id"
17+
:source.sync="geoJsonSource"
18+
>
19+
</mgl-geojson-layer>
20+
21+
</mgl-map>
22+
</template>
23+
```
24+
25+
```javascript
26+
import {
27+
MglMap,
28+
MglNavigationControl,
29+
MglGeojsonLayer
30+
} from 'vue-mapbox'
31+
32+
export default {
33+
components: {
34+
MglMap,
35+
MglNavigationControl,
36+
MglGeolocateControl,
37+
MglGeojsonLayer
38+
},
39+
data() {
40+
return {
41+
accessToken: 'some_token',
42+
mapStyle: 'style_object',
43+
geoJsonSource: {
44+
//...some GeoJSON object
45+
}
46+
}
47+
}
48+
}
49+
```

0 commit comments

Comments
 (0)