diff --git a/assets/icon/ceklis.png b/assets/icon/ceklis.png new file mode 100644 index 0000000..44dce13 Binary files /dev/null and b/assets/icon/ceklis.png differ diff --git a/assets/icon/map_16.png b/assets/icon/map_16.png new file mode 100644 index 0000000..45198f0 Binary files /dev/null and b/assets/icon/map_16.png differ diff --git a/assets/icon/x.png b/assets/icon/x.png new file mode 100644 index 0000000..a0106f2 Binary files /dev/null and b/assets/icon/x.png differ diff --git a/src/component/mapCollectLineScreen.tsx b/src/component/mapCollectLineScreen.tsx index e1a4a21..2d3308d 100644 --- a/src/component/mapCollectLineScreen.tsx +++ b/src/component/mapCollectLineScreen.tsx @@ -1,9 +1,10 @@ import React, {useState, useEffect} from "react"; -import { View, Text, StyleSheet, Alert, TouchableOpacity, Image, StatusBar } from "react-native"; +import { View, Text, StyleSheet, Alert, TouchableOpacity, Image, StatusBar, Pressable } from "react-native"; import MapLibreGL from '@maplibre/maplibre-react-native'; import { MapView,ShapeSource,Camera,UserLocation,PointAnnotation,FillLayer,LineLayer,VectorSource } from "@maplibre/maplibre-react-native"; import Geolocation from "@react-native-community/geolocation"; +import Modal from "react-native-modal"; type MapCollectLineProps = {route: any,navigation: any} function MapCollectLineScreen({route,navigation}:MapCollectLineProps):React.JSX.Element{ @@ -37,6 +38,9 @@ function MapCollectLineScreen({route,navigation}:MapCollectLineProps):React.JSX. const [lat,setLat] = useState(0); const [accuracy,setAccuracy] = useState(0); const [timeStamp,setTimeStamp] = useState(0); + const [modalBasemap,setmodalBasemap] = useState(false); + const [modalLayerList,setmodalLayerList] = useState(false); + useEffect(() => { const intervalID = setInterval(() => { @@ -180,25 +184,55 @@ function MapCollectLineScreen({route,navigation}:MapCollectLineProps):React.JSX. - + setmodalLayerList(true)} style={{position:'absolute',backgroundColor:'#FFFFFF',width:50,height:50,borderRadius:25,alignItems:'center',justifyContent:'center',top:'7%',left:'4%'}}> - + setmodalBasemap(true)} style={{position:'absolute',backgroundColor:'#FFFFFF',width:50,height:50,borderRadius:25,alignItems:'center',justifyContent:'center',top:'15%',left:'4%'}}> - + {/* - + */} + + + setmodalBasemap(false)} style={{top:'18%',alignSelf:'center'}}> + + + + Basemap Gallery + + setmodalBasemap(false)} style={{alignSelf:'flex-end',padding:10}}> + + + + + + setmodalLayerList(false)} style={{top:'18%',alignSelf:'center'}}> + + + + Layer List + + setmodalLayerList(false)} style={{alignSelf:'flex-end',padding:10}}> + + + + + {/* handleZoom(true)}> diff --git a/src/component/mapCollectPolygonScreen.tsx b/src/component/mapCollectPolygonScreen.tsx index 7183cb3..9e04432 100644 --- a/src/component/mapCollectPolygonScreen.tsx +++ b/src/component/mapCollectPolygonScreen.tsx @@ -1,9 +1,10 @@ import React, {useState, useEffect, useRef} from "react"; -import { View, Text, StyleSheet, Alert, TouchableOpacity, Image, StatusBar } from "react-native"; +import { View, Text, StyleSheet, Alert, TouchableOpacity, Image, StatusBar, Pressable } from "react-native"; import MapLibreGL from '@maplibre/maplibre-react-native'; import { MapView,ShapeSource,Camera,UserLocation,PointAnnotation,FillLayer,LineLayer,VectorSource } from "@maplibre/maplibre-react-native"; import Geolocation from "@react-native-community/geolocation"; +import Modal from "react-native-modal"; type MapCollectPolygonProps = {route: any,navigation: any} @@ -21,6 +22,8 @@ function MapCollectPolygonScreen({route,navigation}:MapCollectPolygonProps):Reac const [startPoint, setStartPoint] = useState([]); const [manyPick, setManyPick] = useState(0); const [drawingComplete,setDrawingComplete] = useState(false); + const [modalBasemap,setmodalBasemap] = useState(false); + const [modalLayerList,setmodalLayerList] = useState(false); const morePoint = async () => { setManyPick(manyPick+1); @@ -132,6 +135,7 @@ function MapCollectPolygonScreen({route,navigation}:MapCollectPolygonProps):Reac onRegionDidChange={(region)=> setZoom(region.properties.zoomLevel) } + compassEnabled={false} > - + setmodalLayerList(true)} style={{position:'absolute',backgroundColor:'#FFFFFF',width:50,height:50,borderRadius:25,alignItems:'center',justifyContent:'center',top:'7%',left:'4%'}}> - + setmodalBasemap(true)} style={{position:'absolute',backgroundColor:'#FFFFFF',width:50,height:50,borderRadius:25,alignItems:'center',justifyContent:'center',top:'15%',left:'4%'}}> + + setmodalBasemap(false)} style={{top:'18%',alignSelf:'center'}}> + + + + Basemap Gallery + + setmodalBasemap(false)} style={{alignSelf:'flex-end',padding:10}}> + + + + + + + setmodalLayerList(false)} style={{top:'18%',alignSelf:'center'}}> + + + + Layer List + + setmodalLayerList(false)} style={{alignSelf:'flex-end',padding:10}}> + + + + + + {/* Widget Map */} - + {/* handleZoom(true)}> - + */} { startPoint.length === 0 ? currentPosition.length > 0 ? diff --git a/src/component/mapCollectScreen.tsx b/src/component/mapCollectScreen.tsx index 508834b..19ebb92 100644 --- a/src/component/mapCollectScreen.tsx +++ b/src/component/mapCollectScreen.tsx @@ -1,12 +1,13 @@ import React, {useState, useEffect, useRef} from "react"; -import { View, Text, StyleSheet, Alert, TouchableOpacity, Image, Modal, Pressable, FlatList, LogBox } from "react-native"; +import { View, Text, StyleSheet, Alert, TouchableOpacity, Image, Pressable, FlatList, LogBox, StatusBar, TextInput } from "react-native"; import MapLibreGL from '@maplibre/maplibre-react-native'; import { MapView,ShapeSource,Camera,UserLocation,PointAnnotation,FillLayer,LineLayer,VectorSource } from "@maplibre/maplibre-react-native"; import Geolocation from "@react-native-community/geolocation"; import AsyncStorage from '@react-native-async-storage/async-storage'; -import { TextInput } from "react-native-paper"; +// import { TextInput } from "react-native-paper"; import adminCountry from '../../assets/geojson/admKabKota.json'; +import Modal from "react-native-modal"; // MapLibreGL.setAccessToken(null); type MapCollectProps = {route: any,navigation: any} @@ -21,7 +22,9 @@ function MapCollectScreen({route,navigation}:MapCollectProps):React.JSX.Element{ const [delayRender, setDelayRender] = useState(true); const [long,setLong] = useState(0); const [lat,setLat] = useState(0); - + const [modalInputLocation, setmodalInputLocation] = useState(false); + const [modalBasemap, setmodalBasemap] = useState(false); + const [modalLayerList, setmodalLayerList] = useState(false); const getLocation = () => { Geolocation.getCurrentPosition( position => { @@ -55,7 +58,6 @@ function MapCollectScreen({route,navigation}:MapCollectProps):React.JSX.Element{ }; const [zoom, setZoom] = useState(15); - console.log('zoomLevel',zoom); const MAX_ZOOM_LEVEL = 20; const MIN_ZOOM_LEVEL = 5; @@ -81,10 +83,13 @@ function MapCollectScreen({route,navigation}:MapCollectProps):React.JSX.Element{ setCurrentPosition([long,lat]) setFixCoor({long:long,lat:lat}) } + return ( - + + + {/* Longitude - + */} {/* } - + + setmodalBasemap(true)} style={{position:'absolute',backgroundColor:'#FFFFFF',width:50,height:50,borderRadius:25,alignItems:'center',justifyContent:'center',top:'7%',left:'4%'}}> + + + setmodalLayerList(true)} style={{position:'absolute',backgroundColor:'#FFFFFF',width:50,height:50,borderRadius:25,alignItems:'center',justifyContent:'center',top:'15%',left:'4%'}}> + + + getLocation()} style={{position:'absolute',backgroundColor:'#FFFFFF',width:50,height:50,borderRadius:25,alignItems:'center',justifyContent:'center',top:'23%',left:'4%'}}> + + + { + setmodalInputLocation(true) + }} style={{position:'absolute',backgroundColor:'#FFFFFF',width:50,height:50,borderRadius:25,alignItems:'center',justifyContent:'center',top:'7%',right:'4%'}}> + + + + {!delayRender ? - + Select Position : - + Waiting Get Position } + + setmodalInputLocation(false)} style={{top:'18%',alignSelf:'center'}}> + + + + Input Point + + setmodalInputLocation(false)} style={{alignSelf:'flex-end',padding:10}}> + + + + + Longitude + + Latitude + + + Ok + + + + + + + setmodalBasemap(false)} style={{top:'18%',alignSelf:'center'}}> + + + + Basemap Gallery + + setmodalBasemap(false)} style={{alignSelf:'flex-end',padding:10}}> + + + + + + + setmodalLayerList(false)} style={{top:'18%',alignSelf:'center'}}> + + + + Layer List + + setmodalLayerList(false)} style={{alignSelf:'flex-end',padding:10}}> + + + + + + {/* Widget Map */} - + {/* handleZoom(true)}> - + */} ) } diff --git a/src/component/settingScreen.tsx b/src/component/settingScreen.tsx index 55e43ae..173ef3f 100644 --- a/src/component/settingScreen.tsx +++ b/src/component/settingScreen.tsx @@ -132,7 +132,9 @@ export default function SettingScreen({navigation}:any){ - + { + navigation.navigate('Home', { screen: 'Home', }) + }}>