QML MapQuickItem Animation
-
Hi
My appn receives real time gps data and I need to animate the MapQuickItem with the location. What is the best way to do so?
-
Hi! Something like this:
PositionSource { id: src // ... } MapQuickItem { id: myMarker coordinate: src.position.coordinate; // ... }
-
@Wieland
Hi ...
Thanks for the reply. I had tried that but I am not able to set the coordinate of the source as it is saying it is read only.I was trying to use an array of latitudes and longitudes for dev sake.
This is how I have done.
MapquickitemMapQuickItem { property var rlat : [23.192993,23.212900,23.212358,23.211176,23.209993, 23.208810,23.207627,23.206444,23.205261,23.204079,23.202896, 23.201713, 23.200530,23.199347,23.198165,23.196982,23.195799,23.194616,23.193433,23.192250] property var rlon : [75.788412,75.783390,75.783406, 75.783441, 75.783476, 75.783511, 75.783545, 75.783580, 75.783615, 75.783650, 75.783685, 75.783719, 75.783754, 75.783789, 75.783824, 75.783859 , 75.783894, 75.783928, 75.783963,75.783998 ] property int temp: 0 coordinate: src.position.coordinate PositionSource{ id:src } Timer{ id: timer interval: 5000 // running: true onTriggered: { if(temp == rlat.length -1) timer.stop() else { src.position.coordinate = QtPositioning.coordinate(rlat[temp],rlon[temp]) src.update() } temp++ } } Component.onCompleted: { timer.start() } }
-
@saitej if you are interested in using the ArcGIS Runtime SDK, that should be pretty easy with the LocationDisplay. It hooks into a map view, and directly takes in a PositionSource, and displays that on the screen - https://github.com/Esri/arcgis-runtime-samples-qt/tree/master/ArcGISRuntimeSDKQt_QMLSamples/Maps/DisplayDeviceLocation
You could then log your GPS tracks by keeping an array of coordinates, and adding graphics to the map - https://github.com/Esri/arcgis-runtime-samples-qt/blob/master/ArcGISRuntimeSDKQt_QMLSamples/DisplayInformation/GOSymbols/GOSymbols.qml
-
I tried the ArcGIS Runtime SDK in windows but I am getting import errors like:
module "Esri.ArcGISRuntime" is not installed
module "Esri.ArcGISExtras" is not installedI have installed the ARCGIS SDK with QtCreator and I have given the path also correctly. ARCGIS Runtime QML appears in the project templates also!!
-
@saitej have you checked this? http://doc.qt.io/qt-5/qml-qtpositioning-coordinateanimation.html