我有500mb的离线数据,我想和OSM QtLocation插件一起使用。我使用了这个博客https://www.qt.io/blog/2017/05/24/qtlocation-using-offline-map-tiles-openstreetmap-plugin中的示例源代码。示例应用程序中的数据嵌入在资源文件中,我希望将其放在磁盘上的单独文件夹中。首先,我想让示例应用程序与位于磁盘上的文件夹中的示例数据一起工作,而不是在资源文件中编译。当执行应用程序时,它仍然从在线服务器下载数据。我在网上读了很多文章,但没有一个解决方案是有效的。我使用的是带有MSVC编译器的Qt 5.15.2,Windows 10。
这就是我的代码的样子。
import QtQuick 2.7
import QtQuick.Window 2.2
import QtLocation 5.8
Window {
id: win
objectName: "window"
visible: true
width: 512
height: 512
Map {
id: map
anchors.fill: parent
activeMapType: map.supportedMapTypes[1]
zoomLevel: 1
plugin: Plugin {
id: osmPLugin
name: 'osm';
PluginParameter { name: 'osm.mapping.offline.directory'; value: 'file:///c:/offline_tiles/' }
}
}
}发布于 2021-08-06 05:40:43
您必须使用路径,而不是uri:
PluginParameter { name: 'osm.mapping.offline.directory'; value: 'c:/offline_tiles/' }https://stackoverflow.com/questions/68676513
复制相似问题