Ok. If detecting mouse position without hovering, then you should be fine to just use mousePositionChanged. Take the following example and touch the screen and move around the map. It should pan and display screen coordinates.
import QtQuick 2.3
import QtQuick.Controls 1.2
import ArcGIS.Runtime 10.26
ApplicationWindow {
id: appWindow
width: 800
height: 600
property bool mouseAreaEnabled: true
Map {
id: map
anchors.fill: parent
focus: true
ArcGISTiledMapServiceLayer {
url: "http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"
}
onMousePositionChanged: {
console.log("changed (from map signal)", mouse.x, mouse.y)
}
}
}
If you need to have hovering built in, then the MouseArea limitation is a known limit at this time. You could probably hack something together like the below example that will basically change the anchors of the mouse area so that some of the time you use the mouse area to get screen coordinates, but other times you remove the mouse area and use the map signals.
import QtQuick 2.3
import QtQuick.Controls 1.2
import ArcGIS.Runtime 10.26
ApplicationWindow {
id: appWindow
width: 800
height: 600
property bool mouseAreaEnabled: true
Map {
id: map
anchors.fill: parent
focus: true
ArcGISTiledMapServiceLayer {
url: "http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"
}
onMousePositionChanged: {
console.log("changed (from map signal)")
}
}
Rectangle {
id: myRect
color: "transparent"
states: [
State {
name: "Map"
AnchorChanges {
target: myRect
anchors.top: top
anchors.left: undefined
anchors.right: undefined
anchors.bottom: undefined
}
PropertyChanges {
target: myRect
height: .1
}
},
State {
name: "MouseArea"
AnchorChanges {
target: myRect
anchors.top: map.top
anchors.left: map.left
anchors.right: map.right
anchors.bottom: map.bottom
}
}
]
MouseArea {
id: mouseArea
anchors.fill: parent
hoverEnabled: true
onMouseXChanged: {
console.log("changed (from mouse area)");
}
}
}
Button {
property bool mouseAreaEnabled: true
anchors {
left: parent.left
top: parent.top
margins: 15
}
text: "toggle"
onClicked: {
if (!mouseAreaEnabled) {
myRect.state = "Map";
mouseAreaEnabled = true;
} else if (mouseAreaEnabled) {
myRect.state = "MouseArea";
mouseAreaEnabled = false;
}
}
}
}