Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-115480

Mapbox plugin no longer works

    XMLWordPrintable

Details

    Description

      Steps to reproduce

      Run the Minimal Map example (https://doc.qt.io/qt-5/qtlocation-minimal-map-example.html ) with the "mapbox" plugin:

      Plugin {
          id: mapPlugin
          name: "mapbox"
          PluginParameter {
              name: "mapbox.access_token"
              value: <YOUR_ACCESS_TOKEN>
          }
      }
      

       

      Issue 1

      The Mapbox plugin uses a HTTP URL but Mapbox is now HTTPS-only. Consequently, we see this runtime error:

      tile request error  "Problem with tile image"
      

       

      This is because the HTTP redirect message gets treated as the image. C:\Users\USERNAME\AppData\Local\cache\QtLocation\5.8\tiles\mapbox*.png all contain this text:

      <html>
      <head><title>301 Moved Permanently</title></head>
      <body>
      <center><h1>301 Moved Permanently</h1></center>
      <hr><center>CloudFront</center>
      </body>
      </html>
      

       

      Fix/Workaround 1

      Simply switching from HTTP to HTTPS (https://github.com/qt/qtlocation/blob/v6.6.0-beta2/src/plugins/geoservices/mapbox/qmapboxcommon.h#L13 ) fixes this part.

       

      If I'm not mistaken, the root cause is fixed by https://codereview.qt-project.org/c/qt/qtbase/+/475098 but that wasn't picked to Qt 5.15.

       

      Issue 2

      The default "mapbox.streets" tileset has been disabled:

       

      Consequently, we see this runtime error (if the HTTPS issue is fixed):

      QGeoTileRequestManager: Failed to fetch tile (8682,4766,14) 5 times, giving up. Last error message was: 'Error transferring https://api.tiles.mapbox.com/v4/mapbox.streets/14/8682/4766.png?access_token=<YOUR_ACCESS_TOKEN> - server replied: Gone'
      

       

      Fix/Workaround 2

      Selecting a different tileset ID such as "mapbox.mapbox-streets-v8", "mapbox.mapbox-terrain-v2", or "mapbox.satellite" works fine. For example:

      Plugin {
          id: mapPlugin
          name: "mapbox"
          PluginParameter {
              name: "mapbox.access_token"
              value: <YOUR_ACCESS_TOKEN>
          }
          PluginParameter {
              name: "mapbox.map_id" // Note: Documented as deprecated
              value: "mapbox.mapbox-streets-v8"
          }
      }
      

       

      See https://docs.mapbox.com/studio-manual/reference/tilesets/ for current tilesets.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              tokorpip Tomi Korpipää
              skoh-qt Sze Howe Koh
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes