react-native-baidu-map
react-native-baidu-map copied to clipboard
Baidu Map SDK modules and views for React Native(Android & iOS), support react native 0.61+. 百度地图 React Native 模块,支持 react native 0.61+,已更新到最新的百度地图SDK版本。
百度Android定位SDK自v9.2.9版本起增加了隐私合规接口,使用方式发生了改变,与旧版本不兼容,请务必确保用户同意隐私政策后调用setAgreePrivacy接口以进行SDK初始化之前的准备工作。 新增定位SDK隐私合规接口setAgreePrivacy(boolean isAgreePrivacy); public LocationClient mLocationClient = null; public LocationClient mLocationClient = null; private MyLocationListener myListener = new MyLocationListener(); public void onCreate() { LocationClient.setAgreePrivacy(true); //setAgreePrivacy接口需要在LocationClient实例化之前调用 //如果setAgreePrivacy接口参数设置为了false,则定位功能不会实现 //true,表示用户同意隐私合规政策 //false,表示用户不同意隐私合规政策 } 2实例化LocationClient时,需要捕获异常信息,示例如下:...
代码修改
@Override public void removeViewAt(TextureMapView parent, int index) { View child = parent.getChildAt(index); Log.i("MapViewManager", "removeViewAt:" + index + "," + child.getClass().getName()); if (child instanceof OverlayView) { if (child instanceof OverlayMarker) {...
"react-native": "0.66.4", "react-native-baidu-map": "^1.0.37" android 集成react-native-baidu-map 打包报错 Execution failed for task ':app:packageRelease'. > A failure occurred while executing com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable > java.lang.OutOfMemoryError (no error message)
RN0.61.3 安卓报Could not resolve com.facebook.react:react-native:0.61.2., 不是说支持0.61.2+了么?
源码里面直接移除了
iOS端MapView无法拖动和缩放,安卓是正常的,有大佬知道可能是因为什么问题嘛 RN 0.63 "react-native-baidu-map": "^1.0.37" iOS 10.0
将 包文件下的build.gradle中的compileOnly 'com.facebook.react:react-native:0.62.2' 改为compileOnly 'com.facebook.react:react-native:+'
