The Qt Location API helps you create viable mapping solutions using the data available from some of the popular location services.
Qt Location API 能夠:
To load the Qt Location module, add the following statement to your .qml files
import QtPositioning 5.12 import QtLocation 5.12
The QtLocation QML module depends on the QtPositioning QML module. Therefore every QML application that imports the QtLocation QML module must always import the QtPositioning module as well.
對於 include 當前使用情況適當 header 的 C++ 工程,例如,使用路由的應用程序可以使用
#include <QGeoRoute>
.pro 文件應有 location 添加關鍵詞
QT += location
The API is split into sub-modules, which provide QML and C++ interfaces for specific purposes. They focus mainly on Map and Place information. The required position data can be retrieved using the QtPositioning 模塊。
The Places submodule is the natural complement to Positioning, providing a source of geographical data about Places of Interest (POI). Besides the source information, the API provides information about the location, size, and other related information about a POI. The Places API can also retrieve images, reviews, and other content related to a place.
| Places introduction: | for QML | for C++ |
The module provides the QML and C++ alternatives for maps and navigation. The C++ alternative provides utility classes to get geocoding (finding a geographic coordinate from a street address) and navigation (including driving and walking directions) information, whereas its QML counterpart provides UI components to render the information.
| Maps and Navigation introduction: | for QML | for C++ |
The following are lists of the classes and UI components provided by the module, with example applications to demonstrate their usage:
| QML API 參考 | Full list of QML components in the Qt Location API |
| C++ API 參考按領域 | Full list of C++ classes and methods of the Qt Location APIs sorted by domain |
| C++ API 參考 | Full list of C++ classes and methods of the Qt Location APIs |
| 範例 App | Examples demonstrating use of the Qt Location APIs |
| 地圖和導航教程 | Tutorial introducing the QML Maps Types |
Information about plugins, important notes on their usage, parameters that can be provided to influence their behavior.
| Qt Location Esri Plugin | Uses Esri for location services. |
| Qt Location HERE Plugin | Uses the relevant services provided by HERE. |
| Qt Location Items Overlay Plugin | Provides an empty map intended to be used as background for an overlay layers for map items. |
| Qt Location Mapbox GL 插件 | Uses Mapbox GL for location services. |
| Qt Location Mapbox Plugin | Uses Mapbox for location services. |
| Qt Location 開放式街道地圖插件 | Uses Open Street Map and related services. |
For systems integrators and distributors, information related to making Qt Location available for a new platform.
| GeoServices | Information about the Qt Location GeoServices plugins |
| Places | Information for places backend implementors |
| API 變化 | Information about QML API changes since 5.4 |
Qt Location 在商業許可下是可用的來自 Qt 公司 。此外,它是可用的根據 GNU LGPL (次一般公共許可) 第 3 版 ,或 GNU GPL (一般公共許可) 第 2 版 。見 Qt 許可 進一步瞭解細節。
此外,Qt Location 潛在包含的第 3 方模塊遵循下列準許許可:
| Boost | Boost 軟件許可 1.0 |
| CSS 顔色剖析器 | MIT 許可 |
| Clip2Tri Polygon Triangulation Library | MIT 許可 |
| Clipper Polygon Clipping Library, version 6.4.0 | Boost 軟件許可 1.0 |
| Earcut | ISC 許可 |
| Earcut 多邊形三角測量庫 | ISC 許可 |
| Mapbox GL Native | BSD 2 條款簡化許可 |
| Poly2Tri Polygon Triangulation Library | BSD 3 條款新 (或修訂) 許可 |
| RapidJSON | MIT 許可 |
| Vector Tile Library | ISC 許可 |
| Wagyu Geometry Processing Library | MIT 許可 |
| cURL 剖析日期 | MIT 許可 |
| geojson-cpp | ISC 許可 |
| geojson-vt-cpp | ISC 許可 |
| geometry.hpp | ISC 許可 |
| kdbush.hpp | ISC 許可 |
| libc++ | MIT and UIUC (BSD-like) |
| nunicode | MIT 許可 |
| polylabel | ISC 許可 |
| protozero | BSD 2 條款簡化許可 |
| shelf-pack-cpp | ISC 許可 |
| supercluster.hpp | ISC 許可 |
| tao_tuple | MIT 許可 |
| unique_resource | Boost 軟件許可 1.0 |
| variant | BSD 3 條款新 (或修訂) 許可 |