# Google maps distance matrix

**URL:** <https://community.glideapps.com/t/google-maps-distance-matrix/42198>\
**Category:** Ask for Help\
**Created:** [May 20, 2022, 9:36am UTC](https://community.glideapps.com/t/google-maps-distance-matrix/42198 "2022-05-20T09:36:02Z")\
**Posts on this page:** 7\
**Page:** 2

<div class="post-metadata">

**Author:** ![profxeni](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/profxeni/32/24656_2.png) [@profxeni](https://community.glideapps.com/u/profxeni)\
**Post date:** [May 22, 2022, 4:40pm UTC](https://community.glideapps.com/t/google-maps-distance-matrix/42198/21 "2022-05-22T16:40:10Z")

</div>

Don’t worry @ThinhDinh I just need to change the API.  
Great solution that will benefit many users.  
Thanks for the tenacity, what in Naples (IT) is called “cazzimma” 🙂

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [May 22, 2022, 11:19pm UTC](https://community.glideapps.com/t/google-maps-distance-matrix/42198/22 "2022-05-22T23:19:26Z")

</div>

Hehe, thanks for the kind words, it will benefit me a lot too!

---

<div class="post-metadata">

**Author:** ![ShantanuIyengar](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/shantanuiyengar/32/35546_2.png) [@ShantanuIyengar](https://community.glideapps.com/u/ShantanuIyengar)\
**Post date:** [May 24, 2022, 3:46pm UTC](https://community.glideapps.com/t/google-maps-distance-matrix/42198/23 "2022-05-24T15:46:06Z")

</div>

Hey guys!  
Here is another crazy method to bypass cors!

**Google scripts!**

Steps are simple:

1. Create a new script file by going over to [Apps Script – Google Apps Script](https://script.google.com/home)
2. Copy the code from below

```auto
function doGet(e) {
  var link = e.parameter.link;
  return ContentService.createTextOutput(JSON.stringify(UrlFetchApp.fetch(link).getContentText()));
}

```

1. Deploy the code so anyone can use it and use the url from the deployed web app in your glide app!

2. You would need three columns:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/f/0/f01c403ad7f558488b5a544058fe8aa35ea17b0d.png)

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/c/4/c48a4c7ca31ed8f3542df460e6a51dd875eff1f2.png)

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/3/73ef7d4d42171783232c14d52a2db0ff26c1f310.png)

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/2/621fc6f4b800ad0c514ccb79c20d49096b5fbc67.png)

```auto
.rows[0].elements[0].distance.text

```

Google will bypass all cors issues and you can always keeps logs if you have your own script sending results back!

---

<div class="post-metadata">

**Author:** ![carlos\_yegres](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/carlos_yegres/32/51215_2.png) [@carlos\_yegres](https://community.glideapps.com/u/carlos_yegres)\
**Post date:** [December 6, 2022, 12:09am UTC](https://community.glideapps.com/t/google-maps-distance-matrix/42198/24 "2022-12-06T00:09:11Z")

</div>

Hola amigo, espero pueda ayudarme con este tema. actualmente me encuentro desarrollando una app de entregas de comida a domicilio, he adquirido conocimientos básicos mediante videos en YouTube. he conocido la herramienta de cálculo de distancia de glide, pero esta calcula una distancia recta entre dos puntos, pero en mi caso no me es de utilidad ya que necesito calcular distancias recorrida de un punto a otro para poder valorar el servicio de la entrega a domicilio, me gustaría que me pudiera orientar, pero de una forma básica ya que no conozco de términos de programación. ¿Me pudieras ayudar a construir una columna en glide que me calcule la distancia recorrida de un punto a otro partiendo de una dirección de recogida y dirección de entrega que ingresa el usuario?

---

<div class="post-metadata">

**Author:** ![aocto\_digital](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/aocto_digital/32/60807_2.png) [@aocto\_digital](https://community.glideapps.com/u/aocto_digital)\
**Post date:** [September 29, 2023, 10:11am UTC](https://community.glideapps.com/t/google-maps-distance-matrix/42198/25 "2023-09-29T10:11:27Z")

</div>

> [@ShantanuIyengar](#):
>
> ```auto
> function doGet(e) {
> var link = e.parameter.link;
> return ContentService.createTextOutput(JSON.stringify(UrlFetchApp.fetch(link).getContentText()));
> }
> 
> ```

hiii  
does this use google map api key?

---

<div class="post-metadata">

**Author:** ![ShantanuIyengar](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/shantanuiyengar/32/35546_2.png) [@ShantanuIyengar](https://community.glideapps.com/u/ShantanuIyengar)\
**Post date:** [October 9, 2023, 1:04pm UTC](https://community.glideapps.com/t/google-maps-distance-matrix/42198/26 "2023-10-09T13:04:03Z")

</div>

This is a method to bypass cors. The original link way to implement is

 ![f01c403ad7f558488b5a544058fe8aa35ea17b0d](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/4/a/4a756dae703d09eb85dd33b1c74718240fe3c239.png)

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [October 9, 2023, 2:06pm UTC](https://community.glideapps.com/t/google-maps-distance-matrix/42198/27 "2023-10-09T14:06:45Z")

</div>

That’s pretty neat. Thanks for sharing.

[Previous page](https://community.glideapps.com/t/google-maps-distance-matrix/42198.md?page=1)
