manifestinteractive/jqvmap — pull request #33 by dflemstr (2012-08-09 09:36:52+00:00)
Title: Add methods for highlighting and selecting areas programmatically

This adds a few methods that allow code to select or highlight areas, instead of just via mouse input. This has required some extensive internal changes to realise, but there doesn't seem to be any issues as of now.

$('#mymap').vectorMap('select', 'us'); // selects the United States
$('#mymap').vectorMap('deselect', 'us'); // deselects the United States
$('#mymap').vectorMap('highlight', 'us'); // highlights ("hovers over") the United States
$('#mymap').vectorMap('unhighlight', 'us'); // unhighlights ("mouseouts") the United States

My use-case for this change is that I want to have a list of important countries beside the map, and when a list entry is selected or hovered, the relevant map country should reflect the change.

It is now also possible to call any map method directly via e.g. `$('#mymap').vectorMap('setColors', 'us', '#000');`. It made the most sense to expose the new APIs like this.

The first commit is format fixes that Emacs did automatically when I loaded the file (e.g. converting tabs to spaces for indentation etc.). I would recommend that this commit is included, but it is of course possible to cherry-pick it out if you prefer inconsistent indentation.