Skip to content

Commit

Permalink
map drag support custom animation easing (#2429)
Browse files Browse the repository at this point in the history
  • Loading branch information
deyihu authored Sep 29, 2024
1 parent 708b0e8 commit 9fb78c4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/map/Map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2711,6 +2711,7 @@ export type MapOptionsType = {
layers?: Array<Layer>;
draggable?: boolean;
dragPan?: boolean;
dragPanEasing?: EasingType;
dragRotate?: boolean;
dragPitch?: boolean;
dragRotatePitch?: boolean;
Expand Down
2 changes: 1 addition & 1 deletion src/map/handler/Map.Drag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ class MapDragHandler extends Handler {
const dscale = isTouch ? 5 : 2.8;
const targetPrjCoord = currentCenter.add(dxy._multi(dscale));
// map._fixPrjOnWorldWide(targetPrjCoord);
map._panTo(targetPrjCoord, { 'duration': isTouch ? t * 3 : t * 2, 'easing': 'outExpo' });
map._panTo(targetPrjCoord, { 'duration': isTouch ? t * 3 : t * 2, 'easing': map.options.dragPanEasing || 'outExpo' });
} else {
map.onMoveEnd(param);
}
Expand Down

0 comments on commit 9fb78c4

Please sign in to comment.