Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
Daiko

Scrolltrigger and GoogleMap Markers

Recommended Posts

Hello community, I tried to pin a google map on scroll with generated markers on it. And when I load or update markers, I refresh the Scrolltrigger instance to calculate the new sizes from my updated list (content). Bt when I do a refresh or a resize window, my Google map is reset.

 

I think it's when I make a refresh, the content inside the `pin-spacer` markup reloaded and Google map does reset.

 

Any idea?

 

Thank you

 

Screenshot 2021-06-22 at 08.00.50.png

Link to comment
Share on other sites

Hi Daiko, 

 

We try to keep these forums focused on GSAP specific questions, but anyone is free to jump and help.

 

It's been years since I've messed with Google maps, so I wouldn't be of much of help. I would try to get the map functionality working without ScrollTrigger. So find a way to get resizes and adding markers to work by itself, then once you get that solved, it should be pretty straightforward on hooking it up to ScrollTrigger.

 

  • Like 1
Link to comment
Share on other sites

Hello @OSUblake, thank you for your answer. On resize was working. I think it was because of the Scrolltrigger update function.

 

But anyway, I found another solution using position sticky. 

 

I will maybe take time to investigate about this bug.

 

So thank you for your help.

  • Like 1
Link to comment
Share on other sites

I look forward to seeing your outcome if you're able to share.

 

For anyone else looking for similar but resulting in a less dynamic result, you could use your own map artwork like the below example. It may help someone in some way. ¯\_(ツ)_/¯

 

See the Pen jOryjNX by oliviale (@oliviale) on CodePen

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×