diff --git a/app/(tabs)/map.tsx b/app/(tabs)/map.tsx index 941886f..f1574b6 100644 --- a/app/(tabs)/map.tsx +++ b/app/(tabs)/map.tsx @@ -1,6 +1,6 @@ import React, {useEffect, useState} from 'react'; -import {Image, SafeAreaView, ScrollView, StatusBar, StyleSheet, Switch, View} from 'react-native'; -import Mapbox, {MapView} from "@rnmapbox/maps"; +import {Image, SafeAreaView, ScrollView, StatusBar, StyleSheet, Switch, View, Dimensions} from 'react-native'; +import Mapbox, {Callout, Camera, MapView, PointAnnotation} from "@rnmapbox/maps"; Mapbox.setAccessToken("pk.eyJ1IjoibWFhcnRlbnZyOTgiLCJhIjoiY2x6ZDFqMGp1MGVyejJrczhqcXpvYm9iYiJ9.XvYcL62dWiJQiFmG6mOoug"); @@ -12,7 +12,6 @@ import List from '@/components/List'; import {Request} from '@/services/request'; - export default function MapScreen() { const colorScheme = useColorScheme() ?? 'light'; @@ -75,7 +74,7 @@ export default function MapScreen() { return ( - + Afvalcontainers @@ -87,42 +86,50 @@ export default function MapScreen() { - {/*{activeMarkers().map((marker: any, index: any) => (*/} - {/* */} - {/*))}*/} + + {activeMarkers().map((marker: any, index: any) => ( + + + + {marker.description + ' - ' + marker.street} + + + + ))} + - - ( - - - - {item.name} - + + ( + + + + {item.name} + - toggleSwitch(index)} - /> - - )}/> - + toggleSwitch(index)} + /> + + )}/> @@ -133,6 +140,7 @@ const styles = StyleSheet.create({ container: { marginTop: StatusBar.currentHeight, paddingTop: 25, + flex: 1, }, titleContainer: { paddingLeft: 25, @@ -144,14 +152,16 @@ const styles = StyleSheet.create({ }, mapContainer: { marginTop: 15, + height: 400, }, map: { - width: '100%', - height: 500, + width: Dimensions.get('window').width, + height: 400, flex: 1, }, listContainer: { - marginTop: 10, + flex: 1, + marginTop: 20, paddingLeft: 25, paddingRight: 25, }, @@ -176,5 +186,9 @@ const styles = StyleSheet.create({ height: 30, borderRadius: 5, marginRight: 8, - } + }, + callout: { + width: 200, + padding: 5, + }, }); diff --git a/services/request.tsx b/services/request.tsx index 300670a..90549ce 100644 --- a/services/request.tsx +++ b/services/request.tsx @@ -2,7 +2,7 @@ import axios from 'axios'; const API_URL = 'https://kliko.maartenvr98.nl/api/v1/'; const CONFIG = { - timeout: 3000, + timeout: 30000, }; export class Request {