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 Plugin : Offline map view
Forum Updated to NodeBB v4.3 + New Features

OSM Plugin : Offline map view

Scheduled Pinned Locked Moved Solved QML and Qt Quick
7 Posts 2 Posters 5.2k Views 2 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.
  • KartK Offline
    KartK Offline
    Kart
    wrote on last edited by
    #1

    I have been trying to get off line map viewing in Qt 5.9.1. I have been using OsmOffline mentioned in QtLocation: using offline map tiles with the OpenStreetMap plugin.
    Kindly help me find the right steps to follow.

    raven-worxR 1 Reply Last reply
    0
    • KartK Kart

      I have been trying to get off line map viewing in Qt 5.9.1. I have been using OsmOffline mentioned in QtLocation: using offline map tiles with the OpenStreetMap plugin.
      Kindly help me find the right steps to follow.

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by raven-worx
      #2

      @name_qt
      not a single question in your post.
      It would be very helpful to at least describe properly where you are stuck...

      Beside that, the link you referred to also contains a complete example project. Have you tried it?!

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      KartK 1 Reply Last reply
      0
      • raven-worxR raven-worx

        @name_qt
        not a single question in your post.
        It would be very helpful to at least describe properly where you are stuck...

        Beside that, the link you referred to also contains a complete example project. Have you tried it?!

        KartK Offline
        KartK Offline
        Kart
        wrote on last edited by Kart
        #3

        Hi @raven-worx,
        Of course i tried the example project and i am not able to view the maps off line.
        I am using the following osm plugin parameter.

        osm.mapping.offline.directory
        

        This is the code i am using for displaying the map

        import QtQuick 2.7
        import QtQuick.Window 2.2
        import QtLocation 5.9
        
        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/'
                    }
                }
            }
        }
        

        Can you please point out any mistakes i might be committing in the qml file ?

        raven-worxR 1 Reply Last reply
        0
        • KartK Kart

          Hi @raven-worx,
          Of course i tried the example project and i am not able to view the maps off line.
          I am using the following osm plugin parameter.

          osm.mapping.offline.directory
          

          This is the code i am using for displaying the map

          import QtQuick 2.7
          import QtQuick.Window 2.2
          import QtLocation 5.9
          
          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/'
                      }
                  }
              }
          }
          

          Can you please point out any mistakes i might be committing in the qml file ?

          raven-worxR Offline
          raven-worxR Offline
          raven-worx
          Moderators
          wrote on last edited by raven-worx
          #4

          @name_qt said in OSM Plugin : Offline map view:

          :/offline_tiles/

          and all the offline tiles are in the qrc?!
          Show your qrc file pls.

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          KartK 1 Reply Last reply
          0
          • raven-worxR raven-worx

            @name_qt said in OSM Plugin : Offline map view:

            :/offline_tiles/

            and all the offline tiles are in the qrc?!
            Show your qrc file pls.

            KartK Offline
            KartK Offline
            Kart
            wrote on last edited by Kart
            #5

            @raven-worx

            <RCC>
                <qresource prefix="/">
                    <file>main.qml</file>
            
                    <file>offline_tiles/osm_100-l-3-0-0-0.png</file>
                    <file>offline_tiles/osm_100-l-3-1-0-0.png</file>
                    <file>offline_tiles/osm_100-l-3-1-0-1.png</file>
                    <file>offline_tiles/osm_100-l-3-1-1-0.png</file>
                    <file>offline_tiles/osm_100-l-3-1-1-1.png</file>
                    <file>offline_tiles/osm_100-l-3-2-0-0.png</file>
                    <file>offline_tiles/osm_100-l-3-2-0-1.png</file>
                    <file>offline_tiles/osm_100-l-3-2-0-2.png</file>
                    <file>offline_tiles/osm_100-l-3-2-0-3.png</file>
                    <file>offline_tiles/osm_100-l-3-2-1-0.png</file>
                    <file>offline_tiles/osm_100-l-3-2-1-1.png</file>
                    <file>offline_tiles/osm_100-l-3-2-1-2.png</file>
                    <file>offline_tiles/osm_100-l-3-2-1-3.png</file>
                    <file>offline_tiles/osm_100-l-3-2-2-0.png</file>
                    <file>offline_tiles/osm_100-l-3-2-2-1.png</file>
                    <file>offline_tiles/osm_100-l-3-2-2-2.png</file>
                    <file>offline_tiles/osm_100-l-3-2-2-3.png</file>
                    <file>offline_tiles/osm_100-l-3-2-3-0.png</file>
                    <file>offline_tiles/osm_100-l-3-2-3-1.png</file>
                    <file>offline_tiles/osm_100-l-3-2-3-2.png</file>
                    <file>offline_tiles/osm_100-l-3-2-3-3.png</file>
                </qresource>
            </RCC>
            
            1 Reply Last reply
            0
            • KartK Offline
              KartK Offline
              Kart
              wrote on last edited by
              #6

              I am running this project in Ubuntu 16.04. If that makes any change.

              1 Reply Last reply
              0
              • KartK Offline
                KartK Offline
                Kart
                wrote on last edited by
                #7

                When i gave

                activeMapType: map.supportedMapTypes[2]
                

                the map started working of-line. It was a mismatch of the maptype.

                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