Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Markers customization #28

Closed
wants to merge 14 commits into from
15 changes: 11 additions & 4 deletions app/alerts.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,14 @@ def build_sites_markers(dpt_code=None):
lon = row['Longitude']
site_name = row['Tours']
nb_device = row['Nombres Devices']
markers.append(dl.Marker(id=f'site_{i}', # Necessary to set an id for each marker to reteive callbacks
icon = {
"iconUrl": '../assets/pyro_site_icon.png', # still to be changed to a cleaner path with Path
"iconSize": [60, 60], # Size of the icon
# "iconAnchor": [20, 0] # Point of the icon which will correspond to marker's location
# "popupAnchor": [-3, -76] # Point from which the popup should open relative to the iconAnchor
}
markers.append(dl.Marker(id=f'site_{i}', # Necessary to set an id for each marker to retrieve callbacks
icon=icon,
position=(lat, lon),
children=[dl.Tooltip(site_name),
dl.Popup([html.H2(f'Site {site_name}'),
Expand Down Expand Up @@ -145,9 +152,9 @@ def build_alerts_elements(value, alert_metadata):
)
# Building alerts_markers objects and wraps them in a dl.LayerGroup object
icon = {
"iconUrl": 'https://marsfireengineers.com/assets/images/resources/firedetection.png',
"iconSize": [40, 40], # Size of the icon
"iconAnchor": [20, 20] # Point of the icon which will correspond to marker's location
"iconUrl": '../assets/pyro_alert_icon.png', # still to be changed to a cleaner path with Path
"iconSize": [60, 60], # Size of the icon
"iconAnchor": [0, 60] # Point of the icon which will correspond to marker's location
# "popupAnchor": [-3, -76] # Point from which the popup should open relative to the iconAnchor
}
alerts_markers = [dl.Marker(
Expand Down
Binary file added app/assets/pyro_alert_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/pyro_oldfire_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/pyro_site_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions app/data/.~lock.cameras.csv#
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
,nicolasrousselet,MacBook-Air-de-Nicolas.home,09.12.2020 12:16,file:///Users/nicolasrousselet/Library/Application%20Support/LibreOffice/4;
4 changes: 2 additions & 2 deletions app/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ def build_live_alerts_metadata():
"id": 0,
"created_at": "2020-11-25T15:22:21.690Z",
"media_url": "https://photos.lci.fr/images/613/344/photo-incendie-generac-gard-e8f2d9-0@1x.jpeg",
"lat": 44.765181,
"lon": 4.51488,
"lat": 44.758482,
"lon": 4.516601,
"event_id": 0,
"azimuth": "49.2°",
"site_name": "Serre de pied de Boeuf",
Expand Down