Added 'highlight on click' feature.

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

Information
Abhinav Gangwar
marble
master
148771
Reviewers
marble
nienhueser, rahn, tgridel

Modifications:

  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 :)


  

Files


Issues

  • 4
  • 50
  • 0
  • 54
Description From Last Updated
Same here, do we really need to taint the API with an inputhandler related signal? can't we connect the signal ... Torsten Rahn Torsten Rahn
I would prefer it if we wouldn't taint the MarbleWidget API with inputhandler stuff :) can we just connect the ... Torsten Rahn Torsten Rahn
This is only executed on mouse click, right? Given all the nested loops I'm still a bit concerned about the ... Torsten Rahn Torsten Rahn
Can we put it on the stack instead (i.e. use GeoDataStyle style instead of GeoDataStlye* style) Dennis Nienhüser Dennis Nienhüser
Abhinav Gangwar
Abhinav Gangwar
Torsten Rahn
Abhinav Gangwar
Abhinav Gangwar
Torsten Rahn
Abhinav Gangwar
Abhinav Gangwar
Abhinav Gangwar
Abhinav Gangwar
Torsten Rahn
Torsten Rahn
Abhinav Gangwar
Dennis Nienhüser
Torsten Rahn
Abhinav Gangwar
Dennis Nienhüser
Dennis Nienhüser
Dennis Nienhüser
Abhinav Gangwar
Review request changed

Status: Closed (submitted)

Loading...