mapbox/mapbox-gl-js

Fitbounds with center option not doing expected thing

Open

#11,337 建立於 2021年12月10日

在 GitHub 查看
 (7 留言) (2 反應) (0 負責人)JavaScript (2,203 fork)batch import
good first issue

倉庫指標

Star
 (10,532 star)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

mapbox-gl-js version:2.6.1

browser:Chrome

Steps to Trigger Behavior

1.create LngLatBounds as bounds 2 .use map.fitBounds and pass the center option to it

Link to Demonstration

check out this link for more info: https://jsbin.com/zodotod/edit?html,output

Expected Behavior

The bounds should be in the view and the center of the map should be the center option

Actual Behavior

Just flyTo the center

貢獻者指南