# How do I allow users to adjust location data?

**URL:** <https://community.glideapps.com/t/how-do-i-allow-users-to-adjust-location-data/72746>\
**Category:** Ask for Help\
**Created:** [April 19, 2024, 11:52pm UTC](https://community.glideapps.com/t/how-do-i-allow-users-to-adjust-location-data/72746 "2024-04-19T23:52:28Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![blairrorani](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/blairrorani/32/43426_2.png) [@blairrorani](https://community.glideapps.com/u/blairrorani)\
**Post date:** [April 19, 2024, 11:52pm UTC](https://community.glideapps.com/t/how-do-i-allow-users-to-adjust-location-data/72746/1 "2024-04-19T23:52:28Z")

</div>

**Data:**

- Location (from current location)

**Task:**  
I want to adjust this location if it isn’t 100% accurate.

**Question:**  
How do I do this?

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [April 20, 2024, 12:31am UTC](https://community.glideapps.com/t/how-do-i-allow-users-to-adjust-location-data/72746/2 "2024-04-20T00:31:02Z")

</div>

How do you picture users adjusting the location? You can manually edit the coordinates, but it’s not very user friendly.

---

<div class="post-metadata">

**Author:** ![blairrorani](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/blairrorani/32/43426_2.png) [@blairrorani](https://community.glideapps.com/u/blairrorani)\
**Post date:** [April 20, 2024, 10:50am UTC](https://community.glideapps.com/t/how-do-i-allow-users-to-adjust-location-data/72746/3 "2024-04-20T10:50:08Z")

</div>

I’m trying to think of the UX and UI of doing this in another app.  
You could enter an address an the field looks up the actual address and you select it.  
Or I guess you could drop a pin on a map.

I’m assuming that both are overkill for what I’m trying to achieve.

The goal is to accurately and also quickly record the location of a car accident.

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [April 20, 2024, 3:29pm UTC](https://community.glideapps.com/t/how-do-i-allow-users-to-adjust-location-data/72746/4 "2024-04-20T15:29:43Z")

</div>

Got it. Can’t really think of any good solutions that are user friendly. Ideally the map component would allow us to drop a pin on the map.

Other options would be to use a separate mapping app, get coordinates from that app, and paste them into glide. Still not great though.

This is all assuming that using street addresses would not always be convenient or known. I’m just thinking of an accident that might happen in a rural area or nowhere near posted addresses.

You can check out this post by @Robert_Petitto which demonstrates some integrations that might be useful to you. Maybe they could be useful.

> [@sparkles Glide Integrations (Radar, Pexels, Google Calendar, Gmail/Outlook, Twilio)](https://community.glideapps.com/t/glide-integrations-radar-pexels-google-calendar-gmail-outlook-twilio/59315):
>
> wave Hey fellow Gliders! I’m launching a new series on all the wonderful new integrations that Gliders can add to their Glide apps. Without a single line of code, integrate with dozens of platforms: point_right Integrate OpenAI point_right Send Slack or Discord messages point_right Create PDFs with PDFMonkey or Urlbox First up—compass Forward and Reverse Geocoding with [Radar](https://radar.com)[[Glide: Reusable Actions and Integrations (First up—Radar)] ](https://www.youtube.com/watch?v=99Ohi09i6GU)Listing:play_button Radar: Forward/Revers…

---

<div class="post-metadata">

**Author:** ![Himaladin](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/himaladin/32/71023_2.png) [@Himaladin](https://community.glideapps.com/u/Himaladin)\
**Post date:** [April 20, 2024, 4:08pm UTC](https://community.glideapps.com/t/how-do-i-allow-users-to-adjust-location-data/72746/5 "2024-04-20T16:08:02Z")

</div>

> [@Jeff\_Hager](#):
>
> I’m just thinking of an accident that might happen in a rural area or nowhere near posted addresses.

@Jeff_Hager  
I become curious, what if in the case of an accident in rural areas we use Google’s “Plus Code”? Is this also supported by Mapbox?

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [April 20, 2024, 9:14pm UTC](https://community.glideapps.com/t/how-do-i-allow-users-to-adjust-location-data/72746/6 "2024-04-20T21:14:15Z")

</div>

Did a quick test, and it doesn’t appear that Mapbox properly recognizes google plus codes.

---

<div class="post-metadata">

**Author:** ![Himaladin](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/himaladin/32/71023_2.png) [@Himaladin](https://community.glideapps.com/u/Himaladin)\
**Post date:** [April 21, 2024, 1:43am UTC](https://community.glideapps.com/t/how-do-i-allow-users-to-adjust-location-data/72746/7 "2024-04-21T01:43:30Z")

</div>

Here I share a Google map that uses a plus code. Quite interesting, for example: [https://plus.codes/6PH57VP3+PR](https://plus.codes/6PH57VP3+PR). Take 4 characters from the code and add an approximate location, such as a city, state, or country. The above example then becomes “7VP3+PR6 Singapore”.  
Another interesting thing about this map is that we can move the location to find its code.

 ![Screenshot 2024-04-21 at 08.39.51](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/2/d2bd4981dcbcf92655b84647ab65261c0e917cb3.jpeg)

Then, how to convert between coordinates and plus codes can be read at [Open Location Code - Wikipedia](https://en.wikipedia.org/wiki/Open_Location_Code). I’m not very familiar with this part, maybe you know how, Jeff?

Note: This Google map can be embedded with web embeds, and it’s free.

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [April 21, 2024, 9:53am UTC](https://community.glideapps.com/t/how-do-i-allow-users-to-adjust-location-data/72746/8 "2024-04-21T09:53:00Z")

</div>

I’ll take a closer look later, but at initial glance it looks like it’s easy to decode and encode the long form plus codes to and from coordinates, but the problem I see is that google maps appears to share the short form plus code that includes the city name, which can’t be fully decoded into a set of coordinates on its own. You have to first use a google API, just to geocode a city into it’s 4 digit plus code, and then append it to the rest of the plus code, just to turn around and decode it into a set of useable coordinates.

It’s just as easy, if not easier, to simply grab the coordinates from google maps instead, so I really don’t see much of a benefit to first having to track down the long form plus code, and then add the extra step to decode it into coordinates when you can directly grab the coordinates.

If you look at my screenshot, this is from google maps on my phone. It shows me coordinates as well as the plus code, but the plus code is the short form which can’t be decoded on it’s own without first figuring out the encoding for the city location. Not enough information to pull out coordinates without involving a third party service. The coordinates are right there above it, don’t require any decoding, and are universally recognized, so I would be using those before anything else.

 ![Screenshot_20240421-042143](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/8/d/8d4239d160210e76c93a87448220f7f509346a54.png)

> [@Himaladin](#):
>
> Note: This Google map can be embedded with web embeds, and it’s free.

While it’s true that you can embed a google map, web embeds are sandboxed from the rest of the app, so it still becomes difficult or not as user friendly to transfer data between the web embed and the app itself. Closest option is copy/paste, which is not quite as convenient as dropping a pin and having the coordinates automatically save into your data table. Although it would save a step of having to open a separate app.

---

<div class="post-metadata">

**Author:** ![Himaladin](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/himaladin/32/71023_2.png) [@Himaladin](https://community.glideapps.com/u/Himaladin)\
**Post date:** [April 21, 2024, 10:29am UTC](https://community.glideapps.com/t/how-do-i-allow-users-to-adjust-location-data/72746/9 "2024-04-21T10:29:01Z")

</div>

This is the result of struggling with GPT:

```auto
function convertToOpenLocationCode(lat, long) {
    let newLat = lat + 90;
    let newLong = long + 180;

    newLat *= 8000;
    newLong *= 8000;

    let base20Lat = convertToBase20(Math.floor(newLat));
    let base20Long = convertToBase20(Math.floor(newLong));

    let plusCode = insertCharacters(base20Lat, base20Long);

    return plusCode;
}

function convertToBase20(num) {
    const alphabet = '23456789CFGHJMPQRVWX';
    let result = '';

    while (num > 0) {
        let remainder = num % 20;
        result = alphabet[remainder] + result;
        num = Math.floor(num / 20);
    }

    while (result.length < 5) {
        result = '2' + result;
    }

    return result;
}

function insertCharacters(base20Lat, base20Long) {
    let result = '';
    let latIndex = 0;
    let longIndex = 0;
    for (let i = 0; i < 8; i++) {
        if (i === 4) {
            result += '+';
        } else {
            result += base20Lat.charAt(latIndex++);
            result += base20Long.charAt(longIndex++);
        }
    }
    return result;
}

let [lat, long] = p1.split(',').map(Number);
let plusCode = convertToOpenLocationCode(lat, long);
return plusCode;

```

Coordinate: 1.286813,103.854563  
Return: 6PH57VP3+PR

Regarding copy-pasting, it’s something that cannot be avoided. However, if what is expected is dropping a pin and having the coordinates automatically saved into table, it is something that carries a risk of instability because it can inadvertently change. This is a choice.

---

<div class="post-metadata">

**Author:** ![Himaladin](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/himaladin/32/71023_2.png) [@Himaladin](https://community.glideapps.com/u/Himaladin)\
**Post date:** [April 21, 2024, 10:56am UTC](https://community.glideapps.com/t/how-do-i-allow-users-to-adjust-location-data/72746/10 "2024-04-21T10:56:46Z")

</div>

> [@Jeff\_Hager](#):
>
> It’s just as easy, if not easier, to simply grab the coordinates from google maps instead, so I really don’t see much of a benefit to first having to track down the long form plus code, and then add the extra step to decode it into coordinates when you can directly grab the coordinates.

I only read from Google that accuracy can be achieved through this plus code method. It might come in handy, especially when inputting addresses or rural areas without clear addresses. Another thing is its concise form, making it easy to remember. Okay, just sharing.

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [April 21, 2024, 3:55pm UTC](https://community.glideapps.com/t/how-do-i-allow-users-to-adjust-location-data/72746/11 "2024-04-21T15:55:59Z")

</div>

Plus codes and coordinates are just different ways to write the same thing. One just requires an extra encoding and decoding step to use. They are both definitely more accurate and precise than addresses. I agree with that.

---

<div class="post-metadata">

**Author:** ![blairrorani](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/blairrorani/32/43426_2.png) [@blairrorani](https://community.glideapps.com/u/blairrorani)\
**Post date:** [April 21, 2024, 11:48pm UTC](https://community.glideapps.com/t/how-do-i-allow-users-to-adjust-location-data/72746/12 "2024-04-21T23:48:25Z")

</div>

Glad I could take us down that rabbit hole 🙂

I actually think using current location in my use case will suffice for now and can look at a more full on solution in future as required.

Thank you again everyone, happy to consider this solved and also acknowledge that you’re getting into some nitty gritty stuff with plus codes and coordinates that I don’t want to shut down.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [May 8, 2024, 8:21pm UTC](https://community.glideapps.com/t/how-do-i-allow-users-to-adjust-location-data/72746/13 "2024-05-08T20:21:52Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
