erich.wanker Posted March 11, 2020 Share 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 Link to comment Share on other sites More sharing options...
Hayri ASLAN Posted March 11, 2020 Share Posted March 11, 2020 If you are using uniMap, we have get the user location procedure. Quote Link to comment Share on other sites More sharing options...
andyhill Posted March 11, 2020 Share Posted March 11, 2020 Also for Apple iPhone you will need to use the "https" protocol. Quote Link to comment Share on other sites More sharing options...
erich.wanker Posted March 12, 2020 Author Share 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 Link to comment Share on other sites More sharing options...
Hayri ASLAN Posted March 12, 2020 Share Posted March 12, 2020 it must work on android too. Are you giving location permission to chrome? Quote Link to comment Share on other sites More sharing options...
erich.wanker Posted March 16, 2020 Author Share 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 Link to comment Share on other sites More sharing options...
Hayri ASLAN Posted March 16, 2020 Share Posted March 16, 2020 No. Do you get OnLocationError event? Quote Link to comment Share on other sites More sharing options...
warat mookdaanan Posted May 9, 2023 Share 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 Link to comment Share on other sites More sharing options...
Sherzod Posted May 9, 2023 Share Posted May 9, 2023 Quote Link to comment Share on other sites More sharing options...
jrp Posted April 15 Share Posted April 15 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 Link to comment Share on other sites More sharing options...
Hayri ASLAN Posted April 16 Share Posted April 16 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 Link to comment Share on other sites More sharing options...
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.