- Show Google Maps in the full browser window
{lat: 34.063380, lng: -118.358080}
- It does not need to have the input box or the search icon.
- It simply needs to show the box in the correct location with the correct background color
- Position the container to the best of your ability
class: search-container
width: 400px;
border-radius: 30px;
background-color: white;
top: 320px;
class: stores-list-container
{lat: 34.063380, lng: -118.358080}
- You will run into an error here when posting data
- Use the stores data we retrieved previously
- Use Postman to post the data
console.log()
the data to test
-
Install Mongoose
-
Connect Mongoose to MongoDB Atlas
_id
storeName
phoneNumber
address
openStatusText
addressLines
location
This will allow us to delete all the stores in the database
- Use the documentation link here
- Make sure to correctly map the data to MondoDB Schema
- Save the list of stores in dbStores
- Use the
.create()
function in mongoose to save the list - Test it out using Postman
- Feel free to use the
delete
api endpoint to reset the database and re-test
- This should return the full list of stores
- Make sure to test it with Postman
- Create a
getStores()
function console.log
the list of stores to test
- Create a
searchLocationsNear()
function to loop over all of the stores - Create a
createMarker()
function to add marker to the map
-
Use the documentation here
-
Add an event listener to open info window on the click of a marker
-
Use the
createMarker()
function -
Have the html of the info window be the following:
"<b>" + name + "</b> <br/>" + address
.store-container
.store-info-container
.store-address
.store-phone-number
.store-number-container
.store-number
- Create a
setStoresList()
function to loop over the stores - Use template literals when creating the HTML for stores
- Replace the HTML in
.stores-list
with the HTML generated
- Use the documentation here
- Create a
setOnClickListener()
function - Create a
markers
list and add each marker into the array - Use
.querySelectorAll()
to get all store elements - Loop over every store element and add an event listener to trigger a marker
This will allow us to search for stores based on zip code
- Add
zip_code
parameter to/api/stores
API endpoint
- Use MongoDB GeoQuery to find the stores near that coordinate
- Use
distance
of 3218 meters - Test out using Postman
This service will contain all the logic to get coordinates based on zip code
- Use ASYNC/AWAIT
- Use
googleMapsService
insideget
API endpoint
- Call
getStores()
function on click ofsearch
icon - Get
zip code
data from input
- Use documentation
- Clear markers
- Clear
infoWindow