Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    N900 & access Location API from Javascript ?

    Reply
    kakoskin | # 1 | 2009-12-30, 17:09 | Report

    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.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    jak | # 2 | 2009-12-30, 17:14 | Report

    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.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to jak For This Useful Post:
    danielwilms

     
    kakoskin | # 3 | 2009-12-30, 17:21 | Report

    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 ?

    Edit | Forward | Quote | Quick Reply | Thanks

     
    jackburton | # 4 | 2009-12-30, 18:16 | Report

    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

    Edit | Forward | Quote | Quick Reply | Thanks

     
    onutz | # 5 | 2009-12-30, 19:07 | Report

    also try this: install greasemonkey plugin then maemo geolocation plugin; then you are able to use gmaps quite easy

    Edit | Forward | Quote | Quick Reply | Thanks

     
    jak | # 6 | 2009-12-30, 22:52 | Report

    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.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    kakoskin | # 7 | 2009-12-31, 14:59 | Report

    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.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    nikul.padhya | # 8 | 2010-08-03, 16:57 | Report

    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 -------

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Geekworld | # 9 | 2010-09-11, 00:12 | Report

    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?

    Edit | Forward | Quote | Quick Reply | Thanks

     
vBulletin® Version 3.8.8
Normal Logout