Skip to content

Commit 6e991c7

Browse files
committed
Fix bug on mapnya
1 parent be69c51 commit 6e991c7

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

lib/mapnya/js/release/mapnya.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ define('components/axis',['tools'], function(Tools){
515515
}
516516

517517
var fill_scale = (function(){
518-
var country_id = _.map(options.extra.map_data.features, function(d){return d.properties['iso_a3'];});
518+
var country_id = _.map(options.extra.map_data.features, function(d){return d.properties.iso_a3;});
519519

520520
if(_.every(country_id, function(id){return typeof id == "undefined";})){
521521
return d3.scale.ordinal().range(options.extra.color);
@@ -582,8 +582,8 @@ define('components/axis',['tools'], function(Tools){
582582
.attr("d", path)
583583
.attr("stroke", options.extra.stroke_color)
584584
.attr("fill", function(d){
585-
if(typeof d.id == "undefined")return options.extra.no_data_color;
586-
else return fill_scale(d.id);
585+
if(typeof d.properties.iso_a3 == "undefined")return options.extra.no_data_color;
586+
else return fill_scale(d.properties.iso_a3);
587587
});
588588

589589
if(options.zoom){

lib/mapnya/js/release/mapnya.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/mapnya/js/src/components/axis.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ define(['tools'], function(Tools){
3939
}
4040

4141
var fill_scale = (function(){
42-
var country_id = _.map(options.extra.map_data.features, function(d){return d.properties['iso_a3'];});
42+
var country_id = _.map(options.extra.map_data.features, function(d){return d.properties.iso_a3;});
4343

4444
if(_.every(country_id, function(id){return typeof id == "undefined";})){
4545
return d3.scale.ordinal().range(options.extra.color);
@@ -106,8 +106,8 @@ define(['tools'], function(Tools){
106106
.attr("d", path)
107107
.attr("stroke", options.extra.stroke_color)
108108
.attr("fill", function(d){
109-
if(typeof d.id == "undefined")return options.extra.no_data_color;
110-
else return fill_scale(d.id);
109+
if(typeof d.properties.iso_a3 == "undefined")return options.extra.no_data_color;
110+
else return fill_scale(d.properties.iso_a3);
111111
});
112112

113113
if(options.zoom){

0 commit comments

Comments
 (0)