Registered Member
|
Hello
I'm using MarbleWidget (Qt 5.4, Marble 4.14) and added some placemarks to my map, using GeoDataDocument::append(). Further I extendend the widget's pop-up menu with an action to show additional information depending on the placemarks name. Snippet from the slot called by the popup menu action:
This works fine. I further added GeoDataPlacemarks with a more complex geometry, using the GeoDataLinearRing object and GeoDataPlacemark::setGeometry(), as described in https://techbase.kde.org/Projects/Marbl ... aPlacemark. These polygons are shown perfectly on the map as well. How I create and add Placemarks with polygon geometry:
But they do not appear in the vector returned by whichFeatureAt(mousePos)! I already tried with setFill(true) and setFill(false), but no difference. How can I trigger a mouse event on one of these GeoDataPlacemark polygons? Thanks a lot! |
KDE Developer
|
Looking at the source code I'm afraid this hasn't been implemented yet.
The method QVector<const GeoDataFeature*> MarbleWidget::whichFeatureAt( const QPoint &curpos ) const is supposed to return features. And while geometries like polygons, rings and linestrings might be associated to features we don't take them into consideration (yet). In addition to this there is a method :QVector<const GeoDataFeature*> GeometryLayer::whichFeatureAt(const QPoint& curpos , const ViewportParams *viewport) which gets called by the same method inside MarbleWidget however in this one the geometries aren't taken into consideration yet either. It might be nice to add this (possibly as a specialized whichGeometryAt() method). Implementing this could be a matter of testing for the latLonBox of each geometry and if that returns true recheck by checking whether the cursorPosition is contained inside GeoPainter::regionFromPolygon()). All this would require someone to create a patch |
Registered users: Bing [Bot], daret, Google [Bot], Sogou [Bot]