refactor models, change map package storage and map package loading
This commit is contained in:
parent
0656090f27
commit
376d85f9b4
12 changed files with 226 additions and 150 deletions
|
@ -1,3 +1,3 @@
|
|||
from django.contrib import admin
|
||||
from django.contrib import admin # noqa
|
||||
|
||||
# Register your models here.
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
from django.db import models
|
||||
from django.db import models # noqa
|
||||
|
||||
# Create your models here.
|
||||
|
|
|
@ -19,9 +19,9 @@ var map = L.map('mapeditor', {
|
|||
});
|
||||
|
||||
// Add Source Layers
|
||||
{% for pkg in packages %}
|
||||
{% for source_list in sources %}
|
||||
L.control.layers([], {
|
||||
{% for source in pkg.sources.all %}
|
||||
{% for source in source_list %}
|
||||
"{{ source.name }}": L.imageOverlay('{% url 'map.source' source=source.name %}', {{ source.jsbounds }}),{% endfor %}
|
||||
}).addTo(map);
|
||||
{% endfor %}
|
||||
|
|
|
@ -19,7 +19,7 @@ def editor(request, level=None):
|
|||
level = get_object_or_404(Level, name=level)
|
||||
return render(request, 'control/editor.html', {
|
||||
'bounds': json.dumps(Source.max_bounds()),
|
||||
'packages': Package.objects.all(),
|
||||
'sources': [p.sources.all().order_by('name') for p in Package.objects.all()],
|
||||
'levels': Level.objects.all(),
|
||||
'current_level': level,
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue