Languages

Menu
Sites
Language
Use geolocation

Hi

I want to locate my lon and lat  on tizen

So I find out “navigator.geolocation.getCurrentPosition();”

and on emulator I get "error 2" means "Location information is unavailable."?

So It means that emulator can't get lon and lat?and the interface should be used

on device?

And Is there tizen self getlocation interface?

 

Edited by: Brock Boland on 17 Mar, 2014 Reason: Paragraph tags added automatically from tizen_format_fix module.

Responses

14 Replies
Lakshmi Grandhi
using event injector , u can inject location lat and long into emulator.
kalyani M
hi lakshmi, can i ask one question? if i have one sample app( annex) it's not running in emulator can you please tell me steps how to run web app in emulator thanks
Lakshmi Grandhi
what errors are you getting??
Varsamis
Hi Lakshmi, I want to ask you something on the same matter: Although I can get longitude and latitude (following the geolocation article: https://developer.tizen.org/documentation/using-location-based-services-tizen), it seems that no other [coords] attribute returns a not-null value (i.e. altitude, accuracy, altitudeAccuracy). Also, deCarta attributes fall in the same category (results: undefined). On the same note: the wep app given in the article (AreWeThereYet) is not working properly in 2.1. I can see some results in console but the screen is and remains all-white so no functionality there. Is there something you'd suggest?
Lakshmi Grandhi
Hi Varaamis, Did you add privileges in config file and checked. I will work on the AreWeThereYet app on SDK 2.1 and will get back
Varsamis
The app doesn't have any privileges in config and I didn't add any. Should I? Anyhow, I'm waiting for your comments on 2.1 testing.
Lakshmi Grandhi
Hi Varamsis, I tested app on device, i am getiing lat and longs, but not able to test other features since my WIFI is not connecting.
Varsamis
I see. Are you gonna test it properly soon or is it a permanent problem?
Raghu Kona
Hi, I was able to run the application after modifying the js/lib/tizen/tizen.network.js. After a quick test, I can see that most of the functionality is as described in the article. Can you please replace the below lines if (typeof tizen !== "undefined" && tizen.systeminfo && tizen.systeminfo.isSupported('WifiNetwork')) { tizen.systeminfo.getPropertyValue('WifiNetwork', function(wifi) { with these var deviceCapabilities = tizen.systeminfo.getCapabilities(); if (typeof tizen !== "undefined" && tizen.systeminfo && deviceCapabilities.wifi) { tizen.systeminfo.getPropertyValue('WIFI_NETWORK', function(wifi) { Can you quickly if this helps you in fixing the issue. Regards, Raghu Kona
Raghu Kona
Also as this application is not based on 2.1, you might need to modify the config.xml as <?xml version="1.0" encoding="UTF-8"?> <widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets" id="http://yourdomain/AreWeThereYet" version="0.1.0" viewmodes="fullscreen"> <access origin="http://decarta.com" subdomains="true" /> <access origin="http://decartahws.com" subdomains="true" /> <tizen:application id="smart8alar.AreWeThereYet" package="smart8alar" required_version="2.1" /> <author email="t.wlodarkiew@samsung.com, t.scislo@samsung.com">Tadeusz Wlodarkiewicz, Tomasz Scislo</author> <content src="index.html" /> <tizen:privilege name="http://tizen.org/api/tizen" /> <tizen:privilege name="http://tizen.org/api/notification" /> <tizen:privilege name="http://tizen.org/api/systeminfo" /> <icon src="icon.png" /> <name>AreWeThereYet</name> <tizen:privilege name="http://tizen.org/privilege/notification" /> <tizen:setting screen-orientation="portrait" /> </widget>
Varsamis
Hi Raghu, Thanks for that, it really solved the main functionality issue. Though, the issue I was referring to (altitude attributes - see above) remains. Also, I noticed something for the first time: the values that I'm getting for longitude and latitude correspond to a South Korean spot (I'm in Europe). I verified that checking in another Tizen device. Can you check that too? Lastly, I tried to point to a central place of Seoul just to see the functionality of deCarta API (results as street, streetNameAndNumber, speedLimit). The only ones available are countryCode (KR for this case) and type (here, "structured"). Any thoughts on that?
Raghu Kona
Yeah, it is strange, even for me it is showing Seoul, I am in US. But, Find and Pick destination working fine. There should be some issue with the GPS. Regards, Raghu Kona
mohamed mohdhi

bonjour a tous :) svp je cherche comment intégrer le code javascript qui récupére lattitude et longitude de ma position courant.vous pouver m'aider??? ( code de géolocalisation que j'avais l'intégrer ) :

if (navigator.geolocation)

{

  navigator.geolocation.getCurrentPosition(function(position)
  {
    document.write("Latitude : " + position.coords.latitude + ", longitude : " + position.coords.longitude+"<br>"); 
  });
}
else
  document.write("Votre navigateur ne prend pas en compte la géolocalisation HTML5");

ce code il est exécutable mais il m'affiche des valeurs fausse. et merci d'avance a tous :)

talari praveen kumar

Hi Mohamed,

It is always showing lat and lng of Seoul . This is a known issue, hope it will be fixed in next release.