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 Offline map in user accessible directory
Forum Updated to NodeBB v4.3 + New Features

OSM Offline map in user accessible directory

Scheduled Pinned Locked Moved Solved QML and Qt Quick
4 Posts 3 Posters 4.0k 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.
  • M Offline
    M Offline
    Markus Ippy
    wrote on last edited by
    #1

    Hello

    I am trying to implement offline maps in my application. I tried the example below and it works perfectly.
    http://blog.qt.io/blog/2017/05/24/qtlocation-using-offline-map-tiles-openstreetmap-plugin/

    However i would like to store the map tiles in a user accessible folder. Ideally a relative Path in the same directory as the executable.
    I tried to modify the Plugin Parameter to a absolute path on windows for testing :
    value: 'c:/offline_tiles/' but that does not seem to work .Could i please get some advice on how to do that ?

    Thank you in advance

        plugin: Plugin {
            name: 'osm';
            PluginParameter {
                name: 'osm.mapping.offline.directory'
                value: 'c:/offline_tiles/'
            }
        }
    
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      You should also add which version of Qt you are using as well as the Windows version and compiler.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      M 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        You should also add which version of Qt you are using as well as the Windows version and compiler.

        M Offline
        M Offline
        Markus Ippy
        wrote on last edited by
        #3

        @SGaist Sorry , using QT5.9.1 pn windows 10 with mingw
        but planning to run it on raspberry pi later.

        I just found the issue now , Map types had to be changed from 1 to 2
        activeMapType: map.supportedMapTypes[2] and changed the value to the relative path of my Executables directory
        value: 'file:///offline_tiles/'
        my code looks now like this and it works now when i switch my internet connection off :

        import QtQuick 2.8
        import QtLocation 5.8
        import QtPositioning 5.8

        Item {
        id: mapItem
        anchors.fill: parent
        Rectangle{
        anchors.fill: parent
        Map {
        id: map
        anchors.fill: parent
        activeMapType: map.supportedMapTypes[2]
        zoomLevel: 1
        plugin: Plugin {
        name: 'osm';
        PluginParameter {
        name: 'osm.mapping.offline.directory'
        value: 'file:///offline_tiles/'
        }
        }
        }
        }
        }

        H 1 Reply Last reply
        1
        • M Markus Ippy

          @SGaist Sorry , using QT5.9.1 pn windows 10 with mingw
          but planning to run it on raspberry pi later.

          I just found the issue now , Map types had to be changed from 1 to 2
          activeMapType: map.supportedMapTypes[2] and changed the value to the relative path of my Executables directory
          value: 'file:///offline_tiles/'
          my code looks now like this and it works now when i switch my internet connection off :

          import QtQuick 2.8
          import QtLocation 5.8
          import QtPositioning 5.8

          Item {
          id: mapItem
          anchors.fill: parent
          Rectangle{
          anchors.fill: parent
          Map {
          id: map
          anchors.fill: parent
          activeMapType: map.supportedMapTypes[2]
          zoomLevel: 1
          plugin: Plugin {
          name: 'osm';
          PluginParameter {
          name: 'osm.mapping.offline.directory'
          value: 'file:///offline_tiles/'
          }
          }
          }
          }
          }

          H Offline
          H Offline
          HalilKarabacak
          wrote on last edited by
          #4
          This post is deleted!
          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