-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getMap/setMap is not a function
error when markers are clicked or opened
#29
Comments
After a lot of experimenting, I got this to work by changing my |
i got it to work when i call google maps api without the params "async defer" <script **async defer** src="https://maps.googleapis.com/maps/api/js"></script> |
Hi @matthewmcvickar can help me, I have the same error as you, but I can not fix it. I have this code, where I charge Google Maps. When I try to create and open the "info-window" I get the same error as you. Thx
|
@avechuche I think you need to switch the ES6 |
I managed to solve this issue using dynamic import const SnazzyInfoWindow = await import('snazzy-info-window') But you need to do it after google scripts are fetched |
I resolved this by replacing: Also replace |
@manoj7shekhawat But without |
May sure you are importing the Google maps API before the snazzy windo js This worked for me: <script src="https://maps.googleapis.com/maps/api/js?key={{env("GOOGLE_MAP_API_KEY")}}&v=3.exp"></script> <script src="/js/snazzy-info-window.js"></script> |
Hi @matthewmcvickar , I am having the same issue as you, did try your technique but seems I couldn't make it work. Here is my simplified codepen: |
@anthonysalamin I’m really not sure why it isn’t working. This CodePen setup is different than my setup (using Browserify and Babel), so I don't know how to debug it, but the problem you’re seeing in this CodePen seems to be the same one I originally had, so I think it’s the same root bug in this library. We will need someone at Atmist to fix it, I’m afraid (maybe @joelkravets or @adamkrogh?). |
@matthewmcvickar, thank you so much for getting back at me though ! I will try digg some more. Never used Browserify nor Babel before, I'm just using codepen to write custom code I then implement in my webflow projects. |
Same issues here. Getting very very tired with Google maps |
Run your browserify scripts first and then include Google Maps. In your callback function
This works for me where all other solutions above didn't. |
Fix from @texelate worked for me. |
Here's my code for initializing the map and its markers and infowindows. Markers are being added just fine, but clicking on the marker throws a
marker.getMap is not a function
error, and callingopen()
on the info window returns amarker.setMap is not a function
error.It seems the Snazzy Info Window object can't access the
marker
object it has been assigned.The Code:
The Error:
The text was updated successfully, but these errors were encountered: