Qt Location 示例

这些示例展示了 Qt Location,例如在 QML 用户界面中显示地图、实现基本的路线规划和地点搜索,以及集成定位数据类型。

这些示例可与任何现有的地理服务插件配合使用。不过,某些插件可能需要额外的plugin parameters 才能正常运行。这些示例使用的默认插件是Qt Location 的OpenStreetMap插件,该插件无需任何参数。

GeoJson Viewer (QML)

GeoJson 查看器示例演示了如何操作 MapItems、处理用户输入以及与 GeoJson 文件之间的输入/输出操作。

Map Viewer (QML)

“地图查看器”示例展示了如何显示地图并与其交互、搜索地址以及获取驾车路线。

MapItemView Transitions (QML)

如何将过渡效果与 MapItemView 结合使用。

Minimal Map (QML)

使用Qt Quick 显示地图所需的最小代码量。

Places (QML)

“地点”示例演示了如何搜索地点并访问相关内容。

Places List (QML)

“地点列表”示例演示了如何使用 ListView 搜索并显示地点列表。

Places Map (QML)

“地点地图”示例演示了如何使用 MapItemView 在地图上搜索并显示地点列表。

Plane Spotter (QML)

“飞机观察者”示例演示了位置和定位数据类型与 QML 的紧密集成。

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.