Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read property 'getAttribute' Error #63

Open
avanfeel opened this issue Apr 7, 2015 · 1 comment
Open

Cannot read property 'getAttribute' Error #63

avanfeel opened this issue Apr 7, 2015 · 1 comment

Comments

@avanfeel
Copy link

avanfeel commented Apr 7, 2015

I get a "Uncaught TypeError: Cannot read property 'getAttribute' of undefined" error with this simple code:

var map = kartograph.map('#map', 600, 400);

map.loadMap('arg.svg', function() {
// do something with your map, add layers etc.
});

@jeromepin
Copy link

You can read this answer : either add metadata tag or use the 'addLayer' method if you generated your map with kartograph.py like :

var map = kartograph.map('#map', 600, 400);
map.loadMap('map.svg', function() {
    map.addLayer('my_layer_name_defined_for_kartograph.py', {
            styles: {
                    fill: 'blue',
                    stroke: 'red',
            }
    });
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants