How to set background color for JVector Map?

I have the following code to initialize a JVector map:

map = new jvm.WorldMap({ map: 'us_aea_en', // backgroundColor: #FFFFFF, //Only this line does not work. container: $('#map'), series: { regions: [{ attribute: 'fill' }] } }); 

The above line: backgroundColor: #FFFFFF not executed. I read the API documentation seems to have the correct syntax. The code works fine except for this line. How to set the background? Are there other ways to set the background color?

+6
source share
2 answers

Thanks to @Denis Malinovsky, I finally realized that Answer: backgroundColor: "#FFFFFF"

+7
source

You can also set backgroundColor empty, for example. "" and then specify the background color in css by specifying it in the .jvectormap-container class:

JavaScript:

 var mapObject = $(map).vectorMap({ map: 'us_aea', backgroundColor: "" }); 

Css:

 .jvectormap-container { background-color: navy; } 
+1
source

Source: https://habr.com/ru/post/944095/


All Articles