Skip to content

Commit dc4ff34

Browse files
committed
add vitepress
1 parent 2e6280a commit dc4ff34

20 files changed

+1116
-7991
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,6 @@ vue-mapbox-demo
5252
checklist.txt
5353
.flowconfig
5454
docs_source/.vuepress/dist
55+
56+
docs/.vitepress/dist
57+
docs/.vitepress/cache

.postcssrc.js

-5
This file was deleted.

docs/.vitepress/config.mjs

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import { defineConfig } from 'vitepress'
2+
3+
// https://vitepress.dev/reference/site-config
4+
export default defineConfig({
5+
title: "VueMapbox 3",
6+
description: "A Vue3 mapbox wrapper",
7+
base:"/vue-mapbox/",
8+
themeConfig: {
9+
// https://vitepress.dev/reference/default-theme-config
10+
nav: [
11+
{ text: 'Home', link: '/' },
12+
{ text: 'Guide', link: '/guide/README' },
13+
{ text: 'API', link: '/api/README' },
14+
],
15+
16+
sidebar: [
17+
{
18+
text: 'Guide',
19+
items: [
20+
{ text: 'Quickstart', link: '/guide/README' },
21+
{ text: 'Base map', link: '/guide/basemap' },
22+
{ text: 'Composition', link: '/guide/composition' },
23+
{ text: 'Controls', link: '/guide/controls' },
24+
{ text: 'Markers and popups', link: '/guide/markers&popups' },
25+
{ text: 'Layers and sources', link: '/guide/layers&sources' }
26+
]
27+
},
28+
{
29+
text: 'API',
30+
items: [
31+
{ text: 'GlMap', link: '/api/README' },
32+
{ text: 'Controls', link: '/api/controls' },
33+
{ text: 'MapMarker', link: '/api/marker' },
34+
{ text: 'Popup', link: '/api/popup' },
35+
{ text: 'Layer commons', link: '/api/Layers/README' },
36+
{ text: 'Geojson Layer', link: '/api/Layers/geojsonlayer' },
37+
{ text: 'Vector Layer', link: '/api/Layers/vectorlayer' },
38+
{ text: 'Raster Layer', link: '/api/Layers/rasterlayer' },
39+
{ text: 'Image Layer', link: '/api/Layers/imagelayer' },
40+
{ text: 'Video Layer', link: '/api/Layers/videolayer' },
41+
{ text: 'Canvas Layer', link: '/api/Layers/canvaslayer' },
42+
]
43+
},
44+
{
45+
text: 'Plugin components',
46+
items: [
47+
{ text: 'Using plugin components', link: '/plugin_components/README' },
48+
{ text: 'Create a plugin component', link: '/plugin_components/plugin_components_development' },
49+
50+
]
51+
}
52+
],
53+
54+
socialLinks: [
55+
{ icon: 'github', link: 'https://github.com/systragroup/vue-mapbox' }
56+
],
57+
footer:{message: 'Released under the MIT License.'}
58+
}
59+
})

docs/.vuepress/config.js

-77
This file was deleted.

docs/.vuepress/public/favicon.ico

-14.7 KB
Binary file not shown.

docs/README.md

-76
This file was deleted.

docs/api/Layers/canvaslayer.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ All common [layers props](/api/Layers/README.md#props)
1111

1212
## Events
1313

14-
All common layer [events](/api/Layers/#events)
14+
All common layer [events](/api/Layers/README.md#events)

docs/api/Layers/geojsonlayer.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,4 @@ All common [layers props](/api/Layers/README.md#props)
8080

8181
## Events
8282

83-
All common layer [events](/api/Layers/#events)
83+
All common layer [events](/api/Layers/README.md#events)

docs/api/Layers/imagelayer.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# ImageLayer
2-
32
## Props
43

54
All common [layers props](/api/Layers/README.md#props)
@@ -18,4 +17,4 @@ If you change their value, changes automatically applied to the map.
1817

1918
## Events
2019

21-
All common layer [events](/api/Layers/#events)
20+
All common layer [events](/api/Layers/README.md#events)

docs/api/Layers/rasterlayer.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ All common [layers props](/api/Layers/README.md#props)
1313

1414
## Events
1515

16-
All common layer [events](/api/Layers/#events)
16+
All common layer [events](/api/Layers/README.md#events)

docs/api/Layers/vectorlayer.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ All common [layers props](/api/Layers/README.md#props)
4747

4848
## Events
4949

50-
All common layer [events](/api/Layers/#events)
50+
All common layer [events](/api/Layers/README.md#events)

docs/api/marker.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# Marker
2-
32
## Props
43

54
### `offset`

docs/guide/README.md

+11-50
Original file line numberDiff line numberDiff line change
@@ -4,68 +4,29 @@
44

55
### Installation
66

7-
You can install vue-mapbox via npm. Take note that you need to install mapbox-gl as peer dependency:
7+
You can install vue-mapbox via npm. Take note that you need to install mapbox-gl and map-promisified as peer dependency:
88

99
```bash
10-
npm install --save vue-mapbox mapbox-gl
10+
npm i vue-mapbox mapbox-gl
11+
npm i map-promisified
12+
npm i mapbox-gl
1113
```
1214

13-
Add mapbox JS and CSS files to the files where you need them:
15+
in your vite.config.js add:
1416

1517
```js
16-
import "mapbox-gl/dist/mapbox-gl.css";
17-
import Mapbox from "mapbox-gl";
18-
import { MglMap } from "vue-mapbox";
18+
optimizeDeps: {
19+
include: ['map-promisified'],
20+
}
1921
```
2022

21-
## Using in browser
2223

23-
### Installation
24-
25-
Add Vue, MapboxGL and Vue-mapbox scripts on your page:
26-
27-
```html
28-
<!DOCTYPE html>
29-
<html>
30-
<head>
31-
<!-- ... -->
32-
<!-- Mapbox GL CSS -->
33-
<link
34-
href="https://api.mapbox.com/mapbox-gl-js/v1.6.1/mapbox-gl.css"
35-
rel="stylesheet"
36-
/>
37-
<!-- Vue-mapbox CSS -->
38-
<link
39-
href="https://cdn.jsdelivr.net/npm/vue-mapbox@latest/dist/vue-mapbox.css"
40-
rel="stylesheet"
41-
/>
42-
<!-- Mapbox GL JS -->
43-
<script src="https://api.tiles.mapbox.com/mapbox-gl-js/v1.6.1/mapbox-gl.js"></script>
44-
<!-- VueJS -->
45-
<script src="https://cdn.jsdelivr.net/npm/vue@latest/dist/vue.min.js"></script>
46-
<!-- Vue-mapbox -->
47-
<script
48-
type="text/javascript"
49-
src="https://cdn.jsdelivr.net/npm/vue-mapbox@latest/dist/vue-mapbox.min.js"
50-
></script>
51-
<!-- ... -->
52-
</head>
53-
</html>
54-
```
5524

56-
All components will be placed in global VueMapbox object (`VueMapbox.MglMap` etc.)
57-
58-
## Migration from version 0.1.x
59-
60-
In version `0.2` you don't need to register VueMapbox as Vue plugin.
61-
62-
So you don't need this code anymore:
25+
Add mapbox JS and CSS files to the files where you need them:
6326

6427
```js
65-
import VueMapbox from "vue-mapbox";
28+
import "mapbox-gl/dist/mapbox-gl.css";
6629
import Mapbox from "mapbox-gl";
67-
68-
Vue.use(VueMapbox, { mapboxgl: Mapbox });
30+
import { MglMap } from "vue-mapbox";
6931
```
7032

71-
Now you're ready for mapping. See how to [create a map](/guide/basemap.md).

docs/guide/basemap.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ If none is passed, VueMapbox imports Mapbox-gl internally.
5858
You can control map parameters like zoom, bearing, pitch etc. by changing props.
5959
If you set `.sync` modifier ([Vue docs](https://vuejs.org/v2/guide/components.html#sync-Modifier)) to prop, it will updates when you use operations that takes time to proceed. For example, if you use `flyTo` method, props `zoom`, `center`, `bearing`, `pitch` will be updated when animation ends.
6060

61-
Full list of props see in [API docs](/api/#props), note field 'Synced' in description
61+
Full list of props see in [API docs](/api/README.md#props), note field 'Synced' in description
6262

6363
## Map loading
6464

@@ -132,12 +132,12 @@ export deafult {
132132
</script>
133133
```
134134

135-
See full list of actions on [API](/api/#actions) page.
135+
See full list of actions on [API](/api/README.md#actions) page.
136136

137137
### Method `actions.stop()`
138138

139139
Method `.stop()` just stops all animations on map, updates props with new positions and return Promise with map parameters at the moment when `.stop()` called.
140140

141141
### Events
142142

143-
See list of events on [API](/api/#events) page.
143+
See list of events on [API](/api/README.md#events) page.

0 commit comments

Comments
 (0)