Skip to content

Commit

Permalink
Merge pull request #3 from systragroup/test
Browse files Browse the repository at this point in the history
add vitepress
  • Loading branch information
sboivinsystra authored Dec 5, 2023
2 parents b098d64 + dc4ff34 commit 26220b7
Show file tree
Hide file tree
Showing 20 changed files with 1,116 additions and 7,991 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,6 @@ vue-mapbox-demo
checklist.txt
.flowconfig
docs_source/.vuepress/dist

docs/.vitepress/dist
docs/.vitepress/cache
5 changes: 0 additions & 5 deletions .postcssrc.js

This file was deleted.

59 changes: 59 additions & 0 deletions docs/.vitepress/config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import { defineConfig } from 'vitepress'

// https://vitepress.dev/reference/site-config
export default defineConfig({
title: "VueMapbox 3",
description: "A Vue3 mapbox wrapper",
base:"/vue-mapbox/",
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
nav: [
{ text: 'Home', link: '/' },
{ text: 'Guide', link: '/guide/README' },
{ text: 'API', link: '/api/README' },
],

sidebar: [
{
text: 'Guide',
items: [
{ text: 'Quickstart', link: '/guide/README' },
{ text: 'Base map', link: '/guide/basemap' },
{ text: 'Composition', link: '/guide/composition' },
{ text: 'Controls', link: '/guide/controls' },
{ text: 'Markers and popups', link: '/guide/markers&popups' },
{ text: 'Layers and sources', link: '/guide/layers&sources' }
]
},
{
text: 'API',
items: [
{ text: 'GlMap', link: '/api/README' },
{ text: 'Controls', link: '/api/controls' },
{ text: 'MapMarker', link: '/api/marker' },
{ text: 'Popup', link: '/api/popup' },
{ text: 'Layer commons', link: '/api/Layers/README' },
{ text: 'Geojson Layer', link: '/api/Layers/geojsonlayer' },
{ text: 'Vector Layer', link: '/api/Layers/vectorlayer' },
{ text: 'Raster Layer', link: '/api/Layers/rasterlayer' },
{ text: 'Image Layer', link: '/api/Layers/imagelayer' },
{ text: 'Video Layer', link: '/api/Layers/videolayer' },
{ text: 'Canvas Layer', link: '/api/Layers/canvaslayer' },
]
},
{
text: 'Plugin components',
items: [
{ text: 'Using plugin components', link: '/plugin_components/README' },
{ text: 'Create a plugin component', link: '/plugin_components/plugin_components_development' },

]
}
],

socialLinks: [
{ icon: 'github', link: 'https://github.com/systragroup/vue-mapbox' }
],
footer:{message: 'Released under the MIT License.'}
}
})
77 changes: 0 additions & 77 deletions docs/.vuepress/config.js

This file was deleted.

Binary file removed docs/.vuepress/public/favicon.ico
Binary file not shown.
76 changes: 0 additions & 76 deletions docs/README.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/api/Layers/canvaslayer.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ All common [layers props](/api/Layers/README.md#props)

## Events

All common layer [events](/api/Layers/#events)
All common layer [events](/api/Layers/README.md#events)
2 changes: 1 addition & 1 deletion docs/api/Layers/geojsonlayer.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,4 @@ All common [layers props](/api/Layers/README.md#props)

## Events

All common layer [events](/api/Layers/#events)
All common layer [events](/api/Layers/README.md#events)
3 changes: 1 addition & 2 deletions docs/api/Layers/imagelayer.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# ImageLayer

## Props

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

## Events

All common layer [events](/api/Layers/#events)
All common layer [events](/api/Layers/README.md#events)
2 changes: 1 addition & 1 deletion docs/api/Layers/rasterlayer.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ All common [layers props](/api/Layers/README.md#props)

## Events

All common layer [events](/api/Layers/#events)
All common layer [events](/api/Layers/README.md#events)
2 changes: 1 addition & 1 deletion docs/api/Layers/vectorlayer.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ All common [layers props](/api/Layers/README.md#props)

## Events

All common layer [events](/api/Layers/#events)
All common layer [events](/api/Layers/README.md#events)
1 change: 0 additions & 1 deletion docs/api/marker.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Marker

## Props

### `offset`
Expand Down
61 changes: 11 additions & 50 deletions docs/guide/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,68 +4,29 @@

### Installation

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

```bash
npm install --save vue-mapbox mapbox-gl
npm i vue-mapbox mapbox-gl
npm i map-promisified
npm i mapbox-gl
```

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

```js
import "mapbox-gl/dist/mapbox-gl.css";
import Mapbox from "mapbox-gl";
import { MglMap } from "vue-mapbox";
optimizeDeps: {
include: ['map-promisified'],
}
```

## Using in browser

### Installation

Add Vue, MapboxGL and Vue-mapbox scripts on your page:

```html
<!DOCTYPE html>
<html>
<head>
<!-- ... -->
<!-- Mapbox GL CSS -->
<link
href="https://api.mapbox.com/mapbox-gl-js/v1.6.1/mapbox-gl.css"
rel="stylesheet"
/>
<!-- Vue-mapbox CSS -->
<link
href="https://cdn.jsdelivr.net/npm/vue-mapbox@latest/dist/vue-mapbox.css"
rel="stylesheet"
/>
<!-- Mapbox GL JS -->
<script src="https://api.tiles.mapbox.com/mapbox-gl-js/v1.6.1/mapbox-gl.js"></script>
<!-- VueJS -->
<script src="https://cdn.jsdelivr.net/npm/vue@latest/dist/vue.min.js"></script>
<!-- Vue-mapbox -->
<script
type="text/javascript"
src="https://cdn.jsdelivr.net/npm/vue-mapbox@latest/dist/vue-mapbox.min.js"
></script>
<!-- ... -->
</head>
</html>
```

All components will be placed in global VueMapbox object (`VueMapbox.MglMap` etc.)

## Migration from version 0.1.x

In version `0.2` you don't need to register VueMapbox as Vue plugin.

So you don't need this code anymore:
Add mapbox JS and CSS files to the files where you need them:

```js
import VueMapbox from "vue-mapbox";
import "mapbox-gl/dist/mapbox-gl.css";
import Mapbox from "mapbox-gl";

Vue.use(VueMapbox, { mapboxgl: Mapbox });
import { MglMap } from "vue-mapbox";
```

Now you're ready for mapping. See how to [create a map](/guide/basemap.md).
6 changes: 3 additions & 3 deletions docs/guide/basemap.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ If none is passed, VueMapbox imports Mapbox-gl internally.
You can control map parameters like zoom, bearing, pitch etc. by changing props.
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.

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

## Map loading

Expand Down Expand Up @@ -132,12 +132,12 @@ export deafult {
</script>
```

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

### Method `actions.stop()`

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.

### Events

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

0 comments on commit 26220b7

Please sign in to comment.