Map dimensions

merge-requests/30/head
Bob Mottram 2022-05-23 14:36:15 +01:00
parent a32452f72e
commit 5c5b861435
2 changed files with 7 additions and 3 deletions

View File

@ -215,7 +215,9 @@ def geocoords_from_map_link(url: str,
def html_open_street_map(url: str, def html_open_street_map(url: str,
bounding_box_degrees: float, bounding_box_degrees: float,
translate: {}) -> str: translate: {},
width: str = "725",
height: str = "650") -> str:
"""Returns embed html for an OSM link """Returns embed html for an OSM link
""" """
osm_domain = 'openstreetmap.org' osm_domain = 'openstreetmap.org'
@ -228,7 +230,8 @@ def html_open_street_map(url: str,
return '' return ''
html_str = \ html_str = \
'<iframe width="725" height="650" frameborder="0" ' + \ '<iframe width="' + width + '" height="' + height + \
'" frameborder="0" ' + \
'scrolling="no" marginheight="0" marginwidth="0" ' + \ 'scrolling="no" marginheight="0" marginwidth="0" ' + \
'src="https://www.' + osm_domain + '/export/embed.html?' + \ 'src="https://www.' + osm_domain + '/export/embed.html?' + \
'bbox=' + str(longitude - bounding_box_degrees) + \ 'bbox=' + str(longitude - bounding_box_degrees) + \

View File

@ -193,7 +193,8 @@ def _html_calendar_day(person_cache: {}, css_cache: {}, translate: {},
event_map = \ event_map = \
html_open_street_map(event_place, html_open_street_map(event_place,
bounding_box_degrees, bounding_box_degrees,
translate) translate,
'30vw', '30vw')
if event_map: if event_map:
event_place = event_map event_place = event_map