File size: 1,185 Bytes
312b9eb 55e7c55 312b9eb 55e7c55 312b9eb 55e7c55 312b9eb 7f4ef9c 55e7c55 7f4ef9c 312b9eb 55e7c55 312b9eb |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
import folium
from folium import DivIcon
from folium.plugins import Draw
def create_map(dataframe, recommendations):
m = folium.Map(
location=[35.1796, 129.0406],
zoom_start=12,
tiles='CartoDB positron'
)
for idx, row in dataframe.iterrows():
cell_id = row['enbid_pci']
recommended_cell_state = recommendations.get(cell_id, 'UNKNOWN')
if recommended_cell_state == 'ON':
color = '#7AA1EE'
elif recommended_cell_state == 'OFF':
color = '#FF8181'
else:
color = '#ccc'
custom_icon = DivIcon(
html=f"""
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" width="20" height="20">
<circle cx="10" cy="10" r="5.625" fill="{color}" stroke="#000000" stroke-width="1.25"/>
</svg>
""",
icon_size=(20, 20),
icon_anchor=(10, 10)
)
marker = folium.Marker(
location=(row['ru_svc_lat_val'], row['ru_svc_lng_val']),
icon=custom_icon,
tooltip=f'{cell_id} - {recommended_cell_state}'
)
marker.add_to(m)
return m |