Is it possible to make a form in wappler that allows the user to select a point on a map (defaulting to where they are) and submit the lon and lat as part of the form?
Hey, there’s a geolocation component where you can bind the lat lon.
It will prompt the user to accept the using of that.
Also you can use http://www.geoplugin.net/json.gp as an api and getting the data from there
Thank you very much for the reply. Iadded the component and tried to make it auto fill a text box but it is not?
This definitely would be a helpful tool
Yes, you can use a hidden field and bind the value if you want!
For the api I mention above, wich you can test: http://www.geoplugin.net/json.gp
On serverside
I set an api action:
'http://www.geoplugin.net/json.gp?ip='+$_SERVER.REMOTE_ADDR
(The server remote address will return the ip of the clientside, otherwise will return the same ip from your server)
(Note that you won’t able to fetch the data so first use a real ip like 'http://www.geoplugin.net/json.gp?ip=xxx.xxx.x.x
bind the data on step you want, and finally change to ip='+$_SERVER.REMOTE_ADDR
again)
Hope it helps
If you specifically want the user to select their location from a map rather than using the inbuilt geolocation component which identifies the users current location then i believe you can do this via the google maps component by capturing the lat,log of a map click event which you could then store in form fields.
You can use the users IP as a location aid but this tends to resolve to the users data centre location rather than their precise location which can be very inaccurate.