Spaces:
Runtime error
Runtime error
Erdem Ozer
commited on
Commit
·
bbc62ce
1
Parent(s):
259ba89
fix: apply custom colours to power network after calculation
Browse files
tomorrowcities/pages/engine.py
CHANGED
|
@@ -570,10 +570,18 @@ def create_map_layer(df, name):
|
|
| 570 |
# icon_color=icon_color,
|
| 571 |
# spin=False
|
| 572 |
# ),location=(y,x),title=f'{node["node_id"]}',draggable=False)
|
| 573 |
-
icon_urls = '/static/public/icons/power_plant.png' if node['pwr_plant'] == 1 else '/static/public/icons/pole.png'
|
| 574 |
-
icons = Icon(icon_url=icon_urls, icon_size=[35,35]) if node['pwr_plant'] == 1 else Icon(icon_url=icon_urls, icon_size=[15,20])
|
| 575 |
-
marker = Marker(icon=icons, location=(y,x), title=f'{node["node_id"]}', draggable=False)
|
| 576 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 577 |
markers.append(marker)
|
| 578 |
map_layer= ipyleaflet.MarkerCluster(markers=markers, name = name,
|
| 579 |
disable_clustering_at_zoom=5)
|
|
|
|
| 570 |
# icon_color=icon_color,
|
| 571 |
# spin=False
|
| 572 |
# ),location=(y,x),title=f'{node["node_id"]}',draggable=False)
|
| 573 |
+
# icon_urls = '/static/public/icons/power_plant.png' if node['pwr_plant'] == 1 else '/static/public/icons/pole.png'
|
| 574 |
+
# icons = Icon(icon_url=icon_urls, icon_size=[35,35]) if node['pwr_plant'] == 1 else Icon(icon_url=icon_urls, icon_size=[15,20])
|
| 575 |
+
# marker = Marker(icon=icons, location=(y,x), title=f'{node["node_id"]}', draggable=False)
|
| 576 |
+
if node['is_operational'] == True:
|
| 577 |
+
icon_urls = '/static/public/icons/power_plant0.png' if node['pwr_plant'] == 1 else '/static/public/icons/pole0.png'
|
| 578 |
+
icons = Icon(icon_url=icon_urls, icon_size=[30,30]) if node['pwr_plant'] == 1 else Icon(icon_url=icon_urls, icon_size=[15,20])
|
| 579 |
+
marker = Marker(icon=icons, location=(y,x), title=f'{node["node_id"]}', draggable=False)
|
| 580 |
+
else:
|
| 581 |
+
icon_urls = '/static/public/icons/power_plant4.png' if node['pwr_plant'] == 1 else '/static/public/icons/pole4.png'
|
| 582 |
+
icons = Icon(icon_url=icon_urls, icon_size=[30,30]) if node['pwr_plant'] == 1 else Icon(icon_url=icon_urls, icon_size=[15,20])
|
| 583 |
+
marker = Marker(icon=icons, location=(y,x), title=f'{node["node_id"]}', draggable=False)
|
| 584 |
+
|
| 585 |
markers.append(marker)
|
| 586 |
map_layer= ipyleaflet.MarkerCluster(markers=markers, name = name,
|
| 587 |
disable_clustering_at_zoom=5)
|
tomorrowcities/public/icons/pole0.png
ADDED
|
|
tomorrowcities/public/icons/pole4.png
ADDED
|
|
tomorrowcities/public/icons/power_plant0.png
ADDED
|
|
tomorrowcities/public/icons/power_plant4.png
ADDED
|
|