Dont move center on onZoomLevelChanged



  • Does map have a property, so it doesn't move center if I move mouse cursor on random place on map and try to change zoom level with mouse wheel? Because on default, map zooms towards mouse cursor location. I just need it to zoom straight up from designated center of map, regardless of mouse cursor location.


  • Qt Champions 2018

    Maybe you could try ovelapping a MouseArea on it. Ignoring all events except the wheel ones :

    Map {
        id: map
        MouseArea {
            anchors.fill: parent
            onPressed: event.accepted = false
            onWheel: map.zoomLevel += wheel.angleDelta.y / 120 // tweak this, I have no idea if this works
        }
    }
    

Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.