Is a realtime gps jQuery mobile possible?

Asked By 10 points N/A Posted on -

Hi! Just a curious newbie here. I am proposing a project on our current course and want to deal with jquery incorporated as gps. I don't know if I sound right, but I just want to ask if a realtime gps jquery mobile is possible to program? And what are the necessary things I should have to look after and consider? Thank you very much for your support.

Best Answer by Larson Salmeron
Best Answer
Best Answer
Answered By 0 points N/A #142382

Is a realtime gps jQuery mobile possible?


Realtime GPS jQuery Mobile is possible. HTML5 (the latest HTML version) is the standard for jQuery Mobile. You should and learn HTML5 since it's what need. navigator.geolocaton object cause GPS to be available.


Lewis, use this code for longitude and latitude.


<!DOCTYPE html> 
  <meta name=viewport content="user-scalable=no,width=device-width" />
  <link rel=stylesheet />
  <script src=jquery.js></script>
<div data-role=page id=home>
  <div data-role=header>
  <div data-role=content>
    <span> Latitude : </span> <span id=lat></span> <br />
    <span> Longitude : </span> <span id=lng></span> <br />
navigator.geolocation.getCurrentPosition (function (pos)
  var lat = pos.coords.latitude;
  var lng = pos.coords.longitude;
  $("#lat").text (lat);
  $("#lng").text (lng);



Answered By 0 points N/A #198314

Is a realtime gps jQuery mobile possible?



It is possible to create a jquery GPS for mobile phone, but it may take you some time.

You can use this script for the GPS part:

(function($) {
        $.gps = {
                approximate:function(loc1, loc2, success)
                        x = 69.1 * (loc2.latitude loc1.latitude);
                        y = 53.0 * (loc2.longitude loc1.longitude);
                        mi = Math.sqrt(x * x + y * y);
                distance:function(loc1, loc2, success)
                        mi = (3963 * 3.1415926 * Math.sqrt(
                                (loc2.latitudeloc1.latitude) *
                                (loc2.latitudeloc1.latitude) +
                                Math.cos(loc2.latitude/57.29578) *
                                Math.cos(loc1.latitude/57.29578) *
                                (loc2.longitudeloc1.longitude) *
                /* not 100% sure this works properly, just yet */
                minMaxRadii:function(loc, mi, success)
                        lat_mile = 0.0144839 * mi;
                        lon_mile = (0.0144839 / Math.cos(loc.latitude * 3.1415926 / 180 )) * mi;
                        var range = {
                                max: {
                                        latitude: loc.latitude + lat_mile,
                                        longitude: loc.longitude + lon_mile
                                min: {
                                        latitude: loc.latitude lat_mile,
                                        longitude: loc.longitude lon_mile
                km2mi:function(km){ return km * 0.621371192; },
                mi2km:function(mi){ return mi * 1.609344; }
It also depends on what programming language you would like to use and on what kind of phone you want to use it.
After creating the software, you should use something like this: Location Site
To help you get the needed locations.
Good luck!


Login/Register to Answer

Related Questions