地图与导航(C++)
地图与导航提供用于地理编码(从街道地址查找地理坐标)和导航(包括驾驶和步行方向)的 C++ 实用程序。
目前还无法通过 C++ 与地图进行交互。制图应用程序必须使用地图和导航 (QML)API。
地理编码
在 C++ 中,地址到坐标的查询是使用QGeoCodingManager 类的geocode() 方法进行的。对于坐标到地址的查询,可使用同一类中的reverseGeocode() 方法。QGeoCodingManager 的实例可通过QGeoServiceProvider 获取。
关键类
QGeoServiceProvider | 提供可供使用的QGeoCodingManager 实例。 |
QGeoCodingManager | 接受查询并生成QGeoCodeReply 对象。 |
QGeoCodeReply | 包含地理编码查询结果。 |
导航
在 C++ 中,路由查询使用QGeoRoutingManager 类的calculate() 方法执行。返回的路由回复可以包含通往同一目的地的多条路由。
关键类
QGeoServiceProvider | 提供可供使用的QGeoCodingManager 实例。 |
QGeoRoutingManager | 接受查询并生成QGeoRouteReply 对象。 |
QGeoRouteReply | 包含路由查询结果。 |
QGeoRoute | 包含路由信息。 |
© 2025 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.