huiyan-fe / react-bmapgl

基于百度地图JavaScript GL版API封装的React组件库
http://huiyan.baidu.com/github/react-bmapgl/
MIT License
114 stars 20 forks source link

setBounds方法限制地图区域不生效 #40

Closed htyaw closed 2 years ago

htyaw commented 2 years ago

const bounds = new window.BMapGL.Bounds( new window.BMapGL.Point(79.031845, 23.07253), new window.BMapGL.Point(139.522157, 58.525824), ); map.setBounds(bounds);

ligaofeng0901 commented 2 years ago

试试map.restrictBounds(bounds)

htyaw commented 2 years ago

谢谢 刚才试了一下这个方法可以