fengmap.plugin.ui.min.js 37.9 KB
/**Released Version v3.1.5,BUILD 69,Time 1706862864760. Fengmap Javascript SDK , see: https://www.fengmap.com for details**/
!function(t,i){"object"==typeof exports&&"object"==typeof module?module.exports=i():"function"==typeof define&&define.amd?define([],i):"object"==typeof exports?exports.fengmap=i():t.fengmap=i()}(this,function(){return n=[function(V,t,i){"use strict";i.r(t);var o={LEFT_TOP:1,LEFT_BOTTOM:2,RIGHT_TOP:3,RIGHT_BOTTOM:4};function r(t){return(r="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 s(t,i){for(var n=0;n<i.length;n++){var e=i[n];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,function(t){t=function(t,i){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0===n)return("string"===i?String:Number)(t);n=n.call(t,i||"default");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==r(t)?t:String(t)}(e.key),e)}}i=function(){function i(t){if(!(this instanceof i))throw new TypeError("Cannot call a class as a function");t=t||{},this.u=null,this.h=t,void 0===this.h.position&&(this.h.position=o.LEFT_TOP),this.v=null,this.A=null}var t,n,e;return t=i,(n=[{key:"addTo",value:function(t){this.u=t,this.g()}},{key:"remove",value:function(){this.h.contain.removeChild(this.A)}},{key:"on",value:function(t,i){this.A.onclick=function(){i&&i()},this.A.addEventListener("touchend",function(){i&&i()},!1)}},{key:"position",get:function(){return this.h.position},set:function(t){this.h.position=t,this.S(this.h.position,this.h.offset,this.A)}},{key:"offset",get:function(){var t=this.h.offset;return{x:t.x,y:t.y}},set:function(t){this.h.offset=t,this.S(this.h.position,this.h.offset,this.A)}}])&&s(t.prototype,n),e&&s(t,e),Object.defineProperty(t,"prototype",{writable:!1}),i}(),Object.assign(i.prototype,{g:function(){var t=this,i=document.createElement("div"),n=(i.classList.add("fm-compass-container"),void 0!==this.h.backgroundImageSize&&(i.style.width=this.h.backgroundImageSize+"px",i.style.height=this.h.backgroundImageSize+"px"),void 0!==this.h.backgroundImageURL&&(i.style.backgroundImage="url('"+this.h.backgroundImageURL+"')"),void 0===this.h.position&&void 0===this.h.offset||this.S(this.h.position,this.h.offset,i),(this.h.contain||(this.h.contain=this.u.getContainer(),this.u.getContainer())).appendChild(i),-this.u.getRotation());this.v=document.createElement("div"),this.v.classList.add("fm-compass-element"),this.k(n),void 0!==this.h.pointerImageURL&&(this.v.style.backgroundImage="url('"+this.h.pointerImageURL+"')"),void 0!==this.h.pointerImageSize&&(this.v.style.width=this.h.pointerImageSize+"px",this.v.style.height=this.h.pointerImageSize+"px"),i.appendChild(this.v),this.A=i,this.u.on("update",function(){t.O()})},O:function(){var t=-this.u.getRotation();this.k(t)},k:function(t){this.v.style.transform="rotate("+t+"deg)",this.v.style.msTransform="rotate("+t+"deg)",this.v.style.mozTransform="rotate("+t+"deg)",this.v.style.webkitTransform="rotate("+t+"deg)",this.v.style.oTransform="rotate("+t+"deg)"},S:function(t,i,n){n.style.left="",n.style.right="",n.style.top="",n.style.bottom="",t===o.RIGHT_TOP?(n.style.right=-(i=i||{x:-10,y:10}).x+"px",n.style.top=i.y+"px",n.style.bottom="auto",n.style.left="auto"):t===o.LEFT_BOTTOM?(n.style.left=(i=i||{x:10,y:-10}).x+"px",n.style.bottom=-i.y+"px",n.style.top="auto",n.style.right="auto"):t===o.RIGHT_BOTTOM?(n.style.right=-(i=i||{x:-10,y:-10}).x+"px",n.style.bottom=-i.y+"px",n.style.top="auto",n.style.left="auto"):(n.style.left=(i=i||{x:10,y:10}).x+"px",n.style.top=i.y+"px",n.style.bottom="auto",n.style.right="auto")}});function u(t){return(u="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 h(t,i){for(var n=0;n<i.length;n++){var e=i[n];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,function(t){t=function(t,i){if("object"!=u(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0===n)return("string"===i?String:Number)(t);n=n.call(t,i||"default");if("object"!=u(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==u(t)?t:String(t)}(e.key),e)}}var n=function(){function i(t){if(!(this instanceof i))throw new TypeError("Cannot call a class as a function");this.M=t=t||{},this.j=40,void 0!==t.maxWidth&&(this.j=t.minWidth),this.T=100,void 0!==t.maxWidth&&(this.T=t.maxWidth),(this.B=void 0)!==t.height&&(this.B=t.height),(this.C=void 0)!==t.fontSize&&(this.C=t.fontSize),(this.I=void 0)!==t.position&&(this.I=t.position),this.u=null,this.R=null,this.P=[1e7,5e6,2e6,1e6,5e5,2e5,1e5,5e4,25e3,2e4,1e4,5e3,2e3,1e3,500,200,100,50,20,10,5,2,1,.5,.2,.1,.05,.02,.01],this.U=this.U.bind(this)}var t,n,e;return t=i,(n=[{key:"addTo",value:function(t){this.u=t,this.g()}},{key:"remove",value:function(){this.u.off("zoom",this.U),this.u.getContainer().removeChild(this.R)}}])&&h(t.prototype,n),e&&h(t,e),Object.defineProperty(t,"prototype",{writable:!1}),i}();Object.assign(n.prototype,{g:function(){this.R=document.createElement("div"),this.R.classList.add("fm-control-scale-bar-contain"),this.R.style.width=this.j+"px",void 0!==this.B&&(this.R.style.height=this.B+"px"),this.R.style.zIndex=20,void 0===this.I&&void 0===this.M.offset||this.S(this.I,this.M.offset,this.R),this.u.getContainer().appendChild(this.R);var t=document.createElement("div"),t=(t.setAttribute("id","ruleWord"),t.classList.add("fm-control-scale-bar-text"),void 0!==this.C&&(t.style.fontSize=this.C+"px"),this.R.appendChild(t),document.createElement("div")),t=(t.classList.add("fm-control-scale-bar-left1"),this.R.appendChild(t),document.createElement("div")),t=(t.classList.add("fm-control-scale-bar-left2"),this.R.appendChild(t),document.createElement("div")),t=(t.classList.add("fm-control-scale-bar-right1"),this.R.appendChild(t),document.createElement("div")),t=(t.classList.add("fm-control-scale-bar-right2"),this.R.appendChild(t),document.createElement("div")),t=(t.classList.add("fm-control-scale-bar-bottom1"),this.R.appendChild(t),document.createElement("div"));t.classList.add("fm-control-scale-bar-bottom2"),this.R.appendChild(t),this.U(),this.u.on("zoom",this.U)},S:function(t,i,n){switch(n.style.left="",n.style.right="",n.style.top="",n.style.bottom="",t){case o.LEFT_TOP:n.style.left=(i=i||{x:10,y:10}).x+"px",n.style.top=i.y+"px";break;case o.RIGHT_TOP:n.style.right=-(i=i||{x:-10,y:10}).x+"px",n.style.top=i.y+"px";break;case o.LEFT_BOTTOM:n.style.left=(i=i||{x:10,y:-10}).x+"px",n.style.bottom=-i.y+"px";break;case o.RIGHT_BOTTOM:n.style.right=-(i=i||{x:-10,y:-10}).x+"px",n.style.bottom=-i.y+"px";break;default:n.style.left=(i=i||{x:10,y:10}).x+"px",n.style.top=i.y+"px"}},U:function(t){var i={x:document.body.clientWidth/2,y:document.body.clientHeight/2},n={x:i.x+100,y:i.y},i=fengmap.FMUtil.coordsScreenToMap(this.u,i),n=fengmap.FMUtil.coordsScreenToMap(this.u,n),i=Math.sqrt((i.x-n.x)*(i.x-n.x)+(i.y-n.y)*(i.y-n.y))/100,n=this.P[Math.floor(this.u.getZoom())-1],i=(this.R.style.width=n/i+"px",""),i=n<1e3&&1<=n?n+"米":n<1?1e3*n+"毫米":n/1e3+"公里";document.getElementById("ruleWord").innerHTML=i}});function a(t){return(a="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 l(t,i){for(var n=0;n<i.length;n++){var e=i[n];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,function(t){t=function(t,i){if("object"!=a(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0===n)return("string"===i?String:Number)(t);n=n.call(t,i||"default");if("object"!=a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==a(t)?t:String(t)}(e.key),e)}}var c=function(){function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function")}var i,n,e;return i=t,e=[{key:"toColor",value:function(t){var i;return"number"==typeof t?t:3<=(i=t.split(",")).length?parseInt(i[0])<<16|parseInt(i[1])<<8|parseInt(i[2]):(console.error("color format error",t),0)}},{key:"bindEvent",value:function(t,r,i,s){t.addEventListener(i,function(t){var i,n=t||window.event,e=n.target||n.srcElement,o=n.currentTarget;for(Element.prototype.matches||(Element.prototype.matches=Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector||function(t){for(var i=(this.document||this.ownerDocument).querySelectorAll(t),n=i.length;0<=--n&&i.item(n)!==this;);return-1<n});e!==o;)e.matches(r)&&(i=e,s.call(i,n)),e=e.parentNode})}},{key:"scrollTopAnFun",value:function(){var f,d=!1;return function i(n){var e=n.el,t=n.to,o=n.form,r=(n.time,t<o?"up":"bottom"),s=10,u=(o<t?t-o:t==o?0:o-t)/s,h=0,a=function(t){var i=t.val,n=t.nbak,e=t.n,t=t.elTop;return"up"==r?t+(n-e)*i:t-(n-e)*i};function l(){--f<=0?c():window.setTimeout(function(){!1!==f&&((h=a({val:s,nbak:u,n:f,elTop:t,VDIRECTIONE:r}))&&(e.scrollTop=h),l())},s)}var c=function(){f=d=!1,e.scrollTop=0==o?0:o};d?(f=0,window.setTimeout(function(){var t=Object(n,{to:e.scrollTop});d=!1,i(t)},s+1)):(d=!0,f=u,l())}}},{key:"sleep",value:function(t){for(var i=(new Date).getTime(),n=0;n<1e7&&!((new Date).getTime()-i>t);n++);}},{key:"getClikEventName",value:function(){return window.PointerEvent?"pointerdown":"click"}}],(n=null)&&l(i.prototype,n),e&&l(i,e),Object.defineProperty(i,"prototype",{writable:!1}),t}(),D={FMMap_CONTROL_SMALL:"small",FMMap_CONTROL_NORMAL:"normal"};function f(t){return(f="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 e(t,i){for(var n=0;n<i.length;n++){var e=i[n];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,function(t){t=function(t,i){if("object"!=f(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0===n)return("string"===i?String:Number)(t);n=n.call(t,i||"default");if("object"!=f(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==f(t)?t:String(t)}(e.key),e)}}function L(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}var d=L(function t(i){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.size=D.FMMap_CONTROL_NORMAL,this.position=o.LEFT_TOP,this.offset={x:10,y:10},this.imgURL="resource/style/wedgets/img/",this.floorButtonCount=5,this.needAllLayerBtn=!0,Object.assign(this,i)}),v={MODE_3D:2,MODE_2D:4},m=(Object.freeze(v),v);function y(t,i){var n=document.createElement("div"),t='<div class="fm-scroll" id="scroll_'.concat(t+i,'"></div>');return n.innerHTML=t.trim(),n.firstChild}function A(t,i,n){switch(n.style.left="",n.style.right="",n.style.top="",n.style.bottom="",t){case o.LEFT_TOP:n.style.left=i.x+"px",n.style.top=i.y+"px",n.style.bottom="auto",n.style.right="auto";break;case o.RIGHT_TOP:n.style.right=-i.x+"px",n.style.top=i.y+"px",n.style.bottom="auto",n.style.left="auto";break;case o.LEFT_BOTTOM:n.style.left=i.x+"px",n.style.bottom=-i.y+"px",n.style.top="auto",n.style.right="auto";break;case o.RIGHT_BOTTOM:n.style.right=-i.x+"px",n.style.bottom=-i.y+"px",n.style.top="auto",n.style.left="auto";break;default:n.style.left=i.x+"px",n.style.top=i.y+"px",n.style.bottom="auto",n.style.right="auto"}}function b(t,i){t&&i?t.appendChild(i):console.error(t,i)}for(var p=[],g=0;g<256;g++)p[g]=(g<16?"0":"")+g.toString(16);var w={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var t=4294967295*Math.random()|0,i=4294967295*Math.random()|0,n=4294967295*Math.random()|0,e=4294967295*Math.random()|0;return(p[255&t]+p[t>>8&255]+p[t>>16&255]+p[t>>24&255]+"-"+p[255&i]+p[i>>8&255]+"-"+p[i>>16&15|64]+p[i>>24&255]+"-"+p[63&n|128]+p[n>>8&255]+"-"+p[n>>16&255]+p[n>>24&255]+p[255&e]+p[e>>8&255]+p[e>>16&255]+p[e>>24&255]).toUpperCase()},clamp:function(t,i,n){return Math.max(i,Math.min(n,t))},euclideanModulo:function(t,i){return(t%i+i)%i},mapLinear:function(t,i,n,e,o){return e+(t-i)*(o-e)/(n-i)},lerp:function(t,i,n){return(1-n)*t+n*i},smoothstep:function(t,i,n){return t<=i?0:n<=t?1:(t=(t-i)/(n-i))*t*(3-2*t)},smootherstep:function(t,i,n){return t<=i?0:n<=t?1:(t=(t-i)/(n-i))*t*t*(t*(6*t-15)+10)},randInt:function(t,i){return t+Math.floor(Math.random()*(i-t+1))},randFloat:function(t,i){return t+Math.random()*(i-t)},randFloatSpread:function(t){return t*(.5-Math.random())},degToRad:function(t){return t*w.DEG2RAD},radToDeg:function(t){return t*w.RAD2DEG},isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))},setQuaternionFromProperEuler:function(t,i,n,e,o){var r=Math.cos,s=Math.sin,u=r(n/2),n=s(n/2),h=r((i+e)/2),a=s((i+e)/2),l=r((i-e)/2),c=s((i-e)/2),r=r((e-i)/2),s=s((e-i)/2);"XYX"===o?t.set(u*a,n*l,n*c,u*h):"YZY"===o?t.set(n*c,u*a,n*l,u*h):"ZXZ"===o?t.set(n*l,n*c,u*a,u*h):"XZX"===o?t.set(u*a,n*s,n*r,u*h):"YXY"===o?t.set(n*r,u*a,n*s,u*h):"ZYZ"===o?t.set(n*s,n*r,u*a,u*h):console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order.")}},v={BROWSER:0,WX:1},S=(Object.freeze(v),v),k=S.BROWSER;function x(t){return(x="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 O(t,i){for(var n=0;n<i.length;n++){var e=i[n];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,function(t){t=function(t,i){if("object"!=x(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0===n)return("string"===i?String:Number)(t);n=n.call(t,i||"default");if("object"!=x(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==x(t)?t:String(t)}(e.key),e)}}var E,M=function(){function o(t,i){var n=this;if(!(this instanceof o))throw new TypeError("Cannot call a class as a function");this.map=t,this.parent=i.parent;var e=t.getState().viewBuildingID,i=(this.canClick=!0,i.buildingID),t=t.getMapOptions().buildingID,e=(this.enterShow=i&&i!==t&&e===t,i&&e!==t);this.currentFocuseBuiding=i,k===S.BROWSER&&(t=document.querySelector(".fm-enter-exit-building-button-enter"),i=document.querySelector(".fm-enter-exit-building-button-exit"),this.enterShow?t.classList.remove("fm-hide"):e&&i.classList.remove("fm-hide"),t.addEventListener("pointerdown",function(){n.enterBuilding()}),i.addEventListener("pointerdown",function(){n.exitBuilding()}))}var t,i,n;return t=o,(i=[{key:"enterBuilding",value:function(){var t=this,i=this.currentFocuseBuiding,n=this.canClick,e=this.map;null!==i&&!1!==n&&(this.canClick=!1,e.enterBuilding({buildingID:i,finish:function(){t.canClick=!0}}),this.parent.V=i)}},{key:"exitBuilding",value:function(){var t=this,i=this.map;!1!==this.canClick&&(this.canClick=!1,i.exitBuilding({finish:function(){t.canClick=!0}}),this.currentFocuseBuiding=null,this.parent.V=null)}}])&&O(t.prototype,i),n&&O(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(),v={NORMAL:1,INDOOR:2,OUTDOOR:4},j=(Object.freeze(v),v);function T(t){return(T="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 B(t,i){for(var n=0;n<i.length;n++){var e=i[n];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,function(t){t=function(t,i){if("object"!=T(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0===n)return("string"===i?String:Number)(t);n=n.call(t,i||"default");if("object"!=T(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==T(t)?t:String(t)}(e.key),e)}}v=function(){function i(t){if(!(this instanceof i))throw new TypeError("Cannot call a class as a function");this.R=(t=t||{}).contain,this.D=new d(t),this.L=this.D.floorButtonCount,this.u=null,this._=(window&&"undefined"!==window.fengmap?window:getApp().globalData).fengmap,this.N=!1,this.F=!0,this.G=10,this.Z=null,this.Y=null,this.X=[],this.J=null,this.H=null,this.K=null,this.uuid=null,this.W=null,k===S.BROWSER&&(this.scrollTopAn_=new c.scrollTopAnFun),this.viewModeControl=void 0===t.viewModeControl||t.viewModeControl,this.floorModeControl=void 0===t.floorModeControl||t.floorModeControl,this.timer=null,this.q=t.buildingID,this.$=void 0===t.showMap||t.showMap,this.hasDOM=!1,this.enable=!0,this.tt=void 0===t.entranceIcon||t.entranceIcon,this.V=null,this.isFinishViewMode=!0}var t,n,e;return t=i,(n=[{key:"applicationBuilding",value:function(){this.J=this.u.getBuilding(this.q),null!==this.V&&(this.J=this.u.getBuilding(this.V)),0!==this.J.getFloorInfos().length&&(null!=this.J.level?this.W=this.J.level:this.J.setLevel({level:this.W}),this.R||(this.R=this.u.getContainer()),this.X=this.J.getFloorInfos(),k===S.BROWSER?this.createDOM():(this.tt&&(this.enterExitBuildingButton=new M(this.u,{buildingID:this.q,parent:this})),this.handleViewModeChanged()),1<this.J.visibleLevels.length?this.setLayerStatus(!0):this.setLayerStatus(!1))}},{key:"buildingIsInZoomRange",value:function(t){var i=this.u.getZoom(),t=t.zoomRange,n=!0;return n=t&&(i<t.minLevel||i>t.maxLevel)?!1:n}},{key:"findBuilding",value:function(){var i=!1,t=this.u.getState(),n=!1,e=!1,o=this,r=this.u.focusBuilding;return r&&(r.buildingID===t.viewBuildingID||(t=this.buildingIsInZoomRange(r),r.overviewMode!==j.OUTDOOR&&t))?(i=!0,this.q!==r.buildingID&&(e=!0),this.q=r.buildingID,n=!0):s(),!1===i&&(null!==this.q&&(e=!0),this.q=null),{isShowToolbar:n,isBuildingChange:e};function s(){var t;!0===o.$&&(i=!0,t=o.u.getMapOptions().buildingID,o.q!==t&&(e=!0),o.q=t,n=!0)}}},{key:"addTo",value:function(t){((this.u=t).toolBar=this).initEvent(),this.findBuilding().isShowToolbar&&this.applicationBuilding()}},{key:"switchBuilding",value:function(){this.removeDOM(),this.q=null,this.J=null,this.findBuilding().isShowToolbar&&this.applicationBuilding()}},{key:"remove",value:function(){this.removeEvent(),this.removeDOM(),delete this.u.toolBar}},{key:"removeDOM",value:function(){this.Y&&this.R.removeChild(this.Y),this.Y=null,this.hasDOM=!1}},{key:"removeEvent",value:function(){this.u.off("levelChanged",this.gidchange),this.u.off("visibleLevelsLoaded",this.handleLayerChangeStyle),this.u.off("buildingEntered",this.handleBuildingEntered),this.u.off("buildingExited",this.handleBuildingExited),this.u.off("buildingOverviewModeChanged",this.handleBuildingOverviewModeChanged),this.u.off("ViewBuildingChange",this.handleViewBuildingChange),this.u.off("zoom",this.handleCheckZoom),this.u.off("viewModeChanged",this.handleViewModeChanged)}},{key:"initEvent",value:function(){function t(t){var i;!n.enable||!n.J||t.buildingID&&t.buildingID!==n.J.buildingID||!t.buildingID&&n.J.buildingID!==n.u.getMapOptions().buildingID||k!==S.BROWSER||(i=n.J.getFloorInfos().map(function(t){return t.level}),t.level<i[0])||t.level>i[i.length-1]||(n.Z.scrollTop=n.getCenterScrolltopById(t.level,i.length),n.setGidStyleByEvent(t.level,"levelChanged"))}var n=this;this.gidchange=t,this.u.on("levelChanged",t),this.it=function(t){return(n.map?n.map.mapView.container_:document).querySelector(t)},this.handleBuildingEntered=this.handleBuildingEntered.bind(this),this.handleBuildingExited=this.handleBuildingExited.bind(this),this.handleBuildingOverviewModeChanged=this.handleBuildingOverviewModeChanged.bind(this),this.handleLayerChangeStyle=this.handleLayerChangeStyle.bind(this),this.handleViewBuildingChange=this.handleViewBuildingChange.bind(this),this.handleCheckZoom=this.handleCheckZoom.bind(this),this.handleViewModeChanged=this.handleViewModeChanged.bind(this),this.u.on("ViewBuildingChange",this.handleViewBuildingChange),this.u.on("buildingEntered",this.handleBuildingEntered),this.u.on("buildingExited",this.handleBuildingExited),this.u.on("buildingOverviewModeChanged",this.handleBuildingOverviewModeChanged),this.u.on("visibleLevelsLoaded",this.handleLayerChangeStyle),this.u.on("zoom",this.handleCheckZoom),this.u.on("viewModeChanged",this.handleViewModeChanged)}},{key:"handleViewModeChanged",value:function(){this.u.getViewMode()===m.MODE_3D?this.F=!1:this.F=!0,this.setViewModeToStyle(this.H,this.F?"2d":"3d")}},{key:"handleCheckZoom",value:function(){this.findBuilding().isBuildingChange&&this.switchBuilding()}},{key:"createDOM",value:function(){this.hasDOM=!0,this.uuid=w.generateUUID();(i=document.createElement("div")).innerHTML='\n    <div class="fm-control-groups" </div>'.trim();var t,i=i.firstChild,n=(this.Y=i,A(this.D.position,this.D.offset,i),b(this.R,i),this.J.getFloorInfos().map(function(t){return t.level})),e=n.length,o=this.L,r=!0,s=(this.viewModeControl&&(this.H=((t=document.createElement("div")).innerHTML='\n    <div class="fm-view fm-view-3d"></div>'.trim(),t.firstChild),this.initViewModePanelEvent(this.H),b(i,this.H),this.handleViewModeChanged()),(t=document.createElement("div")).innerHTML='\n      <div class="fm-layer">\n        <div class="fm-layer-image-many"> </div>\n      </div>'.trim(),t.firstChild);if(this.D.needAllLayerBtn&&b(i,s),this.nt=s,this.eventSwitchBtn(s),this.handleLayerChangeStyle=this.handleLayerChangeStyle.bind(this),this.floorModeControl){e<=this.L&&(o=e,r=!1);this._layer;this.N&&this._layers,(s=document.createElement("div")).innerHTML='<div class = "fm-floor-list-group" > </div'.trim();var e=s.firstChild,u=(b(i,e),r&&e.appendChild(y("up",this.uuid)),(s=document.createElement("div")).innerHTML='<div class = "fm-floor-list" > </div'.trim(),s.firstChild);b(e,u),this.Z=u;for(var h,a,l,c=this.X.length-1;-1<c;c--)u.appendChild((h=this.X[c],a=this.uuid,l=void 0,l=document.createElement("div"),a='\n    <div class="fm-floor-name-container">\n      <label\n        class="fm-floor-name fm-floor-name-normal"\n        data-gid='.concat(h.level,'\n        id="gid_').concat(h.level+a,'"\n        <span>').concat(h.alias&&h.alias.toUpperCase()||h.name.toUpperCase(),"</span>\n      </label>\n    </div>\n    "),l.innerHTML=a.trim(),l.firstChild)),0<c&&u.appendChild((h=void 0,(h=document.createElement("div")).innerHTML='\n  <hr class="fm-floor-line" />'.trim(),h.firstChild));var s=document.querySelector(".fm-floor-line"),f=0,s=(s&&(f=s.getBoundingClientRect().height),this.et=document.querySelector(".fm-floor-name-container").clientHeight+f,document.querySelector(".fm-floor-list").style.height=this.et*o+"px",r&&e.appendChild(y("down",this.uuid)),u.scrollTop=this.getCenterScrolltopById(this.W,n.length),document.getElementById("gid_"+this.W+this.uuid));null!=s&&(s.classList.remove("fm-floor-name-normal"),s.classList.add("fm-floor-name-active")),this.eventBtnPanelInit(u),this.eventPanelInit(i,u,n),this.tt&&((f=document.createElement("div")).classList.add("fm-enter-exit-building"),f.innerHTML='\n   <div class="fm-enter-exit-building-button fm-enter-exit-building-button-enter fm-hide">\n    </div>\n    <div class="fm-enter-exit-building-button fm-enter-exit-building-button-exit fm-hide">\n    </div>\n  '.trim(),b(i,f),new M(this.u,{buildingID:this.q,parent:this}))}}},{key:"handleLayerChangeStyle",value:function(t){k===S.BROWSER&&!this.hasDOM||!this.J||t.buildingID&&t.buildingID!==this.J.buildingID||(1<this.J.visibleLevels.length?this.setLayerStatus(!0):this.setLayerStatus(!1))}},{key:"eventSwitchBtn",value:function(t){var i,n=this;this.hasDOM&&(i=c.getClikEventName(),t.addEventListener(i,function(){n.hasDOM&&n.toggleLayer()}))}},{key:"setViewModeToStyle",value:function(t,i){k===S.BROWSER&&this.hasDOM&&("2d"==i?(t.classList.remove("fm-view-3d"),t.classList.add("fm-view-2d")):(t.classList.remove("fm-view-2d"),t.classList.add("fm-view-3d")))}},{key:"initViewModePanelEvent",value:function(t){var i=this,n=c.getClikEventName();t.addEventListener(n,function(){i.toggleViewMode()})}},{key:"eventBtnPanelInit",value:function(n){function t(t){o.changeScrollBtnPic();var i=0;t.wheelDelta?i+=-t.wheelDelta:t.detail&&(i+=t.detail),e.scrollTopAn_({el:n,to:n.scrollTop,form:n.scrollTop+i}),t.stopPropagation()}var e=this,o=this;o.changeScrollBtnPic(),c.bindEvent(n,"label","click",function(){var t;!o.enable||o.W===parseInt(this.dataset.gid)||(o.foucusId=parseInt(this.dataset.gid),t=o.J.getFloorInfos().map(function(t){return t.level}),this.dataset.gid<t[0])||this.dataset.gid>t[t.length-1]||(n.scrollTop=o.getCenterScrolltopById(parseInt(this.dataset.gid),t.length),o.setGidStyleByClick(this.dataset.gid,"click"))});n.addEventListener("mousewheel",t,{passive:!0}),n.addEventListener("MozMousePixelScroll",t,!1),n.addEventListener("touchstart",this.touchstart.bind(this),!1),n.addEventListener("touchmove",this.touchmove.bind(this),!1),n.addEventListener("touchend",this.touchend.bind(this),!0)}},{key:"touchstart",value:function(t){t.preventDefault(),this.touchStartPointY=t.touches[0].pageY,this.touchPointX=t.touches[0].pageX,this.touchPointY=t.touches[0].pageY,t.stopPropagation()}},{key:"touchmove",value:function(t){t.preventDefault(),this.touchEndPointX=t.touches[0].pageX,this.touchEndPointY=t.touches[0].pageY,this.handleTouchEnd(t),t.stopPropagation()}},{key:"handleTouchEnd",value:function(t){this.touchAchieve(t,"handleTouchEnd")}},{key:"touchend",value:function(t){this.touchAchieve(t,"touchend")}},{key:"touchAchieve",value:function(t,i){var n=this,e=null,o=(0<(t=t||window.event).changedTouches.length&&(n.touchEndPointX=t.changedTouches[0].pageX,n.touchEndPointY=t.changedTouches[0].pageY),(e=t.target)instanceof HTMLSpanElement==!0&&(e=e.parentElement),n.touchEndPointY-n.touchPointY);"touchend"===i?((o=Math.abs(o))<5&&0<=o&&e&&(i=parseInt(e.dataset.gid),isNaN(i)||(n.foucusId=i,n.setGidStyleByClick(i,"click"))),t.stopPropagation()):0!=(e=-o)&&(n.touchPointX=n.touchEndPointX,n.touchPointY=n.touchEndPointY,i=n.it(".fm-floor-list"),this.scrollTopAn_({el:i,to:i.scrollTop,form:i.scrollTop+e}))}},{key:"eventPanelInit",value:function(t,i,n){var e=this;function o(t){t.id==="scroll_up"+e.uuid?(t=e.W+1,t=Math.min(n[n.length-1],t),e.foucusId!=t&&(e.foucusId=t,e.setGidStyleByClick(t,"click"))):(t=e.W-1,t=Math.max(n[0],t),e.foucusId!=t&&(e.foucusId=t,e.setGidStyleByClick(t,"click")))}t.onselectstart=function(){return!1},t.style.MozUserSelect="none",c.bindEvent(t,".fm-scroll","click",function(t){o(this)}),c.bindEvent(t,".fm-scroll","touchend",function(t){o(this)})}},{key:"getCenterScrolltopById",value:function(t,i){return(i-t-Math.floor(this.L/2))*this.et}},{key:"changeScrollBtnPic",value:function(){var t=this.W,i=this.J.getFloorInfos().map(function(t){return t.level}),n=(i.sort(function(t,i){return t-i}),document.getElementById("scroll_down"+this.uuid)),e=document.getElementById("scroll_up"+this.uuid);t==i[0]&&n?(n.classList.remove("fm-scroll-down"),n.classList.add("fm-scroll-down-grey")):n&&(n.classList.remove("fm-scroll-down-grey"),n.classList.add("fm-scroll-down")),t==i[i.length-1]&&e?(e.classList.remove("fm-scroll-up"),e.classList.add("fm-scroll-up-grey")):e&&(e.classList.remove("fm-scroll-up-grey"),e.classList.add("fm-scroll-up"))}},{key:"changeFocusLevel",value:function(t){this.foucusId=t}},{key:"changeLevelsSelect",value:function(t){this.allLayer=t,this.setLayerStatus(t)}},{key:"setLayerStatus",value:function(t){this.N=t,k===S.BROWSER&&(this.N?(this.nt.firstElementChild.classList.remove("fm-layer-image-one"),this.nt.firstElementChild.classList.add("fm-layer-image-many")):(this.nt.firstElementChild.classList.remove("fm-layer-image-many"),this.nt.firstElementChild.classList.add("fm-layer-image-one")))}},{key:"onChange",value:function(t){E=t}},{key:"foucusId",get:function(){return this.W},set:function(t){var i=this;this.J&&(null!==this.K&&!1===this.ot&&this.K.finish(),this.ot=!1,this.J.setLevel({level:t,finish:function(){i.ot=!0},callback:function(t){i.K=t}}),E)&&E([t])}},{key:"setGidStyleByEvent",value:function(t){this.setGidStyleByClick(t)}},{key:"setGidStyleByClick",value:function(t){var i=document.getElementById("gid_"+this.W+this.uuid);i&&(i.classList.remove("fm-floor-name-active"),i.classList.add("fm-floor-name-normal"),this.W=parseInt(t),(i=document.getElementById("gid_"+t+this.uuid)).classList.remove("fm-floor-name-normal"),i.classList.add("fm-floor-name-active"),this.changeScrollBtnPic())}},{key:"allLayer",get:function(){return this.N},set:function(t){this.J&&((this.N=t)?this.J.setVisibleLevels(this.J.getFloorInfos().map(function(t){return t.level})):this.J.setVisibleLevels([this.J.level]))}},{key:"handleBuildingEntered",value:function(i){var n=this;null!==this.timer&&clearTimeout(this.timer),this.timer=setTimeout(function(){var t;n.switchBuilding(),n.u.followFocus&&(n.J=n.u.getBuilding(i.buildingID),n.J)&&(n.J.overviewMode==j.NORMAL||n.J.overviewMode==j.INDOOR||n.u.focusBuilding&&n.u.focusBuilding.buildingID==n.u.getState().viewBuildingID)&&(t=n.J.level,n.changeFocusLevel(t))},200)}},{key:"handleBuildingExited",value:function(t){var i=this;null!==this.timer&&clearTimeout(this.timer),this.timer=setTimeout(function(){var t;i.switchBuilding(),i.u.followFocus&&(t=i.J,t=null==i.J?i.u.getBuilding(i.u.getMapOptions().buildingID):t)&&(null!==i.K&&!1===i.ot&&i.K.finish(),i.ot=!1,t.setLevel({level:t.level,finish:function(){i.ot=!0},callback:function(t){i.K=t}}))},200)}},{key:"handleBuildingOverviewModeChanged",value:function(){this.switchBuilding()}},{key:"handleViewBuildingChange",value:function(){this.switchBuilding()}},{key:"toggleViewMode",value:function(){var t=this;!1!==this.isFinishViewMode&&(this.isFinishViewMode=!1,this.u.getViewMode()===m.MODE_3D?(this.u.setViewMode({mode:m.MODE_2D,finish:function(){t.isFinishViewMode=!0}}),this.setViewModeToStyle(this.H,"2d")):(this.u.setViewMode({mode:m.MODE_3D,finish:function(){t.isFinishViewMode=!0}}),this.setViewModeToStyle(this.H,"3d")))}},{key:"toggleLayer",value:function(){var t=!this.N;this.changeLevelsSelect(t),this.u.followFocus&&this.J&&(t=this.J.level,-1==this.J.visibleLevels.indexOf(t)&&this.J.visibleLevels.push(t),this.changeFocusLevel(t))}},{key:"setLevel",value:function(t){t<1||t>this.X.length||(this.foucusId=t)}},{key:"enterBuilding",value:function(){this.enterExitBuildingButton.enterBuilding()}},{key:"exitBuilding",value:function(){this.enterExitBuildingButton.exitBuilding()}}])&&B(t.prototype,n),e&&B(t,e),Object.defineProperty(t,"prototype",{writable:!1}),i}();function C(t){return(C="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 _(t,i){for(var n=0;n<i.length;n++){var e=i[n];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,function(t){t=function(t,i){if("object"!=C(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0===n)return("string"===i?String:Number)(t);n=n.call(t,i||"default");if("object"!=C(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==C(t)?t:String(t)}(e.key),e)}}var N=function(){function i(t){if(!(this instanceof i))throw new TypeError("Cannot call a class as a function");t=t||{},this.u=null,this.rt=new d(t),this.rt.position||(this.rt.position=o.LEFT_TOP),this.R=t.contain,this.rt.offset||(this.rt.offset={x:10,y:10}),this.st=null,this.ut=t.imgURL||"resource/style/wedgets/img/"}var t,n,e;return t=i,(n=[{key:"addTo",value:function(t){this.u=t,this.R||(this.R=this.u.getContainer()),this.init()}},{key:"remove",value:function(){this.R.removeChild(this.st)}},{key:"init",value:function(){var t=this.createPanel(),i=(this.st=t,this);A(this.rt.position,this.rt.offset,t),c.bindEvent(t,"img","mouseover",function(t){this.src=this.dataset.on}),c.bindEvent(t,"img","mouseout",function(t){this.src=this.dataset.leave}),c.bindEvent(t,"div","click",function(t){"in"===this.dataset.type?i.u.zoomIn():i.u.zoomOut()}),c.bindEvent(t,"div","touchend",function(t){"in"===this.dataset.type?i.u.zoomIn():i.u.zoomOut()})}},{key:"showZoom",value:function(t){this.st.style.display=t?"block":"none"}},{key:"createPanel",value:function(){var t=document.createElement("div");return t.setAttribute("class","fm-control-zoom-bar"),t.style.left=0,t.style.top=0,this.R.appendChild(t),t.innerHTML=this.createInnerHtml(),t}},{key:"createInnerHtml",value:function(){return'\n            <div data-type="in" class="fm-control-zoom-bar-button fm-control-zoom-button-bar-in"></div>\n            <hr class="fm-control-zoom-bar-hr"/>\n            <div data-type="out" class="fm-control-zoom-bar-button fm-control-zoom-button-bar-out"></div>\n        '}}])&&_(t.prototype,n),e&&_(t,e),Object.defineProperty(t,"prototype",{writable:!1}),i}();function I(t){return(I="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 F(t,i){for(var n=0;n<i.length;n++){var e=i[n];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,function(t){t=function(t,i){if("object"!=I(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0===n)return("string"===i?String:Number)(t);n=n.call(t,i||"default");if("object"!=I(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==I(t)?t:String(t)}(e.key),e)}}function Q(t,i,n){i=P(i);var e=t,i=G()?Reflect.construct(i,n||[],P(t).constructor):i.apply(t,n);if(i&&("object"===I(i)||"function"==typeof i))return i;if(void 0!==i)throw new TypeError("Derived constructors may only return object or undefined");t=e;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function G(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(G=function(){return!!t})()}function R(){return(R="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,i,n){var e=function(t,i){for(;!Object.prototype.hasOwnProperty.call(t,i)&&null!==(t=P(t)););return t}(t,i);if(e)return(e=Object.getOwnPropertyDescriptor(e,i)).get?e.get.call(arguments.length<3?t:n):e.value}).apply(this,arguments)}function P(t){return(P=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Z(t,i){return(Z=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,i){return t.__proto__=i,t})(t,i)}var Y=function(){var t,i=e,n=N;if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");function e(t){if(this instanceof e)return Q(this,e,[t]);throw new TypeError("Cannot call a class as a function")}return i.prototype=Object.create(n&&n.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),n&&Z(i,n),i=e,(n=[{key:"addTo",value:function(t){R(P(e.prototype),"addTo",this).call(this,t)}},{key:"remove",value:function(){R(P(e.prototype),"remove",this).call(this)}},{key:"showZoom",value:function(t){R(P(e.prototype),"showZoom",this).call(this,t)}},{key:"createPanel",value:function(){var t=document.createElement("div");t.setAttribute("class","fm-control-zoom"),t.style.zIndex=20,t.style.position="absolute",t.style.backgroundColor="white",t.style.boxShadow="2px 2px 3px rgba(0,0,0, 0.3)",t.style.borderRadius="2px",t.style.left=0,t.style.top=0,this.R.appendChild(t);return t.innerHTML=this.createInnerHtml("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOAgMAAABiJsVCAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACVBMVEUAAABmZmYAAABV8S+1AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAATSURBVAjXY2DAC0JDQwMgBF4AAFvvAp8tw46tAAAAAElFTkSuQmCC","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAIElEQVQokWNgGAXUB4zGsrL/ydHIwsDAcI/KjhkFZAMA5XkCUOIdNxMAAAAASUVORK5CYII=","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOAgMAAABiJsVCAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACVBMVEUAAABmZmYAAABV8S+1AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAXSURBVAjXY2BgZQACXERoaGgAhMCrDgBkQQLbnsbDyQAAAABJRU5ErkJggg==","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAOElEQVQokWM0lpVlwAE+QGkBbJJMuHQRAiNBIwsDA8M7HHJ8UBqrPEU2CuGQg8UjVvkhFKr01wgAH8cEixbYBa8AAAAASUVORK5CYII="),t}},{key:"createInnerHtml",value:function(t,i,n,e){return'\n\n            <div data-type="in" style="padding: 14px; cursor: pointer;">\n            <img src='.concat(n," data-leave=").concat(n," data-on=").concat(e,' style="width: 14px; height: 14px;"/>\n             </div>\n            <hr style="height: 1px; border-top: 1px solid rgba(153, 153, 153, 0.45); border-right: none; border-bottom: none; border-left: none; border-image: initial; width: 60%; margin: 0px 20%;">\n            <div data-type="out" style="padding: 14px; cursor: pointer;">\n            <img src=').concat(t," data-leave=").concat(t," data-on=").concat(i,' style="width: 14px; height: 14px;"/>\n            </div>\n        ')}}])&&F(i.prototype,n),t&&F(i,t),Object.defineProperty(i,"prototype",{writable:!1}),e}(),U=window.fengmap||{};U.FMCompass=i,U.FMControlPosition=o,U.FMScaleBar=n,U.FMToolbar=v,U.FMZoomBar=N,U.FMZoomControl=Y,t.default=U}],e={},o.m=n,o.c=e,o.d=function(t,i,n){o.o(t,i)||Object.defineProperty(t,i,{enumerable:!0,get:n})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"ht",{value:!0})},o.t=function(i,t){if(1&t&&(i=o(i)),8&t)return i;if(4&t&&"object"==typeof i&&i&&i.ht)return i;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:i}),2&t&&"string"!=typeof i)for(var e in i)o.d(n,e,function(t){return i[t]}.bind(null,e));return n},o.n=function(t){var i=t&&t.ht?function(){return t.default}:function(){return t};return o.d(i,"a",i),i},o.o=function(t,i){return Object.prototype.hasOwnProperty.call(t,i)},o.p="",o(o.s=0).default;function o(t){var i;return(e[t]||(i=e[t]={i:t,l:!1,exports:{}},n[t].call(i.exports,i,i.exports,o),i.l=!0,i)).exports}var n,e});