Qt Location

The Qt Location API helps you create viable mapping solutions using the data available from some of the popular location services.

概述

Qt Location API 能夠:

  • Access and present map data.
  • Support touch gesture on a specific area of the map.
  • Query for a specific geographical location and route.
  • Add additional layers on top, such as polylines and circles.
  • Search for places and related images.

快速入門

To load the Qt Location module, add the following statement to your .qml files

import QtPositioning 5.15
import QtLocation 5.15
					

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 模塊。

Places

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++

API 參考和範例

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, version 1.65.1

Boost 軟件許可 1.0

CSS 顔色剖析器

MIT 許可

Clip2Tri Polygon Triangulation Library

MIT 許可

Clipper Polygon Clipping Library, version 6.4.0

Boost 軟件許可 1.0

Earcut 多邊形三角測量庫

ISC 許可

Earcut, version 0.12.4

ISC 許可

Mapbox GL Native

BSD 2-clause "Simplified" License and zlib License

可選

Boost 軟件許可 1.0

Poly2Tri Polygon Triangulation Library

BSD 3 條款新 (或修訂) 許可

RapidJSON, version 1.1.0

MIT 許可

Vector Tile Library, version 1.0.2

ISC 許可

Wagyu Geometry Processing Library, version 0.4.3

MIT 許可

cURL 剖析日期

MIT 許可

geojson-cpp, version 0.4.2

ISC 許可

geojson-vt-cpp, version 6.5.1

ISC 許可

geometry.hpp, version 0.9.3

ISC 許可

geosimplify-js polyline simplification library

geosimplify-js License

kdbush.hpp, version 0.1.1-1

ISC 許可

nunicode, version 1.8

MIT 許可

polylabel, version 1.0.3

ISC 許可

protozero, version 1.5.2

BSD 2 條款簡化許可

shelf-pack-cpp, version 2.1.1

ISC 許可

supercluster.hpp, version 0.2.2

ISC 許可

tao_tuple, version 28626e99

MIT 許可

unique_resource, version cba309e

Boost 軟件許可 1.0

variant, version 1.1.4

BSD 3 條款新 (或修訂) 許可