Reputation: 58
We want to implement offline map in our qt project using SD card or local storage. I have downloaded both .osm and .osm.pbf files. Now we need method/process to load a offline map in qt using .osm or .osm.pbf.
Is there a way to display offline maps in QtLocation without generating tiles? Like reading directly from a osm file. If it is not possible in QtLocation, is there any other modules available that I can use in QML?
Upvotes: 1
Views: 2058
Reputation: 48
You can use the following code to load offline tiles. This property works from QtLocation 5.8 onward.
Map {
activeMapType: map.supportedMapTypes[1]
zoomLevel: 5
plugin: Plugin {
name: 'osm';
PluginParameter {
name: 'osm.mapping.offline.directory'
value: '/path/to/map/tiles'
}
}
}
You can also take a look at QtLocation Offline
Upvotes: 2