.attr('class', 'section base-layers')
.appendTo($ui);
- list = $('<ul>')
+ var baseLayers = $('<ul>')
.appendTo(baseSection);
layers.forEach(function(layer) {
var item = $('<li>')
- .appendTo(list);
+ .appendTo(baseLayers);
if (map.hasLayer(layer)) {
item.addClass('active');
map.fire('baselayerchange', {layer: layer});
});
+ item.on('dblclick', toggle);
+
map.on('layeradd layerremove', function() {
item.toggleClass('active', map.hasLayer(layer));
input.prop('checked', map.hasLayer(layer));
.attr("class", "deemphasize")
.appendTo(overlaySection);
- var list = $('<ul>')
+ var overlays = $('<ul>')
.appendTo(overlaySection);
var addOverlay = function (layer, name, maxArea) {
.tooltip({
placement: 'top'
})
- .appendTo(list);
+ .appendTo(overlays);
var label = $('<label>')
.appendTo(item);