refactor tooltip code and add events to doc

2 jobs for mapviewer in 3 minutes and 5 seconds (queued for 2 seconds)