JSGeolocation

91 views
Skip to first unread message

Todd Johnson

unread,
Sep 28, 2025, 12:24:02 PMSep 28
to mementodatabase
I am trying to figure out how to control what is displayed in a geolocation field, the coordinates or the address.   When I choos a location on android or desktop using the map it will store the location object and display the address. I wanted to copy the address from one entry into another entry and finally determined I had to do it using coordinates. Assuming that is the only way, I figured out how to do that using info provided by 
ernst
 
To copy GPS data, I split it into lat and long and then reassemble them. This works well for me.

var ort = e.field("GPS Daten ")
var lat = ort.lat
var lng =ort.lng
var gps = lat +",""+ lng
e.set("GPS neu ",gps)

Thank you for that!

Is there a way to control the objects appearance to show the address like it does when I enter a location using the built in map, instead of the coordinates that I apparently have to use when copying the location from one entry to another? Besides extracting the address and displaying it in a text field.
Thanks in advance!
Todd

Todd Johnson

unread,
Sep 28, 2025, 12:27:48 PMSep 28
to mementodatabase
Is there a way to control the location object to show the address like it did when I enter a position in map, instead of the coordinates, I have to use to copy the location from one to one entry to another? Other than extracting the address and display it in a text field.

Not sure why some of my words get changed when posting.

Todd Johnson

unread,
Sep 28, 2025, 12:29:44 PMSep 28
to mementodatabase
Again, not sure if this is going through translation to another language and back or what. Sorry about the wording.

Er Mo

unread,
Sep 28, 2025, 4:00:22 PMSep 28
to mementodatabase
Hallo
In den Einstellungen des Feldtyp " Standort " gibt es die Möglichkeit die Adresse oder die GPS Daten anzuzeigen . Unter Android --> Primärer Wert

Zu Übersetzung : Da ich kein Englich kann und somit die Übersetzung auch nicht Kontrollieren kann send ich den Text in meiner Muttersprache mit , so kann jeder selbst übersetzen .


Hello
In the settings for the "Location" field type, there is the option to display the address or GPS data. On Android --> Primary Value

Regarding translation: Since I don't speak English and therefore can't check the translation, I'm sending the text in my native language so everyone can translate it themselves.

Ernst

Todd Johnson

unread,
Sep 29, 2025, 9:52:15 AMSep 29
to mementodatabase
Thank you very much!
Todd

Todd Johnson

unread,
Oct 6, 2025, 8:44:09 AMOct 6
to mementodatabase
Following up on this again. The lat/lng method works on desktop or android to copy a location object from one entry to another.
The Android version will allow you to select the Primary Value as the address and that works very well. Then the object is saved with the address as the showing part in the table on phone or desktop.
Is there a way in the scripting to get the address to be the "Primary Value"  when just adding an entry using the desktop? (The same way it does on Android?)
Thanks

Er Mo

unread,
Oct 6, 2025, 1:16:51 PMOct 6
to mementodatabase
Hallo
Du kannst die Adresse in ein Textfeld schreiben .Wenn du das Skript " Erstellen eines Eintrage / Vor den Speichern " erstellst , wird die Adresse in das Textfeld geschriben . Wenn du das für die Änderungen auch brauchst musst du das Selbe in " Bei Änderunge " einstellen . Das ist nur für denn erste Eintrag in Standortfeld . Für mehrere Eingaben im Standortfeld ist es anders .

Hello
You can enter the address in a text field. If you create the "Create an entry / Before saving" script, the address will be written into the text field. If you need this for changes, you have to set the same in "On changes." This only applies to the first entry in the location field. It's different for multiple entries in the location field.

Skript:

var e= entry()
 ort = e.field("Ort")
e.set("Adresse",ort)

Ernst
Reply all
Reply to author
Forward
0 new messages