|
|
@ -1,33 +1,20 @@ |
|
|
|
import React, { useState, useEffect, useContext } from "react"; |
|
|
|
import { StyleSheet, Text, View } from "react-native"; |
|
|
|
import React, { useEffect, useContext } from "react"; |
|
|
|
import { StyleSheet, View } from "react-native"; |
|
|
|
import OpenStreetMap from "../components/map/OpenStreetMap"; |
|
|
|
import { CurrentLocationContext } from "../context/CurrentLocationContext"; |
|
|
|
import attachFocusToQuery from "../hooks/useFocus"; |
|
|
|
import {MapMarkerList} from "../components/MapMarkerList"; |
|
|
|
|
|
|
|
export default function MapFeedScreen() { |
|
|
|
const [position, setPosition] = useState(null); |
|
|
|
|
|
|
|
const context = useContext(CurrentLocationContext); |
|
|
|
const location = context.currentCoordinates; |
|
|
|
const focusChanged = attachFocusToQuery(); |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
setPosition({ |
|
|
|
lat: location["latitude"], |
|
|
|
long: location["longitude"], |
|
|
|
zoom: 16.5, |
|
|
|
}); |
|
|
|
}, [location]); |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
<View style={styles.container}> |
|
|
|
<OpenStreetMap |
|
|
|
markersList={MapMarkerList({reload:focusChanged, renderRain:true})} |
|
|
|
// animateToPosition={position}
|
|
|
|
centerUserLocation={true} |
|
|
|
focusChanged={focusChanged} |
|
|
|
/> |
|
|
|
|
|
|
|
</View> |
|
|
|