projectzerorn-baidumap
v1.0.17
Published
###非稳定版本 暂时不要使用 修改删除了一些方法 改动较大 后续可能会从sincethere/react-native-baidumap断开
Downloads
17
Maintainers
Readme
react-native-baidumap
###非稳定版本 暂时不要使用 修改删除了一些方法 改动较大 后续可能会从sincethere/react-native-baidumap断开
Installation
First you need to install react-native-baidumapkit:
$ npm install react-native-baidumapkit --save
Add Configuration link
($ npm install rnpm --global)
$ rnpm link react-native-baidumapkit
If the link fails, manually add
settings.gradle
include ':react-native-baidumapkit'
project(':react-native-baidumapkit').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-baidumapkit/android')
build.gradle
dependencies {
...
compile project(':react-native-baidumapkit')
}
MainActivity
import com.bee.baidumapview.BaiduMapModuleReactPackage;
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
...
new BaiduMapModuleReactPackage(),
new BaiduMapReactPackage(this),
);
}
Release Notes
- 1.0.0
Example
import BDMapModule from ('react-native-baidumapkit/BDMapModule');
import BDMapView from ('react-native-baidumapkit');
<BDMapView style={styles.mapViewStyle}
ref={'locationMap'}
isEnableClicked={true}
range={this.state.range}
/>
let value = {
"baidu_latitude" :this.props["baidu_latitude"],
"baidu_longitude" :this.props["baidu_longitude"],
"avatar" :this.props.avatar
}
BDMapModule.setLocation(React.findNodeHandle(this.refs.locationMap),value);
BDMapModule.setLocationAnimation(React.findNodeHandle(this.refs.locationMap),value);
BDMapModule.setRuler(React.findNodeHandle(this.refs.locationMap),20);
other....