diff --git a/src/app/components/MapPolygons.js b/src/app/components/MapPolygons.js
index 1bde7ce..7975ada 100644
--- a/src/app/components/MapPolygons.js
+++ b/src/app/components/MapPolygons.js
@@ -1,15 +1,67 @@
-import React from "react";
+import React, { useContext } from "react";
+import { View } from "react-native";
import { Polygon } from "react-native-maps";
+import { CurrentLocationContext } from "../context/CurrentLocationContext";
-export default function MapPolygons({ coordinates }) {
+export default function MapPolygons() {
+ const context = useContext(CurrentLocationContext);
+ const location = context.currentCoordinates;
+
+
+ //Coordenadas dos poligonos das áreas de inundação (substituir por valores da API)
+ const coordinates1 = [
+ {
+ 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
+ }
+ ];
+ const coordinates2 = [
+ {
+ latitude: location["latitude"] + 0.0010,
+ longitude: location["longitude"] - 0.0007
+ },
+ {
+ latitude: (location.latitude) + 0.0006,
+ longitude: (location.longitude) - 0.0006
+ },
+ {
+ latitude: (location.latitude) + 0.17,
+ longitude: (location.longitude) - 0.00225
+ },
+ {
+ latitude: (location.latitude) + 0.001,
+ longitude: (location.longitude) - 0.00212
+ }
+ ]
return (
-
+
+
+
+
);
}
diff --git a/src/app/screens/MapFeedScreen.js b/src/app/screens/MapFeedScreen.js
index a237975..40b6cd9 100644
--- a/src/app/screens/MapFeedScreen.js
+++ b/src/app/screens/MapFeedScreen.js
@@ -16,6 +16,8 @@ function MapFeedScreen(props) {
const datas = useContext(MapDataContext);
const location = context.currentCoordinates;
const focusChanged = attachFocusToQuery();
+ console.log("-----------latitude: "+ location.latitude);
+ console.log("-----------longitude: "+ location.longitude);
const default_location = {
latitude: -12.901799,
@@ -30,27 +32,6 @@ 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 && (
-
+ {datas.floodAreas &&(
+
)}