diff --git a/src/c3nav/control/static/control/control.css b/src/c3nav/control/static/control/control.css index 2f7fd449..cfe15f30 100644 --- a/src/c3nav/control/static/control/control.css +++ b/src/c3nav/control/static/control/control.css @@ -5,3 +5,10 @@ left:0; right:0; } +.leaflet-control-layers-overlays label { + margin-bottom:0; +} +.leaflet-control-layers-overlays input[type="checkbox"] { + margin: 2px 0 0; + top:2px; +} diff --git a/src/c3nav/control/templates/control/editor.html b/src/c3nav/control/templates/control/editor.html index 09014b81..fd0940b6 100644 --- a/src/c3nav/control/templates/control/editor.html +++ b/src/c3nav/control/templates/control/editor.html @@ -15,11 +15,12 @@ var map = L.map('mapeditor', { crs: L.CRS.Simple, }); -layers = { -{% for filename, source in map.sources_by_filename.items %} - "{{ source.name }}": L.imageOverlay('{% url 'map.source' filename=filename %}', {{ source.jsbounds }}),{% endfor %} -} -L.control.layers([], layers).addTo(map); +{% for pkg in map.pkgs.values %} +L.control.layers([], { + {% for source in pkg.sources %} + "{{ source.name }}": L.imageOverlay('{% url 'map.source' filename=source.filename %}', {{ source.jsbounds }}),{% endfor %} +}).addTo(map); +{% endfor %} L.control.scale({imperial: false}).addTo(map);