fix data for level selector
This commit is contained in:
parent
3392226c44
commit
ee20019417
3 changed files with 3 additions and 3 deletions
|
@ -158,7 +158,7 @@ def locations_by_slug_for_request(request) -> Mapping[str, LocationSlug]:
|
||||||
return locations
|
return locations
|
||||||
|
|
||||||
|
|
||||||
def levels_by_short_label_for_request(request) -> Mapping[str, LocationSlug]:
|
def levels_by_short_label_for_request(request) -> Mapping[str, Level]:
|
||||||
cache_key = 'mapdata:levels:by_short_label:%s' % AccessPermission.cache_key_for_request(request)
|
cache_key = 'mapdata:levels:by_short_label:%s' % AccessPermission.cache_key_for_request(request)
|
||||||
levels = cache.get(cache_key, None)
|
levels = cache.get(cache_key, None)
|
||||||
if levels is not None:
|
if levels is not None:
|
||||||
|
|
|
@ -697,7 +697,7 @@ c3nav = {
|
||||||
c3nav._firstRouteLevel = null;
|
c3nav._firstRouteLevel = null;
|
||||||
for (i = c3nav.levels.length - 1; i >= 0; i--) {
|
for (i = c3nav.levels.length - 1; i >= 0; i--) {
|
||||||
var level = c3nav.levels[i];
|
var level = c3nav.levels[i];
|
||||||
var layerGroup = c3nav._levelControl.addLevel(level[0], level[2]);
|
var layerGroup = c3nav._levelControl.addLevel(level[0], level[1]);
|
||||||
c3nav._locationLayers[level[0]] = L.layerGroup().addTo(layerGroup);
|
c3nav._locationLayers[level[0]] = L.layerGroup().addTo(layerGroup);
|
||||||
c3nav._routeLayers[level[0]] = L.layerGroup().addTo(layerGroup);
|
c3nav._routeLayers[level[0]] = L.layerGroup().addTo(layerGroup);
|
||||||
}
|
}
|
||||||
|
|
|
@ -122,7 +122,7 @@ def map_index(request, mode=None, slug=None, slug2=None, details=None, level=Non
|
||||||
|
|
||||||
ctx = {
|
ctx = {
|
||||||
'bounds': json.dumps(Source.max_bounds(), separators=(',', ':')),
|
'bounds': json.dumps(Source.max_bounds(), separators=(',', ':')),
|
||||||
'levels': json.dumps(tuple(levels.values()), separators=(',', ':')),
|
'levels': json.dumps(tuple((level.pk, level.short_label) for level in levels.values()), separators=(',', ':')),
|
||||||
'state': json.dumps(state, separators=(',', ':')),
|
'state': json.dumps(state, separators=(',', ':')),
|
||||||
'tile_cache_server': settings.TILE_CACHE_SERVER,
|
'tile_cache_server': settings.TILE_CACHE_SERVER,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue