inocan-group / vue3-google-map

A set of composable components for easy use of Google Maps in your Vue 3 projects.
https://vue3-google-map.com
MIT License
295 stars 60 forks source link

AdvancedMarker doesn't work in Nuxt 3: [nuxt] Error in 'vue:error' hook - InvalidValueError #270

Open novalbayusetiawan opened 3 months ago

novalbayusetiawan commented 3 months ago

Hi, thank you for this awesome package.

I've just run the example code for AdvancedMarker in Nuxt 3 app with SSR disabled. The map loaded, but the marker didn't show, and I got this error: image

<script setup>
import { GoogleMap, AdvancedMarker } from 'vue3-google-map'

const center = { lat: 40.689247, lng: -74.044502 }
const markerOptions = { position: center, label: 'L', title: 'LADY LIBERTY' }
const pinOptions = { background: '#FBBC04' }
</script>

<template>
  <GoogleMap
    api-key="YOUR_GOOGLE_MAPS_API_KEY"
    mapId="DEMO_MAP_ID"
    style="width: 100%; height: 500px"
    :center="center"
    :zoom="15"
  >
    <AdvancedMarker :options="markerOptions" :pin-options="pinOptions"/>
  </GoogleMap>
</template>
HusamElbashir commented 3 months ago

Apologies this is an error in our docs you should remove the label it's not a valid AdvancedMarker option

const markerOptions = { position: center, title: 'LADY LIBERTY' }
novalbayusetiawan commented 3 months ago

Woah, that solved the issue! however i should move the label into pin-options.glyph when i need it, thank you 👍