# Google maps Components for Vue.js 3 Set of mostly used Google Maps components for Vue.js. #### Why this library exists? We heavily use Google Maps in our projects, so I wanted to have a well maintained Google Maps library. ## Documentation Checkout https://vue-map.netlify.app for a detailed documentation ## Installation You can install it using npm ``` 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 In your `main.js` or inside a Nuxt plugin: ```js import { createApp } from 'vue' import 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 ``` ## Components ### Markers If you need to add markers to the `Map`, add `GMapMarker` as child of `GMapMap` component. ```vue ``` ### Cluster If you have too many markers, it is helpful to cluster markers. You can easily cluster markers by wrapping your markers with `GMapCluster` component. ```vue ``` Checkout docs for more component ## Access map object If you want to access `google map` object, you can access it by getting ref of the map object. ```vue ``` ### Map options You can pass Map options using options property: See [MapOptions](https://developers.google.com/maps/documentation/javascript/reference/map#MapOptions) for a complete list of available options. ```vue ``` ## Contributions The best way to contribute is to report reproducible bugs, but feature requests and improvement suggestions are always welcome too. And definitely bug fixes and PR are welcome.