From 2266cf833c47921604f8c4514d221269cc8faf4a Mon Sep 17 00:00:00 2001 From: Jakub Satora Date: Fri, 4 Oct 2024 15:00:58 +0200 Subject: [PATCH] implemented google maps --- .env.local | 3 +- components/map.tsx | 28 ++++++++++++----- package-lock.json | 78 +++++++++++++++++++++++++++++++++++++++++++++- package.json | 5 ++- 4 files changed, 103 insertions(+), 11 deletions(-) diff --git a/.env.local b/.env.local index 378b97a..22ba86e 100644 --- a/.env.local +++ b/.env.local @@ -1,4 +1,5 @@ EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_cHJvbXB0LW1hZ2dvdC02MC5jbGVyay5hY2NvdW50cy5kZXYk DATABASE_URL=postgresql://ryde_owner:0OwLX1QrRPqT@ep-rapid-water-a2owt30g.eu-central-1.aws.neon.tech/ryde?sslmode=require EXPO_PUBLIC_SERVER_URL=https://uber.dev/ -EXPO_PUBLIC_GEOAPIFY_API_KEY=3cee4c13411d467c8357a8eca4aa99d7 \ No newline at end of file +EXPO_PUBLIC_GEOAPIFY_API_KEY=3cee4c13411d467c8357a8eca4aa99d7 +EXPO_PUBLIC_GOOGLE_API_KEY=AIzaSyABGUpj59-aiIr20fBHGcXFGfT3vEV5rSI \ No newline at end of file diff --git a/components/map.tsx b/components/map.tsx index 22a1832..c7a2a33 100644 --- a/components/map.tsx +++ b/components/map.tsx @@ -1,14 +1,26 @@ import React from 'react' import { Text, View } from 'react-native' - +import MapView, { PROVIDER_DEFAULT } from "react-native-maps" const Map = () => { - return ( - - - Map - - - ) + const region = { + + } + return ( + + + Map + + + ) } export default Map \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 8950453..493c1d0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,12 +28,15 @@ "react-dom": "18.2.0", "react-native": "0.74.5", "react-native-gesture-handler": "~2.16.1", + "react-native-maps": "^1.18.0", + "react-native-maps-directions": "^1.9.0", "react-native-modal": "^13.0.1", "react-native-reanimated": "~3.10.1", "react-native-safe-area-context": "^4.10.5", "react-native-screens": "3.31.1", "react-native-swiper": "^1.6.0", - "react-native-web": "~0.19.10" + "react-native-web": "~0.19.10", + "zustand": "^5.0.0-rc.2" }, "devDependencies": { "@babel/core": "^7.20.0", @@ -7262,6 +7265,11 @@ "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.6.0.tgz", "integrity": "sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA==" }, + "node_modules/@types/geojson": { + "version": "7946.0.14", + "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.14.tgz", + "integrity": "sha512-WCfD5Ht3ZesJUsONdhvm84dmzWOiOzOAqOncN0++w0lBw1o8OuDNJF2McvvCef/yBqb/HYRahp1BYtODFQ8bRg==" + }, "node_modules/@types/graceful-fs": { "version": "4.1.9", "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz", @@ -15714,6 +15722,11 @@ "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==" }, + "node_modules/lodash.isequal": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", + "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==" + }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", @@ -18208,6 +18221,41 @@ "react": "^16.6.0 || ^17.0.0 || ^18.0.0" } }, + "node_modules/react-native-maps": { + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/react-native-maps/-/react-native-maps-1.18.0.tgz", + "integrity": "sha512-S17nYUqeMptgIPaAZuVRo+eRelPreBBYQWw6jsxU7qQ12p+THSfFaqabcNn7fBmsXhT3T27iIl8ek8v1H8BaGw==", + "dependencies": { + "@types/geojson": "^7946.0.13" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "react": ">= 17.0.1", + "react-native": ">= 0.64.3", + "react-native-web": ">= 0.11" + }, + "peerDependenciesMeta": { + "react-native-web": { + "optional": true + } + } + }, + "node_modules/react-native-maps-directions": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/react-native-maps-directions/-/react-native-maps-directions-1.9.0.tgz", + "integrity": "sha512-68SrMOUg4WQ5PmpS9sNOTZaYtdyVYJnnjQOOhABrgiKnb5BXCZRU2gDoS11gYf23hjUBjq8JXzgfn37WcINLwA==", + "dependencies": { + "lodash.isequal": "^4.5.0", + "prop-types": "^15.6.0" + }, + "peerDependencies": { + "react": "*", + "react-native": "*", + "react-native-maps": ">=1.0.0" + } + }, "node_modules/react-native-modal": { "version": "13.0.1", "resolved": "https://registry.npmjs.org/react-native-modal/-/react-native-modal-13.0.1.tgz", @@ -21247,6 +21295,34 @@ "funding": { "url": "https://github.com/sponsors/sindresorhus" } + }, + "node_modules/zustand": { + "version": "5.0.0-rc.2", + "resolved": "https://registry.npmjs.org/zustand/-/zustand-5.0.0-rc.2.tgz", + "integrity": "sha512-o2Nwuvnk8vQBX7CcHL8WfFkZNJdxB/VKeWw0tNglw8p4cypsZ3tRT7rTRTDNeUPFS0qaMBRSKe+fVwL5xpcE3A==", + "engines": { + "node": ">=12.20.0" + }, + "peerDependencies": { + "@types/react": ">=18.0.0", + "immer": ">=9.0.6", + "react": ">=18.0.0", + "use-sync-external-store": ">=1.2.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "immer": { + "optional": true + }, + "react": { + "optional": true + }, + "use-sync-external-store": { + "optional": true + } + } } } } diff --git a/package.json b/package.json index 587ecd3..ced1f41 100644 --- a/package.json +++ b/package.json @@ -35,12 +35,15 @@ "react-dom": "18.2.0", "react-native": "0.74.5", "react-native-gesture-handler": "~2.16.1", + "react-native-maps": "^1.18.0", + "react-native-maps-directions": "^1.9.0", "react-native-modal": "^13.0.1", "react-native-reanimated": "~3.10.1", "react-native-safe-area-context": "^4.10.5", "react-native-screens": "3.31.1", "react-native-swiper": "^1.6.0", - "react-native-web": "~0.19.10" + "react-native-web": "~0.19.10", + "zustand": "^5.0.0-rc.2" }, "devDependencies": { "@babel/core": "^7.20.0",