Important: Please read the Qt Code of Conduct -

Setting from javascript

  • I am having a problem setting from javascript Qt5.7. The code below is a variant on minimal_map for mapbox.
    The console log gives.
    qml: -0
    qml: 1.34624

    So the latitude value seems to get set to zero when setting coordinates. I have tried numerous approaches to trying to set map.ceter but cannot get any of them to work.

    It might be related to the following bug report

    So what I want to know. If it's the same bug what is the work around? If it's not a bug what obvious thing am I overlooking?

    Window {
    width: 512
    height: 512
    visible: true

    Plugin {
        id: mpaboxPlugin
        name: "mapbox"
         PluginParameter {
             name: "mapbox.access_token"
             value: myAccessToken
         PluginParameter {
             name: "mapbox.map_id"
             value: ""
    Map {
        id: map
        anchors.fill: parent
        plugin: mpaboxPlugin
        center {
            latitude: 29
            longitude: 15
        zoomLevel: 6
    PositionSource {
        id: positionSource
        onPositionChanged: {
            // = QtPositioning.coordinate(59.91, 10.75);
   = 52.0;
   = 1.346240;


  • I have exactly the same problem. Some help would be appreciated.

Log in to reply