v3-gmaps
v0.1.9
Published
A lightweight, typed, Google Maps plugin for Vue 3
Downloads
314
Readme
v3-gmaps
This is a lightweight, fully typed library to simplify the use of Google Maps in Vue3 🤏🗺️🧩
For the (original) Vue 2 version check out x5-gmaps 💪
Guide / Demo / Tutorials
- Docs: v3-gmaps Docs
- Example: StackBlitz
- Demo: StackBlitz
Installation
# npm
npm install v3-gmaps
Deployment
This plugin can be installed like any Vue plugin:
import v3gmaps from 'v3-gmaps'
import { createApp } from 'vue'
import App from './App.vue'
// Optional stylesheet needed for showing errors and the Popup component
import 'v3-gmaps/dist/style.css';
createApp(App)
.use(gmaps, { key: 'GOOGLE_API_KEY', libraries: ['visualization'] })
.mount('#app')
Usage
<template>
<div style="height: 500px"> <!-- gmaps-map requires a height to fill -->
<gmaps-map>
<gmaps-marker :position="{ lat: -27, lng: 153 }" />
</gmaps-map>
</div>
</template>
<script>
import { defineComponent } from 'vue'
import { gmapsMap, gmapsMarker } from 'v3-gmaps';
export default defineComponent({
components: { gmapsMap, gmapsMarker }
});
</script>
License
This project is licensed under the MIT License - see the LICENSE file for details