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,6 +353,9 @@ 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:
if coord_list.count([user_lat, user_lon]) > 15:
pass
else:
folium.CircleMarker([user_lat, user_lon], popup=""" folium.CircleMarker([user_lat, user_lon], popup="""
<table style="width: 150px;"> <table style="width: 150px;">
<tbody> <tbody>