split layer controls into packages and improve css
This commit is contained in:
parent
4ba139c380
commit
a546d27efa
2 changed files with 13 additions and 5 deletions
|
@ -5,3 +5,10 @@
|
||||||
left:0;
|
left:0;
|
||||||
right:0;
|
right:0;
|
||||||
}
|
}
|
||||||
|
.leaflet-control-layers-overlays label {
|
||||||
|
margin-bottom:0;
|
||||||
|
}
|
||||||
|
.leaflet-control-layers-overlays input[type="checkbox"] {
|
||||||
|
margin: 2px 0 0;
|
||||||
|
top:2px;
|
||||||
|
}
|
||||||
|
|
|
@ -15,11 +15,12 @@ var map = L.map('mapeditor', {
|
||||||
crs: L.CRS.Simple,
|
crs: L.CRS.Simple,
|
||||||
});
|
});
|
||||||
|
|
||||||
layers = {
|
{% for pkg in map.pkgs.values %}
|
||||||
{% for filename, source in map.sources_by_filename.items %}
|
L.control.layers([], {
|
||||||
"{{ source.name }}": L.imageOverlay('{% url 'map.source' filename=filename %}', {{ source.jsbounds }}),{% endfor %}
|
{% for source in pkg.sources %}
|
||||||
}
|
"{{ source.name }}": L.imageOverlay('{% url 'map.source' filename=source.filename %}', {{ source.jsbounds }}),{% endfor %}
|
||||||
L.control.layers([], layers).addTo(map);
|
}).addTo(map);
|
||||||
|
{% endfor %}
|
||||||
L.control.scale({imperial: false}).addTo(map);
|
L.control.scale({imperial: false}).addTo(map);
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue