|
@ -9,6 +9,7 @@ import { CurrentLocationContext } from "../context/CurrentLocationContext"; |
|
|
import { MapMarkerList } from "../components/MapMarkerList"; |
|
|
import { MapMarkerList } from "../components/MapMarkerList"; |
|
|
import FloatButton from "../components/FloatButton"; |
|
|
import FloatButton from "../components/FloatButton"; |
|
|
import { MapDataContext } from "../context/MapDataContext"; |
|
|
import { MapDataContext } from "../context/MapDataContext"; |
|
|
|
|
|
import MapPolygons from "../components/MapPolygons"; |
|
|
|
|
|
|
|
|
function MapFeedScreen(props) { |
|
|
function MapFeedScreen(props) { |
|
|
const context = useContext(CurrentLocationContext); |
|
|
const context = useContext(CurrentLocationContext); |
|
@ -29,6 +30,27 @@ function MapFeedScreen(props) { |
|
|
longitudeDelta: map_scale * (screen_width / screen_height), |
|
|
longitudeDelta: map_scale * (screen_width / screen_height), |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
//Coordenadas dos poligonos das áreas de inundação (substituir por valores da API em MapPolygons)
|
|
|
|
|
|
const polyCoordinates = [ |
|
|
|
|
|
{ |
|
|
|
|
|
latitude: location["latitude"] - 0.001, |
|
|
|
|
|
longitude: location["longitude"] + 0.00002 |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
latitude: (location.latitude) - 0.0002, |
|
|
|
|
|
longitude: (location.longitude) + 0.0001 |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
latitude: (location.latitude) + 0.001, |
|
|
|
|
|
longitude: (location.longitude) - 0.00002 |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
latitude: (location.latitude) + 0.0002, |
|
|
|
|
|
longitude: (location.longitude) - 0.001 |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
|
return ( |
|
|
return ( |
|
|
<View style={styles.container}> |
|
|
<View style={styles.container}> |
|
|
<MapView |
|
|
<MapView |
|
@ -47,6 +69,11 @@ function MapFeedScreen(props) { |
|
|
renderFlood={datas.flood} |
|
|
renderFlood={datas.flood} |
|
|
renderPluviometer={datas.pluviometer} |
|
|
renderPluviometer={datas.pluviometer} |
|
|
renderRiver={datas.river} /> |
|
|
renderRiver={datas.river} /> |
|
|
|
|
|
|
|
|
|
|
|
{datas.floodAreas && ( |
|
|
|
|
|
<MapPolygons |
|
|
|
|
|
coordinates={polyCoordinates} /> |
|
|
|
|
|
)} |
|
|
</MapView> |
|
|
</MapView> |
|
|
<FloatButton /> |
|
|
<FloatButton /> |
|
|
</View> |
|
|
</View> |
|
|