Integrating Google Maps API with Unity

Hernando Nieto Jaramillo
2 min readSep 23, 2021

--

For this we’ll need to visit the maps static API webpage. This will show us this:

The orange square code will download a static image for us

To do that, we’ll need to send a URL request from Unity (http request)

First, you need to set up a Google cloud platform account in this link

And later you’ll need to fill in some information

After setting up the account, create a new project

After creating the project, you will get a Google maps API key that will be required later.

How to construct the map’s url?

You’ll find further info here
The url requires some parameters

And here there is a code example:
https://maps.googleapis.com/maps/api/staticmap?center=Berkeley,CA&zoom=14&size=400x400&key=YOUR_API_KEY

The parameters are center, zoom, size and key. So, we’ll need to set up these values in Unity

So, using the following code with the example provided in google maps static

You’ll get this:

So, after getting the map values, we can get the desired result.

--

--

No responses yet