Skip to content

Commit

Permalink
setting up google map api
Browse files Browse the repository at this point in the history
  • Loading branch information
mulundapm committed Aug 10, 2024
1 parent 0f2314e commit 5c32498
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 9 deletions.
4 changes: 3 additions & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
REACT_APP_FB_KEY=AIzaSyBhRg3ufseNk278SWxFHnOmHqz-YLOu0-w
REACT_APP_FB_MESSINGSENDER_ID=835331495725
REACT_APP_FB_APP_ID=1:835331495725:web:f59e0506cf9b4903a125a4
REACT_APP_FB_MEASUREMENT_ID=G-CVDGDQ79K4
REACT_APP_FB_MEASUREMENT_ID=G-CVDGDQ79K4
REACT_APP_MAPS_API_KEY=AIzaSyCSXXBBNENckpHT-hKgBMHG2yCJXdaL0As
MAP_ID=c4771a5333638d97
21 changes: 21 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"@vis.gl/react-google-maps": "^1.1.0",
"firebase": "^10.12.2",
"firebaseui": "^6.1.0",
"react": "^18.3.1",
Expand Down
3 changes: 2 additions & 1 deletion src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -256,4 +256,5 @@ input{
max-width: 100%;
bottom: 0;
}
}
}

2 changes: 1 addition & 1 deletion src/Components/RestaurantDetails.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function RestaurantDetails() {
<Link to={thisRestaurant.website}><button className='primary-button'>Reserve a table</button></Link>
</div>
<Reviews reviews={thisRestaurant.reviews}/>
<RestaurantMap/>
<RestaurantMap address={thisRestaurant.address}/>
</div>
)
}
Expand Down
25 changes: 19 additions & 6 deletions src/Components/RestaurantMap.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
import React from 'react'
import map1 from '../Assets/mahayana-map.png'
import { APIProvider, Map, AdvancedMarker, useMapsLibrary, useMap} from '@vis.gl/react-google-maps'
import { useEffect, useState } from 'react'

function RestaurantMap() {
function Geocoding(){
const geocodingApiLoaded = useMapsLibrary("geocoding")
useEffect(()=>{

},[])
}

function RestaurantMap(address) {
const position = { lat: 53.54, lng: 10}
return (
<div>
<img src={map1} alt="Restaurant map" className='restaurant-image center'/>
<p>yes this is an image, imagine it being a map for now</p>
</div>
<APIProvider apiKey={process.env.REACT_APP_MAPS_API_KEY}>
<div style={{height: "150px"}}>
<Map zoom={13} center={position} mapId={'process.env.MAP_ID'}></Map>
<AdvancedMarker position={position}>
<Geocoding></Geocoding>
</AdvancedMarker>
</div>
</APIProvider>
)
}

Expand Down

0 comments on commit 5c32498

Please sign in to comment.