update 6 files

master
Reza_ashrafi 2 years ago
parent 2f72fb2800
commit 9a990351b2
  1. 1
      android/build.gradle
  2. 1
      ios/Podfile
  3. 29
      ios/Podfile.lock
  4. 37
      src/components/MapSelector.js
  5. 2
      src/screens/Address/index.js

@ -16,6 +16,7 @@ buildscript {
// Otherwise we default to the side-by-side NDK version from AGP.
ndkVersion = "21.4.7075529"
}
}
repositories {
google()

@ -20,6 +20,7 @@ target 'danovin' do
)
permissions_path = '../node_modules/react-native-permissions/ios'
pod 'Permission-Camera', :path => "#{permissions_path}/Camera"
pod 'react-native-mapbox-gl', :path => '../node_modules/@react-native-mapbox-gl/maps'
target 'danovinTests' do
inherit! :complete

@ -74,6 +74,9 @@ PODS:
- fmt (6.2.1)
- glog (0.3.5)
- libevent (2.1.12)
- Mapbox-iOS-SDK (5.9.0):
- MapboxMobileEvents (= 0.10.2)
- MapboxMobileEvents (0.10.2)
- OpenSSL-Universal (1.1.1100)
- Permission-Camera (3.3.1):
- RNPermissions
@ -292,8 +295,20 @@ PODS:
- React-Core
- react-native-camera/RN (4.2.1):
- React-Core
- react-native-mapbox-gl (2.0.6):
- react-native-mapbox-gl (8.6.0-beta.0):
- Mapbox-iOS-SDK (~> 5.9.0)
- React
- React-Core
- react-native-mapbox-gl/DynamicLibrary (= 8.6.0-beta.0)
- react-native-mapbox-gl/StaticLibraryFixer (= 8.6.0-beta.0)
- react-native-mapbox-gl/DynamicLibrary (8.6.0-beta.0):
- Mapbox-iOS-SDK (~> 5.9.0)
- React
- React-Core
- react-native-mapbox-gl/StaticLibraryFixer (8.6.0-beta.0):
- Mapbox-iOS-SDK (~> 5.9.0)
- React
- React-Core
- react-native-safe-area-context (4.3.1):
- RCT-Folly
- RCTRequired
@ -429,7 +444,7 @@ DEPENDENCIES:
- React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`)
- React-logger (from `../node_modules/react-native/ReactCommon/logger`)
- react-native-camera (from `../node_modules/react-native-camera`)
- react-native-mapbox-gl (from `../node_modules/mapir-mapbox`)
- "react-native-mapbox-gl (from `../node_modules/@react-native-mapbox-gl/maps`)"
- react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`)
- react-native-video (from `../node_modules/react-native-video`)
- React-perflogger (from `../node_modules/react-native/ReactCommon/reactperflogger`)
@ -464,6 +479,8 @@ SPEC REPOS:
- FlipperKit
- fmt
- libevent
- Mapbox-iOS-SDK
- MapboxMobileEvents
- OpenSSL-Universal
- SocketRocket
- YogaKit
@ -510,7 +527,7 @@ EXTERNAL SOURCES:
react-native-camera:
:path: "../node_modules/react-native-camera"
react-native-mapbox-gl:
:path: "../node_modules/mapir-mapbox"
:path: "../node_modules/@react-native-mapbox-gl/maps"
react-native-safe-area-context:
:path: "../node_modules/react-native-safe-area-context"
react-native-video:
@ -568,6 +585,8 @@ SPEC CHECKSUMS:
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
glog: 476ee3e89abb49e07f822b48323c51c57124b572
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
Mapbox-iOS-SDK: a5915700ec84bc1a7f8b3e746d474789e35b7956
MapboxMobileEvents: 2bc0ca2eedb627b73cf403258dce2b2fa98074a6
OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c
Permission-Camera: bae27a8503530770c35aadfecbb97ec71823382a
RCT-Folly: 4d8508a426467c48885f1151029bc15fa5d7b3b8
@ -584,7 +603,7 @@ SPEC CHECKSUMS:
React-jsinspector: c5989c77cb89ae6a69561095a61cce56a44ae8e8
React-logger: a0833912d93b36b791b7a521672d8ee89107aff1
react-native-camera: 3eae183c1d111103963f3dd913b65d01aef8110f
react-native-mapbox-gl: 80e6a70380f3dea6e8087fce0e08354267258562
react-native-mapbox-gl: b92795f61ff130323e6d25693bd68b081e105455
react-native-safe-area-context: 6c12e3859b6f27b25de4fee8201cfb858432d8de
react-native-video: 0bb76b6d6b77da3009611586c7dbf817b947f30e
React-perflogger: a18b4f0bd933b8b24ecf9f3c54f9bf65180f3fe6
@ -607,6 +626,6 @@ SPEC CHECKSUMS:
Yoga: 99652481fcd320aefa4a7ef90095b95acd181952
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a
PODFILE CHECKSUM: 3f6a032cec3c6ad798a7c435ab88ab63cc1c0148
PODFILE CHECKSUM: b0d4cfa3a5bd4fa03605ffeda7fbfe9a6b27f860
COCOAPODS: 1.11.3

@ -1,17 +1,19 @@
import React from 'react';
// import Mapir from 'mapir-react-native-sdk';
import MapboxGL from '@react-native-mapbox-gl/maps';
MapboxGL.setAccessToken(
'pk.eyJ1IjoicmV6YS1hc2hyYWZpNzciLCJhIjoiY2txdGNwZTUxMDZ1eTJwbHpwcDhhdWJ3ZCJ9.avkn_XgUReNTLAcQQelTYA',
);
export default function MapSelector({setAddress}) {
const [markerCoordinates, setMarkerCoordinates] = React.useState({
latitude: 35.7219,
longitude: 51.3347,
});
const [coordinates, setCoordinates] = React.useState([51.3347, 35.7219]);
const getLocation = location => {
setMarkerCoordinates(location);
console.log(location);
setCoordinates(location);
try {
fetch(
`https://map.ir/reverse/no?lat=${location.latitude}&lon=${location.longitude}`,
`https://map.ir/reverse/no?lat=${location[1]}&lon=${location[0]}`,
{
headers: {
'Content-Type': 'application/json',
@ -27,19 +29,14 @@ export default function MapSelector({setAddress}) {
}
};
const onRegionDidChange = e => {
console.log('onRegionDidChange', e.geometry.coordinates);
};
return (
<></>
// <Mapir
// apiKey={
// 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjkyODE4ODI0N2FhMjdlYTMyMzVlYzRiOWUxZDI3NTQyZTNjYmI3ZjQzY2Q2NGQzYjdkYjU1NmY3NDM5YzU2NzUyNzMxMjAzYzMwOTliYTFiIn0.eyJhdWQiOiIxNjk2MSIsImp0aSI6IjkyODE4ODI0N2FhMjdlYTMyMzVlYzRiOWUxZDI3NTQyZTNjYmI3ZjQzY2Q2NGQzYjdkYjU1NmY3NDM5YzU2NzUyNzMxMjAzYzMwOTliYTFiIiwiaWF0IjoxNjQ0MzE3MDA5LCJuYmYiOjE2NDQzMTcwMDksImV4cCI6MTY0NjgyMjYwOSwic3ViIjoiIiwic2NvcGVzIjpbImJhc2ljIl19.Gckmd77Vw-wmsaztsmVmjYmfp4zXRSy2f0tXS-1p7IY8VJmvCCrk64y7WvCLbH0YfGZI9rG9ZUi5hRJDDGXu70l1ZafCYq2-EkMzcbx-PGTTq2bHGNZujF4ur1xtGoXd2kwGuldiR_6SJdqYLHcupbscFI7hHaQnkN1xWJ-L8476ZOKzUgiBvwH9uElGZXwD6SwfXoGW_R38_isrnfTXKfW9PPixyLaN3404tcjOU1r02HIurrplXlIKRKG9CVXxKsESfJJ8trwtZw6O4erxrnisxfL0VwAR7l69P6KcFb57vvM4j4hKFqxUDr4YvSq1qOTt3urYbAKehhvoiLhZxw'
// }
// onRegionDidChange={e => onRegionDidChange(e)}
// style={{width: '100%', height: '100%'}}>
// <Mapir.Camera zoomLevel={13} centerCoordinate={[35.7219, 51.3347]} />
// </Mapir>
<MapboxGL.MapView
style={{width: '100%', height: '100%'}}
onPress={e => {
getLocation(e.geometry.coordinates);
}}>
<MapboxGL.Camera zoomLevel={12} centerCoordinate={coordinates} />
<MapboxGL.PointAnnotation coordinate={coordinates} />
</MapboxGL.MapView>
);
}

@ -550,7 +550,7 @@ const Address = ({
</View>
{!profilePage ? (
<>
<View style={{width: '100%', height: height / 4}}>
<View style={{width: '100%', height: height / 4, marginTop: 20}}>
<MapSelector setAddress={(text) => setMapAddress(text)} />
</View>
<TextInput

Loading…
Cancel
Save