Jump to content

Recommended Posts

Posted

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>
Posted

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 ..

 

Posted

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

  • 3 years later...
  • 11 months later...
Posted
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

Posted
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

  • Like 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...