!function(e,t){"function"==typeof define&&define.amd?define(["leaflet"],e):"object"==typeof exports&&(module.exports=e(require("leaflet"))),void 0!==t&&t.L&&(t.L.Control.ScaleFactor=e(L),L.control.scalefactor=function(e){return new t.L.Control.ScaleFactor(e)})}(function(e){var t=e.Control.extend({options:{position:"bottomleft",updateWhenIdle:!0},onAdd:function(t){var n="leaflet-control-scalefactor",o=e.DomUtil.create("div",n),i=this.options return this._mScale=e.DomUtil.create("div",n+"-line",o),t.on(i.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),o},onRemove:function(e){e.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_pxTOmm:function(){var e=document.createElement("div") e.style="height:1mm;display:none",e.id="heightRef",document.body.appendChild(e),e=document.getElementById("heightRef") var t=$("#heightRef").height() return e.parentNode.removeChild(e),function(e){return e/t}}(),_update:function(){var e=this._map,t=e.getSize().y/2,n=e.distance(e.containerPointToLatLng([0,t]),e.containerPointToLatLng([100,t])),o=this._pxTOmm(100)/1e3,i=n/o this._mScale.innerHTML="1:"+(""+Math.round(i)).replace(/\B(?=(\d{3})+(?!\d))/g,",")}}) return t},window)