lib/mapnya/js/release/mapnya.js in nyaplot-0.1.1 vs lib/mapnya/js/release/mapnya.js in nyaplot-0.1.2
- old
+ new
@@ -513,11 +513,11 @@
_.extend(options_extra, _options.extra);
options.extra = options_extra;
}
var fill_scale = (function(){
- var country_id = _.map(options.extra.map_data.features, function(d){return d.id;});
+ var country_id = _.map(options.extra.map_data.features, function(d){return d.properties.iso_a3;});
if(_.every(country_id, function(id){return typeof id == "undefined";})){
return d3.scale.ordinal().range(options.extra.color);
}
@@ -580,11 +580,11 @@
.enter()
.append('path')
.attr("d", path)
.attr("stroke", options.extra.stroke_color)
.attr("fill", function(d){
- if(typeof d.id == "undefined")return options.extra.no_data_color;
- else return fill_scale(d.id);
+ if(typeof d.properties.iso_a3 == "undefined")return options.extra.no_data_color;
+ else return fill_scale(d.properties.iso_a3);
});
if(options.zoom){
parent.call(
d3.behavior.zoom()
\ No newline at end of file