Start the GPS selector with coordinates

In my Car Meetings App, people can select an exact GPS location.
For instance, they want to select the middle of a big parking lot.

Most often, it is not enough to know the city and street, because in some cases, the exact location is far aware from the actual street. What I want to do now is to be able to start the locator with an estimate of the real location they need.

Please see this example.
The meeting will be on the "Zonneweide".
The street is not enough, because the exact meeting point is at the red "X".

RensD_0-1711734409479.png
So....in the app they wat to put the 'Bouncing Red Droplet" on the "X" position.

When you start the selector.....it always goes to your current location.
So you need to switch to 'Satellite mode' and then zoom out.
Then dop the Red Bouncing Droplet near the actual location, then zoom in, replace the droplet, zoom in, replace the droplet, etc, etc....till you find the correct location.

RensD_0-1711735217337.png 
RensD_1-1711735440261.png
RensD_2-1711735475770.png
RensD_3-1711735508683.png
RensD_4-1711735537328.png


My question
Is there a way to give the selector a starting position when opening?

 

 

 

 

0 6 140
6 REPLIES 6

You can use an initial value, but the challenge is how the user can know the exact latlong value. You could add direction buttons, but the problem again is, how the user knows to which direction.. to south, to east, etc.

I'm a bit further in solving my issue.
Yes, when I enter a set of coordinates in the GPS column and then open the form in edit mode, then the location is show in de selector. The user is now able to refine the position.

But........when I am entering a new record, the here are no GPS coordinates yet. Big question.....how to get those coordinates?

Apps Script
So, I created a Apps Script-Function called: 
getGpsFromAddress() wich takes an address in about any form and returns GPS coordinates. I must say.....it works GREAT. You can enter any adres and Maps will figure out the location. Even something like getGpsFromAddress("Whitehouse") works just fine.

How to get the input argument for the function. 
When the user is in the form, entering all information about the new meeting, then there are also input fields like 'City' and 'Street'.
RensD_0-1711803927852.png

I created a virtual column called 'v|Address' in wich I concatenate both, comma separated. So: City = 'Hilversum' and Street='Stationsstraat' becomes v|Address = 'Hilversum, Stationsstraat'. When v|Address is fed to the function it comes back with "52.22676623692406, 5.179314926493648" with is correct.

And now my challenge.
How to enter GPS-coordinates into the GPS-box when creating a new record?

When both fields are filled in and v|Address has a value......HOW do I call the function and put that result into the GPS input box as an initial value.?
RensD_1-1711804016945.png

I have tried to put the formula into the 'Initial Value Formula' like "getGpsFromAddress([v|Adres])", but that gets me an error: "Unable to find function 'GETGPSFROMADDRESS'"

I tried an 'automation' and that seems to works, according to the functions logging......but no value appears into the GPS-input box.

RensD_2-1711804211761.png

Help?! 
How am I going to solve this? 

The problem is.. you can't trigger any Bot/Script on the form view.

I'm working like this now. (At least, that is what I try)

I open the Form and the user can enter all needed information.
If the GPS column is empty, it will not show.

When saved, the record will be updated and my Apps Script updates the record with the GPS data (or at least it should).
Then I automatically reopen the form and the user can refine the GPS position.

In theory, it works.
If I update the GPS-coordinated by hand in the Sheet, then all works well.
The problem is.....I can't seem the Apps Script to work.
I keep getting the following error:
Output 'GPS' is invalid: Error in expression '[getGpsFromAddress].[Output]' : Unable to find table 'getGpsFromAddress Output'

The process steps are like this:
RensD_0-1711963305574.png

 

 

Direction buttons......how would I do that?

 

I would assume Enum buttons like "100 meters to south", etc and then make some calculations with the HERE() so it would go 100 meters to south from the default location.

Top Labels in this Space