nzjrs / osm-gps-map

A Gtk+ Widget for Displaying OpenStreetMap tiles LOOKING FOR A NEW MAINTAINER
http://nzjrs.github.com/osm-gps-map
GNU General Public License v2.0
135 stars 58 forks source link

make tracks and polygons clickable and make track points highlightable #95

Open smartyg opened 2 years ago

smartyg commented 2 years ago

Points on tracks and polygons which have the clickable property set will emit a point-clicked signal when the user left-clicks on a point. When the editable property is also set a then a click is only considered as a click when the mouse pointer does not move while the left button is down. In case the mouse is moved while the left button is down it is considered as a drag-n-drop action (thus emitting a point-changed signal).

The point-select signal is also emitted after a 'breaker' has been clicked (only when editable is set).

This patch also include code to highlight a point with a (custom) highlight color (only the alpha channel is the same as for non-highlighted points). Only one point per track can be highlighted. Highlighting a point works by passing a pointer to a OsmGpsMapPoint (which must be in the list of track points) as value for the highlight-point property.

Also two examples are included to demonstrate the use of the click and highlight usage. The second example illustrate these features combined with the editable property.

If there are any question, please don't hesitate to ask.

This is a rebased update from the old pull request (which I accidentally closed).

johnny-bit commented 2 years ago

Looks good, but GH CI keeps failing on unrelated task. I'll try to compile myself locally and give it a go.