Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. osm.mapping.offline.directory parameter value issues
Qt 6.11 is out! See what's new in the release blog

osm.mapping.offline.directory parameter value issues

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 337 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    thegreatest
    wrote on last edited by
    #1

    I have been trying to use the offline directory parameter for the osm plugin, but am having trouble putting a file directory into the value. This blog post (https://www.qt.io/blog/2017/05/24/qtlocation-using-offline-map-tiles-openstreetmap-plugin) provides an example of using the parameter by putting tiles into a .qrc resource file. However, I want to upload lots of tiles and the program starts having memory issues at that point and crashes. So, instead of uploading the images to a .qrc file I thought it would be a better idea to put a file directory into the value, such as "file:///C:/<folder location>/". However, for some reason this method doesn't work and Qt can't load the images when I use a file directory. I am able to load an image into the program just by putting it onto the screen (just in a random spot, unrelated to the plugin), so I know Qt isn't having trouble accessing my files, but I'm wondering if it might be because I'm trying to access an entire folder?

    This is a minimal version of the code; it's pretty much what's in that blog post from 2017 with the offline_tiles folder located inside of a file called qml.qrc

    Map {
        id: map
        anchors.fill: parent
        zoomLevel: 1
        activeMapType: map.supportedMapTypes[1]
        center: QtPositioning.coordinate(0, 0)
    
        plugin: Plugin {
            name: "osm"
            parameters: [
                PluginParameter {
                    name: "osm.mapping.offline.directory"
                    value: ":/offline_tiles/"
                } ]
        }
    }
    

    }

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved