在桌面平台上定位API支持

编程入门 行业动态 更新时间:2024-10-26 18:27:47
本文介绍了在桌面平台上定位API支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我试图使用HTML5 geoposition API来构建一个webkit应用程序来获取当前坐标。我也开启了地理位置功能,但未能以错误开始

启动Geolocation服务失败

然后我尝试使用 QGetPositionInfoSource ,但找不到任何可用的源。我想知道,桌面应用程序支持定位API吗? 这是一个很大的 no-no 。

直接从文档中获取:

Qt Positioning API提供定位信息QML和C ++接口。目前,在 Android , BlackBerry 10 , iOS 和 Linux (使用 GeoClue <

这同样适用于Qt 5.4,可以在相应的快照文档页面中看到。

$ b UPDATE

支持整个 BlackBerry 平台已经被删除。另一方面,桌面平台上对定位API的支持将在下一个Qt 5.6发布版本中提供。目前的文档快照很清楚:

Qt定位API通过QML和C ++接口提供定位信息。

目前API在 Android , iOS , OS X , Linux (使用 GeoClue 版本0.12.99), Windows (将 GPS接收器暴露为提供NMEA句子的串行端口)和 WinRT (使用 Windows。 Devices.Geolocation )。

因此,请下载开发快照并尝试使用这个新的桌面功能。

I've tried to build a webkit app using HTML5 geoposition APIs to get the current coordinates. I've also turned on the geolocation feature but it fails to start with error

Failed to start Geolocation service

Then I've tried to use QGetPositionInfoSource, but it can't find any available source to use. I wonder, is Positioning API supported on desktop applications?

解决方案

That's a big no-no.

Directly from the documentation:

The Qt Positioning API provides positioning information via QML and C++ interfaces. Currently the API is supported on Android, BlackBerry 10, iOS and Linux (using GeoClue).

The same applies for Qt 5.4 as can be seen in the corresponding snapshot documentation page here.

UPDATE

Support for the whole BlackBerry platform has been dropped. On the other hand, support for Positioning API on desktop platforms will be available with the next release of the framework, Qt 5.6. The current documentation snapshot is pretty clear about that:

The Qt Positioning API provides positioning information via QML and C++ interfaces.

Currently the API is supported on Android, iOS, OS X, Linux (using GeoClue version 0.12.99), Windows (with GPS receivers exposed as a serial port providing NMEA sentences), and WinRT (using Windows.Devices.Geolocation).

Thus, download a development snapshot and try out this new desktop feature.

更多推荐

在桌面平台上定位API支持

本文发布于:2023-07-03 21:56:21,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:桌面   平台上   API

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!