Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved MapBox and HERE ok on OSX but not working on IOS

    Mobile and Embedded
    4
    9
    1374
    Loading More Posts
    • 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.
    • A
      AddTheBadd last edited by

      Hello, I have an application that displays a map with a Polyline overlay and the application builds and works as expected on OSX. When I build and deploy on IOS the application works and I get no new error messages but the map is simply blank. This happens whether I use MapBox or HERE. I was originally using MapQuest before the license change and MapQuest worked on IOS and OSX. I am using Qt 5.7.0 and QtLocation 5.6. I have included below some code extracts. I generate the Map in C++ then use the createMap() function to inject the code into the QML. The code is for MapBox but I have a HERE version which does the same thing. Any Help would be greatly appreciated. With no error message I'm not sure where to start!

      import QtLocation 5.6;
      Map { anchors.fill: parent; plugin: mapBoxPlugin; MapPolyline { line.width: 3; line.color: 'green'; path: [ { longitude: -4.93616, latitude: 54.4058, altitude: 6123.53 }, { longitude: -4.93287, latitude: 54.4049, altitude: 6127.04 }, 
      { longitude: -4.92937, latitude: 54.4039, altitude: 6129.64 }, { longitude: -4.92621, latitude: 54.4029, altitude: 6130.84 }, { longitude: -4.92267, latitude: 54.4019, altitude: 6132.23 }, { longitude: -4.91917, latitude: 54.4009, altitude: 6134.3 }, { lon
      gitude: -4.91596, latitude: 54.4, altitude: 6136.69 }, { longitude: -4.91248, latitude: 54.399, altitude: 6139.55 }, { longitude: -4.90894, latitude: 54.398, altitude: 6142.6 }, { longitude: -4.90577, latitude: 54.397, altitude: 6145.43 }, { longitude: -4.
      9023, latitude: 54.396, altitude: 6148.65 }, { longitude: -4.89884, latitude: 54.395, altitude: 6151.95 }, { longitude: -4.89591, latitude: 54.3942, altitude: 6154.82 }, { longitude: -4.89323, latitude: 54.3934, altitude: 6157.52 }, { longitude: -4.88997, latitude: 54.3925, altitude: 6160.79 }]; } MapPolyline { line.width: 7; line.color: 'orange'; path: [ ]; } }
      
      function createMap(map) {
      	var newObject = Qt.createQmlObject( map, eventMap, "dynamicMap");
      	newObject. fitViewportToMapItems();
      	return "eventMap - Done It!";
      }
      
      Plugin {
      	id: mapBoxPlugin
      	name: "mapbox"
      	PluginParameter { name: "mapbox.access_token"; value: "pk.RemovedActualToken!" }
      	PluginParameter { name: "mapbox.map_id"; value: "mapbox.run-bike-hike" }
      }
      
      
      
      1 Reply Last reply Reply Quote 0
      • NickV
        NickV last edited by

        You should register to mapbox and then take a real token for your app.

        1 Reply Last reply Reply Quote 0
        • A
          AddTheBadd last edited by

          Thank you Nick. I do have a real Token and as I mentioned in my post the code works correctly in OSX. I just removed the real Token from the code.

          1 Reply Last reply Reply Quote 0
          • NickV
            NickV last edited by

            Then you should see the permissions of the ios.

            1 Reply Last reply Reply Quote 0
            • A
              AddTheBadd last edited by AddTheBadd

              How do I see the permissions of the ios? Do you know what permissions I need to check?

              1 Reply Last reply Reply Quote 0
              • NickV
                NickV last edited by NickV

                You can see it using xcode. I don't know the exact permission of the ios. You could try using this:

                Plugin{
                id:myPlugin
                name: "mapbox"
                PluginParameter{
                name: "mapbox.map_id";
                value: "mapbox.streets"
                }
                PluginParameter{
                name: "mapbox.access_token";
                value: " your token"
                }
                }
                As You can see the only difference is map id. Try it.

                1 Reply Last reply Reply Quote 0
                • A
                  AddTheBadd last edited by

                  I have just tried using mapbox.streets as the map_id. As before it works on OSX but gives me nothing on IOS. I get no error messages, no map tiles and no path.

                  1 Reply Last reply Reply Quote 0
                  • patrikd
                    patrikd last edited by patrikd

                    Hi AddTheBadd,
                    did you find a solution for your problem? Same here, using the google plugin from vladest works perfect on android but under ios nothing is displayed and no error message :(
                    best,
                    patrik

                    1 Reply Last reply Reply Quote 0
                    • T
                      Toadstool42 last edited by

                      I had the same problem, but adding the following to the project's .pro file fixed the issue:
                      QT += qml quick positioning sensors location network

                      I had no errors before so no idea what was happening, but seems like just for iOS these are explicitly needed for the map plugin to work properly.

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post