From 5f8264cda881d62d5aab91cfcca2e46f6d2adb29 Mon Sep 17 00:00:00 2001 From: Aadhavan Srinivasan Date: Thu, 27 Feb 2025 17:45:53 -0500 Subject: [PATCH] Store language text instead of district text --- index.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index ac05163..a89d6c3 100644 --- a/index.js +++ b/index.js @@ -259,9 +259,15 @@ function drawMap(world) { .attr("text-anchor", "middle") .attr("font-size", "12px") .attr("fill", "black") - .attr("class", "districtText") - .attr("id", d => d.properties.district+"Text") - .text(d => d.properties.district); + .attr("class", "languageText") + .attr("id", d => d.properties.lang_name+"Text") + .text(function(d) { + if (stateOrDistrictOrLanguage(d) == "language") { + return d.properties.lang_name; + } else { + return d.properties.district; + } + }); let allLangs = []