javascript - Google Maps zoomOut-Pan-zoomIn animation -
I'm wondering how to get a smooth zoom in animation with the Google Maps API.
I have two points, one in one, let China, and one in France. When I'm zooming in China, and click on the button France, I want to zoom it out slowly, at times a zoom level. When it is zoomed out, it should pan in the new location, and then zoom in at the new location at a zoom level at that time.
How can I do this?
You need to use zoom parameters to set the zoom parameter continuously and the new center point But a smooth panning method is required.
You can listen to your zoomOut , panTo and zoomIn methods together on the map object and events.
Edit:
While implementing a sample for this problem, I found that the doContinuousZoom the ultimate ZoomIn and ZoomOut (or just on enabled continents zoom on the map) does not work as expected, it works properly, when the tile is in the cache (this is an important point If tiles are not cached then it is not really possible that you can easily get the animation) then this is good Good scaling introduces tiles to a smooth zoom animation and introduces ~ 500 ms delay on each zoom step so you can do it asynchronous (contrary to panTo ), which you will see in your example. Call set async to setTimeout).
Unfortunately this is not true for the zoom in method, which jumps at the target zoom level without scaling animation for each zoom level. I have not tried to set the version for Google Maps code explicitly, so this may be something that has been fixed in later versions. Anyway, this is all that is just jumping the JavaScript circle and not so much with the Google Maps API:
Because this approach seems a little unbelievable, I think it's more To understand the async processing for SetZoom clearly (similar to the panning stuff)
EDIT2:
Then I'm explicitly zooming async (one time I use the setTimeout with a zoom in) Tets also have to be set on fire so that my incidents can be properly fixed. It seems that the incidents of zoomend and panend are being called synchronous. Enable enable
. Continuum zoom does not work on the map, so I think call zoomout, with the ultimate zoom, it is the only way to get it done.
Comments
Post a Comment