analuizaff
3 years ago
12 changed files with 113 additions and 110 deletions
-
49src/app/components/MapMarkerList.js
-
1src/app/components/MapModal.js
-
24src/app/components/map/LeafLetMap.js
-
70src/app/components/map/OpenStreetMap.js
-
3src/app/hooks/selectFromDB.js
-
62src/app/navigation/AppNavigator.js
-
1src/app/navigation/NewListingButton.js
-
2src/app/screens/ForecastScreen.js
-
5src/app/screens/MapFeedScreen.js
-
2src/app/screens/MessagesScreen.js
-
2src/app/screens/SharingDataScreen.js
-
2src/package.json
@ -1,45 +1,20 @@ |
|||
import useMarkers from "../hooks/selectFromDB"; |
|||
|
|||
function isRequestedValue( |
|||
item, |
|||
renderRain, |
|||
renderFlood, |
|||
renderRiver, |
|||
renderPluviometer, |
|||
renderOfficialPluviometer |
|||
) { |
|||
function isRequestedValue(item, renderOptions) { |
|||
return ( |
|||
(item.name == "pluviometer" && renderPluviometer) || |
|||
(item.name == "officialPluviometer") & renderOfficialPluviometer || |
|||
(item.name == "rain" && renderRain) || |
|||
(item.name == "river" && renderRiver) || |
|||
(item.name == "flood" && renderFlood) |
|||
(item.name == "pluviometer" && renderOptions.citzen.pluviometer) || |
|||
(item.name == "officialPluviometer" && |
|||
renderOptions.oficial.automaticPluviometer) || |
|||
(item.name == "rain" && renderOptions.citzen.rain) || |
|||
(item.name == "river" && renderOptions.citzen.riverFlood) || |
|||
(item.name == "flood" && renderOptions.citzen.floodRisk) |
|||
); |
|||
} |
|||
|
|||
function MapMarkerList({ |
|||
markers, |
|||
renderRain = true, |
|||
renderFlood = true, |
|||
renderRiver = true, |
|||
renderPluviometer = true, |
|||
renderOfficialPluviometer = true, |
|||
}) { |
|||
|
|||
// FIXME: Resolve this later!!!
|
|||
return markers.markers; |
|||
function MapMarkerList({ markers, renderOptions }) { |
|||
if (!markers) return null; |
|||
|
|||
// return [...markers.markers].filter(([k, item]) => {
|
|||
// isRequestedValue(
|
|||
// item,
|
|||
// renderRain,
|
|||
// renderFlood,
|
|||
// renderRiver,
|
|||
// renderPluviometer,
|
|||
// renderOfficialPluviometer
|
|||
// )
|
|||
// }
|
|||
// );
|
|||
return [...markers.markers].filter(([_, item]) => { |
|||
return isRequestedValue(item, renderOptions); |
|||
}); |
|||
} |
|||
|
|||
export { MapMarkerList }; |
Write
Preview
Loading…
Cancel
Save
Reference in new issue