How to drag Map with mouse area while plotting waypoints on map in qml Android
Unsolved
General and Desktop
-
I am using qt 5.14.1., SDK version 28 and ndk version 21. I am trying to drag the map with mouse area while plotting waypoints on map. Both dragging and plotting should be work on same time. I am able to plot waypoints successfully but cant able to drag map on same time and also giving problem in zoom in and zoom out of map while plotting the waypoint. I am using the following code
Map { id: mapOfWorld anchors.centerIn: parent; anchors.fill: parent activeMapType: supportedMapTypes[1]; plugin: hereMaps } MouseArea { id: mapAreaClick focus: true anchors.rightMargin: 470 transformOrigin: Item.Center anchors.horizontalCenterOffset: -1 anchors.fill: mapOfWorld anchors.centerIn: mapOfWorld propagateComposedEvents : true preventStealing : true hoverEnabled: true drag.axis: Drag.XandYAxis drag.target: mapOfWorld onReleased: { console.log("MouseArea onReleased") } // move or drag map onPressAndHold: { mapAreaClick.enabled = false mapOfWorld.center = mapOfWorld.toCoordinate((Qt.point((mouse.x),(mouse.y)))) console.log("MouseArea onPressAndHold") } // plot the waypoint onPressed: { mapOfWorld.focus = true mapAreaClick.enabled = true var cordinate = mapOfWorld.toCoordinate((Qt.point((mouse.x),(mouse.y)))); Geofence.addGeoFenceAsset(cordinate) } }
Is there some way to drag map and plot waypoints at same time in QT/QML.