![]() |
N900 & access Location API from Javascript ?
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. |
Re: N900 & access Location API from Javascript ?
Quote:
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. |
Re: N900 & access Location API from Javascript ?
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 ? |
Re: N900 & access Location API from Javascript ?
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 |
Re: N900 & access Location API from Javascript ?
also try this: install greasemonkey plugin then maemo geolocation plugin; then you are able to use gmaps quite easy
|
Re: N900 & access Location API from Javascript ?
Quote:
|
Re: N900 & access Location API from Javascript ?
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. |
Re: N900 & access Location API from Javascript ?
Quote:
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 ------- |
Re: N900 & access Location API from Javascript ?
Quote:
|
All times are GMT. The time now is 02:37. |
vBulletin® Version 3.8.8