Skip to content

Commit 90f9c78

Browse files
Merge pull request #34 from ReyhanehEstiri/main
Add station info
2 parents 7b308f9 + 91bdc23 commit 90f9c78

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

visualization/index.html

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,12 @@
136136
<div class="dialog-body">
137137
<p><strong>نام:</strong> <span id="nodeName"></span></p>
138138
<p><strong>خط:</strong> <span id="nodeLines"></span></p>
139+
139140
<p>
140141
<strong>آدرس:</strong>
141142
<span class="no-select" id="nodeAddress"></span>
142143
</p>
144+
<p id="nodeEmojis"></p>
143145
</div>
144146
</div>
145147

@@ -298,10 +300,28 @@
298300
const nodeNameElement = document.getElementById("nodeName");
299301
const nodeAddressElement = document.getElementById("nodeAddress");
300302
const nodeLinesElement = document.getElementById("nodeLines");
303+
const nodeEmojisElement = document.getElementById("nodeEmojis");
301304
const closeButton = document.getElementById("closeDialogBtn");
302305

306+
const hasWC = node.data.wc || false;
307+
const WcEmoji = hasWC ? ' 🚾' : '';
308+
309+
const hasFastfood = node.data.fastFood || false;
310+
const FastfoodEmoji = hasFastfood ? ' 🍔' : '';
311+
312+
const hasGroceryStore = node.data.groceryStore || false;
313+
const GroceryStoreEmoji = hasGroceryStore ? ' 🛒' : '';
314+
315+
const hasatm = node.data.atm || false;
316+
const atmEmoji = hasatm ? ' 🏧' : '';
317+
318+
const hasCoffeeShop = node.data.coffeeShop || false;
319+
const CoffeeShopEmoji = hasCoffeeShop ? ' ☕' : '';
320+
321+
303322
nodeNameElement.textContent =
304-
node.data.translations.fa || node.data.name;
323+
(node.data.translations.fa || node.data.name || '') ;
324+
305325
nodeLinesElement.innerHTML = node.data.lines
306326
.map(
307327
(line, i) =>
@@ -311,6 +331,8 @@
311331
nodeAddressElement.innerHTML = node.data.address
312332
? `${node.data.address}`
313333
: `به زودی ...`;
334+
335+
nodeEmojisElement.innerHTML = `${WcEmoji} ${FastfoodEmoji} ${GroceryStoreEmoji} ${atmEmoji} ${CoffeeShopEmoji}`;
314336
nodeAddressElement.style.fontSize = "13px";
315337

316338
dialog.style.display = "block";

0 commit comments

Comments
 (0)