|
|
@ -1,14 +1,18 @@ |
|
|
|
// import React from "react";
|
|
|
|
import React from "react"; |
|
|
|
// import MapView, { Marker } from "react-native-maps";
|
|
|
|
import MapboxGL from '@react-native-mapbox-gl/maps'; |
|
|
|
|
|
|
|
|
|
|
|
// //assets
|
|
|
|
//assets
|
|
|
|
// import markerIcon from "../assets/icons/marker.png";
|
|
|
|
// import markerIcon from "../assets/icons/marker.png";
|
|
|
|
|
|
|
|
|
|
|
|
// export default function MapSelector({ setAddress }) {
|
|
|
|
MapboxGL.setAccessToken('<YOUR_ACCESSTOKEN>'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export default function MapSelector({ setAddress }) { |
|
|
|
// const [markerCoordinates, setMarkerCoordinates] = React.useState({
|
|
|
|
// const [markerCoordinates, setMarkerCoordinates] = React.useState({
|
|
|
|
// latitude: 35.7219,
|
|
|
|
// latitude: 35.7219,
|
|
|
|
// longitude: 51.3347,
|
|
|
|
// longitude: 51.3347,
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
|
|
// const getLocation = (location) => {
|
|
|
|
// const getLocation = (location) => {
|
|
|
|
// setMarkerCoordinates(location);
|
|
|
|
// setMarkerCoordinates(location);
|
|
|
|
// try {
|
|
|
|
// try {
|
|
|
@ -29,21 +33,19 @@ |
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// };
|
|
|
|
// };
|
|
|
|
|
|
|
|
|
|
|
|
// return (
|
|
|
|
const onRegionDidChange = (e) => { |
|
|
|
// <MapView
|
|
|
|
console.log('onRegionDidChange', e.geometry.coordinates); |
|
|
|
// initialRegion={{
|
|
|
|
}; |
|
|
|
// latitude: 35.7219,
|
|
|
|
|
|
|
|
// longitude: 51.3347,
|
|
|
|
return ( |
|
|
|
// latitudeDelta: 0.0922,
|
|
|
|
<Mapir |
|
|
|
// longitudeDelta: 0.0421,
|
|
|
|
apiKey={ |
|
|
|
// }}
|
|
|
|
"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjkyODE4ODI0N2FhMjdlYTMyMzVlYzRiOWUxZDI3NTQyZTNjYmI3ZjQzY2Q2NGQzYjdkYjU1NmY3NDM5YzU2NzUyNzMxMjAzYzMwOTliYTFiIn0.eyJhdWQiOiIxNjk2MSIsImp0aSI6IjkyODE4ODI0N2FhMjdlYTMyMzVlYzRiOWUxZDI3NTQyZTNjYmI3ZjQzY2Q2NGQzYjdkYjU1NmY3NDM5YzU2NzUyNzMxMjAzYzMwOTliYTFiIiwiaWF0IjoxNjQ0MzE3MDA5LCJuYmYiOjE2NDQzMTcwMDksImV4cCI6MTY0NjgyMjYwOSwic3ViIjoiIiwic2NvcGVzIjpbImJhc2ljIl19.Gckmd77Vw-wmsaztsmVmjYmfp4zXRSy2f0tXS-1p7IY8VJmvCCrk64y7WvCLbH0YfGZI9rG9ZUi5hRJDDGXu70l1ZafCYq2-EkMzcbx-PGTTq2bHGNZujF4ur1xtGoXd2kwGuldiR_6SJdqYLHcupbscFI7hHaQnkN1xWJ-L8476ZOKzUgiBvwH9uElGZXwD6SwfXoGW_R38_isrnfTXKfW9PPixyLaN3404tcjOU1r02HIurrplXlIKRKG9CVXxKsESfJJ8trwtZw6O4erxrnisxfL0VwAR7l69P6KcFb57vvM4j4hKFqxUDr4YvSq1qOTt3urYbAKehhvoiLhZxw" |
|
|
|
// style={{
|
|
|
|
} |
|
|
|
// width: "100%",
|
|
|
|
onRegionDidChange={(e) => onRegionDidChange(e)} |
|
|
|
// height: "100%",
|
|
|
|
style={{ flex : 1 }} |
|
|
|
// }}
|
|
|
|
> |
|
|
|
// onPress={(e) => getLocation(e.nativeEvent.coordinate)}
|
|
|
|
<Mapir.Camera zoomLevel={13} centerCoordinate={[51.422548, 35.732573]} /> |
|
|
|
// >
|
|
|
|
</Mapir> |
|
|
|
// <Marker coordinate={markerCoordinates} image={markerIcon} />
|
|
|
|
); |
|
|
|
// </MapView>
|
|
|
|
} |
|
|
|
// );
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|