Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

mapviewer example change map provider



  • Hi,
    I have been exploring the map viewer example in qt 5.7 examples but on running it i find that i need to change the mapprovider to either mapbox or here. In order to do so i have obtained my mapbox.map id and mapbox.access_token. I have found out that in order to implement the mapbox provider I need to write this particular piece of code
    Plugin {
    id: myPlugin
    name: "mapbox"
    PluginParameter {
    name: "mapbox.access_token"; value: "my access_token"
    }
    PluginParameter {
    name: "mapbox.map_id"; value: "my map id"
    }
    }
    but i dont know in which particular file of the mapviewer example shud i b writing these lines of code mentioned above.
    Pleases help i have been exploring the net over for the ans for quite some time now but i am unable to find one, cuz most of them say to refer to qt's official documentation which i am not able to understand

    Please help a pin point answer would be highly obliged.
    Thanks



  • In the mapviewer.qml file, you can see a getPlugins() function that does this code dynamically instead of declaratively. You could add in your token and IDs here.


Log in to reply