google.maps.event.trigger(MapInstance,'resize')
is working fine for me, put it at the begin of the function fitMap
.
What you are missing:
currently(not in the code posted above, in your live-code), you call resizeWindow
on each step
.
When you call this function on step
the function will be called before the animation for the current step has finished. The result is that resizeWindow
will not be called when the complete animation has been finished, there will be e.g. a margin on the right side of the map.
Solution: call resizeWindow
also on the complete
-callback of the animation
.