Skip to content

Commit

Permalink
Added param hoverColors for multiple color highlight including Tests …
Browse files Browse the repository at this point in the history
…and README entries
  • Loading branch information
Morgan Massens committed Dec 17, 2015
1 parent 4b5ee83 commit 7400694
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ Whether to Enable Map Zoom ( true or false, defaults to true)

Color of the region when mouse pointer is over it.

**hoverColors**

Colors of individual map regions when mouse pointer is over it. Keys of the colors objects are country codes according to ISO 3166-1 alpha-2 standard. Keys of colors must be in lower case.

**hoverOpacity** *0.5*

Opacity of the region when mouse pointer is over it.
Expand Down
4 changes: 4 additions & 0 deletions tests/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ test("Test Config Options", function () {
},
enableZoom: false,
hoverColor: '#0000FF',
hoverColors: {
us: '#ff0000'
},
hoverOpacity: 0.7,
normalizeFunction: 'polynomial',
scaleColors: ['#b6d6ff', '#005ace'],
Expand Down Expand Up @@ -96,6 +99,7 @@ test("Test Config Options", function () {
equal(map.canvas.params.colors['us'], '#ff0000', 'vectorMap({ colors: { us: "#ff0000" } }) set correctly');
equal(map.canvas.params.enableZoom, false, 'vectorMap({ enableZoom: false }) set correctly');
equal(map.canvas.params.hoverColor, '#0000FF', 'vectorMap({ hoverColor: "#0000FF" }) set correctly');
equal(map.canvas.params.hoverColors['us'], '#ff0000', 'vectorMap({ hoverColors: { us: "#ff0000" } }) set correctly');
equal(map.canvas.params.hoverOpacity, 0.7, 'vectorMap({ hoverOpacity: 0.7 }) set correctly');
equal(map.canvas.params.normalizeFunction, 'polynomial', 'vectorMap({ normalizeFunction: "polynomial" }) set correctly');
equal(map.canvas.params.scaleColors[0][0], 182, 'vectorMap({ scaleColors: ["#b6d6ff", "#005ace"] }) first color red set correctly');
Expand Down

0 comments on commit 7400694

Please sign in to comment.