facebook

Geolocation without maps – CLOSED

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #341407 Reply

    Stu Wade
    Member

    Is it possible to obtain the Latitude and Longditude of a device without actually using a map widget?

    #341409

    nvts
    Member

    Hello,

    below is code that I used in the past for a device with GPS enabled. I just called it with a button onclick. Have not tried it with Mobione though.

    function getLocation() {
    navigator.geolocation.getCurrentPosition(foundLocation, noLocation);
    function foundLocation(position) {

    var lat = position.coords.latitude;
    var long = position.coords.longitude;
    alert(“LAT : “+lat +”, LONG : “+long);
    }
    }

    function noLocation() {
    alert(‘Could not find location’);
    }
    }

    Cheers…

    #341410

    nvts
    Member

    Hello,

    I just tested this URL with a html container in mobione and it gave me back the lat and long plus more.

    http://docs.phonegap.com/en/1.0.0/phonegap_geolocation_geolocation.md.html

    Cheers…

    #341413

    Stu Wade
    Member

    Thanks a lot – now let me see what I can do with this …

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Geolocation without maps – CLOSED

You must be logged in to post in the forum log in