GmapVue is an actively maintained Google Maps component library specifically designed for Vue 2 applications, currently at version 3.5.4. It originated as a fork of the popular but unmaintained `vue2-google-maps` project, ensuring continued support and development for Vue 2 users. The library provides a suite of components for integrating various Google Maps features, including maps, markers, polygons, and autocomplete functionalities, all within a declarative Vue syntax. Recent releases, labeled `gmv3_vX.Y.Z` in its internal changelog, indicate ongoing bug fixes and feature enhancements, with multiple updates in 2024 and 2025. Its key differentiator is its dedicated focus on Vue 2 compatibility and active maintenance, filling a gap left by its predecessor, and offering a robust solution for developers needing Google Maps in their Vue 2 projects.
npm install gmap-vueVerified import paths — ran on the pinned version, not inferred.
This example demonstrates how to install GmapVue as a Vue plugin, initialize it with a Google Maps API key, and render a basic map with a draggable marker. The marker's position updates on drag.
Update your plugin configuration and imports to use the new names: `autoBindAllEvents`, `GoogleMapsCallback`, `getGoogleMapsAPI`, and adjust the import path for `MapElementMixin` to `gmap-vue/components`.
For upgrades from pre-v2.0.0, refactor `MarkerCluster` usage to `Cluster` and ensure correct clustering library dependencies. Update plugin import statements from `import * as GmapVue` to `import GmapVue`.
Refactor your `autocomplete` component usage to render the input element within its `default` slot instead of the `input` named slot.
Standardize your component casing based on your installation method. For CDN/manual inclusion, use kebab-case. For npm installations within Vue CLI or webpack-based projects using SFCs, PascalCase is the standard after global plugin registration.
Ensure you have called `Vue.use(GmapVue, { load: { key: 'YOUR_API_KEY' } });` in your main JavaScript file (e.g., `main.js` or `app.js`) before your root Vue app instance is created.Provide a valid Google Maps API key as a string to the `load.key` option when initializing the plugin: `Vue.use(GmapVue, { load: { key: 'YOUR_VALID_API_KEY' } })`. Confirm the key is enabled for the Google Maps JavaScript API in your Google Cloud Console.Update all calls to `gmapApi` to `getGoogleMapsAPI` and ensure it is correctly imported from `'gmap-vue/helpers'` as a named export.
Ensure that the Google Maps API is fully loaded before interacting with its objects. Use `v-if` or `v-show` directives on your map components, or react to events like `@idle` or `@loaded` emitted by `GmapMap` to ensure readiness.