-
Notifications
You must be signed in to change notification settings - Fork 0
/
leaflet-side-by-side.min.js
1 lines (1 loc) · 8.05 KB
/
leaflet-side-by-side.min.js
1
!function e(n,t,i){function r(s,o){if(!t[s]){if(!n[s]){var d="function"==typeof require&&require;if(!o&&d)return d(s,!0);if(a)return a(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var h=t[s]={exports:{}};n[s][0].call(h.exports,function(e){var t=n[s][1][e];return r(t?t:e)},h,h.exports,e,n,t,i)}return t[s].exports}for(var a="function"==typeof require&&require,s=0;s<i.length;s++)r(i[s]);return r}({1:[function(e,n,t){(function(t){function i(e,n,t,i){n.split(" ").forEach(function(n){h.DomEvent.on(e,n,t,i)})}function r(e,n,t,i){n.split(" ").forEach(function(n){h.DomEvent.off(e,n,t,i)})}function a(e){return"oninput"in e?"input":"change"}function s(){u=this._map.dragging.enabled(),p=this._map.tap&&this._map.tap.enabled(),this._map.dragging.disable(),this._map.tap&&this._map.tap.disable()}function o(e){this._refocusOnMap(e),u&&this._map.dragging.enable(),p&&this._map.tap.enable()}function d(e){return"undefined"===e?[]:Array.isArray(e)?e:[e]}function l(){}var h="undefined"!=typeof window?window.L:"undefined"!=typeof t?t.L:null;e("./layout.css"),e("./range.css");var u,p;h.Control.SideBySide=h.Control.extend({options:{thumbSize:42,padding:0},initialize:function(e,n,t){this.setLeftLayers(e),this.setRightLayers(n),h.setOptions(this,t)},getPosition:function(){var e=this._range.value,n=(.5-e)*(2*this.options.padding+this.options.thumbSize);return this._map.getSize().x*e+n},setPosition:l,includes:h.Mixin.Events,addTo:function(e){this.remove(),this._map=e;var n=this._container=h.DomUtil.create("div","leaflet-sbs",e._controlContainer);this._divider=h.DomUtil.create("div","leaflet-sbs-divider",n);var t=this._range=h.DomUtil.create("input","leaflet-sbs-range",n);return t.type="range",t.min=0,t.max=1,t.step="any",t.value=.5,t.style.paddingLeft=t.style.paddingRight=this.options.padding+"px",this._addEvents(),this._updateLayers(),this},remove:function(){return this._map?(this._removeEvents(),h.DomUtil.remove(this._container),this._map=null,this):this},setLeftLayers:function(e){return this._leftLayers=d(e),this._updateLayers(),this},setRightLayers:function(e){return this._rightLayers=d(e),this._updateLayers(),this},_updateClip:function(){var e=this._map,n=e.containerPointToLayerPoint([0,0]),t=e.containerPointToLayerPoint(e.getSize()),i=n.x+this.getPosition(),r=this.getPosition();this._divider.style.left=r+"px",this.fire("dividermove",{x:r});var a="rect("+[n.y,i,t.y,n.x].join("px,")+"px)",s="rect("+[n.y,t.x,t.y,i].join("px,")+"px)";this._leftLayer&&(this._leftLayer.getContainer().style.clip=a),this._rightLayer&&(this._rightLayer.getContainer().style.clip=s)},_updateLayers:function(){if(!this._map)return this;var e=this._leftLayer,n=this._rightLayer;this._leftLayer=this._rightLayer=null,this._leftLayers.forEach(function(e){this._map.hasLayer(e)&&(this._leftLayer=e)},this),this._rightLayers.forEach(function(e){this._map.hasLayer(e)&&(this._rightLayer=e)},this),e!==this._leftLayer&&(e&&this.fire("leftlayerremove",{layer:e}),this._leftLayer&&this.fire("leftlayeradd",{layer:this._leftLayer})),n!==this._rightLayer&&(n&&this.fire("rightlayerremove",{layer:n}),this._rightLayer&&this.fire("rightlayeradd",{layer:this._rightLayer})),this._updateClip()},_addEvents:function(){var e=this._range,n=this._map;n&&e&&(n.on("move",this._updateClip,this),n.on("layeradd layerremove",this._updateLayers,this),i(e,a(e),this._updateClip,this),i(e,"mousedown touchstart",s,this),i(e,"mouseup touchend",o,this))},_removeEvents:function(){var e=this._range,n=this._map;e&&(r(e,a(e),this._updateClip,this),r(e,"mousedown touchstart",s,this),r(e,"mouseup touchend",o,this)),n&&(n.off("layeradd layerremove",this._updateLayers,this),n.off("move",this._updateClip,this))}}),h.control.sideBySide=function(e,n,t){return new h.Control.SideBySide(e,n,t)},n.exports=h.Control.SideBySide}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./layout.css":2,"./range.css":4}],2:[function(e,n,t){var i=".leaflet-sbs-range {\n position: absolute;\n top: 50%;\n width: 100%;\n z-index: 999;\n}\n.leaflet-sbs-divider {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 50%;\n margin-left: -2px;\n width: 4px;\n background-color: #fff;\n pointer-events: none;\n z-index: 999;\n}\n";e("./node_modules/cssify")(i,void 0,"/Users/gregor/Dev/DdDev/leaflet-side-by-side/layout.css"),n.exports=i},{"./node_modules/cssify":3}],3:[function(e,n,t){function i(e,n,t){var i=e.getElementById(n);if(i)t(i);else{var r=e.getElementsByTagName("head")[0];i=e.createElement("style"),i.id=n,t(i),r.appendChild(i)}return i}n.exports=function(e,n,t){var r=n||document;if(r.createStyleSheet){var a=r.createStyleSheet();return a.cssText=e,a.ownerNode}return i(r,t,function(n){n.styleSheet?n.styleSheet.cssText=e:n.innerHTML=e})},n.exports.byUrl=function(e){if(document.createStyleSheet)return document.createStyleSheet(e).ownerNode;var n=document.getElementsByTagName("head")[0],t=document.createElement("link");return t.rel="stylesheet",t.href=e,n.appendChild(t),t}},{}],4:[function(e,n,t){var i='.leaflet-sbs-range {\n -webkit-appearance: none;\n display: inline-block!important;\n vertical-align: middle;\n height: 0;\n padding: 0;\n margin: 0;\n border: 0;\n background: rgba(0, 0, 0, 0.25);\n min-width: 100px;\n cursor: pointer;\n pointer-events: none;\n z-index: 999;\n}\n.leaflet-sbs-range::-ms-fill-upper {\n background: transparent;\n}\n.leaflet-sbs-range::-ms-fill-lower {\n background: rgba(255, 255, 255, 0.25);\n}\n/* Browser thingies */\n\n.leaflet-sbs-range::-moz-range-track {\n opacity: 0;\n}\n.leaflet-sbs-range::-ms-track {\n opacity: 0;\n}\n.leaflet-sbs-range::-ms-tooltip {\n display: none;\n}\n/* For whatever reason, these need to be defined\n * on their own so dont group them */\n\n.leaflet-sbs-range::-webkit-slider-thumb {\n -webkit-appearance: none;\n margin: 0;\n padding: 0;\n background: #fff;\n height: 40px;\n width: 40px;\n border-radius: 20px;\n cursor: ew-resize;\n pointer-events: auto;\n border: 1px solid #ddd;\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAMAAAC5zwKfAAAABlBMVEV9fX3///+Kct39AAAAAnRSTlP/AOW3MEoAAAA9SURBVFjD7dehDQAwDANBZ/+l2wmKoiqR7pHRcaeaCxAIBAL/g7k9JxAIBAKBQCAQCAQC14H+MhAIBE4CD3fOFvGVBzhZAAAAAElFTkSuQmCC");\n background-position: 50% 50%;\n background-repeat: no-repeat;\n background-size: 40px 40px;\n}\n.leaflet-sbs-range::-ms-thumb {\n margin: 0;\n padding: 0;\n background: #fff;\n height: 40px;\n width: 40px;\n border-radius: 20px;\n cursor: ew-resize;\n pointer-events: auto;\n border: 1px solid #ddd;\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAMAAAC5zwKfAAAABlBMVEV9fX3///+Kct39AAAAAnRSTlP/AOW3MEoAAAA9SURBVFjD7dehDQAwDANBZ/+l2wmKoiqR7pHRcaeaCxAIBAL/g7k9JxAIBAKBQCAQCAQC14H+MhAIBE4CD3fOFvGVBzhZAAAAAElFTkSuQmCC");\n background-position: 50% 50%;\n background-repeat: no-repeat;\n background-size: 40px 40px;\n}\n.leaflet-sbs-range::-moz-range-thumb {\n padding: 0;\n right: 0 ;\n background: #fff;\n height: 40px;\n width: 40px;\n border-radius: 20px;\n cursor: ew-resize;\n pointer-events: auto;\n border: 1px solid #ddd;\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAMAAAC5zwKfAAAABlBMVEV9fX3///+Kct39AAAAAnRSTlP/AOW3MEoAAAA9SURBVFjD7dehDQAwDANBZ/+l2wmKoiqR7pHRcaeaCxAIBAL/g7k9JxAIBAKBQCAQCAQC14H+MhAIBE4CD3fOFvGVBzhZAAAAAElFTkSuQmCC");\n background-position: 50% 50%;\n background-repeat: no-repeat;\n background-size: 40px 40px;\n}\n.leaflet-sbs-range:disabled::-moz-range-thumb {\n cursor: default;\n}\n.leaflet-sbs-range:disabled::-ms-thumb {\n cursor: default;\n}\n.leaflet-sbs-range:disabled::-webkit-slider-thumb {\n cursor: default;\n}\n.leaflet-sbs-range:disabled {\n cursor: default;\n}\n.leaflet-sbs-range:focus {\n outline: none!important;\n}\n.leaflet-sbs-range::-moz-focus-outer {\n border: 0;\n}\n\n';e("./node_modules/cssify")(i,void 0,"/Users/gregor/Dev/DdDev/leaflet-side-by-side/range.css"),n.exports=i},{"./node_modules/cssify":3}]},{},[1]);