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.

For C++ projects include the header appropriate for the current use case, for example applications using routes may use

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

Maps and Navigation

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 Reference Full list of QML components in the Qt Location API
C++ API Reference by domain Full list of C++ classes and methods of the Qt Location APIs sorted by domain
C++ API Reference Full list of C++ classes and methods of the Qt Location APIs
Example Apps Examples demonstrating use of the Qt Location APIs
Maps and Navigation Tutorial 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 条款新 (或修订) 许可