1 2 3 4 |
npm install react-native-maps --save-exact cd ios pod install cd .. |
bunları sırayla uyguluyoruz.
örnek kullanımı;
1 |
import MapView from 'react-native-maps'; |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
render(){ return <SafeAreaView> <View style={styles.container}> <MapView style={styles.map} region={{ latitude: 37.78825, longitude: -122.4324, latitudeDelta: 0.015, longitudeDelta: 0.0121, }} > </MapView> </View> </SafeAreaView> } } const styles = StyleSheet.create({ container: { ...StyleSheet.absoluteFillObject, height: 400, width: 400, justifyContent: 'flex-end', alignItems: 'center', }, map: { ...StyleSheet.absoluteFillObject, }, }); |
bu basit hali ve ekranda gözüken ilk hali tabi. ayarlarımızı yapmamız lazım.