Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

moveCamera不生效 #832

Open
rjlatgithub opened this issue Aug 16, 2024 · 1 comment
Open

moveCamera不生效 #832

rjlatgithub opened this issue Aug 16, 2024 · 1 comment

Comments

@rjlatgithub
Copy link

【跪求支援!】

设备:安卓
RN版本:0.67.5
函数式组件
<MapView
ref={mapRef}
mapType={MapType.Standard}//地图类型
initialCameraPosition={{//初始状态
target: {
latitude,
longitude,
},
zoom: 11,
bearing: 0,
tilt: 0,
}}
myLocationEnabled={true}//是否显示当前定位
indoorViewEnabled={true}//是否显示室内地图
buildingsEnabled={true}//是否显示3D建筑
labelsEnabled={true}//是否显示标注
compassEnabled={false}//是否显示指南针
zoomControlsEnabled={false}//是否显示放大缩小按钮
scaleControlsEnabled={true}//是否显示比例尺
myLocationButtonEnabled={false}//是否显示定位按钮
trafficEnabled={true}//是否显示路况
maxZoom={12}//最大缩放级别
minZoom={10}//最小缩放级别
zoomGesturesEnabled={true}//是否启用缩放手势,用于放大缩小
scrollGesturesEnabled={true}//是否启用滑动手势,用于平移
rotateGesturesEnabled={true}//是否启用旋转手势,用于调整方向
tiltGesturesEnabled={true}//是否启用倾斜手势,用于改变视角
distanceFilter={100}//设定定位的最小更新距离
headingFilter={1}//设定最小更新角度,默认为 1 度

mapRef.current?.moveCamera({
target: {
latitude,
longitude,
},
zoom: 12,
}, 100);

第一次生效,而且也只是zoom属性生效,target位置没变,第二次完全没反应。

是我写法不对,还是有什么属性冲突了

@rjlatgithub
Copy link
Author

已找到原因,服务端返回的经纬度精度问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant