mirror of
https://github.com/aljazceru/twentyone-world.github.io.git
synced 2025-12-19 18:54:20 +01:00
feat(map): show based name if based
This commit is contained in:
15
index.html
15
index.html
@@ -56,9 +56,22 @@ title: Twentyone.World
|
|||||||
}
|
}
|
||||||
return cGray;
|
return cGray;
|
||||||
}
|
}
|
||||||
|
function basedName(iso) {
|
||||||
|
let country = countries.find(c => c.alpha3 == iso);
|
||||||
|
if (country && country.country && country.name) {
|
||||||
|
return country.country + ": " + country.name;
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
map.addLayer('countries', {
|
map.addLayer('countries', {
|
||||||
title: function (d) { return d.name },
|
title: function (d) {
|
||||||
|
if (isBased(d.iso)) {
|
||||||
|
return basedName(d.iso);
|
||||||
|
} else {
|
||||||
|
return d.name;
|
||||||
|
}
|
||||||
|
},
|
||||||
styles: {
|
styles: {
|
||||||
stroke: cDarkGray,
|
stroke: cDarkGray,
|
||||||
fill: cGray
|
fill: cGray
|
||||||
|
|||||||
Reference in New Issue
Block a user