mapbox/tilemill — Issue #977: Wishlist: More Powerful Tooltips
Author: mroswell
Created: 2011-11-30 17:56:48+00:00
State: open

In the past (and possibly into the future) I've used a combination of a PNG (generated from a GIS), an imagemap (generated from a GIS add-on, and the Overlib javascript library to control tooltips. My LCV endorsement map enabled the following:

1. track tooltips to the mouse (I checked out tmcw's page, and this illustrates that one bit of functionality I'm looking for http://macwright.org/superfund/ How do you do that with TileMill? Is it manual code editing?)

2. Set a click feature, so that the tooltip will stay in place

3. For "stay-in-place" tooltips, options to have a click-close button, or mouseover close button

4. Overlib also offers smart tooltip placement. If you're on the right side of the screen, the tooltip will move to the left, and visa versa.

5. Put html code in the tooltip that can be manually customized, including links. (LCV wanted certain candidate tooltips not to link to their website, they had already maxed out in campaign contributions, so the lawyers said: no links for particular candidates... custom coding each tooltip was necessary) Also, because full HTML was allowed, I could have different colors for the title, and even--for Senate districts where they also endorsed Congresspeople, the mouseover could list all three people... It basically allowed tooltips to aggregate multiple layers (although, indeed, this was a lot of hand-coding.) The basic idea, though, was that tool tips could be frozen on the screen, in order to access links (such as contribution forms, etc)

5. (I think Overlib even had some sort of click area feature, so that tiny districts could still be selected... something like that. Although that's less important when you've got built-in zoom functionality.)

I wonder if there's some way to get the best of both words: Mapnik/Tilemill, plus all this functionality. Of all the items above, being able to track the mouse, and being able to freeze the tooltip for access to links are the two most vital.