mapicgc-gl-js 0.0.15-a → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/mapicgc-gl.js +3 -3
- package/dist/mapicgc-gl.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/mapicgc-gl.js
CHANGED
|
@@ -53,9 +53,9 @@ return maplibregl$1;
|
|
|
53
53
|
},{}],3:[function(_dereq_,module,exports){
|
|
54
54
|
"use strict";function _typeof(t){"@babel/helpers - typeof";return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,_toPropertyKey(r.key),r)}}function _createClass(t,e,i){return e&&_defineProperties(t.prototype,e),i&&_defineProperties(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function _toPropertyKey(t){var e=_toPrimitive(t,"string");return"symbol"===_typeof(e)?e:String(e)}function _toPrimitive(t,e){if("object"!==_typeof(t)||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var r=i.call(t,e||"default");if("object"!==_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var Pitch3DToggle=exports.default=function(){function t(){_classCallCheck(this,t),this._bearing=0,this._pitch=60,this._minpitchzoom=null}return _createClass(t,[{key:"onAdd",value:function(t){this._map=t;var e=this;return this._btn=document.createElement("button"),this._btn.className="maplibregl-ctrl-icon maplibregl-ctrl-pitchtoggle-3d",this._btn.id="bt3D",this._btn.type="button",this._btn["aria-label"]="Vista 3D",this._btn.onclick=function(){if(-1!=e._btn.className.indexOf("3d")){var i={pitch:e._pitch,bearing:e._bearing};e._minpitchzoom&&t.getZoom()>e._minpitchzoom&&(i.zoom=e._minpitchzoom);var r=t.getCenter(),n=r.longitude,o=r.latitude;t.getZoom()<10?t.setTerrain({source:"terrainMapZen",exaggeration:1.5}):n>=0&&n<=6&&o>=38.5&&o<=62.33?t.setTerrain({source:"terrainICGC",exaggeration:1.2}):t.setTerrain({source:"terrainMapZen",exaggeration:1.5}),t.easeTo(i),e._btn.className="maplibregl-ctrl-icon maplibregl-ctrl-pitchtoggle-2d"}else t.setTerrain(null),t.easeTo({pitch:0,bearing:0}),e._btn.className="maplibregl-ctrl-icon maplibregl-ctrl-pitchtoggle-3d"},this._container=document.createElement("div"),this._container.className="maplibregl-ctrl maplibregl-ctrl-group",this._container.title="Vista 3D",this._container.appendChild(this._btn),this._container}},{key:"onRemove",value:function(){this._container.parentNode.removeChild(this._container),this._map=void 0}}]),t}();
|
|
55
55
|
},{}],4:[function(_dereq_,module,exports){
|
|
56
|
-
"use strict";function _typeof(e){"@babel/helpers - typeof";return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _defineProperties(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,t,n){return t&&_defineProperties(e.prototype,t),n&&_defineProperties(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"===_typeof(t)?t:String(t)}function _toPrimitive(e,t){if("object"!==_typeof(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!==_typeof(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var CompareMaps=exports.default=_createClass(function e(t,n,o){_classCallCheck(this,e),function e(t,n,o){function i(s,u){if(!n[s]){if(!t[s]){var h="function"==typeof _dereq_&&_dereq_;if(!u&&h)return h(s,!0);if(r)return r(s,!0);throw(u=new Error("Cannot find module '"+s+"'")).code="MODULE_NOT_FOUND",u}h=n[s]={exports:{}},t[s][0].call(h.exports,function(e){return i(t[s][1][e]||e)},h,h.exports,e,t,n,o)}return n[s].exports}for(var r="function"==typeof _dereq_&&_dereq_,s=0;s<o.length;s++)i(o[s]);return i}({1:[function(e,t,n){function o(e,t,n,o){if(this.options=o||{},this._mapA=e,this._mapB=t,this._horizontal="horizontal"===this.options.orientation,this._onDown=this._onDown.bind(this),this._onMove=this._onMove.bind(this),this._onMouseUp=this._onMouseUp.bind(this),this._onTouchEnd=this._onTouchEnd.bind(this),this._ev=new r,this._swiper=document.createElement("div"),this._swiper.className=this._horizontal?"compare-swiper-horizontal":"compare-swiper-vertical",this._controlContainer=document.createElement("div"),this._controlContainer.className=this._horizontal?"maplibregl-compare maplibregl-compare-horizontal":"maplibregl-compare",this._controlContainer.className=this._controlContainer.className,this._controlContainer.appendChild(this._swiper),"string"==typeof n&&document.body.querySelectorAll){if(!(o=document.body.querySelectorAll(n)[0]))throw new Error("Cannot find element with specified container selector.");o.appendChild(this._controlContainer)}else{if(!(n instanceof Element&&n.appendChild))throw new Error("Invalid container specified. Must be CSS selector or HTML element.");n.appendChild(this._controlContainer)}this._bounds=t.getContainer().getBoundingClientRect(),o=(this._horizontal?this._bounds.height:this._bounds.width)/2,this._setPosition(o),this._clearSync=i(e,t),this._onResize=function(){this._bounds=t.getContainer().getBoundingClientRect(),this.currentPosition&&this._setPosition(this.currentPosition)}.bind(this),t.on("resize",this._onResize),this.options&&this.options.mousemove&&(e.getContainer().addEventListener("mousemove",this._onMove),t.getContainer().addEventListener("mousemove",this._onMove)),this._swiper.addEventListener("mousedown",this._onDown),this._swiper.addEventListener("touchstart",this._onDown)}var i=e("@mapbox/mapbox-gl-sync-move"),r=e("events").EventEmitter;o.prototype={_setPointerEvents:function(e){this._controlContainer.style.pointerEvents=e,this._swiper.style.pointerEvents=e},_onDown:function(e){e.touches?(document.addEventListener("touchmove",this._onMove),document.addEventListener("touchend",this._onTouchEnd)):(document.addEventListener("mousemove",this._onMove),document.addEventListener("mouseup",this._onMouseUp))},_setPosition:function(e){e=Math.min(e,this._horizontal?this._bounds.height:this._bounds.width);var t=this._horizontal?"translate(0, "+e+"px)":"translate("+e+"px, 0)",t=(this._controlContainer.style.transform=t,this._controlContainer.style.WebkitTransform=t,this._horizontal?"rect(0, 999em, "+e+"px, 0)":"rect(0, "+e+"px, "+this._bounds.height+"px, 0)"),n=this._horizontal?"rect("+e+"px, 999em, "+this._bounds.height+"px,0)":"rect(0, 999em, "+this._bounds.height+"px,"+e+"px)";this._mapA.getContainer().style.clip=t,this._mapB.getContainer().style.clip=n,this.currentPosition=e},_onMove:function(e){this.options&&this.options.mousemove&&this._setPointerEvents(e.touches?"auto":"none"),this._horizontal?this._setPosition(this._getY(e)):this._setPosition(this._getX(e))},_onMouseUp:function(){document.removeEventListener("mousemove",this._onMove),document.removeEventListener("mouseup",this._onMouseUp),this.fire("slideend",{currentPosition:this.currentPosition})},_onTouchEnd:function(){document.removeEventListener("touchmove",this._onMove),document.removeEventListener("touchend",this._onTouchEnd),this.fire("slideend",{currentPosition:this.currentPosition})},_getX:function(e){return e=(e=e.touches?e.touches[0]:e).clientX-this._bounds.left,e=(e=e<0?0:e)>this._bounds.width?this._bounds.width:e},_getY:function(e){return e=(e=e.touches?e.touches[0]:e).clientY-this._bounds.top,e=(e=e<0?0:e)>this._bounds.height?this._bounds.height:e},setSlider:function(e){this._setPosition(e)},on:function(e,t){return this._ev.on(e,t),this},fire:function(e,t){return this._ev.emit(e,t),this},off:function(e,t){return this._ev.removeListener(e,t),this},remove:function(){this._clearSync(),this._mapB.off("resize",this._onResize);var e=this._mapA.getContainer(),e=(e&&(e.style.clip=null,e.removeEventListener("mousemove",this._onMove)),this._mapB.getContainer());e&&(e.style.clip=null,e.removeEventListener("mousemove",this._onMove)),this._swiper.removeEventListener("mousedown",this._onDown),this._swiper.removeEventListener("touchstart",this._onDown),this._controlContainer.remove()}},window.maplibregl?maplibregl.Compare=o:void 0!==t&&(t.exports=o)},{"@mapbox/mapbox-gl-sync-move":2,events:3}],2:[function(e,t,n){t.exports=function(){function e(){i.forEach(function(e,t){e.on("move",s[t])})}function t(){i.forEach(function(e,t){e.off("move",s[t])})}var n=arguments,o=arguments.length;if(1===o)i=arguments[0];else for(var i=[],r=0;r<o;r++)i.push(n[r]);var s=[];return i.forEach(function(n,o){s[o]=function(n,o){t(),function(e,t){var n=e.getCenter(),o=e.getZoom(),i=e.getBearing(),r=e.getPitch();t.forEach(function(e){e.jumpTo({center:n,zoom:o,bearing:i,pitch:r})})}(n,o),e()}.bind(null,n,i.filter(function(e,t){return t!==o}))}),e(),function(){t(),s=[]}}},{}],3:[function(e,t,n){function o(){o.init.call(this)}function i(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+_typeof(e))}function r(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function s(e,t,n,o){var s,u;return i(n),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,n.listener||n),s=e._events),u=s[t]),void 0===u?(u=s[t]=n,++e._eventsCount):("function"==typeof u?u=s[t]=o?[n,u]:[u,n]:o?u.unshift(n):u.push(n),0<(s=r(e))&&u.length>s&&!u.warned&&(u.warned=!0,(o=new Error("Possible EventEmitter memory leak detected. "+u.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit")).name="MaxListenersExceededWarning",o.emitter=e,o.type=t,o.count=u.length,n=o,console&&console.warn&&console.warn(n))),e}function u(e,t,n){return e={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},t=function(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}.bind(e),t.listener=n,e.wrapFn=t}function h(e,t,n){if(void 0===(e=e._events))return[];if(void 0===(e=e[t]))return[];if("function"==typeof e)return n?[e.listener||e]:[e];if(n){for(var o=e,i=new Array(o.length),r=0;r<i.length;++r)i[r]=o[r].listener||o[r];return i}return f(e,e.length)}function c(e){var t=this._events;if(void 0!==t){if("function"==typeof(t=t[e]))return 1;if(void 0!==t)return t.length}return 0}function f(e,t){for(var n=new Array(t),o=0;o<t;++o)n[o]=e[o];return n}function a(e,t,n,o){if("function"==typeof e.on)o.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+_typeof(e));e.addEventListener(t,function i(r){o.once&&e.removeEventListener(t,i),n(r)})}}var l="object"==("undefined"==typeof Reflect?"undefined":_typeof(Reflect))?Reflect:null,p=l&&"function"==typeof l.apply?l.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},v=l&&"function"==typeof l.ownKeys?l.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)},m=Number.isNaN||function(e){return e!=e};t.exports=o,t.exports.once=function(e,t){return new Promise(function(n,o){function i(n){e.removeListener(t,r),o(n)}function r(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}var s,u,h;a(e,t,r,{once:!0}),"error"!==t&&(u=i,h={once:!0},"function"==typeof(s=e).on&&a(s,"error",u,h))})},(o.EventEmitter=o).prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var d=10;Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return d},set:function(e){if("number"!=typeof e||e<0||m(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");d=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||m(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return r(this)},o.prototype.emit=function(e){for(var t=arguments,n=[],o=1;o<arguments.length;o++)n.push(t[o]);var i="error"===e,r=this._events;if(void 0!==r)i=i&&void 0===r.error;else if(!i)return!1;if(i){if((s=0<n.length?n[0]:s)instanceof Error)throw s;throw i=new Error("Unhandled error."+(s?" ("+s.message+")":"")),i.context=s,i}var s=r[e];if(void 0===s)return!1;if("function"==typeof s)p(s,this,n);else for(var u=s.length,h=f(s,u),o=0;o<u;++o)p(h[o],this,n);return!0},o.prototype.on=o.prototype.addListener=function(e,t){return s(this,e,t,!1)},o.prototype.prependListener=function(e,t){return s(this,e,t,!0)},o.prototype.once=function(e,t){return i(t),this.on(e,u(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return i(t),this.prependListener(e,u(this,e,t)),this},o.prototype.off=o.prototype.removeListener=function(e,t){var n,o,r,s,u;if(i(t),void 0===(o=this._events))return this;if(void 0===(n=o[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete o[e],o.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(r=-1,s=n.length-1;0<=s;s--)if(n[s]===t||n[s].listener===t){u=n[s].listener,r=s;break}if(r<0)return this;if(0===r)n.shift();else{for(var h=n,c=r;c+1<h.length;c++)h[c]=h[c+1];h.pop()}1===n.length&&(o[e]=n[0]),void 0!==o.removeListener&&this.emit("removeListener",e,u||t)}return this},o.prototype.removeAllListeners=function(e){var t,n=this._events;if(void 0===n)return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){for(var o,i=Object.keys(n),r=0;r<i.length;++r)"removeListener"!==(o=i[r])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;0<=r;r--)this.removeListener(e,t[r]);return this},o.prototype.listeners=function(e){return h(this,e,!0)},o.prototype.rawListeners=function(e){return h(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):c.call(e,t)},o.prototype.listenerCount=c,o.prototype.eventNames=function(){return 0<this._eventsCount?v(this._events):[]}},{}]},{},[1])});
|
|
57
|
-
},{}],5:[function(_dereq_,module,exports){
|
|
58
|
-
"use strict";function _typeof(e){"@babel/helpers - typeof";return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function e(t,n,o){function i(s,u){if(!n[s]){if(!t[s]){var h="function"==typeof _dereq_&&_dereq_;if(!u&&h)return h(s,!0);if(r)return r(s,!0);throw(u=new Error("Cannot find module '"+s+"'")).code="MODULE_NOT_FOUND",u}h=n[s]={exports:{}},t[s][0].call(h.exports,function(e){return i(t[s][1][e]||e)},h,h.exports,e,t,n,o)}return n[s].exports}for(var r="function"==typeof _dereq_&&_dereq_,s=0;s<o.length;s++)i(o[s]);return i}({1:[function(e,t,n){function o(e,t,n,o){if(this.options=o||{},this._mapA=e,this._mapB=t,this._horizontal="horizontal"===this.options.orientation,this._onDown=this._onDown.bind(this),this._onMove=this._onMove.bind(this),this._onMouseUp=this._onMouseUp.bind(this),this._onTouchEnd=this._onTouchEnd.bind(this),this._ev=new r,this._swiper=document.createElement("div"),this._swiper.className=this._horizontal?"compare-swiper-horizontal":"compare-swiper-vertical",this._controlContainer=document.createElement("div"),this._controlContainer.className=this._horizontal?"maplibregl-compare maplibregl-compare-horizontal":"maplibregl-compare",this._controlContainer.className=this._controlContainer.className,this._controlContainer.appendChild(this._swiper),"string"==typeof n&&document.body.querySelectorAll){if(!(o=document.body.querySelectorAll(n)[0]))throw new Error("Cannot find element with specified container selector.");o.appendChild(this._controlContainer)}else{if(!(n instanceof Element&&n.appendChild))throw new Error("Invalid container specified. Must be CSS selector or HTML element.");n.appendChild(this._controlContainer)}this._bounds=t.getContainer().getBoundingClientRect(),o=(this._horizontal?this._bounds.height:this._bounds.width)/2,this._setPosition(o),this._clearSync=i(e,t),this._onResize=function(){this._bounds=t.getContainer().getBoundingClientRect(),this.currentPosition&&this._setPosition(this.currentPosition)}.bind(this),t.on("resize",this._onResize),this.options&&this.options.mousemove&&(e.getContainer().addEventListener("mousemove",this._onMove),t.getContainer().addEventListener("mousemove",this._onMove)),this._swiper.addEventListener("mousedown",this._onDown),this._swiper.addEventListener("touchstart",this._onDown)}var i=e("@mapbox/mapbox-gl-sync-move"),r=e("events").EventEmitter;o.prototype={_setPointerEvents:function(e){this._controlContainer.style.pointerEvents=e,this._swiper.style.pointerEvents=e},_onDown:function(e){e.touches?(document.addEventListener("touchmove",this._onMove),document.addEventListener("touchend",this._onTouchEnd)):(document.addEventListener("mousemove",this._onMove),document.addEventListener("mouseup",this._onMouseUp))},_setPosition:function(e){e=Math.min(e,this._horizontal?this._bounds.height:this._bounds.width);var t=this._horizontal?"translate(0, "+e+"px)":"translate("+e+"px, 0)",t=(this._controlContainer.style.transform=t,this._controlContainer.style.WebkitTransform=t,this._horizontal?"rect(0, 999em, "+e+"px, 0)":"rect(0, "+e+"px, "+this._bounds.height+"px, 0)"),n=this._horizontal?"rect("+e+"px, 999em, "+this._bounds.height+"px,0)":"rect(0, 999em, "+this._bounds.height+"px,"+e+"px)";this._mapA.getContainer().style.clip=t,this._mapB.getContainer().style.clip=n,this.currentPosition=e},_onMove:function(e){this.options&&this.options.mousemove&&this._setPointerEvents(e.touches?"auto":"none"),this._horizontal?this._setPosition(this._getY(e)):this._setPosition(this._getX(e))},_onMouseUp:function(){document.removeEventListener("mousemove",this._onMove),document.removeEventListener("mouseup",this._onMouseUp),this.fire("slideend",{currentPosition:this.currentPosition})},_onTouchEnd:function(){document.removeEventListener("touchmove",this._onMove),document.removeEventListener("touchend",this._onTouchEnd),this.fire("slideend",{currentPosition:this.currentPosition})},_getX:function(e){return e=(e=e.touches?e.touches[0]:e).clientX-this._bounds.left,e=(e=e<0?0:e)>this._bounds.width?this._bounds.width:e},_getY:function(e){return e=(e=e.touches?e.touches[0]:e).clientY-this._bounds.top,e=(e=e<0?0:e)>this._bounds.height?this._bounds.height:e},setSlider:function(e){this._setPosition(e)},on:function(e,t){return this._ev.on(e,t),this},fire:function(e,t){return this._ev.emit(e,t),this},off:function(e,t){return this._ev.removeListener(e,t),this},remove:function(){this._clearSync(),this._mapB.off("resize",this._onResize);var e=this._mapA.getContainer(),e=(e&&(e.style.clip=null,e.removeEventListener("mousemove",this._onMove)),this._mapB.getContainer());e&&(e.style.clip=null,e.removeEventListener("mousemove",this._onMove)),this._swiper.removeEventListener("mousedown",this._onDown),this._swiper.removeEventListener("touchstart",this._onDown),this._controlContainer.remove()}},window.maplibregl?maplibregl.Compare=o:void 0!==t&&(t.exports=o)},{"@mapbox/mapbox-gl-sync-move":2,events:3}],2:[function(e,t,n){t.exports=function(){function e(){i.forEach(function(e,t){e.on("move",s[t])})}function t(){i.forEach(function(e,t){e.off("move",s[t])})}var n=arguments,o=arguments.length;if(1===o)i=arguments[0];else for(var i=[],r=0;r<o;r++)i.push(n[r]);var s=[];return i.forEach(function(n,o){s[o]=function(n,o){t(),function(e,t){var n=e.getCenter(),o=e.getZoom(),i=e.getBearing(),r=e.getPitch();t.forEach(function(e){e.jumpTo({center:n,zoom:o,bearing:i,pitch:r})})}(n,o),e()}.bind(null,n,i.filter(function(e,t){return t!==o}))}),e(),function(){t(),s=[]}}},{}],3:[function(e,t,n){function o(){o.init.call(this)}function i(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+_typeof(e))}function r(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function s(e,t,n,o){var s,u;return i(n),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,n.listener||n),s=e._events),u=s[t]),void 0===u?(u=s[t]=n,++e._eventsCount):("function"==typeof u?u=s[t]=o?[n,u]:[u,n]:o?u.unshift(n):u.push(n),0<(s=r(e))&&u.length>s&&!u.warned&&(u.warned=!0,(o=new Error("Possible EventEmitter memory leak detected. "+u.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit")).name="MaxListenersExceededWarning",o.emitter=e,o.type=t,o.count=u.length,n=o,console&&console.warn&&console.warn(n))),e}function u(e,t,n){return e={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},t=function(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}.bind(e),t.listener=n,e.wrapFn=t}function h(e,t,n){if(void 0===(e=e._events))return[];if(void 0===(e=e[t]))return[];if("function"==typeof e)return n?[e.listener||e]:[e];if(n){for(var o=e,i=new Array(o.length),r=0;r<i.length;++r)i[r]=o[r].listener||o[r];return i}return f(e,e.length)}function c(e){var t=this._events;if(void 0!==t){if("function"==typeof(t=t[e]))return 1;if(void 0!==t)return t.length}return 0}function f(e,t){for(var n=new Array(t),o=0;o<t;++o)n[o]=e[o];return n}function a(e,t,n,o){if("function"==typeof e.on)o.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+_typeof(e));e.addEventListener(t,function i(r){o.once&&e.removeEventListener(t,i),n(r)})}}var l="object"==("undefined"==typeof Reflect?"undefined":_typeof(Reflect))?Reflect:null,p=l&&"function"==typeof l.apply?l.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},v=l&&"function"==typeof l.ownKeys?l.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)},m=Number.isNaN||function(e){return e!=e};t.exports=o,t.exports.once=function(e,t){return new Promise(function(n,o){function i(n){e.removeListener(t,r),o(n)}function r(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}var s,u,h;a(e,t,r,{once:!0}),"error"!==t&&(u=i,h={once:!0},"function"==typeof(s=e).on&&a(s,"error",u,h))})},(o.EventEmitter=o).prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var d=10;Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return d},set:function(e){if("number"!=typeof e||e<0||m(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");d=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||m(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return r(this)},o.prototype.emit=function(e){for(var t=arguments,n=[],o=1;o<arguments.length;o++)n.push(t[o]);var i="error"===e,r=this._events;if(void 0!==r)i=i&&void 0===r.error;else if(!i)return!1;if(i){if((s=0<n.length?n[0]:s)instanceof Error)throw s;throw i=new Error("Unhandled error."+(s?" ("+s.message+")":"")),i.context=s,i}var s=r[e];if(void 0===s)return!1;if("function"==typeof s)p(s,this,n);else for(var u=s.length,h=f(s,u),o=0;o<u;++o)p(h[o],this,n);return!0},o.prototype.on=o.prototype.addListener=function(e,t){return s(this,e,t,!1)},o.prototype.prependListener=function(e,t){return s(this,e,t,!0)},o.prototype.once=function(e,t){return i(t),this.on(e,u(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return i(t),this.prependListener(e,u(this,e,t)),this},o.prototype.off=o.prototype.removeListener=function(e,t){var n,o,r,s,u;if(i(t),void 0===(o=this._events))return this;if(void 0===(n=o[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete o[e],o.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(r=-1,s=n.length-1;0<=s;s--)if(n[s]===t||n[s].listener===t){u=n[s].listener,r=s;break}if(r<0)return this;if(0===r)n.shift();else{for(var h=n,c=r;c+1<h.length;c++)h[c]=h[c+1];h.pop()}1===n.length&&(o[e]=n[0]),void 0!==o.removeListener&&this.emit("removeListener",e,u||t)}return this},o.prototype.removeAllListeners=function(e){var t,n=this._events;if(void 0===n)return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){for(var o,i=Object.keys(n),r=0;r<i.length;++r)"removeListener"!==(o=i[r])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;0<=r;r--)this.removeListener(e,t[r]);return this},o.prototype.listeners=function(e){return h(this,e,!0)},o.prototype.rawListeners=function(e){return h(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):c.call(e,t)},o.prototype.listenerCount=c,o.prototype.eventNames=function(){return 0<this._eventsCount?v(this._events):[]}},{}]},{},[1]);
|
|
56
|
+
"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function CompareMaps(e,r,a){(0,_maplibreGlCompare.default)(e,r,a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=CompareMaps;var _maplibreGl=_interopRequireDefault(_dereq_("maplibre-gl")),_maplibreGlCompare=_interopRequireDefault(_dereq_("./maplibre-gl-compare"));
|
|
57
|
+
},{"./maplibre-gl-compare":5,"maplibre-gl":1}],5:[function(_dereq_,module,exports){
|
|
58
|
+
"use strict";function _typeof(e){"@babel/helpers - typeof";return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Compare(e,t,n){!function e(t,n,o){function i(s,u){if(!n[s]){if(!t[s]){var h="function"==typeof _dereq_&&_dereq_;if(!u&&h)return h(s,!0);if(r)return r(s,!0);throw(u=new Error("Cannot find module '"+s+"'")).code="MODULE_NOT_FOUND",u}h=n[s]={exports:{}},t[s][0].call(h.exports,function(e){return i(t[s][1][e]||e)},h,h.exports,e,t,n,o)}return n[s].exports}for(var r="function"==typeof _dereq_&&_dereq_,s=0;s<o.length;s++)i(o[s]);return i}({1:[function(e,t,n){function o(e,t,n,o){if(this.options=o||{},this._mapA=e,this._mapB=t,this._horizontal="horizontal"===this.options.orientation,this._onDown=this._onDown.bind(this),this._onMove=this._onMove.bind(this),this._onMouseUp=this._onMouseUp.bind(this),this._onTouchEnd=this._onTouchEnd.bind(this),this._ev=new r,this._swiper=document.createElement("div"),this._swiper.className=this._horizontal?"compare-swiper-horizontal":"compare-swiper-vertical",this._controlContainer=document.createElement("div"),this._controlContainer.className=this._horizontal?"maplibregl-compare maplibregl-compare-horizontal":"maplibregl-compare",this._controlContainer.className=this._controlContainer.className,this._controlContainer.appendChild(this._swiper),"string"==typeof n&&document.body.querySelectorAll){if(!(o=document.body.querySelectorAll(n)[0]))throw new Error("Cannot find element with specified container selector.");o.appendChild(this._controlContainer)}else{if(!(n instanceof Element&&n.appendChild))throw new Error("Invalid container specified. Must be CSS selector or HTML element.");n.appendChild(this._controlContainer)}this._bounds=t.getContainer().getBoundingClientRect(),o=(this._horizontal?this._bounds.height:this._bounds.width)/2,this._setPosition(o),this._clearSync=i(e,t),this._onResize=function(){this._bounds=t.getContainer().getBoundingClientRect(),this.currentPosition&&this._setPosition(this.currentPosition)}.bind(this),t.on("resize",this._onResize),this.options&&this.options.mousemove&&(e.getContainer().addEventListener("mousemove",this._onMove),t.getContainer().addEventListener("mousemove",this._onMove)),this._swiper.addEventListener("mousedown",this._onDown),this._swiper.addEventListener("touchstart",this._onDown)}var i=e("@mapbox/mapbox-gl-sync-move"),r=e("events").EventEmitter;o.prototype={_setPointerEvents:function(e){this._controlContainer.style.pointerEvents=e,this._swiper.style.pointerEvents=e},_onDown:function(e){e.touches?(document.addEventListener("touchmove",this._onMove),document.addEventListener("touchend",this._onTouchEnd)):(document.addEventListener("mousemove",this._onMove),document.addEventListener("mouseup",this._onMouseUp))},_setPosition:function(e){e=Math.min(e,this._horizontal?this._bounds.height:this._bounds.width);var t=this._horizontal?"translate(0, "+e+"px)":"translate("+e+"px, 0)",t=(this._controlContainer.style.transform=t,this._controlContainer.style.WebkitTransform=t,this._horizontal?"rect(0, 999em, "+e+"px, 0)":"rect(0, "+e+"px, "+this._bounds.height+"px, 0)"),n=this._horizontal?"rect("+e+"px, 999em, "+this._bounds.height+"px,0)":"rect(0, 999em, "+this._bounds.height+"px,"+e+"px)";this._mapA.getContainer().style.clip=t,this._mapB.getContainer().style.clip=n,this.currentPosition=e},_onMove:function(e){this.options&&this.options.mousemove&&this._setPointerEvents(e.touches?"auto":"none"),this._horizontal?this._setPosition(this._getY(e)):this._setPosition(this._getX(e))},_onMouseUp:function(){document.removeEventListener("mousemove",this._onMove),document.removeEventListener("mouseup",this._onMouseUp),this.fire("slideend",{currentPosition:this.currentPosition})},_onTouchEnd:function(){document.removeEventListener("touchmove",this._onMove),document.removeEventListener("touchend",this._onTouchEnd),this.fire("slideend",{currentPosition:this.currentPosition})},_getX:function(e){return e=(e=e.touches?e.touches[0]:e).clientX-this._bounds.left,e=(e=e<0?0:e)>this._bounds.width?this._bounds.width:e},_getY:function(e){return e=(e=e.touches?e.touches[0]:e).clientY-this._bounds.top,e=(e=e<0?0:e)>this._bounds.height?this._bounds.height:e},setSlider:function(e){this._setPosition(e)},on:function(e,t){return this._ev.on(e,t),this},fire:function(e,t){return this._ev.emit(e,t),this},off:function(e,t){return this._ev.removeListener(e,t),this},remove:function(){this._clearSync(),this._mapB.off("resize",this._onResize);var e=this._mapA.getContainer(),e=(e&&(e.style.clip=null,e.removeEventListener("mousemove",this._onMove)),this._mapB.getContainer());e&&(e.style.clip=null,e.removeEventListener("mousemove",this._onMove)),this._swiper.removeEventListener("mousedown",this._onDown),this._swiper.removeEventListener("touchstart",this._onDown),this._controlContainer.remove()}},window.maplibregl?maplibregl.Compare=o:void 0!==t&&(t.exports=o)},{"@mapbox/mapbox-gl-sync-move":2,events:3}],2:[function(e,t,n){t.exports=function(){function e(){i.forEach(function(e,t){e.on("move",s[t])})}function t(){i.forEach(function(e,t){e.off("move",s[t])})}var n=arguments,o=arguments.length;if(1===o)i=arguments[0];else for(var i=[],r=0;r<o;r++)i.push(n[r]);var s=[];return i.forEach(function(n,o){s[o]=function(n,o){t(),function(e,t){var n=e.getCenter(),o=e.getZoom(),i=e.getBearing(),r=e.getPitch();t.forEach(function(e){e.jumpTo({center:n,zoom:o,bearing:i,pitch:r})})}(n,o),e()}.bind(null,n,i.filter(function(e,t){return t!==o}))}),e(),function(){t(),s=[]}}},{}],3:[function(e,t,n){function o(){o.init.call(this)}function i(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+_typeof(e))}function r(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function s(e,t,n,o){var s,u;return i(n),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,n.listener||n),s=e._events),u=s[t]),void 0===u?(u=s[t]=n,++e._eventsCount):("function"==typeof u?u=s[t]=o?[n,u]:[u,n]:o?u.unshift(n):u.push(n),0<(s=r(e))&&u.length>s&&!u.warned&&(u.warned=!0,(o=new Error("Possible EventEmitter memory leak detected. "+u.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit")).name="MaxListenersExceededWarning",o.emitter=e,o.type=t,o.count=u.length,n=o,console&&console.warn&&console.warn(n))),e}function u(e,t,n){return e={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},t=function(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}.bind(e),t.listener=n,e.wrapFn=t}function h(e,t,n){if(void 0===(e=e._events))return[];if(void 0===(e=e[t]))return[];if("function"==typeof e)return n?[e.listener||e]:[e];if(n){for(var o=e,i=new Array(o.length),r=0;r<i.length;++r)i[r]=o[r].listener||o[r];return i}return f(e,e.length)}function c(e){var t=this._events;if(void 0!==t){if("function"==typeof(t=t[e]))return 1;if(void 0!==t)return t.length}return 0}function f(e,t){for(var n=new Array(t),o=0;o<t;++o)n[o]=e[o];return n}function a(e,t,n,o){if("function"==typeof e.on)o.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+_typeof(e));e.addEventListener(t,function i(r){o.once&&e.removeEventListener(t,i),n(r)})}}var l="object"==("undefined"==typeof Reflect?"undefined":_typeof(Reflect))?Reflect:null,p=l&&"function"==typeof l.apply?l.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},v=l&&"function"==typeof l.ownKeys?l.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)},m=Number.isNaN||function(e){return e!=e};t.exports=o,t.exports.once=function(e,t){return new Promise(function(n,o){function i(n){e.removeListener(t,r),o(n)}function r(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}var s,u,h;a(e,t,r,{once:!0}),"error"!==t&&(u=i,h={once:!0},"function"==typeof(s=e).on&&a(s,"error",u,h))})},(o.EventEmitter=o).prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var d=10;Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return d},set:function(e){if("number"!=typeof e||e<0||m(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");d=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||m(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return r(this)},o.prototype.emit=function(e){for(var t=arguments,n=[],o=1;o<arguments.length;o++)n.push(t[o]);var i="error"===e,r=this._events;if(void 0!==r)i=i&&void 0===r.error;else if(!i)return!1;if(i){if((s=0<n.length?n[0]:s)instanceof Error)throw s;throw i=new Error("Unhandled error."+(s?" ("+s.message+")":"")),i.context=s,i}var s=r[e];if(void 0===s)return!1;if("function"==typeof s)p(s,this,n);else for(var u=s.length,h=f(s,u),o=0;o<u;++o)p(h[o],this,n);return!0},o.prototype.on=o.prototype.addListener=function(e,t){return s(this,e,t,!1)},o.prototype.prependListener=function(e,t){return s(this,e,t,!0)},o.prototype.once=function(e,t){return i(t),this.on(e,u(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return i(t),this.prependListener(e,u(this,e,t)),this},o.prototype.off=o.prototype.removeListener=function(e,t){var n,o,r,s,u;if(i(t),void 0===(o=this._events))return this;if(void 0===(n=o[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete o[e],o.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(r=-1,s=n.length-1;0<=s;s--)if(n[s]===t||n[s].listener===t){u=n[s].listener,r=s;break}if(r<0)return this;if(0===r)n.shift();else{for(var h=n,c=r;c+1<h.length;c++)h[c]=h[c+1];h.pop()}1===n.length&&(o[e]=n[0]),void 0!==o.removeListener&&this.emit("removeListener",e,u||t)}return this},o.prototype.removeAllListeners=function(e){var t,n=this._events;if(void 0===n)return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){for(var o,i=Object.keys(n),r=0;r<i.length;++r)"removeListener"!==(o=i[r])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;0<=r;r--)this.removeListener(e,t[r]);return this},o.prototype.listeners=function(e){return h(this,e,!0)},o.prototype.rawListeners=function(e){return h(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):c.call(e,t)},o.prototype.listenerCount=c,o.prototype.eventNames=function(){return 0<this._eventsCount?v(this._events):[]}},{}]},{},[1])}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _default=exports.default=Compare;
|
|
59
59
|
},{}],6:[function(_dereq_,module,exports){
|
|
60
60
|
"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"CompareMaps",{enumerable:!0,get:function(){return _Compare.default}}),Object.defineProperty(exports,"Map",{enumerable:!0,get:function(){return _Map.default}});var _Map=_interopRequireDefault(_dereq_("./map/Map")),_Compare=_interopRequireDefault(_dereq_("./functions/Compare"));
|
|
61
61
|
},{"./functions/Compare":4,"./map/Map":7}],7:[function(_dereq_,module,exports){
|