Compare commits

...

4 commits

Author SHA1 Message Date
09de59c178 Added map icon 2020-06-22 20:07:26 +02:00
f644964473 Updated translations 2020-06-22 20:06:34 +02:00
936f2a8e9e Use public token 2020-06-22 20:02:34 +02:00
1af4688329 Tried implementing basic map markers 2020-06-22 16:04:08 +02:00
5 changed files with 61 additions and 19 deletions

View file

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

View file

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

View file

@ -31,6 +31,7 @@ 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 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 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";
@ -122,9 +123,9 @@ class ServicesScreen extends React.Component<Props, State> {
];
this.insaDataset = [
{
title: "MAP", // TODO translate
title: i18n.t('screens.map'),
subtitle: "MAP",
image: RU_IMAGE,
image: MAP_IMAGE,
onPress: () => nav.navigate("map"),
},
{

View file

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

View file

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