Page 1 of 1

google map auto geolocation data

Posted: 2019-10-06 14:14
by rrahmad
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

Re: google map auto geolocation data

Posted: 2019-10-07 07:11
by pbottcher
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.

Re: google map auto geolocation data

Posted: 2019-10-07 21:42
by rrahmad
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

Re: google map auto geolocation data

Posted: 2019-10-08 09:11
by pbottcher
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.

Re: google map auto geolocation data

Posted: 2019-10-08 18:27
by rrahmad
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.

Re: google map auto geolocation data

Posted: 2021-04-10 22:02
by AEmpeno
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.