diff --git a/src/app/components/MapPolygons.js b/src/app/components/MapPolygons.js
new file mode 100644
index 0000000..7608168
--- /dev/null
+++ b/src/app/components/MapPolygons.js
@@ -0,0 +1,21 @@
+import React, { useState } from "react";
+import { View, StyleSheet, Image } from "react-native";
+import MapView, { Polygon } from "react-native-maps";
+import colors from "../config/colors";
+import { dimensions } from "../config/dimensions";
+import MapModal from "./MapModal";
+const markerSize = 30;
+
+export default function MapPolygons({ coordinates }) {
+ return (
+
+ );
+}
+
+
diff --git a/src/app/context/CurrentLocationContext.js b/src/app/context/CurrentLocationContext.js
index cc93f11..46079d9 100644
--- a/src/app/context/CurrentLocationContext.js
+++ b/src/app/context/CurrentLocationContext.js
@@ -22,8 +22,6 @@ const CurrentLocationProvider = ({ children }) => {
});
setCurrentCoordinates({ latitude, longitude });
- //console.log({ latitude, longitude });
- // console.log(currentCoordinates);
getAddress({ latitude, longitude });
@@ -34,7 +32,6 @@ const CurrentLocationProvider = ({ children }) => {
//get user current location address
const getAddress = async (coordenadas) => {
- // console.log("PEGANDO ENDEREÇO");
Location.setGoogleApiKey("AIzaSyD_wuuokS3SVczc8qSASrsBq0E5qIpdyMc");
@@ -48,7 +45,6 @@ const CurrentLocationProvider = ({ children }) => {
else{//Quando o usuário não da permissão de acesso da localização o geoCode retorna um array vazio
setCurrentLocation("Erro ao carregar localização", coordenadas.x);
}
- //console.log(currentLocation);
};
diff --git a/src/app/context/MapDataContext.js b/src/app/context/MapDataContext.js
index e8b0d87..e70696a 100644
--- a/src/app/context/MapDataContext.js
+++ b/src/app/context/MapDataContext.js
@@ -70,7 +70,7 @@ const MapDataProvider = ({ children }) => {
setPluviometer(layers.values[2].isSelected);
//setOfficialPluviometer(layers.values[3].isSelected);
setRiver(layers.values[4].isSelected);
- //setFloodAreas(layers.values[5].isSelected);
+ setFloodAreas(layers.values[5].isSelected);
}
diff --git a/src/app/screens/MapFeedScreen.js b/src/app/screens/MapFeedScreen.js
index 4b5838f..a237975 100644
--- a/src/app/screens/MapFeedScreen.js
+++ b/src/app/screens/MapFeedScreen.js
@@ -9,6 +9,7 @@ import { CurrentLocationContext } from "../context/CurrentLocationContext";
import { MapMarkerList } from "../components/MapMarkerList";
import FloatButton from "../components/FloatButton";
import { MapDataContext } from "../context/MapDataContext";
+import MapPolygons from "../components/MapPolygons";
function MapFeedScreen(props) {
const context = useContext(CurrentLocationContext);
@@ -29,6 +30,27 @@ function MapFeedScreen(props) {
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 (
-
+
+
+ {datas.floodAreas && (
+
+ )}