react-native-mapa
v1.0.7
Published
React Native Mapa component for iOS + Android
Downloads
29
Maintainers
Readme
React Native Map SDK for iOS and Android
react-native-mapa是一款开源的React Native地图组件,支持iOS和Android。
成为react-native-mapa的核心开发者
react-native-mapa面向开源,我们欢迎任何感兴趣的开发者加入社区, 进入留言区。
稳定版本请使用 v1.0.6+
Prerequisite
react-native-mapa底层依赖mapbox,因此需要提供Mapbox Access Token
。
Dependencies
- node
- npm
- React Native (0.70+)
Installation
查看安装文档Installation
Run Project
IOS
# YARN
yarn run ios
# NPM
npm run ios
Android
# YARN
yarn run android
# NPM
npm run android
Example
import Mapa from 'react-native-mapa';
import {SafeAreaView, StyleSheet} from 'react-native';
import React from 'react';
Mapa.setAccessToken(
'pk.XXX',
);
function Mapview({}: any): React.JSX.Element {
return (
<SafeAreaView style={styles.container}>
<Mapa.MapView>
<Mapa.Camera />
<Mapa.Compass />
</Mapa.MapView>
</SafeAreaView>
);
}
export default Mapview;
const styles = StyleSheet.create({
container: {
height: '100%',
},
});