Learn how to setup atoms locator module in your Nuxt 3 application.
Check out the Nuxt 3 documentation for more information about installing and using modules.
Add @atoms-studio/atoms-locator
dependency to your project:
yarn add @atoms-studio/atoms-locator
Then, add @atoms-studio/atoms-locator
to the modules
section of your Nuxt configuration:
export default { modules: ['@atoms-studio/atoms-locator'], atomsLocator: { // Options }}
Defaults:
{ key: process.env.GOOGLE_API_KEY || 'google_api_key', markerIcon: '', activeMarkerIcon: '', clustererIcon: '', autoImports: false}
key
Google Maps Api key.
Environment variable GOOGLE_API_KEY
can be used to override key
.
markerIcon
Provide the path for the Google Marker icon.
activeMarkerIcon
Provide the path for the Google Marker active icon.
clustererIcon
Provide the path for the Google Clusterer icon.
autoImports
Automatic injection of a Pinia store with some utilities and methods for easy implementation of a store locator project.
autoImports: true
check your nuxt.config.ts
.
Probably, Pinia is included in your modules
array.
If modules: ['@pinia/nuxt']
you need to configure the autoImports composables:[ "@pinia/nuxt", { autoImports: ["defineStore", "storeToRefs", "acceptHMRUpdate"], },]
pinia
and @pinia/nuxt
from your package.json because they will be automatically installed by the module.