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. mapboxgl dont work on raspberry pi
QtWS25 Last Chance

mapboxgl dont work on raspberry pi

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
mapboxglmapboxqml mapmaptypecrosscompile
5 Posts 2 Posters 1.0k 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.
  • M Offline
    M Offline
    miladTalaei
    wrote on 2 Apr 2020, 21:38 last edited by
    #1

    hi guys i crosscompile Qt on raspberry pi with Ubuntu and i want to make a map with Qml and this is my code:

     Map {
            id:map
            anchors.fill: parent
            plugin: Plugin{
                id:myplug
                name:"mapboxgl"
    
                PluginParameter{
                    name: "mapboxgl.access_token"
                    value:"pk.eyJ1IjoibWlsYWRsb3ZlYm90aCIsImEiOiJjanZiaHlrZXEwczF5NDRxZnp0cnFseG9jIn0.CZjNPyoSnkUG4NaEzvb36A"
                }
            }
            zoomLevel: 12
            activeMapType: map.supportedMapTypes[map.supportedMapTypes.length-1]
            center: QtPositioning.coordinate(34.08, 49.70) 
            onSupportedMapTypesChanged: {
                for(var i=0; i<=map.supportedMapTypes.length-1; i++){
                    console.log(i+":"+map.supportedMapTypes[i].name)
                }
            }
    
            onErrorChanged: {
                console.log(map.error)
            }
    
        }
    

    and when i run it on ubuntu with GCC (5.7) every thing is ok l.
    OutPut log:

    qml: 0:mapbox://styles/mapbox/streets-v10
    qml: 1:mapbox://styles/mapbox/basic-v9
    qml: 2:mapbox://styles/mapbox/bright-v9
    qml: 3:mapbox://styles/mapbox/outdoors-v10
    qml: 4:mapbox://styles/mapbox/satellite-v9
    qml: 5:mapbox://styles/mapbox/satellite-streets-v10
    qml: 6:mapbox://styles/mapbox/light-v9
    qml: 7:mapbox://styles/mapbox/dark-v9
    qml: 8:mapbox://styles/mapbox/navigation-preview-day-v2
    qml: 9:mapbox://styles/mapbox/navigation-preview-night-v2
    qml: 10:mapbox://styles/mapbox/navigation-guidance-day-v2
    qml: 11:mapbox://styles/mapbox/navigation-guidance-night-v2
    Threaded rendering is not optimal in the Mapbox GL plugin.
    [ INFO ]  "{QSGRenderThread}[General]: GPU Identifier: SVGA3D; build: RELEASE;  LLVM;"
    

    but when i deployed on my raspberry pi i get nothing i got just a white screen and OutPut log is:

    qml: 1
    qrc:/main.qml:27:9: Unable to assign [undefined] to QDeclarativeGeoMapType*
    

    the raspberry GCC version is 8.3.0.
    so whats my wrong? help me soon as possible please.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      miladTalaei
      wrote on 2 Apr 2020, 22:03 last edited by
      #2

      i change this line

       console.log(map.error)
      

      to this

       console.log(map.errorString")
      

      and i got error on string that says:

      qml: The geoservices provider is not supported.
      

      so i write this function to check which map provider are avaible for me on raspberry and i got this logs when i deployed on Rpi:

       function checkPlugins()
          {
              var plugins = Qt.createQmlObject ('import QtLocation 5.12; Plugin {}', mainwin)
              for (var i = 0; i<plugins.availableServiceProviders.length; i++) {
                  var newPlugin = Qt.createQmlObject ('import QtLocation 5.12; Plugin {name: "' + plugins.availableServiceProviders[i]+ '"}', mainwin)
                  if (newPlugin.supportsMapping()){
                      console.log(newPlugin.name+" is Avaible.")
                  }
              }
          }
      

      and this logs is when i run on Ubuntu:

      qml: esri is Avaible.
      qml: osm is Avaible.
      qml: mapbox is Avaible.
      qml: here is Avaible.
      qml: itemsoverlay is Avaible.
      qml: mapboxgl is Avaible. 
      

      so what can i do to add mapboxgl on my Rpi3

      1 Reply Last reply
      0
      • M Offline
        M Offline
        miladTalaei
        wrote on 2 Apr 2020, 22:17 last edited by
        #3

        sorry guys i forgot to add the raspberry pi logs from checkPlugins so:

        qml: here is Avaible.
        qml: itemsoverlay is Avaible.
        qml: osm is Avaible.
        qml: mapbox is Avaible.
        qml: esri is Avaible.
        
        1 Reply Last reply
        0
        • M Offline
          M Offline
          miladTalaei
          wrote on 5 Apr 2020, 16:59 last edited by
          #4

          please help me guys i need it ):

          C 1 Reply Last reply 12 May 2023, 07:15
          0
          • M miladTalaei
            5 Apr 2020, 16:59

            please help me guys i need it ):

            C Offline
            C Offline
            CzarekECE
            wrote on 12 May 2023, 07:15 last edited by
            #5

            @miladTalaei
            Maybe it is problem with OpenGl support on RPI?

            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