GPS - Lat and Long

How do I get the location (lat and long) on webapp?

Ps.: navigator.geolocation throws error… and I didnt find any doc about the GPS itself…

Thank you for your time!

Actually, it not works for me too. I have tried to ask permission too. below is the code for ask location permissions. it enabled but still gives me a location unavailable error.

You need to add the below privilege to the config file using the privileges tab first.

Then handle your permission ask flow as below.

// use to ask permission for the location
function findLocation(askPermission) {
	var permisson_status = tizen.ppm.checkPermission("");
	if (askPermission && permisson_status === 'PPM_ASK') {
		tizen.ppm.requestPermission("", function(e) {
			if (e === 'PPM_DENY_ONCE') {
			} else if (e === 'PPM_ALLOW_FOREVER') {
				return callGeoLocationService();
	} else if (permisson_status === 'PPM_ALLOW') {

// call geolocation service
function callGeoLocationService() {
	if (navigator.geolocation) {
        		locationSuccessCallback, locationErrorCallback,{enableHighAccuracy: true,maximumAge: 0,timeout: 10000}
    } else {
        console.log('Geolocation is not supported.');

// when process success
function locationSuccessCallback(position) {

// when process error
function locationErrorCallback(error) {
    switch (error.code) {
        case error.PERMISSION_DENIED:
            console.log('User denied the request for Geolocation.');
        case error.POSITION_UNAVAILABLE:
        		console.log('Location information is unavailable.');
        case error.TIMEOUT:
        		console.log('The request to get user location timed out.');
        case error.UNKNOWN_ERROR:
        		console.log('An unknown error occurred.');

but unfortunately, my issue was not resolved to enable permissions too. and then I tried to manually enable location permissions from watch settings. not success. hope you will find an answer!

1 Like

Hello, I already solved this problem using the tizen “healthinfo” API.

Thank you!

1 Like

can you please provide a link of it?

1 Like

Thank you very much for the support!

1 Like

check this Tizen location infromation unavailable - #2 by andrzej_bugajny

1 Like

You can use Tizen Human Activity Monitor (HAM) API or W3C Geolocation API

For both cases, please make sure location privilege is added on config.xml.

1 Like