erich.wanker Posted March 11, 2020 Posted March 11, 2020 i forgot how to get results from a javascript.. ;-) Actually - i need latitude and longitude as Double-Delphi-variables if i click on a button (on desktop and Mobile).. the html example : - https://www.w3schools.com/html/tryit.asp?filename=tryhtml5_geolocation <!DOCTYPE html> <html> <body> <p>Click the button to get your coordinates.</p> <button onclick="getLocation()">Try It</button> <p id="demo"></p> <script> var x = document.getElementById("demo"); function getLocation() { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(showPosition); } else { x.innerHTML = "Geolocation is not supported by this browser."; } } function showPosition(position) { x.innerHTML = "Latitude: " + position.coords.latitude + "<br>Longitude: " + position.coords.longitude; } </script> </body> </html> Quote
Hayri ASLAN Posted March 11, 2020 Posted March 11, 2020 If you are using uniMap, we have get the user location procedure. Quote
andyhill Posted March 11, 2020 Posted March 11, 2020 Also for Apple iPhone you will need to use the "https" protocol. Quote
erich.wanker Posted March 12, 2020 Author Posted March 12, 2020 Hi .. the function (i actual make a desktop AND mobile version with the Desktop-Components) is not working on a android ... so i thought - i try to use javascript .. Quote
Hayri ASLAN Posted March 12, 2020 Posted March 12, 2020 it must work on android too. Are you giving location permission to chrome? Quote
erich.wanker Posted March 16, 2020 Author Posted March 16, 2020 Hy Hayri, (my PWA on android does not ask for permission) can it be - that the possition function works just with https ??? - actualy i use NO https Quote
warat mookdaanan Posted May 9, 2023 Posted May 9, 2023 i try to use this code but i don't understand to make it do you have example to try this? Quote
jrp Posted April 15, 2024 Posted April 15, 2024 On 3/11/2020 at 9:06 PM, Hayri ASLAN said: If you are using uniMap, we have get the user location procedure. Hello, How to get user location with UniMap? Thank you Quote
Hayri ASLAN Posted April 16, 2024 Posted April 16, 2024 On 4/15/2024 at 12:27 AM, jrp said: Hello, How to get user location with UniMap? Thank you Hello Please check UniMap demo. You will see "Get User Location" Button C:\Program Files (x86)\FMSoft\Framework\uniGUI\Demos\Desktop\UniMap 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.