DEV Community

Discussion on: Create Your Own Vue3 Google Maps Component and Deploy to Mobile with Ionic Framework & Capacitor

Collapse
 
bertoloti profile image
bertoloti • Edited

I'm using this code for an app that I'm building but I'm having trouble how to use this GMap component within a ionic modal. Basically i want to show a modal with a Google map every time an item of a location list is clicked but i getting the following error:

You have included the Google Maps JavaScript API multiple times on this page. This may cause unexpected errors.

Tried tweaking the code to add the script only once by checking if the window.google was undefined to avoid the error but when I so, then the Map is only rendered on the first click. Any idea how to properly work around the issue? Thanks