|
@ -1,5 +1,5 @@ |
|
|
import React, { useState } from "react"; |
|
|
import React, { useState } from "react"; |
|
|
import { StyleSheet, View } from "react-native"; |
|
|
|
|
|
|
|
|
import { StyleSheet, View, Text } from "react-native"; |
|
|
import OpenStreetMap from "../components/map/OpenStreetMap"; |
|
|
import OpenStreetMap from "../components/map/OpenStreetMap"; |
|
|
import attachFocusToQuery from "../hooks/useFocus"; |
|
|
import attachFocusToQuery from "../hooks/useFocus"; |
|
|
import HeaderBarMenu from "../components/HeaderBarMenu"; |
|
|
import HeaderBarMenu from "../components/HeaderBarMenu"; |
|
@ -9,8 +9,6 @@ import LoadingMarkersModal from "../components/LoadingMarkersModal"; |
|
|
export default function MapFeedScreen(props) { |
|
|
export default function MapFeedScreen(props) { |
|
|
HeaderBarMenu(props.navigation); |
|
|
HeaderBarMenu(props.navigation); |
|
|
|
|
|
|
|
|
const focusChanged = attachFocusToQuery(); |
|
|
|
|
|
|
|
|
|
|
|
const [dataOptionsToShow, setDataOptionsToShow] = useState({ |
|
|
const [dataOptionsToShow, setDataOptionsToShow] = useState({ |
|
|
oficial: { |
|
|
oficial: { |
|
|
automaticPluviometer: false, |
|
|
automaticPluviometer: false, |
|
@ -26,8 +24,11 @@ export default function MapFeedScreen(props) { |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
const markers = useSocketMarkers(); |
|
|
const markers = useSocketMarkers(); |
|
|
|
|
|
console.log("============= qtd markers " + markers.markers.size + " ================" ) |
|
|
|
|
|
|
|
|
|
|
|
// console.log("location: " + JSON.stringify(global.location))
|
|
|
return ( |
|
|
return ( |
|
|
|
|
|
(global.location) ? ( |
|
|
<View style={styles.container}> |
|
|
<View style={styles.container}> |
|
|
<OpenStreetMap |
|
|
<OpenStreetMap |
|
|
markers={markers} |
|
|
markers={markers} |
|
@ -38,6 +39,11 @@ export default function MapFeedScreen(props) { |
|
|
<LoadingMarkersModal |
|
|
<LoadingMarkersModal |
|
|
show={markers.markers.size <= 0}/> |
|
|
show={markers.markers.size <= 0}/> |
|
|
</View> |
|
|
</View> |
|
|
|
|
|
):( |
|
|
|
|
|
<View> |
|
|
|
|
|
<Text>Apresentar um erro no futuro</Text> |
|
|
|
|
|
</View> |
|
|
|
|
|
) |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|