Is there a way to get device location offline on ArcGIS Runtime QT SDK application?

675
1
06-25-2019 04:37 AM
BrentSlone3
New Contributor III

Hello all, 

I have an android application built using AppStudio for ArcGIS Desktop with Qt Runtime. 

Is there any way via core Qt or ArcGIS Runtime for Qt to get the current location of a device in offline mode? 

I have been researching this and I have found that this can be done using core Android JAVA classes.

I have not found any QML type in API reference of ArcGIS Runtime QT SDK that would allow offline location tracking. 

Any suggestions would be helpful. 

Thank you.

0 Kudos
1 Reply
LucasDanzinger
Esri Frequent Contributor

Hi Brent,

Yes, this is possible with the LocationDisplay and PositionSource classes. PositionSource is a Qt Framework class that obtains the location via GPS (works offline) and the LocationDisplay is an ArcGIS Runtime class that displays the current location on the map. The LocationDisplay takes in a PositionSource object. 

Here is the API doc for:

LocationDisplay - https://developers.arcgis.com/qt/latest/qml/api-reference/qml-esri-arcgisruntime-locationdisplay.htm...

PositionSource - https://doc.qt.io/qt-5/qml-qtpositioning-positionsource.html

And here is a sample, which does use an online basemap, but the actual coordinate display does not require any connection. You could swap out the sample to use a local tile package instead and it would be an offline solution - https://github.com/Esri/arcgis-runtime-samples-qt/tree/master/ArcGISRuntimeSDKQt_QMLSamples/Maps/Dis...

0 Kudos