WebLocation

I am building an app that will allow users to open a browser on their mobile device, go to the site, hit a button and using their location calculate the distance from their location to a set of gas stations they are allowed to use. My confusion lies in how to go about getting the location and testing without port 443.

I’ve added a WebLocation named UserLocation to my app and on the button press I have the following:

UserLocation.Request <—get approval from the user

In testing, I’m not being prompted by the browser to allow location services, but I’m assuming it’s because in the testing environment I have no https.

My next step, I assume, is to do:

UserLocation.Start
UserLocation.Stop

Which should provide me with a latitude and longitude. How to I assign the latitude and longitude to variables to use for the calculation?

Thanks in advanced and sorry, very much still a newb haha

if the client browser send location data to your server app you need https, means a secure connection.

instead of start stop you could use Request

you get an event LocationChanged
https://documentation.xojo.com/api/web/weblocation.html#weblocation

WebMapLocation should give you a distance with .DistanceTo in straight line

1 Like

Thanks, definitely put me on the road going in the right direction!