Improve docs
This commit is contained in:
@@ -43,22 +43,18 @@ module.exports = {
|
|||||||
link: 'https://github.com/fawmi/vue-google-maps.git'
|
link: 'https://github.com/fawmi/vue-google-maps.git'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
sidebarDepth: 0,
|
||||||
|
collapsable: false,
|
||||||
sidebar: [
|
sidebar: [
|
||||||
{
|
{
|
||||||
title: 'Getting started',
|
title: 'Getting started',
|
||||||
path: '/docs/',
|
path: '/docs/',
|
||||||
sidebarDepth: 0,
|
|
||||||
collapsable: false,
|
|
||||||
children: [
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Components',
|
title: 'Components',
|
||||||
collapsable: false,
|
collapsable: false,
|
||||||
path: '/components/',
|
path: '/components/',
|
||||||
sidebarDepth: 0,
|
|
||||||
children: [
|
children: [
|
||||||
'/components/introduction',
|
|
||||||
'/components/map',
|
'/components/map',
|
||||||
'/components/marker',
|
'/components/marker',
|
||||||
'/components/info-window',
|
'/components/info-window',
|
||||||
@@ -69,7 +65,6 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Advanced',
|
title: 'Advanced',
|
||||||
collapsable: false,
|
|
||||||
path: '/advanced/',
|
path: '/advanced/',
|
||||||
sidebarDepth: 0,
|
sidebarDepth: 0,
|
||||||
children: [
|
children: [
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
# Components
|
# Components
|
||||||
|
[[toc]]
|
||||||
|
|
||||||
`@fawmi/vue-google-maps` provides a set of Vue.js 3 components wrapping the Google Maps API v3.
|
`@fawmi/vue-google-maps` provides a set of Vue.js 3 components wrapping the Google Maps API v3.
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
# Cluster
|
# Cluster
|
||||||
|
[[toc]]
|
||||||
|
## Cluster your markers
|
||||||
To cluster objects you simply wrap your markers with the cluster component.
|
To cluster objects you simply wrap your markers with the cluster component.
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
# Info Window
|
# Info Window
|
||||||
|
[[toc]]
|
||||||
|
## Add info window to your components
|
||||||
You can create info window by passing custom HTML or Vue components as the child of `Marker` component.
|
You can create info window by passing custom HTML or Vue components as the child of `Marker` component.
|
||||||
```vue
|
```vue
|
||||||
<GMapMap>
|
<GMapMap>
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
# Components
|
|
||||||
|
|
||||||
`@fawmi/vue-google-maps` provides a set of Vue.js 3 components wrapping the Google Maps API v3.
|
|
||||||
|
|
||||||
Currently `Map`, `Marker`, `InfoWindow`, `Cluster`, `Polygon` and `Rectangle` are supported.
|
|
||||||
|
|
||||||
Checkout the docs page for each component to see how to use it.
|
|
||||||
|
|
||||||
[Map](./map.md)
|
|
||||||
|
|
||||||
[Marker](./marker.md)
|
|
||||||
|
|
||||||
[InfoWindow](./info-window.md)
|
|
||||||
|
|
||||||
[Cluster](./cluster.md)
|
|
||||||
|
|
||||||
[Polygon](./polygon.md)
|
|
||||||
|
|
||||||
[Rectangle](./rectangle.md)
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
# Map
|
# Map
|
||||||
|
[[toc]]
|
||||||
## Install
|
## Install
|
||||||
|
|
||||||
This is the base Map component. If no props are provided, it shows an empty map component with default controls.
|
This is the base Map component. If no props are provided, it shows an empty map component with default controls.
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
# Marker
|
# Marker
|
||||||
|
[[toc]]
|
||||||
|
|
||||||
|
## Add marker to your components
|
||||||
With a marker, you can show specific locations on the map
|
With a marker, you can show specific locations on the map
|
||||||
```vue
|
```vue
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
@@ -1,2 +1,4 @@
|
|||||||
# Polygon
|
# Polygon
|
||||||
|
[[toc]]
|
||||||
|
|
||||||
Polygon is a simple wrapper around google's polygon component.
|
Polygon is a simple wrapper around google's polygon component.
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
# Rectangle
|
# Rectangle
|
||||||
|
[[toc]]
|
||||||
Polygon is a simple wrapper around google's polygon component.
|
Polygon is a simple wrapper around google's polygon component.
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# Introduction
|
# Introduction
|
||||||
|
[[toc]]
|
||||||
`@fawmi/vue-google-maps` provides a set of Vue.js 3 components wrapping the Google Maps API v3.
|
`@fawmi/vue-google-maps` provides a set of Vue.js 3 components wrapping the Google Maps API v3.
|
||||||
|
|
||||||
The following components are currently supported:
|
The following components are currently supported:
|
||||||
|
|||||||
@@ -1,60 +0,0 @@
|
|||||||
# Introduction
|
|
||||||
|
|
||||||
`@fawmi/vue-google-maps` provides a set of Vue.js 3 components wrapping the Google Maps API v3.
|
|
||||||
|
|
||||||
The following components are currently supported:
|
|
||||||
|
|
||||||
`Map`, `Marker`, `Cluster`, `InfoWindow`, `Polygon`, `Rectangle`
|
|
||||||
|
|
||||||
|
|
||||||
Checkout getting started to read, how to install and use vue-google-maps
|
|
||||||
|
|
||||||
# Install and configure
|
|
||||||
|
|
||||||
to install it via NPM
|
|
||||||
```bash
|
|
||||||
npm install -S @fawmi/vue-google-maps
|
|
||||||
```
|
|
||||||
|
|
||||||
## Basic usage
|
|
||||||
You need an API Key. Learn how to [get an Api key ](https://developers.google.com/maps/documentation/javascript/get-api-key).
|
|
||||||
|
|
||||||
## Configure Vue to use the Components
|
|
||||||
|
|
||||||
Initialise the plugin in your `main.js`:
|
|
||||||
```js
|
|
||||||
import { createApp } from 'vue'
|
|
||||||
import * as VueGoogleMaps from '@fawmi/vue-google-maps'
|
|
||||||
|
|
||||||
const app = createApp(App);
|
|
||||||
app.use(VueGoogleMaps, {
|
|
||||||
load: {
|
|
||||||
key: 'YOUR_API_KEY_COMES_HERE',
|
|
||||||
},
|
|
||||||
}).mount('#app')
|
|
||||||
```
|
|
||||||
|
|
||||||
## Use it anywhere in your components
|
|
||||||
|
|
||||||
```vue
|
|
||||||
<template>
|
|
||||||
<GMapMap
|
|
||||||
:center="{lat: 51.093048, lng: 6.842120}"
|
|
||||||
:zoom="7"
|
|
||||||
map-type-id="terrain"
|
|
||||||
style="width: 100vw; height: 900px"
|
|
||||||
>
|
|
||||||
</GMapMap>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script >
|
|
||||||
export default {
|
|
||||||
name: 'App',
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
center: {lat: 51.093048, lng: 6.842120},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
```
|
|
||||||
@@ -1,60 +0,0 @@
|
|||||||
# Introduction
|
|
||||||
|
|
||||||
`@fawmi/vue-google-maps` provides a set of Vue.js 3 components wrapping the Google Maps API v3.
|
|
||||||
|
|
||||||
The following components are currently supported:
|
|
||||||
|
|
||||||
`Map`, `Marker`, `Cluster`, `InfoWindow`, `Polygon`, `Rectangle`
|
|
||||||
|
|
||||||
|
|
||||||
Checkout getting started to read, how to install and use vue-google-maps
|
|
||||||
|
|
||||||
# Install and configure
|
|
||||||
|
|
||||||
to install it via NPM
|
|
||||||
```bash
|
|
||||||
npm install -S @fawmi/vue-google-maps
|
|
||||||
```
|
|
||||||
|
|
||||||
## Basic usage
|
|
||||||
You need an API Key. Learn how to [get an Api key ](https://developers.google.com/maps/documentation/javascript/get-api-key).
|
|
||||||
|
|
||||||
## Configure Vue to use the Components
|
|
||||||
|
|
||||||
Initialise the plugin in your `main.js`:
|
|
||||||
```js
|
|
||||||
import { createApp } from 'vue'
|
|
||||||
import * as VueGoogleMaps from '@fawmi/vue-google-maps'
|
|
||||||
|
|
||||||
const app = createApp(App);
|
|
||||||
app.use(VueGoogleMaps, {
|
|
||||||
load: {
|
|
||||||
key: 'YOUR_API_KEY_COMES_HERE',
|
|
||||||
},
|
|
||||||
}).mount('#app')
|
|
||||||
```
|
|
||||||
|
|
||||||
## Use it anywhere in your components
|
|
||||||
|
|
||||||
```vue
|
|
||||||
<template>
|
|
||||||
<GMapMap
|
|
||||||
:center="{lat: 51.093048, lng: 6.842120}"
|
|
||||||
:zoom="7"
|
|
||||||
map-type-id="terrain"
|
|
||||||
style="width: 100vw; height: 900px"
|
|
||||||
>
|
|
||||||
</GMapMap>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script >
|
|
||||||
export default {
|
|
||||||
name: 'App',
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
center: {lat: 51.093048, lng: 6.842120},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
```
|
|
||||||
Reference in New Issue
Block a user