cap positions on map at 15 for station view

This commit is contained in:
KF7EEL 2021-03-05 08:15:42 -08:00 committed by GitHub
parent 247168d567
commit ef850596d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -206,6 +206,7 @@ def view_map():
map_size = request.args.get('map_size') map_size = request.args.get('map_size')
user_loc = ast.literal_eval(os.popen('cat ' + loc_file).read()) user_loc = ast.literal_eval(os.popen('cat ' + loc_file).read())
last_known_list = [] last_known_list = []
coord_list = []
try: try:
if track_call: if track_call:
#folium_map = folium.Map(location=map_center, zoom_start=int(zoom_level)) #folium_map = folium.Map(location=map_center, zoom_start=int(zoom_level))
@ -320,6 +321,7 @@ def view_map():
if 'W' in user_coord['lon']: if 'W' in user_coord['lon']:
user_lon = -user_lon user_lon = -user_lon
loc_comment = '' loc_comment = ''
coord_list.append([user_lat, user_lon])
if 'comment' in user_coord: if 'comment' in user_coord:
loc_comment = """ loc_comment = """
<tr> <tr>
@ -351,18 +353,21 @@ def view_map():
</i>""", icon=folium.Icon(color="red", icon="record"), tooltip=str(user_coord['call'])).add_to(folium_map) </i>""", icon=folium.Icon(color="red", icon="record"), tooltip=str(user_coord['call'])).add_to(folium_map)
last_known_list.append(user_coord['call']) last_known_list.append(user_coord['call'])
if user_coord['call'] in last_known_list: if user_coord['call'] in last_known_list:
folium.CircleMarker([user_lat, user_lon], popup=""" if coord_list.count([user_lat, user_lon]) > 15:
<table style="width: 150px;"> pass
<tbody> else:
<tr> folium.CircleMarker([user_lat, user_lon], popup="""
<td style="text-align: center;"><strong>""" + user_coord['call'] + """</strong></td> <table style="width: 150px;">
</tr> <tbody>
<tr> <tr>
<td style="text-align: center;"><em>""" + loc_time + """</em></td> <td style="text-align: center;"><strong>""" + user_coord['call'] + """</strong></td>
</tr> </tr>
</tbody> <tr>
</table> <td style="text-align: center;"><em>""" + loc_time + """</em></td>
""", tooltip=str(user_coord['call']), fill=True, fill_color="#3186cc", radius=4).add_to(marker_cluster) </tr>
</tbody>
</table>
""", tooltip=str(user_coord['call']), fill=True, fill_color="#3186cc", radius=4).add_to(marker_cluster)
return folium_map._repr_html_() return folium_map._repr_html_()