How do I force redraw with Google Maps API v3.0?

后端 未结 1 402
萌比男神i
萌比男神i 2020-12-05 17:24

I have a fairly sophisticated Maps application that handles multiple custom markers and such. I have a function called resizeWindow that I call in a listener to that wheneve

相关标签:
1条回答
  • 2020-12-05 18:16

    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.

    0 讨论(0)
提交回复
热议问题