You can get TimeSlider up and running by doing the following:
- Create a new Qt Quick C++ project from our template
- include the toolkit PRI in your pro file -
include(/path/to/arcgis-runtime-qt-toolkit/uitools/toolkitcpp.pri)
- register your components in the main.cpp -
#include <Esri/ArcGISRuntime/Toolkit/register.h>
Esri::ArcGISRuntime::Toolkit::registerComponents(engine);
- Add a timeslider to your qml:
MapView {
id: view
anchors.fill: parent
// set focus to enable keyboard navigation
focus: true
TimeSlider {
anchors {
left: parent.left
right: parent.right
bottom: parent.bottom
}
geoView: view
}
}
- Add a time enabled layer, such as this map image layer
ToolkitTestCppQuick::ToolkitTestCppQuick(QObject* parent /* = nullptr */):
QObject(parent),
m_map(new Map(Basemap::streets(this), this))
{
auto imgLyr = new ArcGISMapImageLayer(QUrl("https://sampleserver6.arcgisonline.com/arcgis/rest/services/Hurricanes/MapServer"), this);
m_map->operationalLayers()->append(imgLyr);
}
- The time slider will automatically get the time extent, and you can manipulate/filter the time: