Please complete all sections that you can but please don't remove any section, otherwise the bot will close your issue because it doesn't meet our issue template (you can remove this comment)
Describe the bug
If you don't have a GmapMap component on your page (or if it's not visible/rendered) and you try to use dynamic importing (googleMapsApiInitializer) then you might see this error:
locations:1 Uncaught (in promise) _.qe {message: 'GoogleMapsCallback is not a function', stack: 'Error\n at _.qe.captureStackTrace (https://maps/.…es%2Cgeometry&callback=GoogleMapsCallback:235:269', name: 'InvalidValueError'}
To reproduce
Steps to reproduce the behavior:
Initialize the plugin but pass in dynamicLoad: false, to the config
Call googleMapsApiInitializer without a GmapMap instance on your page
See error
Expected behavior
I would expect that initializing the plugin should be when it sets window.GoogleMapsCallback instead of it apparently being only when you use the GmapMap component.
Current behavior
If you don't use the GmapMap component then after Google maps loads it will throw an error (the google maps JS code throws the error) because it can't find window.GoogleMapsCallback
locations:1 Uncaught (in promise) _.qe {message: 'GoogleMapsCallback is not a function', stack: 'Error\n at _.qe.captureStackTrace (https://maps/.…es%2Cgeometry&callback=GoogleMapsCallback:235:269', name: 'InvalidValueError'}
Screenshots
N/A
Desktop (please complete the following information)
OS: macOS 12.5.1
Browser: Chrome
Version: 105.0.5195.102
Smartphone (please complete the following information)
Device: N/A
OS: N/A
Browser: N/A
Version: N/A
Additional context
It would be useful to add something to the docs about this and/or actually register that callback at time of plugin initialization instead of waiting until you load a GmapMap component.
Describe the bug
If you don't have a
GmapMap
component on your page (or if it's not visible/rendered) and you try to use dynamic importing (googleMapsApiInitializer
) then you might see this error:To reproduce
Steps to reproduce the behavior:
dynamicLoad: false,
to the configgoogleMapsApiInitializer
without aGmapMap
instance on your pageExpected behavior
I would expect that initializing the plugin should be when it sets
window.GoogleMapsCallback
instead of it apparently being only when you use theGmapMap
component.Current behavior
If you don't use the
GmapMap
component then after Google maps loads it will throw an error (the google maps JS code throws the error) because it can't findwindow.GoogleMapsCallback
Screenshots
N/A
Desktop (please complete the following information)
Smartphone (please complete the following information)
Additional context
It would be useful to add something to the docs about this and/or actually register that callback at time of plugin initialization instead of waiting until you load a
GmapMap
component.Versions
Package manager
Plugin version