You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: projects/build-a-cafe-finder-with-javascript/build-a-cafe-finder-with-javascript.mdx
+10-9Lines changed: 10 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,12 +4,13 @@ author: Gabriela Banaag
4
4
uid:
5
5
datePublished: 2025-08-06
6
6
description:
7
-
header: https://imgur.com/a/iz4inIW
7
+
header: https://i.imgur.com/VKm4oPJ.gif
8
+
8
9
tags:
9
10
---
10
11
11
12
<BannerImage
12
-
link="https://imgur.com/a/iz4inIW"
13
+
link="https://i.imgur.com/VKm4oPJ.gif"
13
14
description=""
14
15
uid={false}
15
16
cl="for-sidebar"
@@ -25,7 +26,7 @@ tags:
25
26
/>
26
27
27
28
<BannerImage
28
-
link="https://imgur.com/a/iz4inIW"
29
+
link="https://i.imgur.com/VKm4oPJ.gif"
29
30
description=""
30
31
uid={false}
31
32
/>
@@ -44,6 +45,8 @@ The Google Maps Platform is a collection of Application Programming Interfaces (
44
45
45
46
Some popular apps that use the Google Maps Platform include Uber and Airbnb, which access a user’s location to calculate rides and show rentals in specific areas!
The [Places API](https://developers.google.com/maps/documentation/places/web-service/overview) is a smaller API under the Google Maps API. It fetches location data like location names, addresses, photos, and many more attributes! It’s a great tool for accessing updated data and finding multiple places without manually copying all of their information into a project. ****We’ll be using this in our project! ****
To see cafes nearby, the browser needs access to your location. There’s a builtin JavaScript function that takes care of that for you called ``useLocation()`` and it takes your device’s latitude and longitude coordinates.
117
+
To see cafes nearby, the browser needs access to your location. There’s a built-in JavaScript function that takes care of that for you called ``useLocation()`` and it takes your device’s latitude and longitude coordinates.
115
118
116
119
```jsx
117
120
functiongetLocation() {
@@ -185,8 +188,6 @@ If the API finds results for nearby cafes, we’ll take that data and insert it
185
188
186
189
We’re gonna create a wrapper for our cards, and inject data from the API into the wrapper as we go. To start, let’s make a function called ``displayCards()`` that renders a div container whenever the website starts up.
187
190
188
-
<ImageZoomsrc="https://imgur-url-here.png"style={{ width: "60%", height: "auto" }}alt="alt text here"/>
189
-
190
191
We’ll start by creating a container that takes the first saved cafe in our cafe options. We’ll make the content of this card blank for now, and fill it in with information when we use the Places API.
A****library**** is a collection of reusable resources like functions, classes, and pieces of pre-written code. An**API****** is a an interface that lets your code communicate with another application.
262
+
A****library**** is a collection of reusable resources like functions, classes, and pieces of pre-written code. An**API****** is an interface that lets your code communicate with another application.
0 commit comments