Jump to content

Get the result of a Javascript (gps position)


erich.wanker

Recommended Posts

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>
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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