Question

I have the following code to initialize 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 does not execute. I read the API documentation, it seems to have correct syntax. The code works perfect except for that line. How to set the background? Are there any other ways to set the background color?

Was it helpful?

Solution

Thanks to @Denis Malinovsky, I finally figured out that The answer is: backgroundColor: "#FFFFFF"

OTHER TIPS

You can also set backgroundColor to be empty, e.g. "", 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;
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top