Skip to content

Docs: Google Maps example is not working #169

Closed
@MickL

Description

@MickL

I was trying to use the example:

<script setup lang="ts">
const { $script } = useScriptGoogleMaps({
  apiKey: 'key'
})
$script.then(({ maps }) => {
  const map = new maps.Map(document.getElementById('map'), {
    center: { lat: -34.397, lng: 150.644 },
    zoom: 8
  })
})
</script>

But I get a type error in my IDE: Property Map does not exist on type typeof maps | Promise<typeof maps>

As well as an error in Vue/Nuxt: Uncaught (in promise) TypeError: maps.Map is not a constructor

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions