Update docs

This commit is contained in:
Fawad Mirzad
2021-02-14 10:16:55 +01:00
parent c4b05d252f
commit d31bff5ab7
2 changed files with 19 additions and 26 deletions

View File

@@ -1,11 +1,8 @@
# Info Window
## Create
You can create info window by passing custom HTML or Vue components as the child of `Marker` component.
```vue
<GoogleMap>
<Marker
<GmapMap>
<GmapMarker
:geoCoordinates="[
{
lat: 51.2432981,
@@ -14,8 +11,8 @@ You can create info window by passing custom HTML or Vue components as the child
]"
>
<div>I am info window. I appear, when you click a marker</div>
</Marker>
</GoogleMap>
</GmapMarker>
</GmapMap>
```
## Center markers automatically

View File

@@ -4,31 +4,31 @@
This is the base Map component. If no props are provided, it shows an empty map component with default controls.
```javascript
<GoogleMap />
```vue
<GmapMap />
```
## Provide your own style
You can provide custom map styling as prop.
You can generate custom map styles at [https://mapstyle.withgoogle.com/](https://mapstyle.withgoogle.com/)
```javascript
<GoogleMap
```vue
<GmapMap
:style="mapStyles"
/>
```
## Disable ui elements
You can disable all ui components at once
```javascript
<GoogleMap
```vue
<GmapMap
:disableDefaultUI="true"
/>
```
You can also disable specific UI components
```vue
<GoogleMap
<GmapMap
:options="{
zoomControl: true,
mapTypeControl: true,
@@ -36,25 +36,21 @@ You can also disable specific UI components
streetViewControl: true,
rotateControl: true,
fullscreenControl: true,
}"
}"
/>
```
## Access google maps instance
You can easily access Map instance by injecting it in your component.
You can easily access Map instance by accessing map ref in your component.
```javascript
const loadMap = inject(
"mapPromise"
);
loadMap.then(map=> {
console.log( {map})
})
```vue
<GmapMap
ref="myMapRef"
:disableDefaultUI="true"
/>
```
## Add custom button
You can use the map instance to add custom buttons to your map
```js