Wed Apr 22, 2020 10:57 am
how can I detect if a user clicked on a line on the map that was drawn using:
I especially need to know which of the lines was selected. I did not find a suitable way especially when the line was drawn using:
What I tried so far:
I discovered that MarbleWidget::whichFeatureAt returns nothing for poly lines.
I tried to use Marble::GeoDataLineString::latLonAltBox for determining with GeoDataLatLonAltBox::contains (const GeoDataCoordinates &) if the coordinate of my click position is within the GeoDataLatLonAltBox. This did not work as expected. Especially when drawing with Marble::Tessellate. The GeoDataLatLonAltBox does not respect the option.
I tried using GeoPainter::regionFromPolyline do determine if the clicked point lies within the region of one of the the GeoDataStringLines. Here I get performance issues (with 19.04.3) when calling GeoPainter::regionFromPolyline from within the render function. I get too many render events when the map is zoomed in. But apparently this approach does not work as well.
Currently I am out of ideas and would appreciate some help. Thanks.