traintrape-moi/client/app/(tabs)/index.jsx
Emmy D'Anello 49fcb6edbc
Structure globale de l'application client
Signed-off-by: Emmy D'Anello <emmy@luemy.eu>
2024-12-01 18:59:11 +01:00

47 lines
1.1 KiB
JavaScript

import { Platform, StyleSheet } from 'react-native'
import { ThemedView } from '@/components/ThemedView'
export default function MapScreen() {
if (Platform.OS === "web") {
const maplibre = require('react-map-gl/maplibre')
const Map = maplibre.Map
return <ThemedView style={styles.page}>
<Map
initialViewState={{
longitude: 0,
latitude: 0,
zoom: 1
}}
mapStyle="https://demotiles.maplibre.org/style.json"
/>
</ThemedView>
}
else {
const MapLibreGL = require('@maplibre/maplibre-react-native')
MapLibreGL.setAccessToken(null)
return (
<ThemedView style={styles.page}>
<MapLibreGL.MapView
style={styles.map}
logoEnabled={false}
styleURL="https://demotiles.maplibre.org/style.json"
children={[]}
/>
</ThemedView>
)
}
}
const styles = StyleSheet.create({
page: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
map: {
flex: 1,
alignSelf: 'stretch',
},
});