Active Topics

 


Reply
Thread Tools
Posts: 3 | Thanked: 0 times | Joined on Dec 2009
#1
Hi,

Is there any way to get GPS location using Javascript in N900 browser ? I have heard that I could be possible but some plugin needs to be installed first. I would like to use the location on my ajax web page.
 
Posts: 104 | Thanked: 47 times | Joined on Sep 2009 @ Kassel, Hesse, Germany
#2
Originally Posted by kakoskin View Post
Hi,

Is there any way to get GPS location using Javascript in N900 browser ? I have heard that I could be possible but some plugin needs to be installed first. I would like to use the location on my ajax web page.

I guess looking at http://dev.w3.org/geo/api/spec-source.html and https://developer.mozilla.org/en/using_geolocation should help. You need to install the maemo-geolocation package.
__________________
Julian Andres Klode - Debian Developer, Ubuntu Member

See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/.
 

The Following User Says Thank You to jak For This Useful Post:
Posts: 3 | Thanked: 0 times | Joined on Dec 2009
#3
Thank you!

Does this mean that I need to use Firefox and it's not possible with the built-in browser that ships with N900 ?
 
Posts: 466 | Thanked: 661 times | Joined on Jan 2009
#4
Check out maeMaps (search this site) for an example application that uses the plugin.

The plugin works with the built-in browser.

Here is a post:
http://talk.maemo.org/showthread.php...hlight=maemaps
 
onutz's Avatar
Posts: 81 | Thanked: 15 times | Joined on Sep 2009 @ Romania, Bucharest
#5
also try this: install greasemonkey plugin then maemo geolocation plugin; then you are able to use gmaps quite easy
 
Posts: 104 | Thanked: 47 times | Joined on Sep 2009 @ Kassel, Hesse, Germany
#6
Originally Posted by kakoskin View Post
Thank you!

Does this mean that I need to use Firefox and it's not possible with the built-in browser that ships with N900 ?
The N900 browser is based on Firefox code, it uses the Gecko engine just like Firefox does. And the API itself is a completely browser-independent W3C Standard Draft.
__________________
Julian Andres Klode - Debian Developer, Ubuntu Member

See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/.
 
Posts: 3 | Thanked: 0 times | Joined on Dec 2009
#7
Some status update for those who are trying similar stuff.

I installed Firefox Mobile on my N900 and then Maemo GeoLocation add-on (https://addons.mozilla.org/en-US/mobile/addon/46819), works pretty ok, you can test it at:
http://geo.webvm.net/

This configuration does not enable geolocation in N900 default browser however.
 
Posts: 29 | Thanked: 71 times | Joined on Apr 2010 @ Fresno, CA
#8
Originally Posted by kakoskin View Post
Hi,

Is there any way to get GPS location using Javascript in N900 browser ? I have heard that I could be possible but some plugin needs to be installed first. I would like to use the location on my ajax web page.
Hey you can also check
www.narrativecolors.com/map.html for javascript example.

also here is the code

----------------------XXXX------------------

function getMyLocation(){
if(navigator.geolocation) { // Try Browser's Geolocation
browserSupportFlag = true;
navigator.geolocation.getCurrentPosition(function( position) {
initialLocation = new google.maps.LatLng(position.coords.latitude,positi on.coords.longitude);
map.setCenter(initialLocation);
}, function() { handleNoGeolocation(browserSupportFlag); });
} else if (google.gears) { // Try Google Gears Geolocation
browserSupportFlag = true;
var geo = google.gears.factory.create('beta.geolocation');
geo.getCurrentPosition(function(position) {
initialLocation = new google.maps.LatLng(position.latitude,position.long itude);
map.setCenter(initialLocation);
}, function() { handleNoGeoLocation(browserSupportFlag); });
} else { // Browser doesn't support Geolocation
browserSupportFlag = false;
handleNoGeolocation(browserSupportFlag);
}
function handleNoGeolocation(errorFlag) {
if (errorFlag == true) {
alert("Geolocation service failed.");
} else {
alert("Your browser doesn't support geolocation !!");
}
}
var image = new google.maps.MarkerImage(
'images/iamhere.png', new google.maps.Size(48,48),
new google.maps.Point(0,0),
new google.maps.Point(24,48)
);

marker = new google.maps.Marker({ map: map, position: initialLocation, icon: image, title:"We are Here !! "});
}


-----------#### HOPE it works -------
 
Posts: 111 | Thanked: 16 times | Joined on May 2010
#9
Originally Posted by jak View Post
The N900 browser is based on Firefox code, it uses the Gecko engine just like Firefox does. And the API itself is a completely browser-independent W3C Standard Draft.
Is solution fr this?
 
Reply


 
Forum Jump


All times are GMT. The time now is 05:05.