Added 'highlight on click' feature.

Review Request #118717 - Created June 13, 2014 and submitted - Latest diff uploaded

Abhinav Gangwar
nienhueser, rahn, tgridel


  1. Added support to specify highlight color in dgml file.
  2. Highlighting is done in the following way:

-> Input handler emits mouseClickGeoPostion( qreal lon, qreal lat, GeoDataCoordinates::Unit unit ) whenever a click
is detected on map.

-> Signal mouseClickGeoPostion(..) is connected to the signal MarbleMap::announceMouseClick(..) which
further triggers the slot GeometryLayer::hadnleHighlight(..) which iterates over the tree model to find the
placemarks, from all GeoDataDocuments in which any of its style map has an entry for highlight styleId, which
were under mouse when the click event happened.

-> After searching for all such placemarks GeometryLayer::hadnleHighlight(..) emits signal
announceHighlight(QVector<GeoDataPlacemarks> which is caught by GeoGraphicsScene to execute the slot
GeoGraphicsScene::applyHighlight(QVector< GeoDataPlacemark
> selectedPlacemark).

-> GeoGraphicsScene::applyHighlight(..) we find all GeoGraphicsItems for a plcamark and execute
GeoGraphicsItem::setHighlightStyle( GeoDataStyle *highlightStyle ) for each graphics items if the corresponding
placemark's style url is set to a style map which has a entry for highlight styleId.

-> GeoGraphicsItem::setHighlightStyle(..) assigns this style to GeoGraphicsItemPrivate::m_highlightStyle makes
GeoGraphicsItemPrivate::m_isHighlighted true. m_isHighlight decides which style ( normal or highlight ) to use
to paint the graphics item.

That's it . Need feedback :)