Jimshreds
Jimshreds

Reputation: 33

jVectorMap change SVG stroke color

Using jVectorMap on a site and would like to change the stroke color of state borders within the USA map. Have tried inserting a stroke color within each states coords within the path to no avail.

Has anyone been able to do such thing?

Upvotes: 3

Views: 5704

Answers (3)

mindtwitch
mindtwitch

Reputation: 121

Appears you can add the stroke in the stylesheet.

.jvectormap-region {
    stroke: white;
    stroke-width: 2;
}

Upvotes: 11

Bernd Volke
Bernd Volke

Reputation: 1

Just add the following code around line 123 of jquery.vector-map.js:

node.setAttribute('d', config.path);
node.setAttribute('stroke', '#000000'); // Whatever color you like!
node.setFill = function(color)...

Greetings!

Another question: my VML Fallback doesn't seem to work. The path coordinates are from an SVG created by Adobe Illustrator. Has anyone the same problem or can give me a solution which programm to use to create the path data?

Upvotes: 0

bjornd
bjornd

Reputation: 22943

Unfortunately you can't achieve this easily now without modifying the code of the jVectorMap.

Upvotes: 0

Related Questions