google map auto geolocation data

Got something cool to share with AppGini users? Feel free to post it here!
Post Reply
rrahmad
Posts: 8
Joined: 2019-10-05 15:14

google map auto geolocation data

Post by rrahmad » 2019-10-06 14:14

hooks\table.php

function table_before_insert(&$data, $memberInfo, &$args){

$data['test'] = xxxx ;

return TRUE;

hi
does anyone know how to put my current geolocation google map on xxxx automaticaly. copy and paste does work on appgini google map but i need it to be automatically. thanks

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: google map auto geolocation data

Post by pbottcher » 2019-10-07 07:11

Hi,

not sure I get what you try to do, but I would rather think that you need to do that on the client side, as I would expect that you want to catch the clients geolocation.

Otherwise please explain in more detail what you try to get.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

rrahmad
Posts: 8
Joined: 2019-10-05 15:14

Re: google map auto geolocation data

Post by rrahmad » 2019-10-07 21:42

yes. so client side can save location without needed to copy paste from google map url. its an automatic location. i read some document from google and other. most of it using html5 and jscript. i dont know how to implement it here on appgini php.

https://developers.google.com/maps/docu ... eolocation
Attachments
lokasi.png
lokasi.png (226.47 KiB) Viewed 3657 times

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: google map auto geolocation data

Post by pbottcher » 2019-10-08 09:11

Hi,

sorry to ask again. Do you want to display the current location of the user on the map, as shown in the picture, or do you want to capture the current latitude and longitude in some fields ?

Actually you can use the TABLENAME_dv function to add the javascript code provided on the google document page to your page and handle the rest by adding the desired functions there.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

rrahmad
Posts: 8
Joined: 2019-10-05 15:14

Re: google map auto geolocation data

Post by rrahmad » 2019-10-08 18:27

hi, i want client to capture current location and save it to database with out a need to copy and paste from google map browser url. it happen directly when table.phd or web start.
can you give me example on how to implement it? or just attach those code file.
function table_before_insert(&$data, $memberInfo, &$args) is example only. i thought maybe can put there. function table_dv(&$data, $memberInfo, &$args) or other also can if it can work.

this is an example using jotform
https://form.jotform.me/92805102466454

maybe anyone here were able to do it before. sorry im not a programmer. im new on appgini and udemy.

AEmpeno
Veteran Member
Posts: 72
Joined: 2018-01-04 18:48

Re: google map auto geolocation data

Post by AEmpeno » 2021-04-10 22:02

Were you able to solve the issue? I am trying to get the GPS coordinates as well.

I have a map table and a "location" field name. What I would like to happen is every time I hit the save button I would like the GPS coordinates (latitude and longitude) automatically save the coordinates.

Post Reply