JVectorMap change color

I'm trying to customize a map of the US states, I fell in jVectorMap, but I can’t change the color, no matter what I do.

I tried to implement my problem in jsfiddle, but it does not want to do anything. A map is generated on my computer, but the colors just won't change.

http://jsfiddle.net/rsRnj/

I am using the plugin: http://jvectormap.com/

Anyone have any ideas why I can't change the colors of the states?

Or, if there is an easier-to-use card, I would also accept this recommendation. Basically, I just want a map with colors and freezes to be available on my page.

EDIT Now try another map library, publish the results when you're done

+4
source share
2 answers

Shutting down with this option: http://newsignature.github.com/us-map/

The jVector map looks good if you have data to overlay, but I just want every state to contact someone else on the site.

0
source

Perhaps try again with jvectormap? If I understand your purpose correctly, jvectormap should work fine.


working example
Here is the fork of your violin that seems to fit your color and click requirements:
http://jsfiddle.net/bQ78b/1/

$(function() { $('#usMap').vectorMap({ map: 'us_aea_en', hoverColor: false, hoverOpacity: 0.5, onRegionClick: function(e, code){ alert( code.replace("US-", "") ); }, regionStyle: { initial: { fill: '#128da7' }, hover: { fill: "#A0D1DC" } } }); }); 

Hope this helps ...

+13
source

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


All Articles