Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qml load Offline Map (mapbox, osm and etc)

Qml load Offline Map (mapbox, osm and etc)

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 4 Posters 4.5k Views
  • 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.
  • N Offline
    N Offline
    nsourl
    wrote on 18 May 2021, 07:14 last edited by
    #1

    Hi,

    I am working on a project where it's necessary to use a Map. But the internet connection will not be always sufficient and stable enough to render the map in live mode.

    So, we need to load the map offline and I was looking a way how to do that in Qml. But unfortunately it's not clear to me what are the steps that I have to follow to load the Map offline in Qml and if it's supported from available Qt Location Plugins (mapbox, mapboxgl, osm, esri and etc).

    Also, does anyone know if it's possible to load offline in Qml a custom or paid map?

    Thanks.

    1 Reply Last reply
    0
    • J Offline
      J Offline
      jeremy_k
      wrote on 18 May 2021, 07:33 last edited by
      #2

      For OSM: https://www.qt.io/blog/2017/05/24/qtlocation-using-offline-map-tiles-openstreetmap-plugin

      If the goal is an offline mode that ignores network accessibility, it's a little more complicated. https://bugreports.qt.io/browse/QTBUG-77207

      Asking a question about code? http://eel.is/iso-c++/testcase/

      N 1 Reply Last reply 18 May 2021, 08:54
      3
      • J jeremy_k
        18 May 2021, 07:33

        For OSM: https://www.qt.io/blog/2017/05/24/qtlocation-using-offline-map-tiles-openstreetmap-plugin

        If the goal is an offline mode that ignores network accessibility, it's a little more complicated. https://bugreports.qt.io/browse/QTBUG-77207

        N Offline
        N Offline
        nsourl
        wrote on 18 May 2021, 08:54 last edited by
        #3

        @jeremy_k thank you for sharing all these useful information.

        Do you know is there any way to do the same with mapboxgl plugin instead of osm ?

        Thanks.

        J 1 Reply Last reply 18 May 2021, 18:14
        0
        • N nsourl
          18 May 2021, 08:54

          @jeremy_k thank you for sharing all these useful information.

          Do you know is there any way to do the same with mapboxgl plugin instead of osm ?

          Thanks.

          J Offline
          J Offline
          jeremy_k
          wrote on 18 May 2021, 18:14 last edited by
          #4

          I don't know if any of the other plugins offer this functionality.

          Asking a question about code? http://eel.is/iso-c++/testcase/

          1 Reply Last reply
          0
          • N Offline
            N Offline
            nsourl
            wrote on 28 May 2021, 10:15 last edited by
            #5

            @jeremy_k

            Finally, I was able to load offline map using the osm plugin and following the guidelines from blog post.

            You can make it with Mapbox plugin too by using commercial Mapbox Atlas product to self-host a Docker container and feed your Qt application with offline map data. But the Atlas price is quite high for projects that are not recommended for enterprise and large scale applications.

            Thank you for your help!

            D 1 Reply Last reply 2 Jun 2023, 06:35
            0
            • N nsourl
              28 May 2021, 10:15

              @jeremy_k

              Finally, I was able to load offline map using the osm plugin and following the guidelines from blog post.

              You can make it with Mapbox plugin too by using commercial Mapbox Atlas product to self-host a Docker container and feed your Qt application with offline map data. But the Atlas price is quite high for projects that are not recommended for enterprise and large scale applications.

              Thank you for your help!

              D Offline
              D Offline
              dearqt
              wrote on 2 Jun 2023, 06:35 last edited by dearqt 6 Feb 2023, 06:36
              #6

              @nsourl How did you load offline map with using osm plugin. I have offline tiles and I am using osm plugin but when there is no network connection it does not display the map. Here is my qml:
              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 {
                      name: 'osm';
                      PluginParameter {
                          name: 'osm.mapping.offline.directory'
                          value: ':/offline_tiles/'
                      }
                  }
              }
              

              }

              Exactly the same with https://www.qt.io/blog/2017/05/24/qtlocation-using-offline-map-tiles-openstreetmap-plugin this article bur it does not work when there is no internet.

              1 Reply Last reply
              0
              • H Offline
                H Offline
                HemaSaraswathi
                wrote on 20 May 2024, 09:40 last edited by
                #7

                osm_100-<l|h>-<map_id>-<z>-<x>-<y>.<extension>
                While naming your tiles make sure the map id value is same as the active map type.
                Here you have given 1 as active map type so make sure map_id is 1.

                1 Reply Last reply
                0
                • S SGaist referenced this topic on 19 Feb 2025, 20:58

                • Login

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