Hi ,
I Can display my position from map like below code from QML .But how can I get position point form positionDisplay because I want to get that point and use in buffering geometry in my application.
positionDisplay {
positionSource: PositionSource {
}
}
Thanks.
Solved! Go to Solution.
KK-
Please see the PositionDisplay API Reference- ArcGIS Runtime SDK for Qt QML API: PositionDisplay Class Reference
It has a property on it called mapPoint, and that returns a Point object of your current location.
For example:
import QtQuick 2.3 import QtQuick.Controls 1.2 import ArcGIS.Runtime 10.26 import QtPositioning 5.3 ApplicationWindow { id: appWindow width: 800 height: 600 title: "d" Map { id: map anchors.fill: parent focus: true positionDisplay { positionSource: PositionSource { id: ps } } onStatusChanged: { if (status === Enums.MapStatusReady) { ps.active = true; } } ArcGISTiledMapServiceLayer { url: "http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" } } Button { anchors { left: parent.left top: parent.top margins: 10 } text: "get point" onClicked: { var point = map.positionDisplay.mapPoint; console.log("x", point.x, "y", point.y, "wkid", point.spatialReference.wkid) } } }
KK-
Please see the PositionDisplay API Reference- ArcGIS Runtime SDK for Qt QML API: PositionDisplay Class Reference
It has a property on it called mapPoint, and that returns a Point object of your current location.
For example:
import QtQuick 2.3 import QtQuick.Controls 1.2 import ArcGIS.Runtime 10.26 import QtPositioning 5.3 ApplicationWindow { id: appWindow width: 800 height: 600 title: "d" Map { id: map anchors.fill: parent focus: true positionDisplay { positionSource: PositionSource { id: ps } } onStatusChanged: { if (status === Enums.MapStatusReady) { ps.active = true; } } ArcGISTiledMapServiceLayer { url: "http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" } } Button { anchors { left: parent.left top: parent.top margins: 10 } text: "get point" onClicked: { var point = map.positionDisplay.mapPoint; console.log("x", point.x, "y", point.y, "wkid", point.spatialReference.wkid) } } }