I want to implement zoom to area feature by drawing rectangle in QT local offline app.
Could you please suggest right way to do it....
which methods to call ...
Essentially you need to draw a rectangle on the screen and convert the corners from screen coordinates to map coordinates. Once you do that, you can get an Envelope representing the extent, and then create a ViewpointExtent from the envelope, and setViewpoint on the MapView.
We have an example similar to what you are looking for, where the sample draws a rectangle and converts it to an Envelope so that this area can be taken offline. You can based your example off this only instead of exporting tiles, you'd zoom to the Envelope
I am trying to use CPP + QML...I am handling mouse click event but panning is not allowing me to draw Reactangle How disable it.
There are some examples of this here - arcgis-runtime-qt-projects-100/OverrideMapSignals at master · ldanzinger/arcgis-runtime-qt-projects-...
For example, you could do:
connect(m_mapView, &MapQuickView::mousePressed, [](QMouseEvent& event)
{
// accept the event - this will prevent the default panning from happening
event.accept();
});
Thanks it's working what to do in case on second button click I want to release this connect and connect with new one .