Store nodes/segments, click handler, segments' nodes
Fire node/segment mouseenter/mouseout/click events
Stop DOM event propagation
Store non-segmented ways in the database

Segmentations are for the routes. The OSM data can be left as they are
Use ways instead of segments