add option for map theme
This commit is contained in:
parent
7febe66a76
commit
89176e922c
@ -167,7 +167,7 @@ def dashboard_loc_write(call, lat, lon, time):
|
||||
# dash_entries = []
|
||||
dash_entries.insert(0, {'call': call, 'lat': lat, 'lon': lon, 'time':time})
|
||||
with open("/tmp/gps_data_user_loc.txt", 'w') as user_loc_file:
|
||||
user_loc_file.write(str(dash_entries[:50]))
|
||||
user_loc_file.write(str(dash_entries[:200]))
|
||||
user_loc_file.close()
|
||||
logger.info('User location saved for dashboard')
|
||||
#logger.info(dash_entries)
|
||||
|
@ -160,7 +160,7 @@ def dashboard_loc_write(call, lat, lon, time):
|
||||
# dash_entries = []
|
||||
dash_entries.insert(0, {'call': call, 'lat': lat, 'lon': lon, 'time':time})
|
||||
with open("/tmp/gps_data_user_loc.txt", 'w') as user_loc_file:
|
||||
user_loc_file.write(str(dash_entries[:50]))
|
||||
user_loc_file.write(str(dash_entries[:200]))
|
||||
user_loc_file.close()
|
||||
logger.info('User location saved for dashboard')
|
||||
#logger.info(dash_entries)
|
||||
|
@ -196,7 +196,7 @@ def view_map():
|
||||
if 'W' in user_coord['lon']:
|
||||
user_lon = -user_lon
|
||||
if user_coord['call'] not in last_known_list and user_coord['call'] == track_call:
|
||||
folium_map = folium.Map(location=[user_lat, user_lon], tiles="Stamen Toner", zoom_start=15)
|
||||
folium_map = folium.Map(location=[user_lat, user_lon], tiles=map_theme, zoom_start=15)
|
||||
marker_cluster = MarkerCluster().add_to(folium_map)
|
||||
folium.Marker([user_lat, user_lon], popup="""<i>
|
||||
<table style="width: 150px;">
|
||||
@ -251,7 +251,7 @@ def view_map():
|
||||
<p style="text-align: center;"><button onclick="self.close()">Close Window</button>
|
||||
</p>"""
|
||||
if not track_call:
|
||||
folium_map = folium.Map(location=map_center, tiles="Stamen Toner", zoom_start=int(zoom_level))
|
||||
folium_map = folium.Map(location=map_center, tiles=map_theme, zoom_start=int(zoom_level))
|
||||
marker_cluster = MarkerCluster().add_to(folium_map)
|
||||
for user_coord in user_loc:
|
||||
user_lat = aprs_to_latlon(float(re.sub('[A-Za-z]','', user_coord['lat'])))
|
||||
|
@ -51,6 +51,9 @@ contact_website = 'https://hbl.ink'
|
||||
# Center dashboard map over these coordinates
|
||||
map_center = (47.00, -120.00)
|
||||
zoom_level = 7
|
||||
# List and preview of some map themes at http://leaflet-extras.github.io/leaflet-providers/preview/
|
||||
# The following are options for map themes and just work, you should use one of these: “OpenStreetMap”, “Stamen” (Terrain, Toner, and Watercolor),
|
||||
map_theme = 'Stamen Toner'
|
||||
|
||||
# RSS feed link, shows in the link section of each RSS item.
|
||||
rss_link = 'http://localhost:8092'
|
||||
|
Loading…
Reference in New Issue
Block a user