fix showing route with mobileclient
This commit is contained in:
parent
121a952c1f
commit
19bf4d1dd9
3 changed files with 5 additions and 3 deletions
|
@ -95,8 +95,6 @@ c3nav = {
|
||||||
continue_init: function() {
|
continue_init: function() {
|
||||||
c3nav.init_map();
|
c3nav.init_map();
|
||||||
|
|
||||||
c3nav._primary_color = $('.leaflet-control-attribution a:not(:hover)').css('color');
|
|
||||||
|
|
||||||
$('.locationinput').data('location', null);
|
$('.locationinput').data('location', null);
|
||||||
|
|
||||||
var $main = $('main'),
|
var $main = $('main'),
|
||||||
|
@ -106,6 +104,8 @@ c3nav = {
|
||||||
c3nav.last_site_update = JSON.parse($main.attr('data-last-site-update'));
|
c3nav.last_site_update = JSON.parse($main.attr('data-last-site-update'));
|
||||||
c3nav.new_site_update = false;
|
c3nav.new_site_update = false;
|
||||||
|
|
||||||
|
c3nav._primary_color = $main.attr('data-primary-color') || L.polyline([0, 0]).options.color;
|
||||||
|
|
||||||
c3nav.ssids = $main.is('[data-ssids]') ? JSON.parse($main.attr('data-ssids')) : null;
|
c3nav.ssids = $main.is('[data-ssids]') ? JSON.parse($main.attr('data-ssids')) : null;
|
||||||
|
|
||||||
history.replaceState(state, window.location.path);
|
history.replaceState(state, window.location.path);
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<main class="map" data-state="{{ state }}"{% if embed %} data-embed{% endif %} data-last-site-update="{{ last_site_update }}"{% if ssids %} data-ssids="{{ ssids }}"{% endif %}>
|
<main class="map" data-state="{{ state }}"{% if embed %} data-embed{% endif %} data-last-site-update="{{ last_site_update }}"{% if ssids %} data-ssids="{{ ssids }}"{% endif %} data-primary-color="{{ primary_color }}">
|
||||||
{% if not request.mobileclient %}
|
{% if not request.mobileclient %}
|
||||||
<section id="attributions">
|
<section id="attributions">
|
||||||
{% if not embed %}
|
{% if not embed %}
|
||||||
|
|
|
@ -119,12 +119,14 @@ def map_index(request, mode=None, slug=None, slug2=None, details=None, options=N
|
||||||
if not initial_bounds:
|
if not initial_bounds:
|
||||||
initial_bounds = tuple(chain(*Source.max_bounds()))
|
initial_bounds = tuple(chain(*Source.max_bounds()))
|
||||||
|
|
||||||
|
print
|
||||||
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,
|
||||||
|
'primary_color': settings.PRIMARY_COLOR,
|
||||||
'initial_bounds': json.dumps(initial_bounds, separators=(',', ':')) if initial_bounds else None,
|
'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,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue