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. mapbox implementation
QtWS25 Last Chance

mapbox implementation

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
7 Posts 3 Posters 540 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.
  • K Offline
    K Offline
    kodegiki
    wrote on last edited by
    #1

    Hi,
    I'm trying to load a mapbox into the application (I'm not the first programmer to take care of the application). I tried to do exactly what was described https://docs.mapbox.com/help/tutorials/first-steps-android-sdk/ and each time the application crashed and did not want to build.
    Please help.

    K raven-worxR 2 Replies Last reply
    0
    • K kodegiki

      Hi,
      I'm trying to load a mapbox into the application (I'm not the first programmer to take care of the application). I tried to do exactly what was described https://docs.mapbox.com/help/tutorials/first-steps-android-sdk/ and each time the application crashed and did not want to build.
      Please help.

      K Offline
      K Offline
      koahnig
      wrote on last edited by koahnig
      #2

      @kodegiki

      And what is the connection to Qt?

      Vote the answer(s) that helped you to solve your issue(s)

      K 1 Reply Last reply
      2
      • K koahnig

        @kodegiki

        And what is the connection to Qt?

        K Offline
        K Offline
        kodegiki
        wrote on last edited by
        #3

        @koahnig Every time I tried to type in map instead of osm (mapbox). Reading the documentation from the official website did not help.

        1 Reply Last reply
        0
        • K kodegiki

          Hi,
          I'm trying to load a mapbox into the application (I'm not the first programmer to take care of the application). I tried to do exactly what was described https://docs.mapbox.com/help/tutorials/first-steps-android-sdk/ and each time the application crashed and did not want to build.
          Please help.

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

          @kodegiki
          something is still not clear here.
          are you trying to display a map with QtLocation module (which has its own mapbox plugin) or to manually integrate the mapbox SDK via Android API? / Java?!

          --- 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
          1
          • K Offline
            K Offline
            kodegiki
            wrote on last edited by kodegiki
            #5

            So at first I tried to display using the integrated QtLocation module. I tried to watch movies and did exactly what they contained. Nothing worked. I did it like that

            import QtQuick 2.0
            import QtQuick.Window 2.0
            import QtLocation 5.9
            import QtPositioning 5.8
            
            Window {
            width: 512
            height: 512
            visible: true
            
                Map {
                    plugin: Plugin { name: "mapboxgl" }
            
                    center: QtPositioning.coordinate(60.170448, 24.942046) // Helsinki
                    zoomLevel: 12
            
                    MapParameter {
                        type: "source"
            
                        property var name: "routeSource"
                        property var sourceType: "geojson"
                        property var data: '{ "type": "FeatureCollection", "features": \
                            [{ "type": "Feature", "properties": {}, "geometry": { \
                            "type": "LineString", "coordinates": [[ 24.934938848018646, \
                            60.16830257086771 ], [ 24.943315386772156, 60.16227776476442 ]]}}]}'
                    }
            
                    MapParameter {
                        type: "layer"
            
                        property var name: "route"
                        property var layerType: "line"
                        property var source: "routeSource"
            
                        // Draw under the first road label layer
                        // of the mapbox-streets style.
                        property var before: "road-label-small"
                    }
            
                    MapParameter {
                        type: "paint"
            
                        property var layer: "route"
                        property var lineColor: "blue"
                        property var lineWidth: 8.0
                    }
            
                    MapParameter {
                        type: "layout"
            
                        property var layer: "route"
                        property var lineJoin: "round"
                        property var lineCap: "round"
                    }
                }
            }
            
            

            it ended with this mistake
            W QtThread: type=1400 audit(0.0:86): avc: granted { execute } for path="/data/data/org.qtproject.example.nienazwany/qt-reserved-files/qml/QtQuick.2/libqtquick2plugin.so" dev="vdc" ino=22569 scontext=u:r:untrusted_app_27:s0:c134,c256,c512,c768 tcontext=u:object_r:app_data_file:s0:c134,c256,c512,c768 tclass=file app=org.qtproject.example.nienazwany
            W linker : Warning: "/data/data/org.qtproject.example.nienazwany/qt-reserved-files/qml/QtQuick.2/libqtquick2plugin.so" has unsupported flags DT_FLAGS_1=0x80 (ignoring unsupported flags)
            W QtThread: type=1400 audit(0.0:87): avc: granted { execute } for path="/data/data/org.qtproject.example.nienazwany/qt-reserved-files/qml/QtQuick/Window.2/libwindowplugin.so" dev="vdc" ino=22574 scontext=u:r:untrusted_app_27:s0:c134,c256,c512,c768 tcontext=u:object_r:app_data_file:s0:c134,c256,c512,c768 tclass=file app=org.qtproject.example.nienazwany
            W linker : Warning: "/data/data/org.qtproject.example.nienazwany/qt-reserved-files/qml/QtQuick/Window.2/libwindowplugin.so" has unsupported flags DT_FLAGS_1=0x80 (ignoring unsupported flags)
            W linker : Warning: "/data/data/org.qtproject.example.nienazwany/qt-reserved-files/qml/QtLocation/libdeclarative_location.so" has unsupported flags DT_FLAGS_1=0x80 (ignoring unsupported flags)
            W linker : Warning: "/data/data/org.qtproject.example.nienazwany/qt-reserved-files/qml/QtPositioning/libdeclarative_positioning.so" has unsupported flags DT_FLAGS_1=0x80 (ignoring unsupported flags)
            W QtThread: type=1400 audit(0.0:88): avc: granted { execute } for path="/data/data/org.qtproject.example.nienazwany/qt-reserved-files/qml/QtLocation/libdeclarative_location.so" dev="vdc" ino=22577 scontext=u:r:untrusted_app_27:s0:c134,c256,c512,c768 tcontext=u:object_r:app_data_file:s0:c134,c256,c512,c768 tclass=file app=org.qtproject.example.nienazwany

            raven-worxR 1 Reply Last reply
            0
            • K kodegiki

              So at first I tried to display using the integrated QtLocation module. I tried to watch movies and did exactly what they contained. Nothing worked. I did it like that

              import QtQuick 2.0
              import QtQuick.Window 2.0
              import QtLocation 5.9
              import QtPositioning 5.8
              
              Window {
              width: 512
              height: 512
              visible: true
              
                  Map {
                      plugin: Plugin { name: "mapboxgl" }
              
                      center: QtPositioning.coordinate(60.170448, 24.942046) // Helsinki
                      zoomLevel: 12
              
                      MapParameter {
                          type: "source"
              
                          property var name: "routeSource"
                          property var sourceType: "geojson"
                          property var data: '{ "type": "FeatureCollection", "features": \
                              [{ "type": "Feature", "properties": {}, "geometry": { \
                              "type": "LineString", "coordinates": [[ 24.934938848018646, \
                              60.16830257086771 ], [ 24.943315386772156, 60.16227776476442 ]]}}]}'
                      }
              
                      MapParameter {
                          type: "layer"
              
                          property var name: "route"
                          property var layerType: "line"
                          property var source: "routeSource"
              
                          // Draw under the first road label layer
                          // of the mapbox-streets style.
                          property var before: "road-label-small"
                      }
              
                      MapParameter {
                          type: "paint"
              
                          property var layer: "route"
                          property var lineColor: "blue"
                          property var lineWidth: 8.0
                      }
              
                      MapParameter {
                          type: "layout"
              
                          property var layer: "route"
                          property var lineJoin: "round"
                          property var lineCap: "round"
                      }
                  }
              }
              
              

              it ended with this mistake
              W QtThread: type=1400 audit(0.0:86): avc: granted { execute } for path="/data/data/org.qtproject.example.nienazwany/qt-reserved-files/qml/QtQuick.2/libqtquick2plugin.so" dev="vdc" ino=22569 scontext=u:r:untrusted_app_27:s0:c134,c256,c512,c768 tcontext=u:object_r:app_data_file:s0:c134,c256,c512,c768 tclass=file app=org.qtproject.example.nienazwany
              W linker : Warning: "/data/data/org.qtproject.example.nienazwany/qt-reserved-files/qml/QtQuick.2/libqtquick2plugin.so" has unsupported flags DT_FLAGS_1=0x80 (ignoring unsupported flags)
              W QtThread: type=1400 audit(0.0:87): avc: granted { execute } for path="/data/data/org.qtproject.example.nienazwany/qt-reserved-files/qml/QtQuick/Window.2/libwindowplugin.so" dev="vdc" ino=22574 scontext=u:r:untrusted_app_27:s0:c134,c256,c512,c768 tcontext=u:object_r:app_data_file:s0:c134,c256,c512,c768 tclass=file app=org.qtproject.example.nienazwany
              W linker : Warning: "/data/data/org.qtproject.example.nienazwany/qt-reserved-files/qml/QtQuick/Window.2/libwindowplugin.so" has unsupported flags DT_FLAGS_1=0x80 (ignoring unsupported flags)
              W linker : Warning: "/data/data/org.qtproject.example.nienazwany/qt-reserved-files/qml/QtLocation/libdeclarative_location.so" has unsupported flags DT_FLAGS_1=0x80 (ignoring unsupported flags)
              W linker : Warning: "/data/data/org.qtproject.example.nienazwany/qt-reserved-files/qml/QtPositioning/libdeclarative_positioning.so" has unsupported flags DT_FLAGS_1=0x80 (ignoring unsupported flags)
              W QtThread: type=1400 audit(0.0:88): avc: granted { execute } for path="/data/data/org.qtproject.example.nienazwany/qt-reserved-files/qml/QtLocation/libdeclarative_location.so" dev="vdc" ino=22577 scontext=u:r:untrusted_app_27:s0:c134,c256,c512,c768 tcontext=u:object_r:app_data_file:s0:c134,c256,c512,c768 tclass=file app=org.qtproject.example.nienazwany

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

              @kodegiki
              those are not errors but only warnings and do not affect your app in the end.

              You should also start reading the docs at very first - like for every problem you encounter actually.
              You need to provide an API key in order to use MapBox service (like for most 3rd party services).
              So first register your application on the MapBox website and paste the provided key to the plugin as stated in the docs.

              --- 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
              2
              • K Offline
                K Offline
                kodegiki
                wrote on last edited by
                #7

                I have read the documentation before and gave the api key to the PluginParameter. Now app is on but i only see white background

                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