L.Control.MinZoomIndicator=L.Control.extend({options:{position:"bottomleft"},_layers:{},initialize:function(t){L.Util.setOptions(this,t),this._layers=new Object},_addLayer:function(t){var e=15;t.options.minzoom&&(e=t.options.minzoom),this._layers[t._leaflet_id]=e,this._updateBox(null)},_removeLayer:function(t){this._layers[t._leaflet_id]=null,this._updateBox(null)},_getMinZoomLevel:function(){var t=-1;for(var e in this._layers)null!=this._layers[e]&&this._layers[e]>t&&(t=this._layers[e]);return t},onAdd:function(t){this._map=t,t.zoomIndicator=this;var e=this.className,o=this._container=L.DomUtil.create("div",e);return t.on("moveend",this._updateBox,this),this._updateBox(null),o},onRemove:function(t){L.Control.prototype.onRemove.call(this,t),t.off({moveend:this._updateBox},this),this._map=null},_updateBox:function(t){null!=t&&L.DomEvent.preventDefault(t);var e=this._getMinZoomLevel();this._container.innerHTML=-1==e?this.options.minZoomMessageNoLayer:this.options.minZoomMessage.replace(/CURRENTZOOM/,this._map.getZoom()).replace(/MINZOOMLEVEL/,e),this._container.style.display=this._map.getZoom()>=e?"none":"block"},className:"leaflet-control-minZoomIndicator"}),L.LatLngBounds.prototype.toOverpassBBoxString=function(){var t=this._southWest,e=this._northEast;return[t.lat,t.lng,e.lat,e.lng].join(",")},L.OverPassLayer=L.FeatureGroup.extend({options:{debug:!1,minzoom:15,endpoint:"http://overpass-api.de/api/",query:"(node(BBOX)[organic];node(BBOX)[second_hand];);out qt;",callback:function(t){for(var e=0;e=d;d++)for(var u=r;l>=u;u++){var p=Math.round(1e6*this.tile2long(d,i))/1e6,c=Math.round(1e6*this.tile2long(d+1,i))/1e6,m=Math.round(1e6*this.tile2lat(u,i))/1e6,_=Math.round(1e6*this.tile2lat(u+1,i))/1e6;h.push(new L.LatLngBounds(new L.LatLng(_,p),new L.LatLng(m,c)))}return h},addBBox:function(t,e,o,n){L.polygon([[n,t],[e,t],[e,o],[n,o]]).addTo(this._map)},onMoveEnd:function(){if(this.options.debug&&console.debug("load Pois"),this._map.getZoom()>=this.options.minzoom)for(var t=this._view2BBoxes(this._map.getBounds()._southWest.lng,this._map.getBounds()._southWest.lat,this._map.getBounds()._northEast.lng,this._map.getBounds()._northEast.lat),e=0,o=t.length,n=!0,i=0;i=200&&this.status<400){var t={instance:d};d.options.callback.call(t,JSON.parse(this.response)),d.options.debug&&console.debug("queryCount: "+o+" - finishedCount: "+e),++e==o&&d.options.afterRequest.call(d)}},u.send()}}},onAdd:function(t){this._map=t,t.zoomIndicator?(this._zoomControl=t.zoomIndicator,this._zoomControl._addLayer(this)):(this._zoomControl=new L.Control.MinZoomIndicator(this.options.minZoomIndicatorOptions),t.addControl(this._zoomControl),this._zoomControl._addLayer(this)),this.onMoveEnd(),-1!=this.options.query.indexOf("(BBOX)")&&t.on("moveend",this.onMoveEnd,this),this.options.debug&&console.debug("add layer")},onRemove:function(t){this.options.debug&&console.debug("remove layer"),L.LayerGroup.prototype.onRemove.call(this,t),this._ids={},this._requested={},this._zoomControl._removeLayer(this),t.off({moveend:this.onMoveEnd},this),this._map=null},getData:function(){return this.options.debug&&console.debug(this._data),this._data}});