Skip to content
This repository has been archived by the owner on Jul 25, 2021. It is now read-only.

Usage with dburles:google-maps makes map works once #13

Closed
boogieprod opened this issue Aug 7, 2015 · 3 comments
Closed

Usage with dburles:google-maps makes map works once #13

boogieprod opened this issue Aug 7, 2015 · 3 comments

Comments

@boogieprod
Copy link

Hello,

I'll start by thanking you for the package. (I believe it's a must for any app given Meteor fast rendering)

I've experienced an issue using Momentum transition with dburles:google-maps. I first thought it had something to do with the maps package but if you take a look at this: dburles/meteor-google-maps#58, we discovered that it was the momentum transition that made the issue with the map not re-loading properly on re-route.

Here's a simple reproduction app showing the issue: https://github.com/boogieprod/momentum-map-bug.

I've looked at other issues topics but couldn't find anything useful on how to work around this bug.

Let me know if you have something in mind as I feel your package is a must for my app.

Thanks in advance,
Boogieprod

@tmeasday
Copy link
Member

Is the issue that google maps is rendering while the page is still transitioning onto the screen and this is screwing things up?

The simple solution is to simply put a timeout in your onCreated callback (https://github.com/boogieprod/momentum-map-bug/blob/master/mapbug-route.js#L31) that is longer than the transition time for momentum.

It would be nice to have a Momentum.onTransitionEnd(function() {}) or the like (percolatestudio/meteor-momentum#22) to make this less hacky. But it's non trivial to add (see the ticket)

@boogieprod
Copy link
Author

Hi tmeasday, the issue is that the map only renders one. I've deployed the app on momentum-map-bug.meteor.com. Just try to re-navigate to the map once you saw it, you'll see what the issue is.

I'm very newb as a web developer just started last November, and I was wondering if you could help me with the setTimeout function? Meteor doesn't provide much information about it (same for stackoverflow). I made this change on the previous code https://github.com/boogieprod/momentum-map-bug/blob/master/mapbug-route.js#L33 and it clearly doesn't set any timeout on the function, what am I doing wrong?

I've looked around the internet to find a solution but couldn't find any and now my head is spinning... Feel free to tell me to ask this question on stackoverflow, I would understand.

I've posted this on stackoverflow if someone experiments the same issue (solution is still in progress, Thanks to Michel Floyd for his efforts) http://stackoverflow.com/questions/31947774/meteor-settimeout-function-doesnt-work

Thanks in advance

@tmeasday
Copy link
Member

You might have to figure out a way to avoid rendering the {{> googleMap}} at all until it's finished transitioning. I'm not sure, would need to play with it.

@dburles - do you have any idea why it's breaking?

@domyen domyen closed this as completed Feb 10, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants