fix error if INITIAL_BOUNDS are not set
This commit is contained in:
parent
f12c5d56e8
commit
7aeecb085f
1 changed files with 2 additions and 1 deletions
|
@ -113,13 +113,14 @@ def map_index(request, mode=None, slug=None, slug2=None, details=None, options=N
|
||||||
'zoom': float(zoom),
|
'zoom': float(zoom),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
initial_bounds = settings.INITIAL_BOUNDS
|
||||||
ctx = {
|
ctx = {
|
||||||
'bounds': json.dumps(Source.max_bounds(), separators=(',', ':')),
|
'bounds': json.dumps(Source.max_bounds(), separators=(',', ':')),
|
||||||
'levels': json.dumps(tuple((level.pk, level.short_label) for level in levels.values()), separators=(',', ':')),
|
'levels': json.dumps(tuple((level.pk, level.short_label) for level in levels.values()), separators=(',', ':')),
|
||||||
'state': json.dumps(state, separators=(',', ':'), cls=DjangoJSONEncoder),
|
'state': json.dumps(state, separators=(',', ':'), cls=DjangoJSONEncoder),
|
||||||
'tile_cache_server': settings.TILE_CACHE_SERVER,
|
'tile_cache_server': settings.TILE_CACHE_SERVER,
|
||||||
'initial_level': settings.INITIAL_LEVEL,
|
'initial_level': settings.INITIAL_LEVEL,
|
||||||
'initial_bounds': json.dumps(settings.INITIAL_BOUNDS, separators=(',', ':')),
|
'initial_bounds': json.dumps(initial_bounds, separators=(',', ':')) if initial_bounds else None,
|
||||||
'last_site_update': json.dumps(SiteUpdate.last_update()),
|
'last_site_update': json.dumps(SiteUpdate.last_update()),
|
||||||
'ssids': json.dumps(settings.WIFI_SSIDS, separators=(',', ':')) if settings.WIFI_SSIDS else None,
|
'ssids': json.dumps(settings.WIFI_SSIDS, separators=(',', ':')) if settings.WIFI_SSIDS else None,
|
||||||
'embed': bool(embed),
|
'embed': bool(embed),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue