I am using arcgis 100.6 and qt version 5.12.
I want to identify graphics on my map on mouse click and display the respective graphic attributes such as name and coordinates. In order to achieve this I want to use a responsive label i.e the label geometry should change as per zoom scale. Another issue is that whenever I click on graphics the map is zoomed in due to the mouseEvent. I am not using the arcgis callout api as I dont want to use any qml code in my application.
Currently my application appears as follows:
Fig 1. On click on graphics it is identified and label is displayed
Fig 2. On zooming out label geometry remains unchanged
1. Is it possible to achieve such responsive labels on map (geometry changing as per zoom scale)
2. and at the same time block zoom in due to mouse events whenever graphic is clicked ?
The QML callout draws a shape using a Canvas and then displays it on the screen using the LocationToScreen API. Whenever the MapView's viewpoint changes, the draw location is updated with a new screen point. I think you could use the same workflow for your widgets based app. Here is an example workflow:
- Get the Point location of your feature
- Call locationToScreen and pass in your features geometry - https://developers.arcgis.com/qt/latest/cpp/api-reference/esri-arcgisruntime-mapview.html
- Display your graphic at that location
- Whenever the MapView's viewpoint changes (user pans/zooms), re execute this routine