【发布时间】:2017-05-24 15:07:06
【问题描述】:
我正在尝试从三星 Gear S3 读取我的 GPS 数据,当我在 Tizen 工作室中模拟它时,我的项目工作正常。当我在实时 Gear S3 上运行该项目时,它没有获得任何 GPS 数据。
我在模拟应用程序时收到此弹出窗口,但我没有在齿轮上弹出询问我任何权限的弹出窗口,所以我认为这与问题有关。
我做过的事情:
- Gear 的 GPS 仅在 GPS 上启用。
- 每次尝试都重建、清理、重新启动所有内容、卸载应用程序。
- 项目有三星证书
- 为 config.xml 添加了一系列功能和权限(参见下面的代码)
代码
config.xml 如上所述,包括一堆可能不必要的功能和权限。
<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns:tizen="http://tizen.org/ns/widgets" xmlns="http://www.w3.org/ns/widgets" id="http://yourdomain/OSMLEAF" version="1.0.0" viewmodes="maximized">
<access origin="*" subdomains="true"></access>
<tizen:application id="5lI7dRUWxx.OSMLEAF" package="5lI7dRUWxx" required_version="2.3.1"/>
<content src="index.html"/>
<feature name="http://tizen.org/feature/screen.size.all"/>
<feature name="http://tizen.org/feature/location.gps"/>
<feature name="http://tizen.org/feature/location.gps.satellite"/>
<feature name="http://tizen.org/feature/location"/>
<feature name="http://tizen.org/feature/location.geofence"/>
<feature name="http://tizen.org/feature/location.batch"/>
<icon src="icon.png"/>
<name>OSMLEAF</name>
<tizen:privilege name="http://tizen.org/privilege/notification"/>
<tizen:privilege name="http://tizen.org/privilege/setting"/>
<tizen:privilege name="http://tizen.org/privilege/system"/>
<tizen:privilege name="http://tizen.org/privilege/package.info"/>
<tizen:privilege name="http://tizen.org/privilege/location"/>
<tizen:privilege name="http://tizen.org/privilege/internet"/>
<tizen:privilege name="http://tizen.org/privilege/application.launch"/>
<tizen:privilege name="http://tizen.org/privilege/filesystem.read"/>
<tizen:privilege name="http://tizen.org/privilege/filesystem.write"/>
<tizen:privilege name="http://tizen.org/privilege/download"/>
<tizen:profile name="wearable"/>
<tizen:setting background-support="enable" encryption="disable" hwkey-event="enable"/>
</widget>
编辑:我正在尝试处理坐标的 javascript:
var options = {enableHighAccuracy: true,timeout: 0};
function successCallback(position)
{
console.log("succes");
currentGpsPosLat = position.coords.latitude;
currentGpsPosLong = position.coords.longitude;
marker.setLatLng([currentGpsPosLat,currentGpsPosLong]);
console.log("going to"+ currentGpsPosLong + " -- " +currentGpsPosLat);
}
var marker = L.marker([0.0, 0.0],{icon:carIcon}).addTo(map);
function errorCallback(error)
{
console.log("error");
console.log(error);
}
navigator.geolocation.watchPosition(successCallback, errorCallback, options);
window.setInterval(function(){
marker.setLatLng([currentGpsPosLat,currentGpsPosLong]);
map.flyTo([currentGpsPosLat,currentGpsPosLong], 17);
}, 10000);
在互联网上找不到有关此问题的任何信息,因此非常感谢任何帮助我指出正确方向的帮助!
【问题讨论】:
-
你想做什么?给出一些示例代码
-
嗨,Iqbal,我已经从我正在尝试做的事情中添加了 javascript。我正在尝试创建一个图标并不断将图标移动到 GPS 位置。如果您需要更多信息,请告诉我,感谢您与我一起思考!
-
它是 Tizen API 吗?我认为这是第三方 api。这不是 Tizen 的一部分,可能是 var marker = L.marker([0.0, 0.0],{icon:carIcon}).addTo(map);
标签: javascript config tizen tizen-wearable-sdk tizen-web-app