42 lines
909 B
TypeScript
42 lines
909 B
TypeScript
// MapScreen.tsx
|
|
import React from 'react';
|
|
import { StyleSheet, View, Dimensions } from 'react-native';
|
|
import MapView, { Marker, PROVIDER_DEFAULT } from 'react-native-maps';
|
|
|
|
const MapScreen: React.FC = () => {
|
|
const region = {
|
|
latitude: 48.8566,
|
|
longitude: 2.3522,
|
|
latitudeDelta: 0.05,
|
|
longitudeDelta: 0.05,
|
|
};
|
|
|
|
return (
|
|
<View style={styles.container}>
|
|
<MapView
|
|
provider={PROVIDER_DEFAULT} // OpenStreetMap
|
|
style={styles.map}
|
|
region={region}
|
|
>
|
|
<Marker
|
|
coordinate={{ latitude: 48.8566, longitude: 2.3522 }}
|
|
title="Paris"
|
|
description="Capitale de la France"
|
|
/>
|
|
</MapView>
|
|
</View>
|
|
);
|
|
};
|
|
|
|
const styles = StyleSheet.create({
|
|
container: {
|
|
flex: 1,
|
|
},
|
|
map: {
|
|
width: Dimensions.get('window').width,
|
|
height: Dimensions.get('window').height,
|
|
},
|
|
});
|
|
|
|
export default MapScreen;
|