markmarkoh / datamaps

Customizable SVG map visualizations for the web in a single Javascript file using D3.js
http://datamaps.github.io
MIT License
3.78k stars 1.01k forks source link

Somaliland have negative ID #151

Closed ranska closed 8 years ago

ranska commented 9 years ago

Usecase: Given i make a map scoped on Africa And i do some click event like """

 done: function(datamap) {
        datamap.svg.selectAll('.datamaps-subunit').on('click', function(geography) {
            // change color using geography.id
        });
    }

""" Then i give the following message error """ Uncaught SyntaxError: An invalid or illegal string was specified. """

the id is the only negative number that i found

geometry: Object
id: "-99"
properties: Object

is it normal ?

maeishoj commented 9 years ago

All regions that are disputed in every map i encountered (this, jQvmap etc) give a negative value to them. Not sure why, but you can modify the source yourself if you need to have it..