Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QML Maps
QtWS25 Last Chance

QML Maps

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
11 Posts 8 Posters 6.9k 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.
  • NickVN Offline
    NickVN Offline
    NickV
    wrote on last edited by
    #1

    Hello!
    I used to work with osm map plugin but since 11 july 2016 direct tile access has been discontinued. Now i want to be able to use osm map plugin or another plugin that it is compatible with android and iOS. Is there any solution about my problem?

    raven-worxR 1 Reply Last reply
    1
    • NickVN NickV

      Hello!
      I used to work with osm map plugin but since 11 july 2016 direct tile access has been discontinued. Now i want to be able to use osm map plugin or another plugin that it is compatible with android and iOS. Is there any solution about my problem?

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

      @NickV
      QTBUG-54599

      --- 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

      1 Reply Last reply
      0
      • NickVN Offline
        NickVN Offline
        NickV
        wrote on last edited by
        #3

        So the answer is that there is no plugin in order to have maps in my app? Can you please give me an example of using thunder forest plugin?

        Thanks in advance!

        raven-worxR 1 Reply Last reply
        1
        • NickVN NickV

          So the answer is that there is no plugin in order to have maps in my app? Can you please give me an example of using thunder forest plugin?

          Thanks in advance!

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

          @NickV
          Officially Qt comes beside OSM with HERE (formerly Nokia) and Mapbox plugins

          Otherwise there are some 3rd party map plugins available on the web (e.g. for Google maps)
          You would need to compile and link them against your Qt version yourself.

          --- 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

          1 Reply Last reply
          0
          • dead_manD Offline
            dead_manD Offline
            dead_man
            wrote on last edited by
            #5

            I wrote my own map component. It was hard, but it works. OSM, Google Maps and more are supported

            1 Reply Last reply
            0
            • rmarzocchi84R Offline
              rmarzocchi84R Offline
              rmarzocchi84
              wrote on last edited by
              #6

              Sorry, but in the instruction of open street map plugin I read that I can use a different host and specify my preferred tile server (e.g. mapnik??)

              I tried the following solution, but it doesn't work. I do not understand why? It seems that the app continue to use mapquest tiles...

              Plugin {
              id: myosmplugin
              //preferred: ["osm", "nokia", "foo"]
              name: "osm"
              //required: Plugin.AnyMappingFeatures | Plugin.AnyGeocodingFeatures
              PluginParameter{name: "osm.mapping.host"; value: "http://tile.openstreetmap.org"}
              //PluginParameter { name: "osm.mapping.host"; value: "http://c.tile.thunderforest.com/outdoors/" }
              }

              user901735110U 1 Reply Last reply
              0
              • rmarzocchi84R rmarzocchi84

                Sorry, but in the instruction of open street map plugin I read that I can use a different host and specify my preferred tile server (e.g. mapnik??)

                I tried the following solution, but it doesn't work. I do not understand why? It seems that the app continue to use mapquest tiles...

                Plugin {
                id: myosmplugin
                //preferred: ["osm", "nokia", "foo"]
                name: "osm"
                //required: Plugin.AnyMappingFeatures | Plugin.AnyGeocodingFeatures
                PluginParameter{name: "osm.mapping.host"; value: "http://tile.openstreetmap.org"}
                //PluginParameter { name: "osm.mapping.host"; value: "http://c.tile.thunderforest.com/outdoors/" }
                }

                user901735110U Offline
                user901735110U Offline
                user901735110
                wrote on last edited by user901735110
                #7

                @rmarzocchi84

                I was just dealing with this issue and am answering this as the community forums have been quite helpful with my project. If you found the documentation that I read, at http://doc.qt.io/qt-5/location-plugin-osm.html, then it is wrong as of this writing.

                It states that "This parameter should be set to a valid server url with the correct osm api and the Map::activeMapType to the corresponding MapType.CustomMap". The Map::activeMapType is a MapType not an integer type, so setting this enumeration did not work resulting in error

                Unable to assign int to QDeclarativeGeoMapType*
                

                Digging through the 5.7 source produces (in qtlocation/src/plugins/geoservices/osm/qgeotiledmappingmanagerengineosm.cpp):

                    if (parameters.contains(QStringLiteral("osm.mapping.custom.host"))
                            || parameters.contains(QStringLiteral("osm.mapping.host"))) {
                
                ...
                
                        m_providers.push_back(
                            new QGeoTileProviderOsm("",
                                nm,
                                QGeoMapType(QGeoMapType::CustomMap, tr("Custom URL Map"), tr("Custom url map view set via urlprefix parameter"), false, false, 8),
                                QGeoTileProviderOsm::TileProvider(tmsServer + QStringLiteral("%z/%x/%y.png"),
                                    QStringLiteral("png"),
                                    mapCopyright,
                                    dataCopyright
                                )));
                ...
                }
                

                There is a Map::supportedMapTypes available of type list<MapType>. On my desktop system, JSON.stringify( supportedMapTypes ) using a Map with an "osm" plugin produces:

                {"0":{"objectName":"","style":1,"name":"Street Map","description":"Street map view in daylight mode","mobile":false,"night":false},"1":{"objectName":"","style":2,"name":"Satellite Map","description":"Satellite map view in daylight mode","mobile":false,"night":false},"2":{"objectName":"","style":10,"name":"Cycle Map","description":"Cycle map view in daylight mode","mobile":false,"night":false},"3":{"objectName":"","style":6,"name":"Transit Map","description":"Public transit map view in daylight mode","mobile":false,"night":false},"4":{"objectName":"","style":6,"name":"Night Transit Map","description":"Public transit map view in night mode","mobile":false,"night":true},"5":{"objectName":"","style":4,"name":"Terrain Map","description":"Terrain map view","mobile":false,"night":false},"6":{"objectName":"","style":8,"name":"Hiking Map","description":"Hiking map view","mobile":false,"night":false},"7":{"objectName":"","style":100,"name":"Custom URL Map","description":"Custom url map view set via urlprefix parameter","mobile":false,"night":false}}
                

                Note item "7":{"objectName":"","style":100,"name":"Custom URL Map","description":"Custom url map view set via urlprefix parameter","mobile":false,"night":false} is the "Custom URL Map" from the C++ source.

                So, finally, the following code snippet from a simple test app worked (Qt 5.7):

                import QtQuick 2.5
                import QtQuick.Window 2.2
                import QtLocation 5.3
                
                Window {
                    visible: true
                    width: 640
                    height: 480
                
                    Plugin {
                        id: myPlugin
                        name: "osm"
                        PluginParameter { name: "osm.mapping.host";
                            value: "http://myobfuscatedhost.tld/osm/" }
                        PluginParameter { name: "osm.mapping.copyright";
                            value: "The documentation is wrong." }
                    }
                
                    Map {
                        anchors.fill: parent
                        plugin: myPlugin
                
                        Component.onCompleted: {
                            for( var i_type in supportedMapTypes ) {
                                if( supportedMapTypes[i_type].name.localeCompare( "Custom URL Map" ) === 0 ) {
                                    activeMapType = supportedMapTypes[i_type]
                                }
                            }
                        }
                    }
                }
                

                The images displayed by the resulting map have been confirmed to be from the switch2osm test server I setup.

                Good luck.

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @user901735110 Hi and welcome to devnet,

                  You should open a bug report about this on the bug report sysetm mentioning your findings. You could even fix the documentation itself by submitting a patch for integration.

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

                  1 Reply Last reply
                  0
                  • L Offline
                    L Offline
                    ldanzinger
                    wrote on last edited by
                    #9

                    Esri plans on releasing a geolocation provider for Qt Location, and will be discussing it at QtCon this year. I think everyone will be interested to see the basemaps offered, and to take advantage of routing and geocoding as well. If anyone is in Berlin for the conference, I encourage you to attend this session.

                    1 Reply Last reply
                    0
                    • M Offline
                      M Offline
                      mbnoimi
                      wrote on last edited by
                      #10

                      I wonder is there any progress done on this issue? If yes; may you please guide us how to use OSM with Qt

                      I run "Places Map (QML)" example to find the ugly error message of discontinued service :(

                      1 Reply Last reply
                      0
                      • M Offline
                        M Offline
                        mbnoimi
                        wrote on last edited by
                        #11

                        BTW, I found this widget which view OSM but unfortunately it doesn't work under Android and I couldn't find a way to add places in the map
                        https://github.com/raptorswing/MapGraphics

                        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