File tree Expand file tree Collapse file tree 3 files changed +10
-1
lines changed
packages/maptalks/src/map Expand file tree Collapse file tree 3 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ declare module "./Map" {
9
9
interface Map {
10
10
//@internal
11
11
_mapAnimPlayer : Player ;
12
+ //@internal
13
+ _animPlayer : Player ;
12
14
isRotating ( ) : boolean ;
13
15
//@internal
14
16
_animateTo ( view : MapViewType , options ?: MapAnimationOptionsType , step ?: ( frame ) => void ) : Player ;
Original file line number Diff line number Diff line change @@ -114,7 +114,7 @@ Map.include(/** @lends Map.prototype */{
114
114
scale = fromRes / res / startScale ,
115
115
startPoint = this . _startZoomCoord && this . prjToContainerPoint ( this . _startZoomCoord , this . _startZoomVal ) ;
116
116
const offset = this . getViewPoint ( ) ;
117
- if ( ! this . isRotating ( ) && startPoint && ! startPoint . equals ( origin ) && scale !== 1 ) {
117
+ if ( ! this . isRotating ( ) && startPoint && origin && ! startPoint . equals ( origin ) && scale !== 1 ) {
118
118
const pitch = this . getPitch ( ) ;
119
119
// coordinate at origin changed, usually by map.setCenter
120
120
// add origin offset
Original file line number Diff line number Diff line change @@ -1759,6 +1759,13 @@ export class Map extends Handlerable(Eventable(Renderable(Class))) {
1759
1759
return this ;
1760
1760
}
1761
1761
this . _fireEvent ( 'removestart' ) ;
1762
+ //remove animation when map removed
1763
+ const animationPlayerList = [ this . _animPlayer , this . _mapAnimPlayer ] ;
1764
+ animationPlayerList . forEach ( player => {
1765
+ if ( player && player . finish ) {
1766
+ this . _stopAnim ( player ) ;
1767
+ }
1768
+ } ) ;
1762
1769
this . _removeDomEvents ( ) ;
1763
1770
this . _clearHandlers ( ) ;
1764
1771
this . removeBaseLayer ( ) ;
You can’t perform that action at this time.
0 commit comments