react-native-mapa
v1.1.0
Published
React Native Mapa component for iOS + Android
Downloads
123
Maintainers
Readme
Prerequisite
react-native-mapa relies on mapbox, so you need to provide a Mapbox Access Token
.
Dependencies
- node
- npm
- React Native (0.70+)
Installation
Please check the installation documentation 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%',
},
});