')
+ .appendTo(item);
+
+ map.whenReady(function() {
+ var miniMap = L.map(div[0], {attributionControl: false, zoomControl: false})
+ .addLayer(new layer.constructor());
+
+ miniMap.dragging.disable();
+ miniMap.touchZoom.disable();
+ miniMap.doubleClickZoom.disable();
+ miniMap.scrollWheelZoom.disable();
+
+ $ui
+ .on('show', shown)
+ .on('hide', hide);
+
+ function shown() {
+ miniMap.invalidateSize();
+ setView();
+ map.on('moveend', setView);
+ }
+
+ function hide() {
+ map.off('moveend', setView);
+ }
+
+ function setView() {
+ miniMap.setView(map.getCenter(), Math.max(map.getZoom() - 2, 0));
+ }
+ });
+
+ var label = $('