Skip to content

Commit 9fb78c4

Browse files
authored
map drag support custom animation easing (#2429)
1 parent 708b0e8 commit 9fb78c4

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/map/Map.ts

+1
Original file line numberDiff line numberDiff line change
@@ -2711,6 +2711,7 @@ export type MapOptionsType = {
27112711
layers?: Array<Layer>;
27122712
draggable?: boolean;
27132713
dragPan?: boolean;
2714+
dragPanEasing?: EasingType;
27142715
dragRotate?: boolean;
27152716
dragPitch?: boolean;
27162717
dragRotatePitch?: boolean;

src/map/handler/Map.Drag.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ class MapDragHandler extends Handler {
190190
const dscale = isTouch ? 5 : 2.8;
191191
const targetPrjCoord = currentCenter.add(dxy._multi(dscale));
192192
// map._fixPrjOnWorldWide(targetPrjCoord);
193-
map._panTo(targetPrjCoord, { 'duration': isTouch ? t * 3 : t * 2, 'easing': 'outExpo' });
193+
map._panTo(targetPrjCoord, { 'duration': isTouch ? t * 3 : t * 2, 'easing': map.options.dragPanEasing || 'outExpo' });
194194
} else {
195195
map.onMoveEnd(param);
196196
}

0 commit comments

Comments
 (0)