Compare commits

..

No commits in common. "09de59c178423813835f94a9317a66fdcc95e7d8" and "211e57167d6491b3f97925c01d5b25b175fba7d0" have entirely different histories.

5 changed files with 19 additions and 61 deletions

View file

@ -111,7 +111,7 @@ function MainStackComponent(props: { createTabNavigator: () => React.Node }) {
name="map" name="map"
component={MapScreen} component={MapScreen}
options={{ options={{
title: i18n.t('screens.map'), title: "MAP", // TODO translate
}} }}
/> />

View file

@ -12,41 +12,26 @@ type Props = {
theme: CustomTheme, theme: CustomTheme,
} }
type State = { MapboxGL.setAccessToken("sk.eyJ1IjoiYW1pY2FsZS1pbnNhdCIsImEiOiJja2JpM212Z3QwYmxmMnhsc3RxZWYza2Q5In0.og84RKRa6-vr3qRA1qU9Aw");
featureCollection: Array<Object>,
}
MapboxGL.setAccessToken("pk.eyJ1IjoiYW1pY2FsZS1pbnNhdCIsImEiOiJja2JpM2d5OHYwYmdiMndxdnV4bmh6bGFwIn0.qiOwbs2_HRaQGUOpBDjbsQ"); const layerStyles = {
smileyFace: {
// const styles = { fillAntialias: true,
// icon: { fillColor: 'white',
// iconImage: exampleIcon, fillOutlineColor: 'rgba(255, 255, 255, 0.84)',
// iconAllowOverlap: true, },
// }, };
// };
// const FEATURES = [{
// type: 'Feature',
// geometry: {
// type: 'Point',
// coordinates: [1.4669608, 43.5698867],
// }
// }]
/** /**
* Class defining the app's map screen. * Class defining the app's map screen.
*/ */
class MapScreen extends React.Component<Props, State> { class MapScreen extends React.Component<Props> {
map: { current: null | MapboxGL.MapView }; map : { current: null | MapboxGL.MapView };
constructor() { constructor() {
super(); super();
this.map = React.createRef(); this.map = React.createRef();
this.state = {
featureCollection: [],
};
} }
componentDidMount() { componentDidMount() {
@ -54,47 +39,23 @@ class MapScreen extends React.Component<Props, State> {
} }
// onSymbolPress = (feature) => {
// console.log("coucou");
// }
//
//
// onSourceLayerPress = ({features, coordinates, point}) => {
// console.log(
// 'You pressed a layer here are your features:',
// features,
// coordinates,
// point,
// );
// }
render() { render() {
return ( return (
<View style={{flex: 1}}> <View style={{flex: 1}}>
<MapboxGL.MapView <MapboxGL.MapView
style={{flex: 1}} style={{flex: 1}}
ref={this.map}
styleURL={MapboxGL.StyleURL.Outdoors} styleURL={MapboxGL.StyleURL.Outdoors}
ref={this.map}
surfaceView={true} surfaceView={true}
onPress={(e) => { onPress={async () => {
console.log(e) const center = await this.map.current.getCenter();
console.log(center);
}} }}
> >
<MapboxGL.Camera <MapboxGL.Camera
zoomLevel={15} zoomLevel={15}
centerCoordinate={[1.4669608, 43.5698867]} centerCoordinate={[1.4669608, 43.5698867]}
pitch={30}
/> />
{/*<MapboxGL.ShapeSource*/}
{/* id="symbolLocationSource"*/}
{/* shape={{ type: 'FeatureCollection', features: FEATURES }}*/}
{/*>*/}
{/* <MapboxGL.SymbolLayer*/}
{/* id="symbolLocationSymbols"*/}
{/* minZoomLevel={15}*/}
{/* style={styles.icon}*/}
{/* />*/}
{/*</MapboxGL.ShapeSource>*/}
</MapboxGL.MapView> </MapboxGL.MapView>
</View> </View>
); );

View file

@ -31,7 +31,6 @@ const WIKETUD_IMAGE = "https://etud.insa-toulouse.fr/~amicale_app/images/Wiketud
const EE_IMAGE = "https://etud.insa-toulouse.fr/~amicale_app/images/EEC.png"; const EE_IMAGE = "https://etud.insa-toulouse.fr/~amicale_app/images/EEC.png";
const TUTORINSA_IMAGE = "https://etud.insa-toulouse.fr/~amicale_app/images/TutorINSA.png"; const TUTORINSA_IMAGE = "https://etud.insa-toulouse.fr/~amicale_app/images/TutorINSA.png";
const MAP_IMAGE = "https://etud.insa-toulouse.fr/~amicale_app/images/Map.png";
const BIB_IMAGE = "https://etud.insa-toulouse.fr/~amicale_app/images/Bib.png"; const BIB_IMAGE = "https://etud.insa-toulouse.fr/~amicale_app/images/Bib.png";
const RU_IMAGE = "https://etud.insa-toulouse.fr/~amicale_app/images/RU.png"; const RU_IMAGE = "https://etud.insa-toulouse.fr/~amicale_app/images/RU.png";
const ROOM_IMAGE = "https://etud.insa-toulouse.fr/~amicale_app/images/Salles.png"; const ROOM_IMAGE = "https://etud.insa-toulouse.fr/~amicale_app/images/Salles.png";
@ -123,9 +122,9 @@ class ServicesScreen extends React.Component<Props, State> {
]; ];
this.insaDataset = [ this.insaDataset = [
{ {
title: i18n.t('screens.map'), title: "MAP", // TODO translate
subtitle: "MAP", subtitle: "MAP",
image: MAP_IMAGE, image: RU_IMAGE,
onPress: () => nav.navigate("map"), onPress: () => nav.navigate("map"),
}, },
{ {

View file

@ -25,8 +25,7 @@
"profile": "Profile", "profile": "Profile",
"vote": "Elections", "vote": "Elections",
"scanner": "Scanotron 3000", "scanner": "Scanotron 3000",
"feedback": "Feedback", "feedback": "Feedback"
"map": "Campus Map"
}, },
"intro": { "intro": {
"slideMain": { "slideMain": {

View file

@ -25,8 +25,7 @@
"profile": "Profil", "profile": "Profil",
"vote": "Élections", "vote": "Élections",
"scanner": "Scanotron 3000", "scanner": "Scanotron 3000",
"feedback": "Votre avis", "feedback": "Votre avis"
"map": "Carte du campus"
}, },
"intro": { "intro": {
"slideMain": { "slideMain": {