Profile | Register | Active Topics | Search | FAQ

Advanced Search
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 GpsGate
 GpsGate for Developers
 Get GPS position from a browser using javascript
 New Topic  Reply to Topic
 Printer Friendly
Next Page
Digg this
Author Previous Topic Topic Next Topic
Page: of 2

johan
Forum Admin

Sweden
15470 Posts

Posted - 09/25/2007 :  05:54:39  Show Profile  Visit johan's Homepage  Reply with Quote
GPS in Browser - Get GPS position from a browser using javascript

This feature in GpsGate will allow web pages to read the position from a GPS connected to your local computer in a safe and controlled way. This opens up for very cool web applications which can become position aware.

Some example applications are to make a form that automatically includes a GPS position before it is posted to a web server. Or a map displayed in the browser which marks out your current position.

Make sure you have GpsGate Client Express installed, and have "GPS in Browser" added as Output. You can download GpsGate here. GpsGate Client Express is free to use without time limit.

For a simple demonstration click here
For a sample that adds GPS position to a form click here
Connect a GPS to Google maps here

Requirements
You need a built in GPS or a GPS connected to your computer and GpsGate must be running. GPS in browser works with any browser that handles javascripts. It is tested on Internet Explorer, Firefox, Opera, Safari, and Opera Mobile on Windows Mobile / Pocket PC.

Answers to some common questions.

1. Is it safe? Which web site can access my GPS position?
Yes, it is safe. Web pages that you view in your browser can request the GPS position using Javascript. But you as a user will always be asked to permit a certain page to do so.

2. Can I connect my GPS to a map on any site now?
No, a web page must be specially designed to take advantage of this feature. See the developer section below for more information.

3. Can I turn this feature off?
Yes, simply remove "GPS in browser" from your Outputs in GpsGate. Or exit GpsGate.

4. Can the GPS be turned on only when it is accessed by a page?
Yes, make sure "Close input on idle" (Pocket PC) or "Close input when no outputs conencted" (Windows) is selected. With this option selected GpsGate will only activate the GPS when it is needed, this will save battery. You must select "Show more options..." in the "Advanced" tab to see this option. By default it is turned off.

For Developers

"GPS in browser" uses cross scripting. GpsGate runs a small local web server from which your page can request GPS information. A javascript library is included to make this really simple. Please take a look at the source code for gps.html for a sample.

Simple sample on how to get GPS position into your web page.
<HTML>
<HEAD>
</HEAD>
<BODY>

<script type="text/javascript" src="http://localhost:12175/javascript/GpsGate.js"></script>

<script type="text/javascript">
  //<![CDATA[

  // That is the callback function that is specified in getGpsInfo() and 
  // executed after the data is returned
  // See more info on the returned "gps" object below.

	if (typeof(GpsGate) == 'undefined' || typeof(GpsGate.Client) == 'undefined')
	{
		alert('GpsGate not installed or not started!');
	}

	function gpsGateCallback(gps)
	{
		var resultTag = document.getElementById('position');
		resultTag.innerHTML = 'longitude:' + gps.trackPoint.position.longitude + 
		                      ' latitude:' + gps.trackPoint.position.latitude;

		var d = new Date(gps.trackPoint.utc);

		resultTag = document.getElementById('time');
		resultTag.innerHTML = d.toLocaleString();
	}

  //]]>
</script>

<div id="position"></div><br>
<br>

<div id="time"></div><br>
<br>

<form name="f1">
  <input value="GPS info" type="button" 
                         onclick='JavaScript:GpsGate.Client.getGpsInfo(gpsGateCallback)' 
                         id=button1 name=button1>
</form>

</BODY>
</HTML>

Specification of object sent to getGpsInfo() callback
You can also call getVersion() which will return the version object only.

obj
  .status
    // boolean - Will be true if this is a valid fix, else set to false
    .valid
    // boolean -Will be set to true if user permitted GPS request.
    // If set to false only version information, and no other 
    // information is provided in this object
    .permitted

  // Version of GpsGate installed.
  .version
    // integer - Major version. For 2.5 build 233 this value is 2
    .major
    // integer - Minor version. For 2.5 build 233 this value is 5
    .minor
    // integer - Build number. For 2.5 build 233 this value is 233
    .build
	
  .trackPoint
    .position
      // double - Latitude in decimal degrees.
      .latitude
      // double - Longitude in decimal degrees
      .longitude
      // double - Altitude in meters
      .altitude
	
    .velocity
      // double - Speed over ground in meters per second
      .groundSpeed
      // double - Heading in degrees. 0 is north, 90 east, 180 south, 270 west, etc.
      .heading
      // double - Magnetic variation in degrees
      .magneticVariation
	
    // string - Time stamp in GMT / UTC
    .utc
    
    // Quality of position
    .precision
      // double - HDOP
      .hdop
    
  // Satellites used for fix
	.satellites
	  // integer - Number of satellites in items arrat
    .count
    // Array with information of each satellite in view
    items[]
      // integer - satellite ID
      .prn
      // integer - Signal to noice ratio
      .snr
      // integer - Elevation in degrees
      .elevation
      // integer - Azimuth in degrees
      .azimuth
      // boolean - true if this satellite was used to calculate position fix.
      .usedForFix
You can optionally use this logo on a web page that supports GpsGate "GPS in Browser"


More GPS Web Service from Franson...

GpsGate.com Web Services - Position sharing over the Internet.

The GpsGate Server AJAX API enables integration of live position data and tracks from GpsGate.com or any other GpsGate Server installation to your web page.

Just by quick and easy "cut and paste programming" from our examples you can display the live positions for a group of users on your web page. With simple javascript programming you can build more advanced integrations with our AJAX API. Have a look at our examples for inspiration! More info here

richardhula
Average Member

98 Posts

Posted - 09/25/2007 :  16:29:38  Show Profile  Reply with Quote
Thanks for latest version Johan.

Note that web demo works fine when running GpsGate direct but fails when run as service.

Regards - Richard
Go to Top of Page

steversmith1
New Member

USA
3 Posts

Posted - 10/01/2007 :  13:08:49  Show Profile  Visit steversmith1's Homepage  Reply with Quote
Hello. I am new to the GPS Gateway. Sounds like something we can use. My question is:

Does it work with any GPS Receiver or do you support specific GPS manufactures?

I look forward to testing this out and just want to make sure I get the correct GPS device.

Steve Smith
Go to Top of Page

johan
Forum Admin

Sweden
15470 Posts

Posted - 10/01/2007 :  13:11:50  Show Profile  Visit johan's Homepage  Reply with Quote
GpsGate supports almost all GPS receivers. We cannot guarantee that a specific combination of GPS + computer + software works. But in most cases there are no problems. Just run the wizard and you are up and running.

Make sure you buy a GPS that supports NMEA.

Regards,
Johan

Franson Support
Go to Top of Page

steversmith1
New Member

USA
3 Posts

Posted - 10/01/2007 :  13:39:58  Show Profile  Visit steversmith1's Homepage  Reply with Quote
Thanks for the fast reply. One more question: If I simply get the GpsGate off your web site, is that the correct version? Are there any other considerations?

Steve Smith
Go to Top of Page

johan
Forum Admin

Sweden
15470 Posts

Posted - 10/01/2007 :  13:41:46  Show Profile  Visit johan's Homepage  Reply with Quote
Yes.

Please try. GpsGate is free to try, and the best way to learn and understand is by testing yourself :-)

Regards,
Johan

Franson Support
Go to Top of Page

steversmith1
New Member

USA
3 Posts

Posted - 10/03/2007 :  19:04:39  Show Profile  Visit steversmith1's Homepage  Reply with Quote
It worked!!

Pretty slick stuff. Would this work in a Windows CE environment?

Steve Smith
Go to Top of Page

johan
Forum Admin

Sweden
15470 Posts

Posted - 10/04/2007 :  03:06:34  Show Profile  Visit johan's Homepage  Reply with Quote
It works for Opera Mobile:
http://www.opera.com/products/mobile/products/winmobile/

It might work in Pocket Internet Explorer in WM6.0, but for sure not in earlier versions.

The fallback solution for Pocket Internet Explorer is to use our GpsTools ActiveX solution:
http://franson.com/gpstools/guide.asp?section=GpsToolsInternetExplorer&platform=net

See the "Access GPS from Internet Explorer HTML page" section. Download GpsTools SDK and take a look at the html sample page included.

Hopefully Microsoft will include full "Ajax" Javascript support in Pocket Internet explorer soon and then it will work with the "cross-scripting" solution presented above as well. The benefit with the solution above is that it is browser independent given that the browser fairly new.

Regards,
Johan

Franson Support
Go to Top of Page

tiendung
Starting Member

Singapore
1 Posts

Posted - 02/24/2008 :  23:03:41  Show Profile  Reply with Quote
Hi,

Does GpsGate work with Minomo 0.2 on Windows Mobile 5.0? I tried but it did not work.
Go to Top of Page

johan
Forum Admin

Sweden
15470 Posts

Posted - 02/25/2008 :  02:05:15  Show Profile  Visit johan's Homepage  Reply with Quote
The browser must support AJAX

Regards,
Johan

Franson Support
Go to Top of Page

spand
Junior Member

11 Posts

Posted - 05/08/2008 :  15:44:11  Show Profile  Reply with Quote
Hi

What does it mean [10049] Could not blind socket while im trying to use tcp/ip server option and I put my server IP address?
Go to Top of Page

johan
Forum Admin

Sweden
15470 Posts

Posted - 05/09/2008 :  02:10:20  Show Profile  Visit johan's Homepage  Reply with Quote
This means that some other application on your computer is using the port, in this case port 12175 on IP address 127.0.0.1

Regards,
Johan

Franson Support
Go to Top of Page

pino.giuseppe
New Member

2 Posts

Posted - 05/16/2008 :  07:11:42  Show Profile  Reply with Quote
Hi,

Few weeks ago(April-2008) I bought at "Share.it" your software Franson GPSGATE for Windows_XP_SP2 Ver:2.61 to be used with Microsoft Internet Explorer7.0 (or Firefox).

No problem using it with "Google-Earth" ,everything is working fine.

The problem is with "GPS in Browser" function when viewing Google maps of my area : No "I am here" indication when I watch my local area with Google Maps.

Furthermore in the Franson_GPS_Gate OUTPUT, I selected :"VIEW IN BROWSER " option ,but nothing to to.

I supposed I should view an indicator like in "Google_Earth" :" I AM HERE " or am I wrong ??

All the DEMO LINKS in this FORUM work

Is there a FIX ??

As I said ,using the software with "GOOGLE_EARTH" ,it works fine. Am I missing something ??

Thanks ,best regards,waiting for your reply

Mendola Giuseppe

Go to Top of Page

johan
Forum Admin

Sweden
15470 Posts

Posted - 05/16/2008 :  11:35:08  Show Profile  Visit johan's Homepage  Reply with Quote
In general web pages needs to be adjusted to work with "GPS in Browser". How this is made is described above in this guide.

To "hook" into an existing web page you try the sample "Show your local GPS position on all the main map sites" at the bottom of this page:
http://gpsgate.com/index.php?id=66


Regards,
Johan

Franson Support
Go to Top of Page

rjwinte@yahoo.com
New Member

USA
6 Posts

Posted - 05/28/2008 :  20:55:23  Show Profile  Reply with Quote
I have the same problem as Mendola, no indicator in google maps. I got the Gpsgate toolbar to appear in INTERNET EXPLORER by downloading an old version PLUG IN PACK, but the Jump To button does nothing. I have google maps in my OUT list in Settings and it shows 1 Client connected. I have a new purchase/install of GPSGATE CLIENT 2.6. Google Earth works, but not Google Map. I tried it without the PLUG IN PACK and did not get the GPSGATE toolbar in EXPLORER.

Bob W.
Go to Top of Page

johan
Forum Admin

Sweden
15470 Posts

Posted - 05/29/2008 :  03:28:58  Show Profile  Visit johan's Homepage  Reply with Quote
GpsGate Toolbar is no longer supported. It is the replaced by the "GpsGate in Browser" feature.

There are two ways to connect a map on a web page to GpsGate.
1. Modify the web page to use GpsGate Ajax API to access the GPS position. How this is done is described at the top of this post.

2. To "hook" into an existing web page you try the sample "Show your local GPS position on all the main map sites" at the bottom of this page:
http://gpsgate.com/index.php?id=66

Regards,
Johan

Franson Support
Go to Top of Page

maddo
Starting Member

1 Posts

Posted - 06/12/2008 :  04:08:09  Show Profile  Reply with Quote
Has anyone tried this on a mobile with GPS. Can you create a mobile version (e.g. for Symbian)?

Thanks.
Go to Top of Page

ebijl
New Member

2 Posts

Posted - 07/15/2008 :  04:20:46  Show Profile  Reply with Quote
I have been trying to use the "GPS in Browser" feature and it works fine with
the simple demonstration
gps position to a form
gps to google maps
but it doesn't work on a single one of the major mapping sites

I am also not able any more to install the GpsGate toolbar in IE. I did that before on one of my computers and at least on that one I am able to get a GPS position in the various mapping sites.

Any idea what I could be doing wrong as far as "GPS in Browser" is concerned and also why the Franson Gps Gate doesn't show up any more in the toolbar selection?

Regards Edward
Go to Top of Page

johan
Forum Admin

Sweden
15470 Posts

Posted - 07/15/2008 :  04:26:15  Show Profile  Visit johan's Homepage  Reply with Quote
The toolbar is not longer supported.

A web page must include support for "GPS in browser" for it to work. If you would like to see this feature on a specific site, you can contact the site owner and ask him to include support for "GPS in Browser".

There is also a "hook" into an existing web page you try the sample "Show your local GPS position on all the main map sites" at the bottom of this page:
http://gpsgate.com/index.php?id=66

Regards,
Johan

Franson Support
Go to Top of Page

Fredrik
developer

Sweden
1127 Posts

Posted - 07/15/2008 :  04:30:12  Show Profile  Visit Fredrik's Homepage  Reply with Quote
Edward:
Regarding the main map sites, have you tried this example? http://gpsgate.com/index.php?id=120
(it won't show a marker icon but should be able to center on your current position on quite a few map-services)

The GpsGate toolbar is a discontinued product. We might develop a more fully featured solution in a way similar to the example above, but no date set. Currently the Gps-in-browser is more focused on providing You with the tool to integrate your local position in your web-applications.

Regards,
Fredrik

Franson Support
Go to Top of Page

ebijl
New Member

2 Posts

Posted - 07/15/2008 :  09:12:27  Show Profile  Reply with Quote
Johan, Fredrik,

When I installed the toolbar it already wasn't supported any more. For some reason or another I managed at the time to install it and make it work. Have no clue why it doesn't install this time, but I will have to accept the fact that I don't manage to get it to work on the other computers. But on the computer it is installed on, I have a GPS position on all major mapping sites indicated. A real pity that you don't support that plug in any more!

However that doesn't change the fact that the "GPS in Browser" feature refuses to work on all map sites indicated by you apart from your site http://gpsgate.com/demo/gpsinbrows2.html where it does work.

If you want to see what I might be doing wrong, you can remotely access the computer that I am trying this on, using UltraVNC. Just send me an email "off forum" for the access password and the IP address.

Regards, Edward
Go to Top of Page

mbond
New Member

United Kingdom
5 Posts

Posted - 08/06/2008 :  12:17:49  Show Profile  Reply with Quote
Hi,

It mentions above in the article that gps in browser is tested in IE on WM6, however I can't get it to work. I'm on a (new WM6 version) HTC Advantage and it works in the Opera browser, but won't in the IE browser. IE Browser doesn't even ask if i want to permit it (whereas opera asks if i want to permit access to the other site (localhost). Your demo doesn't work in IE either. Do you know of anything obvious to check for(security settings etc.) or can you confirm that it won't work in IE?
Go to Top of Page

johan
Forum Admin

Sweden
15470 Posts

Posted - 08/06/2008 :  12:20:12  Show Profile  Visit johan's Homepage  Reply with Quote
The browser must support Ajax to make "GPS in Browser" work. As far as I know IE on WM does not support Ajax. You need to use Opera on WM.

(The main article does not say that IE on WM6 is supported.)

And why Microsoft doesn't make a functional browser on WM is beyond my understanding.

Regards,
Johan

Franson Support
Go to Top of Page

mbond
New Member

United Kingdom
5 Posts

Posted - 08/06/2008 :  12:31:42  Show Profile  Reply with Quote
Thanks for the quick response, I fully agree, microsoft really should get their act together and sort out their browser.

In the requirements of the first post, it states 'It is tested on Internet Explorer, Firefox, Opera, Safari, and Opera Mobile on Windows Mobile / Pocket PC.'

Does the activeX control from gpstools still work with this version? If so I may be able to do some user agent sniffing and sort it out that way.
Go to Top of Page

johan
Forum Admin

Sweden
15470 Posts

Posted - 08/06/2008 :  12:39:59  Show Profile  Visit johan's Homepage  Reply with Quote
Yes, "Opera Mobile on Windows Mobile / Pocket PC", which you also has confirmed works.

The ActiveX will most likely work, but it was quite some times since we tested it.

Regards,
Johan

Franson Support
Go to Top of Page

mbond
New Member

United Kingdom
5 Posts

Posted - 08/06/2008 :  12:49:58  Show Profile  Reply with Quote
Ahh, I thought you meant all of those browsers on Windows Mobile. Ok cheers, will get on with testing then :O)
Go to Top of Page

johan
Forum Admin

Sweden
15470 Posts

Posted - 08/06/2008 :  12:52:09  Show Profile  Visit johan's Homepage  Reply with Quote
Note that the GpsTools ActiveX DLL is installed together with GpsGate, so you will not need to install anything more than GpsGate.

Regards,
Johan

Franson Support
Go to Top of Page

mbond
New Member

United Kingdom
5 Posts

Posted - 08/06/2008 :  13:12:09  Show Profile  Reply with Quote
The activeX seems to work ok.

One thing i noticed is that the ActiveX allows returning of data in northing and easting - is this something that GPS in browser will support? I will need to convert lats and longs somehow otherwise as our apps mark eastings and northings.
Go to Top of Page

johan
Forum Admin

Sweden
15470 Posts

Posted - 08/06/2008 :  13:15:20  Show Profile  Visit johan's Homepage  Reply with Quote
Currently "GPS in Browser" only supports returning data in lon/lat WGS84.

Regards,
Johan

Franson Support
Go to Top of Page

mbond
New Member

United Kingdom
5 Posts

Posted - 08/07/2008 :  04:51:12  Show Profile  Reply with Quote
Are any plans to provide northing and easting data on the object returned in GPS In Browser. We've been using gpsGate for a while and our apps are heavily reliant on using the northing and eastings from the previous activeX version as we submit those values to the server.Having these available would save a large amount of server side code from having to be rewritten.

If this is something that is in the pipeline it would be greatly appreciated.
Go to Top of Page

johan
Forum Admin

Sweden
15470 Posts

Posted - 08/07/2008 :  04:55:18  Show Profile  Visit johan's Homepage  Reply with Quote
It is not in the pipeline, but we can consider it if you sponsor the development. In that case contact us here for a further discussion:
http://franson.com/gpsgate/support.asp

Regards,
Johan

Franson Support
Go to Top of Page

trchhetri
New Member

2 Posts

Posted - 09/23/2008 :  05:57:33  Show Profile  Reply with Quote
Hi johan.. I am having some problem with the gpsgate . I downloaded the windows mobile version few days back and had connected it to my laptop and it did run well fetching the co-ordiantes on my laptop. After few days I tried opening up the gpsgate on my mobile but fails to get the co-ordinates on my mobile inspite of getting the gps signal . With the settings the gps gets the valid position but if I try opening up gps.html it doesnot respond at all. I have checked all the input and output settings as well , so could you please let me know where am i going wrong.
Go to Top of Page

roadofking
New Member

3 Posts

Posted - 10/08/2008 :  09:49:00  Show Profile  Reply with Quote
Hi
I run the sample(http://franson.com/gpsgate/gps.html) on windows mobile 5.0 . My browser is IE.
I click the button "GPS info" doesn't show the position and time.
but I can see where I am on gpsgate.com(http://apps.gpsgate.com/BuddyTracker/Home.aspx)
how can I make the lng and lat show on the sample page?
Go to Top of Page

Fredrik
developer

Sweden
1127 Posts

Posted - 10/08/2008 :  10:59:21  Show Profile  Visit Fredrik's Homepage  Reply with Quote
@roadofking:
The browser needs to support JavaScript (please see "Requirements" in the post above). Try Opera Mobile for example.

Regards,
Fredrik

Franson Support
Go to Top of Page

roadofking
New Member

3 Posts

Posted - 10/08/2008 :  23:04:04  Show Profile  Reply with Quote
Thank you Fredrik
It's does work with opera mobile!
Go to Top of Page

patoch
New Member

2 Posts

Posted - 10/18/2008 :  19:09:45  Show Profile  Reply with Quote
Hello,

I am trying GPSGate on a Samsung i900 with Windows Mobile 6.1 and Opera 9.5.
GPSGate is running and says "GPS data with valid position".
Javascript is activated.

When I call the page http://localhost:12175, I get "Erreur Serveur", ie. Server Internal Error - HTTP 500.

Could you tell me what is wrong ?

Many thanks in advance,

Patrick
Go to Top of Page

johan
Forum Admin

Sweden
15470 Posts

Posted - 10/19/2008 :  14:02:47  Show Profile  Visit johan's Homepage  Reply with Quote
Have you added "GPS in Browser" as Output in GpsGate?

GpsGate does not output the error "Server Internal Error - HTTP 500", so whatever the reason is for that error message is, it does not come from GpsGate.

Regards,
Johan

Franson Support
Go to Top of Page

patoch
New Member

2 Posts

Posted - 10/20/2008 :  05:35:27  Show Profile  Reply with Quote
Hello,
yes I added "GPS in browser" to the output list.
Did you test it on WM 6.1 and Opera 9 ? can there be any limitation from Samsung ?
Is there a place where I should search for error logs ?
Many thanks,
Patrick
Go to Top of Page

thoughtless
New Member

2 Posts

Posted - 10/20/2008 :  20:38:59  Show Profile  Visit thoughtless's Homepage  Reply with Quote
This is an awesome feature! I'm just looking for more information about the data returned. Is there any documentation anywhere?

I guess the only value I'm unsure of is the groundSpeed. Is this value returned in knots or mph?

Also, just out of curiosity. What are the values such as altitude measured in? Meters, feet?

Again -- GREAT feature! The only suggestion I have is to simply get a JSON response instead of one wrapped in a function and eval. I am reading it through PHP for a project on my computer and it is much easier to read this data stream than a COM and parse sentences!
Go to Top of Page

johan
Forum Admin

Sweden
15470 Posts

Posted - 10/21/2008 :  03:35:24  Show Profile  Visit johan's Homepage  Reply with Quote
"// double - Speed over ground in meters per second", you find documentation for each variable in the first post above in this thread.

The reason you get it through eval, is that it should work using cross-scripting.

Regards,
Johan

Franson Support
Go to Top of Page

Fredrik
developer

Sweden
1127 Posts

Posted - 10/21/2008 :  08:08:49  Show Profile  Visit Fredrik's Homepage  Reply with Quote
@thoughtless. Please see the reference docs at: http://gpsgate.com/docs/gpsgateservices/jsdoc/index.html

Regards,
Fredrik

Franson Support
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Next Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
GpsGate Forum © 2014 GpsGate AB Go To Top Of Page