Getting a Google Maps API key
- Go to the Google Cloud Console
- Create a new project (or select an existing one)
- Enable the Maps JavaScript API under APIs & Services
- Create an API key under APIs & Services → Credentials
- Restrict the key to your website’s domain for production use
Adding the API key to index.html
The Maps JavaScript API is loaded at the bottom ofindex.html. Replace the existing key with your own:
index.html
AIzaSyBlPw3GQYI3faa_9mRE6plWuM7xNEmrwH0 with your own API key. The callback=initMap parameter tells the Maps SDK to call initMap() once it has loaded.
initMap() function
TheinitMap() function in js/scripts.js creates the map and places a marker at the venue coordinates:
js/scripts.js
lat and lng values to your venue’s coordinates. The zoom level of 15 is suitable for a city block — increase it (e.g. 17) to zoom in closer, or decrease it to show a wider area. scrollwheel: false prevents the map from accidentally capturing scroll events on the page.
Alternate venue example: initBBSRMap()
The file also contains a second map function for an alternate venue in Bhubaneswar:js/scripts.js
initMap() is used as the Maps API callback. If your wedding has multiple venues on different pages, you can switch the callback parameter in the script tag to point to a different function, or call a different function manually after the API loads.
Updating the coordinates
Map HTML structure
The map section inindex.html consists of a full-width canvas div and an overlaid content wrapper:
index.html
#map-content. The pointer-events-none / pointer-events-auto classes allow click events to pass through the transparent overlay to the map, while still making the info card and buttons interactive.
The “Show info” / “Show map” toggle is handled in js/scripts.js:
js/scripts.js
toggle-map-content CSS class sets opacity: 0; visibility: hidden to animate the card in and out.
The Book Uber button lives inside
#map-content, right next to the venue address. See the Uber integration page for instructions on updating the deep-link URL.