Profile | Register | Active Topics | Search | FAQ
You are welcome to post questions, comments and tips in all forums and topics.
And if you think you have relevant information, do not hesitate to make a contribution!

Advanced Search
 All Forums
 Franson GpsGate
 GpsGate for Developers
 Get GPS position from a browser using javascript

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
johan Posted - 09/25/2007 : 05:54:39
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 2.6 or later installed, and have "GPS in Browser" added as Output. You can download GpsGate here



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

Connect GPS to a list of major mapping sites 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
40   L A T E S T    R E P L I E S    (Newest First)
Fredrik Posted - 01/29/2010 : 10:25:18
The gpsgate toolbar is a discontinued product. It is not the same as the bookmarklet solution.
Some of the sites listed might have changed since last update, please report a site that doesn't work anymore or suggest one you'd like to see supported.

If you are knowledgeable in JavaScript you could extend this yourself, see http://franson.com/forum/topic.asp?TOPIC_ID=6102. For best control you should use the official API of the map-site you like to use and create a custom page (something like this, that you can run locally, http://gpsgate.com/demo/gpsinbrows2.html)

Regards,
Fredrik

Franson Support
quantumhead Posted - 01/08/2010 : 13:54:50
Does not seem to work with any of the sites listed @ http://gpsgate.com/index.php?id=120. Im running IE8, firefox & chrome and java 1.6.0_17.

Take google maps. the gpsgage tool bar allows you to connect the page to gpsgate but wont jump to location etc. most other sites wont highlight the gpsgate toolbar & connect to gpsgate and if they do says sorry this site cant be used with gpsgate (no google map instance found)

You say above that the tool bar is not supported but your instructions say “Surf to any of the sites listed below and simply press the bookmark. The map will now center on your current GPS-position”.

The local test on 127. works a treat, the public page works a treat.

Im currently travelling the world and find gpsgate is great (there are other issues) but really would also like this feature for weather maps etc.

What i am trying to fig is, is it this laptop or is it the site?

Am I getting this all wrong?
johan Posted - 07/10/2009 : 04:05:16
The browser must support Axaj/Javascript locally on the browser for "GPS in Browser" to work.

Regards,
Johan

Franson Support
JamesP Posted - 07/10/2009 : 03:55:37
OK - reported bug to Opera

P.S. Does something like SkyFire stand a chance of working - it claims to have full ajax and js support - but I suspect it may be doing most of that on remote servers - and compressing the reulting image to you (which presumably means it will never see the local server and hence the GPS position)

Think I've read that Microsoft are planning something similar
johan Posted - 07/10/2009 : 03:27:50
Please report this bug to Opera as well. Let us know if this bug remains after Opera's final release.

Regards,
Johan

Franson Support
JamesP Posted - 07/09/2009 : 18:48:29
Hi,

A quick heads up on Windows Mobile browser compatability.
WM6
Opera mobile 8.65 works fine
Opera mobile 9.7 beta - no longer appears to work (javascript error: GPSGate not installed or not started) - but it obvioulsy is as it works in 8.65

Also doesn't work in Pocket IE mobile or Skyfire.

Hopefully Opera will sort theri beta out - otherwise that seems to leave us without a mobile browser to use

Thanks
SCTProject Posted - 05/15/2009 : 12:11:33
Thanks for replying Johan, it was actually local admin issue on the PC.
johan Posted - 05/14/2009 : 11:53:09
Try this link in a normal browser:
http://localhost:12175/

Regards,
Johan

Franson Support
SCTProject Posted - 05/14/2009 : 11:49:47
Hi Fredrik/Johan,
I'm getting the "GpsGate not installed or started" when trying the example web page, which I saved locally as I don't have internet access on the PC I have it installed on. I have added GPS in Browser to Active output.
The Franson tray icon->settings shows "Running OK!" and GPS data with valid position, and netstat -a shows amoungst other data "TCP lap04110:12175 LISTENING" so it all seems to be available, but the javascript does not appear to work.
Any help would be appreciated.
Thanks in advance
johan Posted - 02/02/2009 : 13:33:10
Really cool!

I would suggest that you post this (very same) information in the main GpsGate 2.6 forum to get some more readers. Here:
http://franson.com/forum/forum.asp?FORUM_ID=23

Regards,
Johan

Franson Support
Prefect Posted - 02/02/2009 : 13:19:03
Hi All

@Franson: Thanks for the cool "GPS in Browser" feature!

I made a small tech-demo for in-browser-navigation out of the google maps example. You can watch a video of the app here:


http://www.iteconomy.biz/gpsgate/demo/


I always wanted to have a quick and easy reliable navigation tool on my CarPC. Now thats possible! And it works! :-)
It is still under heavy development!


Requirements:
- GPS Gate with "GPS in Browser" activated
- GPS Receiver
- CarPC or Notebook in Car
- Some sort of online-connection (GSM/UMTS, WLAN...)
- A browser

I suggest google Chrome or better Iron (the same, only without the googe-sniffing stuff) because of the fast jscript implementation and the possibility to run the application in a separate fullscreen-window.
http://www.srware.net/en/software_srware_iron_download.php



Features:
- Runs completely in browser with jscript, with live maps from google maps.
- Shows you position and heading on the map. The headings-arrow gets automatically rotated (that was hard work!)
- Shows Speed, Altitude etc. gps Data
- Shows the name of the street you are currently on. Display of house-numbers also supported! (uses google reverse-geocoding, not activated right now)
- Lets you navigate: click on the map and it will show you the fastest path from your current location to the place you clicked.
- Or: type in a location in the text-box and click "navigate". Also restaurant-names, only streetnames and so on can be navigated to (uses google location search)
- Auto-Pans map to display your location in center. Auto-Zooms map according to the speed you are driving.
- Tracks your path you have been driving.
- Displays google maps in full-screen with overlayed transparent controls.



Todo:
- On-Screen keyboard and autocompletion for entering addresses in the navigation-textfield.
- Saving states, addresses and option-values in cookies
- get rid of the annoying "not transparent" heading-indicator. (the red arrow should be transparent, but imagemagick ****s up somehow. help please!)



btw: please don't steal the jscript code, just ask me if you want to use it or modify it by your own.



You can try it out here:

http://www.iteconomy.biz/gpsgate/gmaps.php

(Right now it is a pretty slow server that it is hosted on...)

Please give me feedback! :-)


Regards!
Chris


CarPC on RX-8
thoughtless Posted - 10/21/2008 : 22:55:37
quote:
Originally posted by Fredrik

@thoughtless. Please see the reference docs at: http://gpsgate.com/docs/gpsgateservices/jsdoc/index.html

Regards,
Fredrik

Franson Support



Perfect! Thanks!
Fredrik Posted - 10/21/2008 : 08:08:49
@thoughtless. Please see the reference docs at: http://gpsgate.com/docs/gpsgateservices/jsdoc/index.html

Regards,
Fredrik

Franson Support
johan Posted - 10/21/2008 : 03:35:24
"// 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
thoughtless Posted - 10/20/2008 : 20:38:59
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!
patoch Posted - 10/20/2008 : 05:35:27
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
johan Posted - 10/19/2008 : 14:02:47
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
patoch Posted - 10/18/2008 : 19:09:45
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
roadofking Posted - 10/08/2008 : 23:04:04
Thank you Fredrik
It's does work with opera mobile!
Fredrik Posted - 10/08/2008 : 10:59:21
@roadofking:
The browser needs to support JavaScript (please see "Requirements" in the post above). Try Opera Mobile for example.

Regards,
Fredrik

Franson Support
roadofking Posted - 10/08/2008 : 09:49:00
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?
trchhetri Posted - 09/23/2008 : 05:57:33
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.
johan Posted - 08/07/2008 : 04:55:18
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
mbond Posted - 08/07/2008 : 04:51:12
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.
johan Posted - 08/06/2008 : 13:15:20
Currently "GPS in Browser" only supports returning data in lon/lat WGS84.

Regards,
Johan

Franson Support
mbond Posted - 08/06/2008 : 13:12:09
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.
johan Posted - 08/06/2008 : 12:52:09
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
mbond Posted - 08/06/2008 : 12:49:58
Ahh, I thought you meant all of those browsers on Windows Mobile. Ok cheers, will get on with testing then :O)
johan Posted - 08/06/2008 : 12:39:59
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
mbond Posted - 08/06/2008 : 12:31:42
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.
johan Posted - 08/06/2008 : 12:20:12
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
mbond Posted - 08/06/2008 : 12:17:49
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?
ebijl Posted - 07/15/2008 : 09:12:27
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
Fredrik Posted - 07/15/2008 : 04:30:12
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
johan Posted - 07/15/2008 : 04:26:15
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
ebijl Posted - 07/15/2008 : 04:20:46
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
maddo Posted - 06/12/2008 : 04:08:09
Has anyone tried this on a mobile with GPS. Can you create a mobile version (e.g. for Symbian)?

Thanks.
johan Posted - 05/29/2008 : 03:28:58
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
rjwinte@yahoo.com Posted - 05/28/2008 : 20:55:23
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.
johan Posted - 05/16/2008 : 11:35:08
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

GpsGate Forum © 2010 Franson Technology AB Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.04