fix sources in editor

This commit is contained in:
Laura Klünder 2017-05-27 14:28:07 +02:00
parent b90d9ba536
commit e5d97f45cc
2 changed files with 6 additions and 3 deletions

View file

@ -138,6 +138,9 @@ form button.invisiblesubmit {
#map .leaflet-overlay-pane .c3nav-highlight {
cursor:pointer;
}
.leaflet-overlay-pane .leaflet-image-layer {
z-index:201;
}
/* responsiveness */
#responsive_switch {

View file

@ -57,14 +57,14 @@ editor = {
sources: {},
get_sources: function () {
// load sources
editor._sources_control = L.control.layers().addTo(editor.map);
editor._sources_control = L.control.layers([], [], {autoZIndex: true}).addTo(editor.map);
$.getJSON('/api/sources/', function (sources) {
var source;
for (var i = 0; i < sources.length; i++) {
source = sources[i];
editor.sources[source.name] = source;
source.layer = L.imageOverlay('/api/sources/' + source.name + '/image/', source.bounds);
editor.sources[source.id] = source;
source.layer = L.imageOverlay('/api/sources/'+source.id+'/image/', source.bounds, {opacity: 0.3});
editor._sources_control.addOverlay(source.layer, source.name);
}
});