fix: enable animate option for GaodeMap fitBounds (fix #2704)#2853
fix: enable animate option for GaodeMap fitBounds (fix #2704)#2853
Conversation
|
There was a problem hiding this comment.
Code Review
This pull request updates the fitBounds method in the AMap service to support animation options via a new fitBoundsOptions parameter. Feedback identifies a logic error where the immediately parameter is hardcoded to true, which prevents animations from occurring regardless of the animate flag. Additionally, the animate argument is being passed to the wrong parameter index in the setBounds call. The reviewer also recommends replacing the any type for the options parameter with a more specific type definition to improve type safety.
| true, | ||
| // @ts-expect-error animate 参数,控制动画效果 | ||
| animate, |
There was a problem hiding this comment.
| } | ||
|
|
||
| public fitBounds(extent: Bounds): void { | ||
| public fitBounds(extent: Bounds, fitBoundsOptions?: any): void { |
There was a problem hiding this comment.
修复 Issue #2704: 当使用GaodeMap时,scene.fitBounds(bounds, {animate: true})无动画效果
修改内容
影响范围
只影响高德地图 (amap-next),其他地图保持不变。
测试方法
使用高德地图时,现在应该有过渡动画效果。