0

I really need to sign an ID to all my Raphael pathes. I used the solution posted in this answer how to access id attributes of any element in raphael and it works just find in Chrome and Firefox. It does not work at all in Internet Explorer. It even stop the pathes from loading. Does anyone have an idea how to fix this? I know IE is always a tough one, but I have to make it work on this browser.

for(var i = 0; i < statePathArr.length; i++) {
    var path = mapPaper.path(statePathArr[i].coordinates).attr({
        'fill' : '#EDECE7',
        'stroke': '#666666'
    });
path.node.id(statePathArr[i].name);
Community
  • 1
  • 1
Maximilian Lindsey
  • 809
  • 4
  • 18
  • 35

1 Answers1

1

You should use the internal Id that Raphael offers you. For example:

for(var i = 0; i < statePathArr.length; i++) {
var path = mapPaper.path(statePathArr[i].coordinates).attr({
    'fill' : '#EDECE7',
    'stroke': '#666666'
}); 
path.id = statePathArr[i].name;
}

And then you just need to use the getById('') method.

var getPath = paper.getById('IDoftheparh')

That way you are not using the nodes and you are taking advantage of the cross browsers capabilities of raphael.

limoragni
  • 2,716
  • 2
  • 32
  • 50