Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation for 0.1.5 #20

Merged
merged 2 commits into from
Nov 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ labels: ''
assignees: ''
---

**Read before opening a new issue**
**Read before opening a new issue (I suggest you read in preview mode)**
**Are you asking a question or need help?**
Please use Github discussion, you will find better help there.
Notice that if you create a question issue, we will close it and create a new discussion for you.
Expand All @@ -15,12 +15,20 @@ Notice that if you create a question issue, we will close it and create a new di
You should trying enabling events before using them.
More details here: https://vue-map.netlify.app/docs/#register-google-maps-events.

**Playcode support**
We strongly recommend you to use Playcode to reproduce your code!
You can find a small template [here](https://playcode.io/1012771).
Following the steps on the template will make things really, really easier!

**Codepen support**
You can use Codepen to report your bug!
In your Codepen, go to Settings, then select JS. In Add Packages section, search for vue-google-maps-community-fork
You can use Codepen to report your bug as well!
In your Codepen, go to Settings, then select JS. In Add Packages section, search for vue-google-maps-community-fork.
TBH Codepen isn't a really good option because of the file structure, but feel free to use if you prefer it!

**Lastly, remember to look if this issue isn't already created**

**You can delete whatever part you want in this issue, but please be clear and remember to use the Preview option**
**Also, remember to look if this issue isn't already created**
**OK! You can delete everything until here!**
**You can also delete whatever part you want in this issue, but please make it clear**

**Describe what you're reporting**
Don't be ashamed to show what you're doing. Give us a clear and concise description of what the bug is.
Expand Down
16 changes: 12 additions & 4 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,20 @@ assignees: ''
Please use Github discussion, you will find better help there.
Notice that if you create a question issue, we will close it and create a new discussion for you.

**Playcode support**
We strongly recommend you to use Playcode to reproduce your code!
You can find a small template [here](https://playcode.io/1012771).
Following the steps on the template will make things really, really easier!

**Codepen support**
You can use Codepen to report your bug!
In your Codepen, go to Settings, then select JS. In Add Packages section, search for vue-google-maps-community-fork
You can use Codepen to report your bug as well!
In your Codepen, go to Settings, then select JS. In Add Packages section, search for vue-google-maps-community-fork.
TBH Codepen isn't a really good option because of the file structure, but feel free to use if you prefer it!

**Lastly, remember to look if this issue isn't already created**

**You can delete whatever part you want in this issue, but please be clear and remember to use the Preview option**
**Also, remember to look if this feature request isn't already created**
**OK! You can delete everything until here!**
**You can also delete whatever part you want in this issue, but please make it clear**

**Does your feature has anything related to a problem?**
Please describe what the problem is related to. For example: I'm frustrated that I cannot do [...] easily.
Expand Down
22 changes: 17 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,16 @@ app
.mount('#app')
```

### IMPORTANT ABOUT CONFIGURATION
### AN IMPORTANT POINT ABOUT YOUR CONFIGURATION

If you are getting a "Requested module 'fast-deep-equal' does not provide an export named 'default'" error, please notice:
You might be getting the following error:

- We are are aware of [this error](https://github.com/NathanAP/vue-google-maps-community-fork/issues/4) and we hope that it will be fixed soon.
`Requested module 'fast-deep-equal' does not provide an export named 'default'`

Please notice:

- [We are aware](https://github.com/NathanAP/vue-google-maps-community-fork/issues/4) of this problem.
- We hope that it will be fixed soon enough.
- To avoid it right now, you need to do this configuration in your `vite.config.js`:

```js
Expand All @@ -70,7 +75,8 @@ If you are getting a "Requested module 'fast-deep-equal' does not provide an exp
},
```

- This **WILL NOT** fix it. This is a hack, please follow the issue to keep track of the situation.
- This **IS NOT** a fix. This is just a hack we are using to avoid the problem.
- Please subscribe to the issue to stay in touch with this problem

### Use it anywhere in your components

Expand Down Expand Up @@ -129,6 +135,8 @@ export default {

If you have too many markers, it is helpful to cluster markers. You can easily cluster markers by wrapping your markers with `GMapCluster` component.

Note: clusters were not working in the original version of this package. All of the clusters are here because of the community fixes. If you're having trouble with it please [try using the docs](https://vue-google-maps-community-fork.netlify.app/components/cluster.html). Also, feel free to open discussions or issues to get help.

```vue
<template>
<GMapMap :center="center" :zoom="7" map-type-id="terrain" style="width: 500px; height: 300px">
Expand Down Expand Up @@ -156,7 +164,7 @@ export default {
lat: 51.093048,
lng: 6.84212,
},
}, // Along list of clusters
}, // A long list of clusters
],
}
},
Expand Down Expand Up @@ -295,3 +303,7 @@ export default defineNuxtPlugin((nuxtApp) => {
})
})
```

## Sponsorship

Please read [this discussion](https://github.com/NathanAP/vue-google-maps-community-fork/discussions/1) where we talk about sponsorships.
20 changes: 10 additions & 10 deletions docs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-google-maps-community-fork-docs",
"version": "0.0.1",
"version": "0.1.0",
"description": "Documentation for Vue Google Maps Community Fork",
"main": "index.js",
"authors": {
Expand All @@ -9,7 +9,7 @@
},
"repository": "NathanAP/vue-google-maps-community-fork",
"scripts": {
"dev": "vuepress dev src",
"dev": "NODE_OPTIONS=--openssl-legacy-provider vuepress dev src",
"build": "vuepress build src"
},
"license": "MIT",
Expand Down
1 change: 1 addition & 0 deletions docs/src/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ module.exports = {
'/examples/how-to-access-google-maps-object',
'/examples/how-to-add-custom-controls',
'/examples/how-to-open-or-close-info-window-on-event',
'/examples/using-custom-renderer-function-and-clustering-algorithm',
],
},
],
Expand Down
8 changes: 6 additions & 2 deletions docs/src/components/cluster.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# Cluster

Here you will find some uses for Google Maps Cluster component:
Here you will find some uses for Google Maps Clusterers.

[[toc]]

## Before everything

Clustering your markers are only possible because of `@googlemaps/markerclusterer`! The community is thankful for your effort!

## Cluster your markers

You can add clusters to your `GMapMarker` using `GMapCluster` component inside of `GMapMap` component:
Expand Down Expand Up @@ -36,7 +40,7 @@ You can add clusters to your `GMapMarker` using `GMapCluster` component inside o
lat: 51.093048,
lng: 6.84212,
},
}, // Along list of clusters
}, // A long list of clusters
],
}
},
Expand Down
2 changes: 2 additions & 0 deletions docs/src/examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ Here you will find some basic examples that might be useful for you.
- [How to add custom controls](./how-to-add-custom-controls.md)

- [How to open or close an Info window on event](./how-to-open-or-close-info-window-on-event.md)

- [Using custom renderer function and clustering algorithm](./using-custom-renderer-function-and-clustering-algorithm.md)
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Using custom renderer function and clustering algorithm

In order to use custom renderer function and clustering algorithm, you will need to do the following step before:

## Install `@googlemaps/makerclusterer` package into your own project

Use `npm install @googlemaps/markerclusterer` to install the library into your project.

Note: this is required because it was the best option for us to make Clustering viable. The original version of this library wasn't supporting the new MarkerClustering package version, so we had to make adjustments. You can read more about it in [this PR](https://github.com/NathanAP/vue-google-maps-community-fork/pull/19).

## Example

Following this example will help you create your own render function and clustering algorithm.

```html
<template>
<GMapMap
ref="google"
:center="center"
:zoom="7"
map-type-id="terrain"
style="width: 500px; height: 300px"
>
<GMapCluster :algorithm="algorithm" :renderer="{ renderer: renderer }">
<GMapMarker
v-for="(m, index) in markers"
:key="index"
:clickable="true"
:draggable="true"
:position="m.position"
@click="center = m.position"
/>
</GMapCluster>
</GMapMap>
</template>
<script>
import { GridAlgorithm } from '@googlemaps/markerclusterer'

export default {
name: 'App',
data() {
return {
algorithm: new GridAlgorithm({}),
center: { lat: 51.093048, lng: 6.84212 },
google: null,
markers: [
{
position: {
lat: 51.093048,
lng: 6.84212,
},
}, // A long list of clusters
],
}
},
methods: {
renderer: ({ count, position }) =>
new this.google.maps.Marker({
label: {
text: String(count),
color: 'white',
fontSize: '10px',
},
position,
// adjust zIndex to be above other markers
zIndex: Number(this.google.maps.Marker.MAX_ZINDEX) + count,
}),
},
}
</script>
```
2 changes: 1 addition & 1 deletion docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export default {
lat: 51.093048,
lng: 6.84212,
},
}, // Along list of clusters
}, // A long list of clusters
],
}
},
Expand Down
28 changes: 14 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vue-google-maps-community-fork",
"description": "Google Maps components for VueJS 3 maintained by the community",
"version": "0.1.4",
"version": "0.1.5",
"private": false,
"main": "src/main.js",
"keywords": [
Expand Down