﻿_jsload&&_jsload('oppc', 'function c3(){this._currentState="idle";this._currentTouchCount=0;this._firstPointerId=-1;this._secondPointerId=-1}c3.prototype.takeAction=function(e,i){if(this["_on"+e]){this["_on"+e](i)}return this.getState()};c3.prototype._onmousedown=function(e){if(this._currentTouchCount===0){this._firstPointerId=e}else{if(this._currentTouchCount===1){this._secondPointerId=e}}this._currentTouchCount++;if(this._currentState==="idle"){this._currentState="readyToDrag"}else{if(this._currentState==="dragging"||this._currentState==="readyToDrag"){this._currentState="readyToPinch"}else{if(this._currentState==="pinching"){this._currentState="freeze"}else{this._currentState="freeze"}}}};c3.prototype._onmousemove=function(){if(this._currentState==="readyToDrag"||this._currentState==="dragging"){this._currentState="dragging"}else{if(this._currentState==="readyToPinch"){this._currentState="pinching"}}};c3.prototype._onmouseup=function(e){if(this._currentState==="idle"){return}this._currentTouchCount--;if(this._currentState==="readyToDrag"||this._currentState==="dragging"){this._currentState="idle";this._firstPointerId=-1;this._secondPointerId=-1}else{if(this._currentState==="readyToPinch"||this._currentState==="pinching"){this._clearId(e);this._currentState="freeze"}else{if(this._currentState==="freeze"){if(this._currentTouchCount===0){this._currentState="idle";this._firstPointerId=-1;this._secondPointerId=-1;return}if(this._currentTouchCount===2){if(e!==this._firstPointerId&&e!==this._secondPointerId){this._currentState="pinching"}}if(e===this._firstPointerId||e===this._secondPointerId){this._clearId(e);this._currentState="freeze"}}}}};c3.prototype._ongesturestart=function(){if(window.TouchEvent||!window.GestureEvent){return}if(this._currentState==="idle"||this._currentState==="readyToDrag"){this._currentState="readyToPinch"}};c3.prototype._ongesturechange=function(){if(window.TouchEvent||!window.GestureEvent){return}if(this._currentState==="readyToPinch"){this._currentState="pinching"}};c3.prototype._ongestureend=function(){if(window.TouchEvent||!window.GestureEvent){return}if(this._currentState==="readyToPinch"||this._currentState==="pinching"||this._currentState==="freeze"){this._currentState="idle"}};c3.prototype.getState=function(){return ct[this._currentState]||0};c3.prototype.reset=function(){this._currentState="idle";this._currentTouchCount=0;this._firstPointerId=-1;this._secondPointerId=-1};c3.prototype._clearId=function(e){if(e===this._firstPointerId){this._firstPointerId=-1}else{if(e===this._secondPointerId){this._secondPointerId=-1}}};c3.prototype.setState=function(e){this._currentState=e};aG.register(function(e){if(e._mouse){return}e._mouse=new eR(e);if(!e._mouse._drag){e._mouse=null}if(e._renderType==="webgl"){e.addEventListener("dblclick",function(i){if(this.config.enableDblclickZoom){this.zoomIn(i.point)}});e.addEventListener("rightdblclick",function(i){if(this.config.enableDblclickZoom){this.zoomOut(i.point)}});e.addEventListener("minuspress",function(i){if(this.config.enableKeyboard){this.zoomOut()}});e.addEventListener("pluspress",function(i){if(this.config.enableKeyboard){this.zoomIn()}})}});function ae(fd,fc){var i={};i.id=fd.pointerId||0;i.clientPos={x:fd.clientX||fd.pageX||0,y:fd.clientY||fd.pageY||0};i.offsetPos={x:fd.layerX||fd.offsetX||0,y:fd.layerY||fd.offsetY||0};i.target=fd.target;i.button=fd.button||0;i.ctrlKey=fd.ctrlKey||false;i.metaKey=fd.metaKey||false;var fe=ci(i,fc);x.extend(i,fe);i.offsetPosMap=new cJ(fe.x,fe.y);i.timeStamp=fd.timeStamp;i.domEvent=fd;if(fd.type&&fd.type.indexOf("wheel")>-1){i.wheelDelta=fd.wheelDelta;i.detail=fd.detail;i.deltaX=fd.deltaX;i.deltaY=fd.deltaY;i.deltaMode=fd.deltaMode}i.offsetX=i.offsetPosMap.x;i.offsetY=i.offsetPosMap.y;i.layerX=fd.layerX;i.layerY=fd.layerY;return i}function ci(i,e){var fd=i.target;var fi=i.clientPos.x;var fh=i.clientPos.y;var fg=null;var ff=null;if(fd.nodeType!==1){fd=fd.parentNode}var fe=e.getContainer();var fc=fe;while(fc){fi-=fc.offsetLeft;fh-=fc.offsetTop;fc=fc.offsetParent}if(typeof window.scrollY==="number"){fh+=window.scrollY}while(fd&&fd!==fe){if(fd.hashCode){if(x.instance(fd.hashCode) instanceof bH){fg=x.instance(fd.hashCode)}if(x.instance(fd.hashCode) instanceof V||x.instance(fd.hashCode) instanceof e5){ff=x.instance(fd.hashCode)}}fd=fd.parentNode}return{x:fi,y:fh,overlay:fg,infoWindow:ff,pixel:new cJ(fi,fh),point:e.pixelToPoint(new cJ(fi,fh))}}function ea(fe,fd){var ff=fe.changedTouches[0];var i=fe.changedTouches.length;var fc={target:fe.target,timeStamp:fe.timeStamp,ctrlKey:fe.ctrlKey||false,webkitForce:fe.webkitForce,metaKey:fe.metaKey||false,touchesCount:fe.touches.length,targetTouchesCount:fe.targetTouches.length};if(fe.changedTouches){fc.changedTouchesCount=fe.changedTouches.length}else{fc.changedTouchesCount=1}c0(ff,fc,fd);if(i>1){fc.secondTouchInfo={};x.extend(fc.secondTouchInfo,fc);c0(fe.changedTouches[1],fc.secondTouchInfo,fd)}return fc}function c0(ff,fg,e){if(!ff){return}var fi=ff.clientX;var fh=ff.clientY;fg.id=ff.identifier||0;fg.clientPos={x:fi,y:fh};var fd=0;var fc=0;var i=e.container;while(i.offsetParent){fd+=i.offsetLeft;fc+=i.offsetTop;i=i.offsetParent}fg.offsetPos={x:fi-fd,y:fh-fc};fg.button=0;fg.offsetPosMap=new cJ(fg.offsetPos.x,fg.offsetPos.y);var fe=ci(fg,e);x.extend(fg,fe)}function w(fh,fg){var i=fh.clientX;var fi=fh.clientY;if(typeof window.scrollY==="number"){fi+=window.scrollY}var ff={};ff.id=0;ff.clientPos={x:i,y:fi};ff.target=fh.target;var fd=0;var fc=0;var fe=fg.container;while(fe.offsetParent){fd+=fe.offsetLeft;fc+=fe.offsetTop;fe=fe.offsetParent}ff.offsetPos={x:i-fd,y:fi-fc};ff.timeStamp=fh.timeStamp;ff.offsetPosMap=new cJ(ff.offsetPos.x,ff.offsetPos.y);ff.scale=fh.scale;ff.rotation=fh.rotation;return ff}function eR(e){this._map=e;if(e._renderType==="webgl"){this._drag=new bh(e)}else{if(typeof eF==="undefined"){return}this._drag=new eF(e)}this._earthDrag=null;this._earthWheel=null;this._dragStarted=false;this._touchStarted=false;this._waitForSecondTouch=false;this._firstTouchInfo={};this._secondTouchInfo={};this._currentTouchCount=0;this._prevGestureScale=1;this._useGesture=!!((dZ()&&window.GestureEvent)||(!window.TouchEvent&&window.GestureEvent));this._opButton=-1;this._rotationFix=0;this._pinchRotationThreshold=20;this._pinchZoomThreshold=0.2;this._gestureStatus={zoom:false,rotate:false,tilt:false,dragZoom:false};this._diffX=0;this._diffY=0;this._enableRightDrag=true;if(typeof navigator.userAgent==="string"&&navigator.userAgent.indexOf("QQBrowser")>0){this._enableRightDrag=false}this._lastWheelTime=new Date();this._isModernBrowser=e.config.isModernBrowser;if(e.getRenderType()==="webgl"){e.deepZoom=new W(e)}else{if(this._isModernBrowser){e.deepZoom=new aT(e)}}this._stateMachine=new c3();this._init();this._bind();if(this._useGesture){this._bindGesture()}this._bindRightButton();this._bindMouseWheel();this._operationVelocity=0;this._lastDiffDistance=0;this._zoomVelocity=0;this._lastDiffZoom=0;this._rotationVelocity=0;this._initRotation=0;this._trackVelocityTimer=null;this._trackTimeStamp=0;this._lastDragPoint={x:0,y:0};this._penultimateDragPoint={x:0,y:0};this._touchInMap=false}eR.prototype._init=function(){this._supportPointerEvent=(window.PointerEvent||window.MSPointerEvent)&&(navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0);var e={mousedown:"mousedown",mousemove:"mousemove",mouseup:"mouseup"};if(this._supportPointerEvent){if(window.PointerEvent){e.mousedown="pointerdown";e.mousemove="pointermove";e.mouseup="pointerup"}else{if(window.MSPointerEvent){e.mousedown="MSPointerDown";e.mousemove="MSPointerMove";e.mouseup="MSPointerUp"}}}this._eventMapping=e};eR.prototype._bind=function(){var fe=this._map;var fc=fe.temp;var i=this._eventMapping;var fd=this;var e=fe.platform;x.on(e,i.mousedown,function(fg){if(dZ()){return}fd._mousedown=true;var ff=ae(fg,fe);fd._mouseButton=fg.button;fe.dispatchEvent(x.extend(new az("onmousedown"),ff));fd._processMouseDown(ff)});x.on(e,"touchstart",function(fg){if(fd._mousedown===true){return}fd._touchStarted=true;var ff=ea(fg,fe);fd._processMouseDown(ff);fd._touchInMap=true});x.on(document,i.mousemove,function(fg){if(fd._touchStarted){return}var ff=ae(fg,fe);ff.button=fd._mouseButton;if(fe.currentOperation===ct.idle){fe.dispatchEvent(x.extend(new az("onmousemove"),ff))}fd._processMouseMove(ff)});if(dZ()){fe.getContainer().addEventListener("touchmove",function(ff){ff.preventDefault()},false)}x.on(document,"touchmove",function(ff){if(!fd._touchInMap){return}fd._processMouseMove(ea(ff,fe))});x.on(document,i.mouseup,function(ff){if(fd._touchStarted){return}fd._mousedown=false;fd._processMouseUp(ae(ff,fe))});x.on(document,"touchend",function(fj){if(!fd._touchInMap){return}if(!fd._firstTouchInfo||!fd._firstTouchInfo.offsetPos){fd._processMouseUp(ae(fj,fe));return}if(fj.targetTouches.length===0){var fh=Math.abs(fd._diffX)>5||Math.abs(fd._diffY)>5;fd._touchStarted=false;if(!fd._twoFingerTouched&&!fh){var ff=new az("onclick");x.extend(ff,fd._firstTouchInfo);ff.icon=fe.getIconByClickPosition(fd._firstTouchInfo.offsetPos);fe.dispatchEvent(ff);if(fd._waitForSecondTouch===false){fd._waitForSecondTouch=true;fd._firstTouchPos={x:fd._firstTouchInfo.offsetPos.x,y:fd._firstTouchInfo.offsetPos.y};fd._doubleTouchTimer=setTimeout(function fg(){fd._waitForSecondTouch=false;fd._doubleTouchTimer=null},fe.config.clickInterval)}else{if(Math.abs(fd._firstTouchInfo.offsetPos.x-fd._firstTouchPos.x)<20&&Math.abs(fd._firstTouchInfo.offsetPos.y-fd._firstTouchPos.y)<20){var fi=new az("ondblclick");x.extend(fi,fd._firstTouchInfo);fe.dispatchEvent(fi)}fd._waitForSecondTouch=false;clearTimeout(fd._doubleTouchTimer);fd._doubleTouchTimer=null}}fd._twoFingerTouched=false;fd._touchInMap=false}fd._processMouseUp(ea(fj,fe))});x.on(e,"click",function(fi){if(window.TouchEvent&&dZ()){return}if(fe.getLock()===true){return}if(fe.currentOperation===ct.idle){var fh=fd._diffX===0&&fd._diffY===0;var fg=ae(fi,fe);if(fh){var ff=new az("onclick");x.extend(ff,fg);ff.icon=fe.getIconByClickPosition(ff.offsetPosMap);fe.dispatchEvent(ff)}if(!fc._clickTimer){fc._clickTimer=setTimeout(function(){fc._clickTimer=null;if(fh){var fj=new az("onclickex");x.extend(fj,fg);fe.dispatchEvent(fj)}},fe.config.clickInterval)}}fd._diffX=0;fd._diffY=0});fe.container.onselectstart=function(){return false};x.on(fe.container,"contextmenu",function(ff){ff.cancelBubble=true;a4(ff)});x.on(e,"dblclick",function(ff){if(fe.getLock()===true){return}if(fe.currentOperation===ct.idle){if(x.Browser.ie){fe.dispatchEvent(x.extend(new az("onclick"),ae(ff,fe)))}if(fc._clickTimer){clearTimeout(fc._clickTimer);fc._clickTimer=null}fe.dispatchEvent(x.extend(new az("ondblclick"),ae(ff,fe)))}});x.on(document,"mousedown",function(fg){fg=window.event||fg;var ff=fg.srcElement||fg.target;if(fc.canKeyboard){fc.canKeyboard=fe.container.contains(ff)}else{fc.canKeyboard=e.contains(ff)}});x.on(e,"webkitmouseforcedown",function(ff){fe.dispatchEvent(x.extend(new az("onforcedown"),ae(ff,fe)))});x.on(e,"webkitmouseforceup",function(ff){fe.dispatchEvent(x.extend(new az("onforceup"),ae(ff,fe)))})};eR.prototype._bindGesture=function(){var e=this;var i=this._map;x.on(i.platform,"gesturestart",function(fd){i.currentOperation=e._stateMachine.takeAction("gesturestart");var fc=w(fd,i);e._gestureStartTime=fc.timeStamp;if(fc.rotation<-160){e._rotationFix=180}else{if(fc.rotation>160){e._rotationFix=-180}else{e._rotationFix=0}}e._pinchStartPosition=fc.offsetPosMap;e._getCurrentDrag().onReadyToPinch(fd,{initMiddlePoint:fc.offsetPosMap,pinchStartPosition:e._pinchStartPosition,zoomRatio:1});fd.preventDefault()});x.on(document,"gesturechange",function(ff){if(i.currentOperation!==ct.readyToPinch&&i.currentOperation!==ct.pinching){return}i.currentOperation=e._stateMachine.takeAction("gesturechange");if(i.currentOperation!==ct.pinching){return}var fe=w(ff,i);if(isNaN(fe.scale)){fe.scale=e._prevGestureScale}else{e._prevGestureScale=fe.scale}fe.rotation+=e._rotationFix;var fc=fe.offsetPosMap;e._pinchingPosition=fc;e._diffX=fc.x-e._pinchStartPosition.x;e._diffY=fc.y-e._pinchStartPosition.y;var fd=e._getPinchParam(fe);if(!fd){ff.preventDefault();return}e._getCurrentDrag().onPinching(ff,{pinchStartPosition:e._pinchStartPosition,pinchingPosition:fc,pinchingDistance:fd.pinchingDistance,zoomRatio:fd.zoomRatio,angleDiff:fd.rotation,gestureStatus:e._gestureStatus});ff.preventDefault()});x.on(document,"gestureend",function(fe){if(i.currentOperation!==ct.readyToPinch&&i.currentOperation!==ct.pinching){return}var fd=w(fe,i);if(isNaN(fd.scale)){fd.scale=e._prevGestureScale}else{e._prevGestureScale=fd.scale}var fc=e._pinchParam||{};e._getCurrentDrag().onPinchEnd(fe,{pinchStartPosition:e._pinchStartPosition,pinchEndPosition:e._pinchingPosition,zoomRatio:fc.zoomRatio,angleDiff:fc.rotation,gestureStatus:e._gestureStatus});e._resetGestureParam();i.currentOperation=e._stateMachine.takeAction("gestureend");fe.preventDefault()})};eR.prototype._getPinchParam=function(fd){var fi=fd.scale;var fk=fd.rotation;var fe=fd.offsetPosMap;var fh=fe.x-this._pinchStartPosition.x;var ff=fe.y-this._pinchStartPosition.y;var fc={x:fh,y:ff};var fj=fd.timeStamp-this._gestureStartTime;if(fj<100){return null}var i=this._gestureStatus;if(!this._gestureDetected){this._gestureDetected=true;if(Math.abs(fh)<10&&Math.abs(ff)>10&&Math.abs(fi-1)<0.1&&fk<10){i.tilt=true}}var fg=0;if(!i.tilt&&!i.rotate){if(Math.abs(fk)>this._pinchRotationThreshold){this._initRotation=fk;if(fk>0){fg=fk-this._pinchRotationThreshold}else{fg=fk+this._pinchRotationThreshold}i.rotate=true}else{fk=0}}if(i.rotate&&this._initRotation){fg+=fk-this._initRotation}var e=fi;if(i.tilt){e=1}this._pinchParam={zoomRatio:e,rotation:fg,pinchingDistance:fc};return this._pinchParam};eR.prototype._resetGestureParam=function(){this._initRotation=0;this._gestureStatus.zoom=false;this._gestureStatus.rotate=false;this._gestureStatus.tilt=false;this._gestureStatus.dragZoom=false;this._gestureDetected=false;this._pinchParam=null;this._gestureStartTime=null};eR.prototype._bindRightButton=function(){var i=this._map;var e=this;x.on(i.container,this._eventMapping.mouseup,function(fc){if(i.mapType===BMAP_EARTH_MAP){return}if(i.getLock()===true){return}if(i.currentOperation!==ct.readyToDrag){if(i.currentOperation===ct.dragging&&e._diffX===0&&e._diffY===0){}else{return}}if(fc.button===2){e._processRightClick(ae(fc,i))}})};eR.prototype._processMouseDown=function(fi){var i=this._map;if(fi.overlay&&fi.overlay instanceof b6&&fi.overlay._config.enableDraggingMap===false&&!dZ()){if(i.currentOperation===ct.idle){this._clearStatus();this._firstTouchInfo=fi;this._firstTouchInfo.initX=fi.offsetPosMap.x;this._firstTouchInfo.initY=fi.offsetPosMap.y;return}}if(i.currentOperation!==ct.idle&&fi.button!==this._opButton){return}if(fi.button===2&&this._currentTouchCount===1){return}if(i.getLock()){return}if(this._currentTouchCount===2){return}this._currentTouchCount++;if(this._currentTouchCount===2){this._twoFingerTouched=true}if(this._lastTouchstartTime&&dZ()){var fe=fi.timeStamp-this._lastTouchstartTime;if(fe<200){this._gestureStatus.dragZoom=true}}this._lastTouchstartTime=fi.timeStamp;i.currentOperation=this._stateMachine.takeAction("mousedown",fi.id);if(fi.secondTouchInfo){this._currentTouchCount++;i.currentOperation=this._stateMachine.takeAction("mousedown",fi.secondTouchInfo.id)}if(i.currentOperation===ct.readyToDrag){if(x.Browser.firefox){fi.target.setCapture()}var ff=this._firstTouchInfo;x.extend(ff,fi);ff.initX=fi.offsetPosMap.x;ff.initY=fi.offsetPosMap.y;this._opButton=fi.button;if(fi.button===2&&this._enableRightDrag===false){i.currentOperation=ct.idle;this._stateMachine.reset();return}this._getCurrentDrag().onReadyToDrag(fi)}else{if(i.currentOperation===ct.readyToPinch){if(fi.secondTouchInfo){x.extend(this._firstTouchInfo,fi);this._firstTouchInfo.initX=fi.offsetPosMap.x;this._firstTouchInfo.initY=fi.offsetPosMap.y;x.extend(this._secondTouchInfo,fi.secondTouchInfo);this._secondTouchInfo.initX=fi.secondTouchInfo.offsetPosMap.x;this._secondTouchInfo.initY=fi.secondTouchInfo.offsetPosMap.y;this._opButton=fi.button}else{x.extend(this._secondTouchInfo,fi);this._secondTouchInfo.initX=fi.offsetPosMap.x;this._secondTouchInfo.initY=fi.offsetPosMap.y}if(this._useGesture){return}this._initTouchDistance=ez(this._firstTouchInfo.offsetPosMap,this._secondTouchInfo.offsetPosMap);this._initMiddlePoint=bN(this._firstTouchInfo.offsetPosMap,this._secondTouchInfo.offsetPosMap);var fd=this._firstTouchInfo.initX-this._initMiddlePoint.x;var fk=this._initMiddlePoint.y-this._firstTouchInfo.initY;var fc=this._secondTouchInfo.initX-this._initMiddlePoint.x;var fj=this._initMiddlePoint.y-this._secondTouchInfo.initY;var fg;if(fd-fc!==0){var fh=(fj-fk)/(fc-fd);fg=bY(Math.atan(fh))}else{fg=90}if(fg<0){fg=180+fg}this._initAngle=fg;this._preAngle=fg;this._pinchStartPosition=this._initMiddlePoint;this._getCurrentDrag().onReadyToPinch(fi,{initMiddlePoint:this._initMiddlePoint,pinchStartPosition:this._pinchStartPosition,zoomRatio:1})}}};eR.prototype._processMouseMove=function(ff){var i=this._map;if(i.currentOperation===ct.idle){return}if(ff.id===this._firstTouchInfo.id){x.extend(this._firstTouchInfo,ff)}else{if(ff.id===this._secondTouchInfo.id){x.extend(this._secondTouchInfo,ff)}}if(ff.secondTouchInfo){if(ff.secondTouchInfo.id===this._firstTouchInfo.id){x.extend(this._firstTouchInfo,ff.secondTouchInfo)}else{if(ff.secondTouchInfo.id===this._secondTouchInfo.id){x.extend(this._secondTouchInfo,ff.secondTouchInfo)}}}i.currentOperation=this._stateMachine.takeAction("mousemove",ff.id);if(i.currentOperation===ct.pinching){if(this._useGesture){return}if(!this._gestureStartTime){this._gestureStartTime=ff.timeStamp}var fj=ez(this._firstTouchInfo.offsetPosMap,this._secondTouchInfo.offsetPosMap);var fi=bN(this._firstTouchInfo.offsetPosMap,this._secondTouchInfo.offsetPosMap);this._pinchingPosition=fi;this._diffX=fi.x-this._initMiddlePoint.x;this._diffY=fi.y-this._initMiddlePoint.y;var fg={scale:Math.round(fj/this._initTouchDistance*100)/100,rotation:this._calcRotationDiff(fi),offsetPosMap:fi,timeStamp:ff.timeStamp};this._pinchingPosition=fi;var fc=this._getPinchParam(fg);if(fc){this._zoomRatio=fc.zoomRatio;this._getCurrentDrag().onPinching(ff,{initMiddlePoint:this._initMiddlePoint,pinchStartPosition:this._pinchStartPosition,pinchingPosition:fi,pinchingDistance:fc.pinchingDistance,zoomRatio:fc.zoomRatio,angleDiff:fc.rotation,gestureStatus:this._gestureStatus})}}else{if(i.currentOperation===ct.dragging){var fe=this._getCurrentDrag();if(this._dragStarted===false){fe.onDragStart&&fe.onDragStart(ff);this._dragStarted=true}if(ff.id===this._firstTouchInfo.id){this._diffX=ff.offsetPosMap.x-this._firstTouchInfo.initX;this._diffY=ff.offsetPosMap.y-this._firstTouchInfo.initY}else{if(ff.secondTouchInfo&&ff.secondTouchInfo.id===this._firstTouchInfo.id){this._diffX=ff.secondTouchInfo.offsetPosMap.x-this._firstTouchInfo.initX;this._diffY=ff.secondTouchInfo.offsetPosMap.y-this._firstTouchInfo.initY}}this._lastDragPoint=ff.pixel;var fd;if(this._lastDragPoint.x===this._penultimateDragPoint.x&&this._lastDragPoint.y===this._penultimateDragPoint.y){fd={x:this._diffX,y:this._diffY}}else{fd={x:this._lastDragPoint.x-this._penultimateDragPoint.x,y:this._lastDragPoint.y-this._penultimateDragPoint.y}}fe.onDragging(ff,{diffX:this._diffX,diffY:this._diffY,velocity:this._operationVelocity,button:this._opButton,dragDistance:{x:this._diffX,y:this._diffY},gestureStatus:this._gestureStatus,dir:fd});if(!this._trackVelocityTimer){var fh=this;this._trackTimeStamp=(new Date()).getTime();this._trackVelocityTimer=setInterval(function(){fh._trackVelocity();fh._penultimateDragPoint=fh._lastDragPoint},30)}}}};eR.prototype._calcRotationDiff=function(fi){var i=this._firstTouchInfo.offsetPosMap.x-fi.x;var fh=fi.y-this._firstTouchInfo.offsetPosMap.y;var e=this._secondTouchInfo.offsetPosMap.x-fi.x;var fg=fi.y-this._secondTouchInfo.offsetPosMap.y;var fd;if(i-e!==0){var fe=(fg-fh)/(e-i);fd=bY(Math.atan(fe))}else{fd=90}if(fd<0){fd=180+fd}var fc=fd;while(this._preAngle-fd>100){fd=fd+180}while(this._preAngle-fd<-100){fd=fd-180}var ff=this._initAngle-fd;this._preAngle=fd;return ff};eR.prototype._processMouseUp=function(fe){var fd=this._map;if(fd.currentOperation===ct.idle){return}if(fe.button!==this._opButton){return}this._currentTouchCount--;if(fd.currentOperation===ct.readyToDrag||fd.currentOperation===ct.dragging){if(this._trackVelocityTimer){clearInterval(this._trackVelocityTimer);this._trackVelocityTimer=null}this._dragStarted=false;var i;if(this._lastDragPoint.x===this._penultimateDragPoint.x&&this._lastDragPoint.y===this._penultimateDragPoint.y){i={x:this._diffX,y:this._diffY}}else{i={x:this._lastDragPoint.x-this._penultimateDragPoint.x,y:this._lastDragPoint.y-this._penultimateDragPoint.y}}this._getCurrentDrag().onDragEnd(fe,{velocity:this._operationVelocity,dragDistance:{x:this._diffX,y:this._diffY},gestureStatus:this._gestureStatus,dir:i});this._clearStatus(fe);this._resetGestureParam();if(x.Browser.firefox){fe.target.releaseCapture()}this._opButton=-1}else{if(fd.currentOperation===ct.pinching){if(!this._useGesture){var fc=this._pinchParam;if(fc){this._getCurrentDrag().onPinchEnd(fe,{pinchStartPosition:this._pinchStartPosition,pinchEndPosition:this._pinchingPosition,zoomRatio:fc.zoomRatio,angleDiff:fc.rotation,gestureStatus:this._gestureStatus})}this._resetGestureParam()}this._clearId(fe.id)}else{if(fd.currentOperation===ct.freeze){if(this._currentTouchCount===0){this._clearStatus(fe)}else{if(fe.id===this._firstTouchInfo.id||fe.id===this._secondTouchInfo.id){if(!this._useGesture){var fc=this._pinchParam;if(fc){this._getCurrentDrag().onPinchEnd(fe,{pinchStartPosition:this._pinchStartPosition,pinchEndPosition:this._pinchingPosition,zoomRatio:fc.zoomRatio,angleDiff:fc.rotation,gestureStatus:this._gestureStatus})}this._resetGestureParam()}this._clearId(fe.id)}}}}}fd.currentOperation=this._stateMachine.takeAction("mouseup",fe.id);if(fe.changedTouchesCount===2||fe.targetTouchesCount===0){fe.changedTouchesCount=1;this._processMouseUp(fe)}if(this._currentTouchCount===0&&dZ()){this._diffX=this._diffY=0}};eR.prototype._clearId=function(e){if(e===this._firstTouchInfo.id){this._firstTouchInfo={}}else{if(e===this._secondTouchInfo.id){this._secondTouchInfo={}}}};eR.prototype._clearStatus=function(){this._firstTouchInfo={};this._secondTouchInfo={}};eR.prototype._processRightClick=function(fe){var fd=this._map;var fc=fd.temp;if(fc.rightDblclickTimer){clearTimeout(fc.rightDblclickTimer);fc.rightDblclickTimer=null;fd.dispatchEvent(x.extend(new az("onrightclick"),fe));fd.dispatchEvent(x.extend(new az("onrightdblclick"),fe))}else{fd.dispatchEvent(x.extend(new az("onrightclick"),fe));var i=x.extend(new az("onrightclickex"),fe);fc.rightDblclickTimer=setTimeout(function(){fc.rightDblclickTimer=null;fd.dispatchEvent(i)},fd.config.clickInterval)}};eR.prototype._bindMouseWheel=function(){var fd=this._map;var fc=this;if(!x.Browser.firefox){x.on(fd.container,"mousewheel",function i(fe){if(fd.getLock()===true){return}if(fd.mapType!==BMAP_EARTH_MAP){if(fc._isModernBrowser){fc._deepZoomWheel(fe)}else{fc._wheel(fe)}}else{if(fc._earthWheel){fc._earthWheel.onWheel(ae(fe,fd))}}a4(fe)})}else{x.on(fd.container,"wheel",function e(fe){if(fd.getLock()===true){return}if(fd.mapType!==BMAP_EARTH_MAP){if(fc._isModernBrowser){fc._deepZoomWheel(fe)}else{fc._wheel(fe)}}else{if(fc._earthWheel){fc._earthWheel.onWheel(ae(fe,fd))}}a4(fe)})}};eR.prototype._getCurrentDrag=function(){var e=this._map;if(e.getMapType()!==BMAP_EARTH_MAP){return this._drag}return this._earthDrag};eR.prototype._wheel=function(fg){var ff=this._map;var fd=this._map.temp;if(fd.dragAni){fd.dragAni.stop();fd.dragAni=null;setTimeout(function(){ff.dispatchEvent(new az("onmoveend"))},1)}if(fd.touchZoomLabelCanvas){fd.touchZoomLabelCanvas.style.display="none"}if(fd.touchZoomDiv){fd.touchZoomDiv.style.display="none"}fg=window.event||fg;ff.lastLevel=ff.zoomLevel;var fc=new az("onmousewheel");fc.trend=fg.wheelDelta>=0;if(isNaN(fg.wheelDelta)){fc.trend=fg.deltaY<=0}var i=new Date();if(fc.trend===true&&ff.zoomLevel===ff.getMaxZoom()||fc.trend===false&&ff.zoomLevel===ff.getMinZoom()||i-this._lastWheelTime<220){ff.currentOperation^=ct.mousewheel;if(fc.trend===true&&ff.zoomLevel===ff.getMaxZoom()||fc.trend===false&&ff.zoomLevel===ff.getMinZoom()){var fe=new az("onzoomexceeded");if(ff.zoomLevel===ff.getMaxZoom()){fe.targetZoom=ff.zoomLevel+1}else{fe.targetZoom=ff.zoomLevel-1}ff.dispatchEvent(fe)}a4(fg);return}this._astWheelTime=i;x.extend(fc,ae(fg,ff));ff.dispatchEvent(fc)};eR.prototype._deepZoomWheel=function(fd){var fc=this._map;var i=new az("ondeepzoommousewheel");x.extend(i,ae(fd,fc));fc.dispatchEvent(i)};eR.prototype.setEarthDrag=function(e){this._earthDrag=e};eR.prototype.setEarthWheel=function(e){this._earthWheel=e};eR.prototype._trackVelocity=function(){var fc=(new Date()).getTime();var e=fc-this._trackTimeStamp;if(e===0){return}this._trackTimeStamp=fc;var fd=Math.sqrt(Math.pow(this._diffX,2)+Math.pow(this._diffY,2));var fe=Math.abs(fd-this._lastDiffDistance);this._lastDiffDistance=fd;var i=500*fe/e;this._operationVelocity=(0.6*i+0.4*this._operationVelocity)};function aT(e){this.map=e;this.tileMgr=e.tileMgr;this.canvas2dMapMgr=e.canvas2dMapMgr;this.enableCanvas2dMap=!!(e.getRenderType()==="canvas");this.zoomCount=0;this.preZoomCount=null;this.preRenderTick=1;this.maxZoomWheelDir=1;this.minZoomWheelDir=-1;this.isDispatchZoomStart=false;this.maxZoom=e.getMaxZoom();this.minZoom=e.getMinZoom();this.lastWheelTime=0;this.opMethod="";this.inDecayMode=false;this.lastWheelDelta=0;this.lastDiff=0;this._animationLayer=ed.get(e);this.bindEvent()}var a7=aT.prototype;a7.bindEvent=function(){var e=this;var i=e.map;i.addEventListener("maptypechange",function(fc){e.maxZoom=i.getMaxZoom();e.minZoom=i.getMinZoom()});i.addEventListener("deepzoommousewheel",function(fc){if(this.config.enableWheelZoom){e.wheel(fc)}})};a7.wheel=function(fs){var fw=this,fv=fw.map,fk=fv.temp;if(fk.dragAni){fw.enableCanvas2dMap&&fw.canvas2dMapMgr.updateLabel();fk.dragAni.stop();fk.dragAni=null;fv.dispatchEvent(new az("onmoveend"))}var fe=Math.floor(fs.timeStamp);var ft=fe-this.lastWheelTime;var fo=fs.wheelDelta>=0;if(isNaN(fs.wheelDelta)){fo=fs.deltaY<=0}var fu=Math.abs(fs.deltaY);var ff=Math.abs(fs.wheelDelta);var fp=fu;if(ft>100){this.inDecayMode=false;this.opMethod=aX(ff,fp,fs.deltaMode);this.zoomCount=0;this.preZoomCount=null;fv.fire(new az("onmousewheelscroll"))}if(this.opMethod==="padScroll"){if(fp===0&&ft===0){if(this.inDecayMode===false){this.inDecayMode=true}}}if(ft===0){return}this.lastWheelTime=fe;if(this.opMethod==="padScroll"&&ft<40){if(fo){fw.zoomCount+=0.13}else{fw.zoomCount-=0.16}var fl=fs.wheelDelta-this.lastWheelDelta;var i=fl-this.lastDiff;var fd=this.lastDiff;this.lastDiff=fl;this.lastWheelDeltaAbs=ff;this.lastWheelDelta=fs.wheelDelta;this.lastTrend=fo;if(typeof this.lastTrend==="boolean"&&fo!==this.lastTrend||this.opMethod==="padScroll"&&ff===3&&!isNaN(i)&&Math.abs(fl-fd)>50){fw._animationLayer.stopAnimation();if(fw.zoomAni){fw.zoomAni.stop();fw.zoomAni=null}}else{if(this.preZoomCount!==0){if((fl<0&&fd>0)||(fl>0&&fd<0)){if(fp<5){this.inDecayMode=false}}else{return}}}}this.preZoomCount=this.zoomCount;var fr=fs.wheelDelta/120||-fs.detail/3;if(fr===0&&x.Browser.firefox){fr=-fs.deltaY}if(fr===0){return}var fq=fr>=0?1:-1;var fi=Math.ceil(Math.abs(fr))*fq;if(this.opMethod==="padPinch"){fi=fs.deltaY}var fh=fi>0?1:-1;var fc=fv.getZoom();if(fh<0){fw.maxZoomWheelDir=-1}if(fh>0){fw.minZoomWheelDir=1}var fn=fw.maxZoom;var fj=fw.minZoom;if((fc>=fn&&fh>0&&fw.maxZoomWheelDir===1)||(fc<=fj&&fh<0&&fw.minZoomWheelDir===-1)){var fm=new az("onzoomexceeded");if(fc>=fn){fm.targetZoom=fc+1}else{fm.targetZoom=fc-1}fv.dispatchEvent(fm);return}if(this.opMethod==="mouseWheel"&&this.zoomAni){return}if(this.opMethod!=="mouseWheel"){fi*=0.6}fw.zoomCount+=fi;if(this.opMethod==="mouseWheel"){fw.zoomCount=fw.limitZoomCount(fw.zoomCount)}var fg=new cJ(fs.pixel.x,fs.pixel.y);if(this.opMethod!=="mouseWheel"){if(fw.zoomAni||fw.timer||fw.zoomCount===0||fw.inDecayMode===true){return}fw.timer=setTimeout(function(){var e=Math.abs(fw.zoomCount);e=Math.round(e);if(fo){fw.zoomCount=e}else{fw.zoomCount=-e}fw.zoomCount=fw.limitZoomCount(fw.zoomCount);if(fw.zoomCount===0){fw.timer=null;return}fw.zoomMap(fg,fw.zoomCount,fh);fw.timer=null},30);return}this._animationLayer.stopAnimation();fw.timer&&clearTimeout(fw.timer);fw.timer=setTimeout(function(){fw.zoomMap(fg,fw.zoomCount,fh);fw.timer=null},25)};a7.limitZoomCount=function(fc){var fd=this,fe=fd.minZoom,e=fd.maxZoom,i=this.map.getZoom();fc=Math.min(Math.max(fc,-3),3);if(i+fc>e){fc=e-i}else{if(i+fc<fe){fc=fe-i}}return fc};a7.zoomMap=function(fe,fl,ff,fd,i){var fo=this.map;var e=fo.getZoom();var fg=fo.getCenter().clone();var fp=this;var fc=fp.tileMgr;var fm=e+Math.round(fl);var fj=fo.width;var fh=fo.height;i=i||{};fd=fd||new cB(0,0);if(i.fireEvent!==false&&!fp.isDispatchZoomStart){fp.isDispatchZoomStart=true;fo.dispatchEvent(new az("onzoomstart"))}if(fo.config.zoomCenter){fe=fo.pointToPixel(fo.config.zoomCenter)}var fr=fo.pixelToPoint(fe);var fq=fo.getZoomUnits(fm);var fi=new eU(fr.lng+fq*(fj/2-fe.x+fd.width),fr.lat-fq*(fh/2-fe.y+fd.height));fi=fo.restrictCenter(fi,fq,fm);var fk=fo.pointToPixel(fr,{center:fi,zoom:fm});var fn=0;this.zoomAni=this._animationLayer.startAnimation({fixPosition:fe,fixMCPosition:fr,zoomCount:fl,pixOffset:fd,onAnimationBeforeLooping:function(fu,fw){var fs=fo.getZoomUnits(fw);var fv=new eU(fr.lng+fs*(fj/2-fe.x+fd.width*fu),fr.lat-fs*(fh/2-fe.y+fd.height*fu));fv=fo.restrictCenter(fv,fs,fw);var fy=fo.pointToPixel(fr,{center:fv,zoom:fw});var ft=0;if(fo.isRestrict===true){ft=fy.y-fe.y}if(ft!==0&&fn===0){var fx=fo.pointToPixel(fr,{center:fv,zooom:fw});fn=fk.y-fx.y}return{loopingCenter:fv,yDiff:ft,totalYDiff:fn}},onAnimationLooping:function(ft,fw,fu){if(!fu){var fs=fo.getZoomUnits(fw);fu=new eU(fr.lng+fs*(fj/2-fe.x+fd.width*ft),fr.lat-fs*(fh/2-fe.y+fd.height*ft));fu=fo.restrictCenter(fu)}if(fp.enableCanvas2dMap){var fv=new az("onzooming_inner");fv.zoom=fw;fv.center=fu;fo.dispatchEvent(fv)}},onAnimationFinish:function(){fo.zoomLevel=fm;fo.centerPoint=fi;fc.moveGridTiles();fo.dispatchEvent(new az("onzooming"));if(i.fireEvent!==false){var fs=new az("onzoomend");fs.notClearLabel=true;fo.dispatchEvent(fs)}fp.zoomCount=0;fp.maxZoomWheelDir=1;fp.minZoomWheelDir=-1;fp.isDispatchZoomStart=false;fp.zoomAni=null;if(i.callback){i.callback()}}})};function eF(e){this._map=e;this._touchZoomLayer=null;this._zoomStartFired=false}x.extend(eF.prototype,{onReadyToDrag:function(fe,i){if(fe.button===2){return}var fd=this._map;var fc=fd.temp;if(fc.dragAni){fc.dragAni.stop();fc.dragAni=null;fd.dispatchEvent(new az("onmoveend"))}if(!fd.config.enableDragging){return}fc.pl=fd.offsetX;fc.pt=fd.offsetY;if(fc.curSpotsArray.length===0){fd.platform.style.cursor=fd.config.draggingCursor}else{fd.platform.style.cursor="pointer"}},onReadyToPinch:function(fe,fc){if(!this._touchZoomLayer){this._touchZoomLayer=ed.get(this._map)}this._touchZoomLayer.hideNonAnimationLayers();var i=fc.pinchStartPosition;if(this._map.config.fixCenterWhenPinch){var fd=this._map.getSize();i.x=fd.width/2;i.y=fd.height/2}this._touchZoomLayer.setFixPosition(i);this._touchZoomLayer.prepareLayer();this._touchZoomLayer.prepareAniParam();this._touchZoomLayer.prepareLabelLayer();this._pinchStartPosition=i;this._pinchStartPositionMC=this._map.pixelToPoint(i)},onDragStart:function(fc){if(fc.button===2){return}var i=this._map;if(!i.config.enableDragging){return}i.platform.style.cursor=i.config.draggingCursor},onDragging:function(ff,fc){var fe=this._map;if(!fe.config.enableDragging){return}if(ff.button===2||fc.button===2){return}var fd=fe.temp;var i=40;var fg=ff.timeStamp;var fh=(fg-fd.lastLoadTileTime)>i;if(fh){fd.lastLoadTileTime=fg}fd.lastDomMoveTime=fg;if(Math.abs(fc.diffX)>1||Math.abs(fc.diffY)>1){if(!fd._moved){fe.dispatchEvent(x.extend(new az("ondragstart"),ff));fe.dispatchEvent(new az("onmovestart"));fd._moved=true}fe.dispatchEvent(x.extend(new az("ondragging"),ff));fe._setPlatformPosition(fc.diffX,fc.diffY,{initMapOffsetX:fd.pl,initMapOffsetY:fd.pt,dispatchEvent:fh})}},onPinching:function(fh,fd){var fe=this._map;var fc=this._pinchStartPositionMC;var fk=this._pinchStartPosition;var ff=Math.log(fd.zoomRatio)/Math.log(2);if(ff!==1&&this._zoomStartFired===false){fe.dispatchEvent(new az("onzoomstart"));this._zoomStartFired=true}var fj=fe.getZoom()+ff;if(fj>fe.getMaxZoom()){fj=fe.getMaxZoom()}else{if(fj<fe.getMinZoom()){fj=fe.getMinZoom()}}var fm=Math.pow(2,fj-fe.getZoom());var fl=fe.getZoomUnits(fj);var i=new eU(fc.lng+fl*(fe.width/2-fk.x),fc.lat-fl*(fe.height/2-fk.y));i=fe.restrictCenter(i,fl,fj);var fg=fe.pointToPixel(fc,{center:i,zoom:fj});var fi=fg.y-fk.y;this._touchZoomLayer.setZoom(fm,fi);var fh=new az("onzooming_inner");fh.zoom=fj;fh.center=i;fe.dispatchEvent(fh)},onDragEnd:function(fe,i){var fd=this._map;if(!fd.config.enableDragging){return}if(fe.button===2){return}var fc=fd.temp;if(fc.curSpotsArray.length===0){fd.platform.style.cursor=fd.config.defaultCursor}else{fd.platform.style.cursor="pointer"}if(fc._moved){fd.dispatchEvent(x.extend(new az("ondragend"),fe));if(!fd.config.enableInertialDragging||fe.timeStamp-fc.lastDomMoveTime>100){fd.dispatchEvent(new az("onmoveend"))}else{this._processMotion(i.velocity,i.dragDistance)}}fc._moved=false},onPinchEnd:function(fg,i){var ff=this._map;var fd=Math.round(Math.log(i.zoomRatio)/Math.log(2));var fc=Math.max(Math.min(ff.getZoom()+fd,ff.getMaxZoom()),ff.getMinZoom());var fh=ff.pixelToPoint(this._pinchStartPosition);ff.zoomTo(fc,fh,{noAnimation:true,fireEvent:false});ff.dispatchEvent(new az("onzoomend"));this._zoomStartFired=false;var fe=this;setTimeout(function(){fe._touchZoomLayer.showNonAnimationLayers();fe._touchZoomLayer.setZoomFinish();fe._touchZoomLayer.showLabel()},30)},_processMotion:function(fd,fm){var fj=this._map;var fo=fj.temp;var i=(new Date()).getTime();var e=0.5*fd;var fn=0;var fl=0;if(fm.y===0){fn=e}else{var fh=Math.abs(fm.x/fm.y);fl=Math.round(Math.sqrt(e*e/(1+fh*fh)));fn=Math.round(fh*fl)}var fk=fm.x+fn;var fi=fm.y+fl;if(fm.x<0){fk=fm.x-fn}if(fm.y<0){fi=fm.y-fl}if(fo.dragAni){fo.dragAni.stop();fo.dragAni=null;fj.dispatchEvent(new az("onmoveend"))}var ff=true;var fc=fj.config.isModernBrowser?60:30;var fg=0;var fe=0;fo.dragAni=new l({duration:10000,fps:fc,render:function(fr,fq){var fp=(new Date()).getTime()-i;var fs=Math.exp(-fp/250);fg=fm.x>=0?(fk-fn*fs):(fk+fn*fs);fe=fm.y>=0?(fi-fl*fs):(fi+fl*fs);if(fn*fs<10&&fl*fs<10){fo.dragAni.stop();return}fj._setPlatformPosition(Math.round(fg),Math.round(fe),{initMapOffsetX:fo.pl,initMapOffsetY:fo.pt,dispatchEvent:ff})},finish:function(){fo.dragAni=null;fj._setPlatformPosition(Math.round(fg),Math.round(fe),{initMapOffsetX:fo.pl,initMapOffsetY:fo.pt});fj.dispatchEvent(new az("onmoveend"))},onStop:function(){fo.dragAni=null;fj._setPlatformPosition(Math.round(fg),Math.round(fe),{initMapOffsetX:fo.pl,initMapOffsetY:fo.pt});fj.dispatchEvent(new az("onmoveend"))}})}});aG.register(function(i){var e=i;if(i._keyboardInit===true){return}i._keyboardInit=true;x.on(document,"keydown",function(fc){if(e.temp.stopArrow===true){e.temp.stopArrow=false}if(e.config.enableKeyboard&&e.temp.canKeyboard){var fc=window.event||fc;var fd=false;if(x.Platform.macintosh){if(fc.metaKey===true){fd=true}}else{if(fc.ctrlKey===true){fd=true}}switch(fc.keyCode||fc.which){case 189:case 109:case 173:if(!fd){e.temp.operating=true;e.dispatchEvent(new az("onminuspress"))}break;case 61:case 187:case 107:if(!fd){e.temp.operating=true;e.dispatchEvent(new az("onpluspress"))}break;case 33:e.temp.operating=false;e.temp.stopArrow=true;fc.cancelBubble=true;fc.returnValue=false;break;case 34:e.temp.operating=false;e.temp.stopArrow=true;fc.cancelBubble=true;fc.returnValue=false;break;case 35:e.temp.operating=false;e.temp.stopArrow=true;fc.cancelBubble=true;fc.returnValue=false;break;case 36:e.temp.operating=false;e.temp.stopArrow=true;fc.cancelBubble=true;fc.returnValue=false;break;case 37:if(e.mapType==="B_EARTH_MAP"){return}e.temp.operating=true;e.temp.arrow|=1;e._arrow();fc.cancelBubble=true;fc.returnValue=false;break;case 38:if(e.mapType==="B_EARTH_MAP"){return}e.temp.operating=true;e.temp.arrow|=2;e._arrow();fc.cancelBubble=true;fc.returnValue=false;break;case 39:if(e.mapType==="B_EARTH_MAP"){return}e.temp.operating=true;e.temp.arrow|=4;e._arrow();fc.cancelBubble=true;fc.returnValue=false;break;case 40:if(e.mapType==="B_EARTH_MAP"){return}e.temp.operating=true;e.temp.arrow|=8;e._arrow();fc.cancelBubble=true;fc.returnValue=false;break}}});x.on(document,"keyup",function(fc){if(e.config.enableKeyboard){var fc=window.event||fc;switch(fc.keyCode||fc.which){case 37:e.temp.arrow=e.temp.arrow&~1;if(e.temp.arrow!==0){e._arrow()}break;case 38:e.temp.arrow=e.temp.arrow&~2;if(e.temp.arrow!==0){e._arrow()}break;case 39:e.temp.arrow=e.temp.arrow&~4;if(e.temp.arrow!==0){e._arrow()}break;case 40:e.temp.arrow=e.temp.arrow&~8;if(e.temp.arrow!==0){e._arrow()}break}}e.temp.operating=false});bS.prototype._arrow=function(){if(this.mapType===BMAP_EARTH_MAP){return}if(this._arrow.occurrent&&this._arrow._lastArrow===this.temp.arrow&&this.temp.stopArrow===true){return}var fc=this;var fe=fc.temp.arrow;fc._arrow._lastArrow=fe;fc._arrow.interval=30;fc._arrow.duration=999;fc._arrow.dx=fc._arrow.dy=0;if(fe&1){fc._arrow.dx=1}if(fe&2){fc._arrow.dy=1}if(fe&4){fc._arrow.dx=-1}if(fe&8){fc._arrow.dy=-1}if(fe&1&&fe&4){fc._arrow.dx=0}if(fe&2&&fe&8){fc._arrow.dy=0}if(!fc._arrow.occurrent){fc._arrow.occurrent=true;fc._arrow.time=new Date().getTime();fc._arrow.beginTime=fc._arrow.time;fc.dispatchEvent(new az("onmovestart"));var fd=new l({fps:fc._arrow.interval,duration:fc._arrow.duration,transition:bo.linear,render:function(fl){var fg=fc._arrow;var fj=fc.temp.arrow;if(fc._arrow._lastArrow!==fj){fc._arrow._lastArrow=fj;if(fj&1){fg.dx=1}if(fj&2){fg.dy=1}if(fj&4){fg.dx=-1}if(fj&8){fg.dy=-1}if(fj&1&&fj&4){fg.dx=0}if(fj&2&&fj&8){fg.dy=0}}if(fc.temp.stopArrow===true){fg.dx=0;fg.dy=0}var fk=new Date().getTime();var fi=Math.pow((fk-fg.beginTime)/fg.duration,2);if(!fc.temp.arrow){fg.occurrent=false;fd.terminative=true;fc._arrow.time=new Date().getTime();setTimeout(function(){fc.dispatchEvent(new az("onmoveend"))},40)}var fm=(fk-fg.time);var fh=fg.dx*fm*fi>=0?Math.ceil(fg.dx*fm*fi):Math.floor(fg.dx*fm*fi);var ff=fg.dy*fm*fi>=0?Math.ceil(fg.dy*fm*fi):Math.floor(fg.dy*fm*fi);if(fh!==0&&ff!==0){fh=Math.round(fh*0.7);ff=Math.round(ff*0.7)}fg.time=fk;fc._setPlatformPosition(fh,ff)},finish:function(){fc._arrow.time=new Date().getTime();setTimeout(function(){fc._arrowPan()},fc._arrow.interval)}})}};bS.prototype._arrowPan=function(){var ff=this;var fd=ff._arrow;if(ff.temp.stopArrow){fd.dx=0;fd.dy=0}if(!ff.temp.arrow){fd.occurrent=false;ff.dispatchEvent(new az("onmoveend"));return}var fg=new Date().getTime();var fh=(fg-fd.time);var fe=Math.ceil(fd.dx*fh);var fc=Math.ceil(fd.dy*fh);fd.time=fg;ff._setPlatformPosition(fe,fc);setTimeout(function(){ff._arrowPan()},fd.interval)}});dp.prototype.zoom=function(fe,fd){var fg=fd?fd.width:0;var ff=fd?fd.height:0;var fr=this.map;var ft=fr.config;var fs=this;var fq={x:fe.x-parseInt(fs.tilesDiv.style.left,10)-fr.offsetX,y:fe.y-parseInt(fs.tilesDiv.style.top,10)-fr.offsetY};if(fr.overlayDiv){fr.overlayDiv.style.visibility="hidden"}var e;for(var fn=0,fm=fs.tileLayers.length;fn<fm;fn++){e=fs.tileLayers[fn];if(!e.baseLayer){e.tilesDiv.style.visibility="hidden"}}if(!this.zoomsDiv){this.zoomsDiv=this.tilesDiv.cloneNode(true)}else{if(this.zoomsDiv.parentNode&&!this._zTimeLine){this.zoomsDiv.parentNode.removeChild(this.zoomsDiv);this.zoomsDiv=null;this.zoomsDiv=this.tilesDiv.cloneNode(true)}}var fc=this.zoomsDiv;var fk=fc.style;fk.display="block";this.tilesDiv.style.visibility="hidden";fr.platform.insertBefore(fc,fr.platform.firstChild);var fp=[];var fh=fr.zoomLevel-fr.lastLevel;if(!fs._diff){fs._diff=fh}else{if(fr.zoomLevel-fr.lastLevel>0){fs._diff++}else{fs._diff--}}if(this._zTimeLine&&this._zTimeLine.schedule===0){this._zTimeLine.stop();this._zTimeLine=null;fh=fs._diff}var fj=Math.pow(2,fh);var fo=fc.children.length;for(var fn=fo-1;fn>-1;fn--){var fi={};var fl=fc.children[fn].style;fi.top=parseInt(fl.top,10)||0;fi.left=parseInt(fl.left,10)||0;fi.width=parseInt(fl.width,10);fi.height=parseInt(fl.height,10);fi.dw=fi.width*fj-fi.width;fi.dh=fi.height*fj-fi.height;fi.dx=(fi.left-fq.x)*fj-(fi.left-fq.x);fi.dy=(fi.top-fq.y)*fj-(fi.top-fq.y);fp[fn]=fi}fc._ol=parseInt(fc.style.left,10);fc._ot=parseInt(fc.style.top,10);if(this._zTimeLine){this._zTimeLine.stop();this._zTimeLine=null}this._zTimeLine=new l({fps:20,duration:ft.enableContinuousZoom?ft.zoomerDuration:1,transition:bo.easeInQuad,render:function(fw){if(fw<0.1){return}for(var fv=fp.length-1;fv>-1;fv--){var fx=fp[fv];if(fc.children[fv]){var fu=fc.children[fv].style;fu.top=Math.round(fx.top+fx.dy*fw)+"px";fu.left=Math.round(fx.left+fx.dx*fw)+"px";fu.width=Math.ceil(fx.width+fx.dw*fw)+"px";fu.height=Math.ceil(fx.height+fx.dh*fw)+"px"}}if(fg||ff){fk.left=fc._ol-(fg*fw)+"px";fk.top=fc._ot-(ff*fw)+"px"}},finish:function(){if(fr.getZoom()===3&&fr.getMapType()==="B_NORMAL_MAP"){fr.centerPoint.lat=0}fs.moveGridTiles(true);if(fr.overlayDiv){setTimeout(function(){fr.overlayDiv.style.visibility="visible"},10)}for(var fv=0,fu=fs.tileLayers.length;fv<fu;fv++){e=fs.tileLayers[fv];if(!e.baseLayer){e.tilesDiv.style.visibility=""}}fs.tilesDiv.style.visibility="";delete fs._diff;fr.dispatchEvent(new az("onzoomend"));fc=null;fs._zTimeLine=null}})};');
﻿_jsload&&_jsload('control', 'x.extend(cl.prototype,{_asyncDraw:function(){if(this._map){this._i(this._map)}},initialize:function(e){ax.prototype.initialize.call(this,e);this._render();this._updateState();this._bind(e);return this._container},_bind:function(i){var e=this;i.addEventListener("load",function(fc){e._updateState()});i.addEventListener("moveend",function(fc){e._updateState()});i.addEventListener("zoomend",function(fc){e._updateState()})},_render:function(){ax.prototype._render.call(this);x.ac(this._container,"BMap_cpyCtrl");var e=this._container.style;e.cursor="default";e.whiteSpace="nowrap";e.MozUserSelect="none";e.WebkitTextSizeAdjust="none";ax.prototype._setPosition.call(this);if(this.sateMapStyle){this.addSateMapStyle()}},_updateState:function(){if(!this._map||!this._container||this._copyrightCollection.length===0){return}for(var fd=0,e=this._copyrightCollection.length;fd<e;fd++){var ff;var fh=this._map.getZoom();if(this._copyrightCollection[fd].mapType!==""&&this._map.mapType!==this._copyrightCollection[fd].mapType){ff=false}else{if(fh<this._copyrightCollection[fd].minZoom){ff=false}else{ff=true}}if(ff){if(this._container){var fe=false;for(var fc=0,fg=this._container.children.length;fc<fg;fc++){if(parseInt(this._container.children[fc].getAttribute("_cid"),10)===this._copyrightCollection[fd].id){fe=true;this._container.children[fc].style.display="block";if(this._container.children[fc].innerHTML!==this._copyrightCollection[fd].content){this._container.children[fc].innerHTML=this._copyrightCollection[fd].content}break}}if(!fe){this._generateHTML(this._copyrightCollection[fd])}}}else{if(this._container){for(var fc=0;fc<this._container.children.length;fc++){if(parseInt(this._container.children[fc].getAttribute("_cid"),10)===this._copyrightCollection[fd].id&&this._container.children[fc].style.display!=="none"){this._container.children[fc].style.display="none";return}}}}}},addCopyright:function(fd){if(!fd||typeof fd.id!=="number"||isNaN(fd.id)){return}var e={minZoom:0,bounds:null,content:"",mapType:""};for(var fc in fd){e[fc]=fd[fc]}if(this._map){var fg=e.minZoom;if(fg===-1||fg<this._map.getMinZoom()||fg>this._map.getMaxZoom()){e.minZoom=this._map.getMinZoom()}if(e.mapType!==""&&!bc[e.mapType]){e.mapType=BMAP_NORMAL_MAP}}var fe=this.getCopyright(fd.id);if(fe){for(var ff in e){fe[ff]=e[ff]}}else{this._copyrightCollection.push(e)}this._updateState()},getCopyright:function(fd){for(var fc=0,e=this._copyrightCollection.length;fc<e;fc++){if(this._copyrightCollection[fc].id===fd){return this._copyrightCollection[fc]}}},getCopyrightCollection:function(){return this._copyrightCollection},removeCopyright:function(ff){var fd;for(var fc=0,e=this._copyrightCollection.length;fc<e;fc++){if(this._copyrightCollection[fc].id===ff){fd=this._copyrightCollection.splice(fc,1);fc--;e=this._copyrightCollection.length}}var fe=this.getDom(ff);if(fe&&fe.parentNode){fe.parentNode.removeChild(fe);fe=null}this._updateState();return fd},_generateHTML:function(e){if(!this._container){return}this._container.innerHTML+=\'<span _cid="\'+e.id+\'">\'+e.content+"</span>"},getDom:function(fe){var fd=ax.prototype.getDom.call(this);if(typeof fe==="undefined"){return fd}else{if(fd){for(var fc=0,e=fd.children.length;fc<e;fc++){if(parseInt(fd.children[fc].getAttribute("_cid"),10)===fe){return fd.children[fc]}}}}}});function dw(){}x.extend(b8.prototype,{_asyncDraw:function(){if(this._map){this._i(this._map);this.dispatchEvent(new az("ondomready"))}},initialize:function(e){ax.prototype.initialize.call(this,e);this._firstAnimation=true;this._setParam();this._render();this._bind();this._setSliderZoomLv(e.getZoom());this._bindMapEvent(e);var i=this._opts.offset||(new cB(1,0));this.setOffset(i);this.redraw();return this._container},_bindMapEvent:function(i){var e=this;i.addEventListener("zoomend",function(fc){if(!e._map){return}e._setSliderZoomLv(e._map.getZoom());if(e._msover){return}if(e._isShowLevelHint){if(e.getType()===BMAP_NAVIGATION_CONTROL_ANIM){e._hideTimerId=setTimeout(function(){e._hideLevelHint(true);e._shrinkSlider()},1000)}else{e._hideTimerId=setTimeout(function(){e._hideLevelHint(true)},1000)}}});i.addEventListener("mousewheel",function(){if(!e._map){return}if(e._map.config.enableWheelZoom&&e._isShowLevelHint){if(e._hideTimerId){clearTimeout(e._hideTimerId);e._hideTimerId=null}if(e.getType()!==BMAP_NAVIGATION_CONTROL_ANIM){e._showLevelHint()}}});i.addEventListener("load",function(fc){if(!e._map){return}e._setSliderZoomLv(e._map.getZoom())})},redraw:function(){this._setParam();this.setType(this._opts.type);if(this._map){this._setSliderZoomLv(this._map.getZoom())}},_setParam:function(){this._minZoomLevel=this._map.config.zoomLevelMin;this._maxZoomLevel=this._map.config.zoomLevelMax;if(this._minZoomLevel>4||this._maxZoomLevel<18){this._isShowLevelHint=false}else{this._isShowLevelHint=true}this._totalZoomLv=this._maxZoomLevel-this._minZoomLevel+1;this._maxBarY=this._minBarY+(this._totalZoomLv-1)*this._sliderInterval},_render:function(){ax.prototype._render.call(this);var fc=x.Browser.ie==6?" BMap_ie6":"";var i=" BMap_stdMpType"+this._opts.type;var fd=this._container;x.ac(fd,"BMap_stdMpCtrl");x.ac(fd,fc);x.ac(fd,i);fd.innerHTML=this._generateHtml(this._opts.type);this._setSliderBarCursor(x.Browser.opera?"pointer":dh.defaultCursor);this._panBtnContainer=x.G(fd.children[0]);this._zoomDom=x.G(fd.children[1]);var e=this._zoomDom;this._btnZoomIn=x.G(e.children[0]);this._btnZoomOut=x.G(e.children[1]);this._sliderDom=x.G(e.children[2]);this._sliderBaseDom=x.G(e.children[2].children[0]);this._sliderBotDom=x.G(e.children[2].children[1]);this.setType(this._opts.type)},_setSliderHeight:function(){var i=this._opts.type;var fd=this.controlHeight[i].width;var fe=this.controlHeight[i].height;var ff=this.controlHeight[i].zoomHeight;var e=this.controlHeight[i].zoomWidth;var fg=this.controlHeight[i].sliderHeight;if(this._opts.type==BMAP_NAVIGATION_CONTROL_LARGE||this._opts.type==BMAP_NAVIGATION_CONTROL_ANIM){}this._container.style.width=fd+"px";this._container.style.height=fe+"px";this._zoomDom.style.height=ff+"px";this._zoomDom.style.width=fd+"px";if(this.getType()==BMAP_NAVIGATION_CONTROL_ANIM){this._btnZoomOut.style.top=24+"px"}else{var fc=(this._opts.forceNew===true)?29:23;this._btnZoomOut.style.top=ff-fc+"px"}this._sliderDom.style.height=fg+"px";this._sliderBaseDom.style.height=fg+"px";if(this._opts.type==BMAP_NAVIGATION_CONTROL_ZOOM){this._zoomDom.children[0].style.left=this._zoomDom.children[1].style.left="0"}else{this._zoomDom.children[0].style.left=this._zoomDom.children[1].style.left=""}},_generateHtml:function(){var e=[];e.push(this._generatePanHtml());e.push(this._generateZoomContainerHtml());return e.join("")},_generatePanHtml:function(){var e=\'<div class="BMap_stdMpPan"><div class="BMap_button BMap_panN" title="向上平移"></div><div class="BMap_button BMap_panW" title="向左平移"></div><div class="BMap_button BMap_panE" title="向右平移"></div><div class="BMap_button BMap_panS" title="向下平移"></div><div class="BMap_stdMpPanBg BMap_smcbg"></div></div>\';return e},_generateZoomContainerHtml:function(){var e=\'<div class="BMap_stdMpZoom">\'+this._generateZoomHtml()+this._generateSliderHtml()+this._generateZoomBalloonHtml()+"</div>";return e},_generateZoomHtml:function(){var e="BMap_button";(this._opts.forceNew===true)&&(e="BMap_button_new");var i=\'<div class="\'+e+\' BMap_stdMpZoomIn" title="放大一级"><div class="BMap_smcbg in"></div></div><div class="\'+e+\' BMap_stdMpZoomOut" title="缩小一级"><div class="BMap_smcbg out"></div></div>\';return i},_generateSliderHtml:function(){var e=\'<div class="BMap_stdMpSlider"><div class="BMap_stdMpSliderBgTop"><div class="BMap_smcbg"></div></div><div class="BMap_stdMpSliderBgBot"><div class="BMap_smcbg"></div></div><div class="BMap_stdMpSliderMask" title="放置到此级别"></div><div class="BMap_stdMpSliderBar" title="拖动缩放"><div class="BMap_smcbg"></div></div></div>\';return e},_generateZoomBalloonHtml:function(){var e=\'<div class="BMap_zlHolder"><div class="BMap_zlSt"><div class="BMap_smcbg"></div></div><div class="BMap_zlCity"><div class="BMap_smcbg"></div></div><div class="BMap_zlProv"><div class="BMap_smcbg"></div></div><div class="BMap_zlCountry"><div class="BMap_smcbg"></div></div></div>\';return e},setType:function(e){if(typeof e=="number"&&e>=BMAP_NAVIGATION_CONTROL_LARGE&&e<=BMAP_NAVIGATION_CONTROL_ANIM){this._opts.type=e}else{this._opts.type=BMAP_NAVIGATION_CONTROL_LARGE}if(!this._map||!this._container){return}var i=this._container;i.className=i.className.replace(/BMap_stdMpType\\d/,"BMap_stdMpType"+this._opts.type);this._setSliderHeight();if(e!=BMAP_NAVIGATION_CONTROL_LARGE&&e!=BMAP_NAVIGATION_CONTROL_ANIM){x.rc(i.children[1].children[2],"hvr")}this.setAnchor(this._opts.anchor)},getType:function(){return this._opts.type},_bind:function(){var fn=this;var fm=fn._container;var ff=this._opts.from=="MAP_INDEX";function fe(i,fp){return i.contains?i!=fp&&i.contains(fp):!!(i.compareDocumentPosition(fp)&16)}function fi(fr,fq){var fp,i=fr.type.toLowerCase();if(i=="mouseover"){fp=fr.relatedTarget||fr.fromElement}else{if(i==="mouseout"){fp=fr.relatedTarget||fr.toElement}else{return true}}return fp&&fp.prefix!="xul"&&!fe(fq,fp)&&fp!==fq}x.on(fm,"mouseover",function(i){i=i||window.event;if(fi(i,fm)){fn.dispatchEvent(new az("onmouseover"))}});x.on(fm,"mouseout",function(i){i=i||window.event;if(fi(i,fm)){fn.dispatchEvent(new az("onmouseout"))}});function fd(){if(!fn._isShowLevelHint){return}fn._msover=true;if(fn._hideTimerId){clearTimeout(fn._hideTimerId);fn._hideTimerId=null}fn._expandSlider();if(fn.getType()!==BMAP_NAVIGATION_CONTROL_ANIM){fn._showLevelHint()}}function fh(){if(!fn._isShowLevelHint){return}if(fn._hideTimerId){clearTimeout(fn._hideTimerId)}fn._msover=false;fn._hideTimerId=setTimeout(function(){fn._hideLevelHint();fn._hideTimerId=null;fn._shrinkSlider()},1000)}if("onmouseenter" in document.documentElement){x.on(this._zoomDom,"mouseenter",function(i){fd()});x.on(this._zoomDom,"mouseleave",function(fp){var i=fp.relatedTarget;if(i&&(i===this||fe(this,i))){return}fh()})}else{x.on(this._zoomDom,"mouseover",function(fp){var i=fp.relatedTarget;if(i&&(i===this||fe(this,i))){return}fd()});x.on(this._zoomDom,"mouseout",function(fp){var i=fp.relatedTarget;if(i&&(i===this||fe(this,i))){return}fh()})}x.on(fm.children[0],"mouseover",function(){fn._hideLevelHint(true)});x.on(fm.children[0].children[0],"click",function(){fn._panBy(0,Math.round(fn._map.height/3));ff?dw(6004):null});x.on(fm.children[0].children[1],"click",function(){fn._panBy(Math.round(fn._map.width/3),0);ff?dw(6004):null});x.on(fm.children[0].children[2],"click",function(){fn._panBy(-Math.round(fn._map.width/3),0);ff?dw(6004):null});x.on(fm.children[0].children[3],"click",function(){fn._panBy(0,-Math.round(fn._map.height/3));ff?dw(6004):null});x.on(fm.children[0].children[0],"mouseover",function(){fn._panBtnContainer.style.backgroundPosition="0 -44px"});x.on(fm.children[0].children[1],"mouseover",function(){fn._panBtnContainer.style.backgroundPosition="0 -176px"});x.on(fm.children[0].children[2],"mouseover",function(){fn._panBtnContainer.style.backgroundPosition="0 -88px"});x.on(fm.children[0].children[3],"mouseover",function(){fn._panBtnContainer.style.backgroundPosition="0 -132px"});x.on(fn._panBtnContainer,"mouseout",function(){fn._panBtnContainer.style.backgroundPosition="0 0"});var fl=fm.children[1].children;x.on(fl[0],"click",function(){var i=fn._map;if(i.mapType===BMAP_EARTH_MAP){if(i._earth){if(i._earth.getLock()){return}i._earth.zoomIn({from:"control"});i._earth.fire(new az("onzoominclick"))}}else{ff?dw(6005):null;if(i.config.isModernBrowser){fn._deepZoomIn()}else{fn._zoomIn()}i.fire(new az("onzoominclick"))}});x.on(fl[1],"click",function(){var i=fn._map;if(i.mapType===BMAP_EARTH_MAP){if(i._earth){if(i._earth.getLock()){return}i._earth.zoomOut({from:"control"});i._earth.fire(new az("onzoomoutclick"))}}else{ff?dw(6005):null;if(i.config.isModernBrowser){fn._deepZoomOut()}else{fn._zoomOut()}i.fire(new az("onzoomoutclick"))}});for(var fg=1;fg<6;fg++){x.on(fm.children[0].children[fg],"mouseup",function(i){if(fn._map.currentOperation!==ct.dragging&&fn._map.currentOperation!==ct.stdMapCtrlDrag){g(i)}});x.on(fm.children[0].children[fg],"contextmenu",function(i){a4(i)});x.on(fm.children[0].children[fg],"click",function(i){a4(i)})}x.on(fl[0],"mouseup",function(i){if(fn._map.currentOperation!==ct.dragging&&fn._map.currentOperation!==ct.stdMapCtrlDrag){g(i)}});x.on(fl[1],"mouseup",function(i){if(fn._map.currentOperation!==ct.dragging&&fn._map.currentOperation!==ct.stdMapCtrlDrag){g(i)}});x.on(fl[0],"contextmenu",function(i){a4(i)});x.on(fl[1],"contextmenu",function(i){a4(i)});var fo=fm.children[1].children[2].children[2];x.on(fo,"mouseup",function(i){if(fn._map.currentOperation!==ct.dragging&&fn._map.currentOperation!==ct.stdMapCtrlDrag){g(i)}});x.on(fl[0],"click",function(i){g(i)});x.on(fl[1],"click",function(i){g(i)});x.on(fo,"click",function(i){g(i)});var fk=fm.children[1].children[2].children[3];x.on(fk,"mouseup",function(i){if(i.button==2){g(i)}});x.on(fk,"contextmenu",function(i){a4(i)});x.on(this._zoomDom.children[3].children[0],"click",function(i){fn._map.zoomTo(18)});x.on(this._zoomDom.children[3].children[1],"click",function(i){fn._map.zoomTo(12)});x.on(this._zoomDom.children[3].children[2],"click",function(i){fn._map.zoomTo(8)});x.on(this._zoomDom.children[3].children[3],"click",function(i){fn._map.zoomTo(4)});x.on(fo,"mousedown",function(fp){fp=window.event||fp;var i=fp.offsetY||fp.layerY||0;var fq=0;fq=(fn._maxZoomLevel+1)-Math.round(fn._totalZoomLv*parseFloat(i/(fn._totalZoomLv*fn._sliderInterval)));fn._map.zoomTo(fq);ff?dw(6006):null});x.on(fk,"mouseover",function(){x.ac(fk,"h")});x.on(fk,"mouseout",function(){if(fn._map.currentOperation!==ct.stdMapCtrlDrag){x.rc(fk,"h")}});var fj=function(i){var i=window.event||i;if(i.button==2){return}if((x.Browser.ie&&i.button!=1)){return}if(fk.setCapture){fk.setCapture()}fn._map.currentOperation=ct.stdMapCtrlDrag;fn._bind.my=i.pageY||i.clientY||0;if(!x.Browser.opera){fn._setSliderBarCursor(dh.draggingCursor)}x.on(document,"mousemove",e);x.on(document,"mouseup",fc);g(i);return a4(i)};var e=function(fp){if(fn._map.currentOperation===ct.stdMapCtrlDrag){var fp=window.event||fp;var fq=fp.pageY||fp.clientY;var i=fn._curBarY-fq+fn._bind.my;if(i<fn._minBarY){i=fn._minBarY}else{if(i>fn._maxBarY){i=fn._maxBarY}}fk.style.top=(fn._sliderHeight-i-15)+"px";fn._sliderBotDom.style.height=i+"px"}};var fc=function(fp){if(fn._map.currentOperation===ct.stdMapCtrlDrag){var i=x.G(fk);fn._curBarY=parseInt(i.style.top);x.rc(fk,"h");fn._map.currentOperation=ct.idle;if(fm&&fk&&fk.releaseCapture){fk.releaseCapture()}if(!x.Browser.opera){fn._setSliderBarCursor(dh.defaultCursor)}var fq=(fn._maxZoomLevel+1)-Math.round(parseFloat(fn._curBarY-fn._minBarY)/parseFloat(fn._maxBarY-fn._minBarY)*(fn._totalZoomLv-1)+1);fn._map.zoomTo(fq);ff?dw(6006):null;x.un(document,"mousemove",e);x.un(document,"mouseup",fc)}};x.on(fk,"mousedown",fj)},_setSliderBarCursor:function(e){this._container.children[1].children[2].children[3].style.cursor=e},_panBy:function(i,e){this._map.panBy(i,e)},_zoomIn:function(){this._map.zoomIn()},_zoomOut:function(){this._map.zoomOut()},_deepZoomOut:function(){this._map.deepZoomMedia(-1)},_deepZoomIn:function(){this._map.deepZoomMedia(1)},_setSliderZoomLv:function(i){if(!this._container||(this.getType()!=BMAP_NAVIGATION_CONTROL_LARGE&&this.getType()!=BMAP_NAVIGATION_CONTROL_ANIM)){return}var e=(i-this._minZoomLevel)*this._sliderInterval+this._minBarY;this._curBarY=e>this._maxBarY?this._maxBarY:e<this._minBarY?this._minBarY:e;this._container.children[1].children[2].children[3].style.top=(this._sliderHeight-this._curBarY-15)+"px";this._sliderBotDom.style.height=this._curBarY+"px"},_hideLevelHint:function(e){if(this._opts.type==BMAP_NAVIGATION_CONTROL_LARGE||this._opts.type==BMAP_NAVIGATION_CONTROL_ANIM){if(this._container){x.rc(this._container.children[1].children[3],"hvr")}}if(e&&this._hideTimerId){clearTimeout(this._hideTimerId);this._hideTimerId=null}},_showLevelHint:function(){if(this._opts.type==BMAP_NAVIGATION_CONTROL_LARGE||this._opts.type==BMAP_NAVIGATION_CONTROL_ANIM){if(this._container){x.ac(this._container.children[1].children[3],"hvr")}}},_expandSlider:function(){},_shrinkSlider:function(){},show:function(){ax.prototype.show.call(this);if(x.Browser.ie<8){var e=this;setTimeout(function(){e.setType(e._opts.type)},1)}}});x.extend(eL.prototype,{_asyncDraw:function(){if(this._map){this._i(this._map)}},initialize:function(e){ax.prototype.initialize.call(this,e);this._render(e);this._setParam();this._updateScale();this._bind(e);return this._container},_setParam:function(){this._numberArray={us:[5280*5000,5280*2500,5280*2000,5280*1000,5280*500,5280*200,5280*100,5280*50,5280*25,5280*20,5280*10,5280*5,5280*2,5280,2000,1000,500,200,100,50,20,10,5],metric:[10000000,5000000,2000000,1000000,500000,200000,100000,50000,25000,20000,10000,5000,2000,1000,500,200,100,50,20,10,5,2,1]}},_bind:function(i){var e=this;i.addEventListener("zoomend",function(fc){e._updateScale()});i.addEventListener("load",function(fc){e._updateScale()});i.addEventListener("moveend",function(fc){e._updateScale()})},_render:function(e){ax.prototype._render.call(this,e);x.ac(this._container,"BMap_scaleCtrl");this._container.innerHTML=this._generateHTML();this._container.style.WebkitTextSizeAdjust="none";this._scaleText=this._container.children[0];ax.prototype._setPosition.call(this);if(this.sateMapStyle){this.addSateMapStyle()}},_generateHTML:function(){var e=\'<div class="BMap_scaleTxt" style="white-space:nowrap;overflow:visible;text-align:center" unselectable="on"></div><div class="BMap_scaleBarBG BMap_scaleHBarBG"></div><div class="BMap_scaleBarBG BMap_scaleRBarBG"></div><div class="BMap_scaleBarBG BMap_scaleLBarBG"></div><div class="BMap_scaleBar BMap_scaleHBar"></div><div class="BMap_scaleBar BMap_scaleLBar"></div><div class="BMap_scaleBar BMap_scaleRBar"></div>\';return e},setUnit:function(e){this._opts.unit=this._units[e]&&this._units[e].name||this._opts.unit;if(!this._map){return}this._updateScale()},_setScaleText:function(i,e){this._scaleText.innerHTML=i+"&nbsp;"+e},_updateScale:function(){if(!this._map||!this._container||!this._map.isLoaded()){return}var fc=this._map;var fk=new cJ(Math.round(fc.width/2-50),Math.round(fc.height/2));var fg=new cJ(Math.round(fc.width/2+50),Math.round(fc.height/2));var fd=fc.pixelToPoint(fk,{heading:0});var fj=fc.pixelToPoint(fg,{heading:0});var ff=cL.getDistanceByMC(fd,fj)/100;if(ff==0||isNaN(ff)){return}var i=this._convertUnit(ff,this._opts.unit);var e=0;var fe=this._units[this._opts.unit].incon;var fi=Math.round(this._map.getZoom());var fh=this._numberArray[this._opts.unit][fi-1];e=fh/i;if(dZ()&&e>100){fh=this._numberArray[this._opts.unit][fi];e=fh/i}if(e>300){return}var fl=fh>=fe?this._units[this._opts.unit].u2:this._units[this._opts.unit].u1;if(fh>=fe){fh=Math.round(fh/fe)}this._setScaleText(fh,fl);this._container.style.width=Math.round(e)+"px"},_convertUnit:function(e,i){i=i||"metric";if(this._units[i]){return e*this._units[i].conv}return e}});var dA=new String(dh.imgPath+"maptype.png?20150903");dA.toCss=function(e,fc){e=typeof e==="number"?e+"px ":"";fc=typeof fc==="number"?fc+"px ":"";var i="transparent url("+this+") no-repeat "+e+fc;return i};var aZ=[[0,-138],[-11,-138]];aZ.toCss=function(i){var e=this[Number(i)];return e[0]+"px "+e[1]+"px"};var ah={B_EARTH_MAP:{text:"3D地图",title:"显示3D地图",file:dA,x:0,y:-92,right:0},B_SATELLITE_MAP:{text:"卫星",title:"显示卫星地图",file:dA,x:0,y:-46,right:0},B_NORMAL_MAP:{text:"地图",title:"显示普通地图",file:dA,x:0,y:0,right:0}};var es={B_NORMAL_MAP:{first:"B_SATELLITE_MAP",second:"B_EARTH_MAP",showMenu:false},B_SATELLITE_MAP:{first:"B_NORMAL_MAP",second:"B_EARTH_MAP",showMenu:true},B_EARTH_MAP:{first:"B_SATELLITE_MAP",second:"B_NORMAL_MAP",showMenu:true}};var bd=["B_NORMAL_MAP","B_SATELLITE_MAP","B_EARTH_MAP"];var ao={HIGHLIGHT:"#0c88e8",NORMAL:"#ffffff",HIGHLIGHT_TEXT:"#ffffff",NORMAL_TEXT:"#666666"};x.extend(aR.prototype,{_asyncDraw:function(){if(this._map){this._i(this._map)}},initialize:function(fs){ax.prototype.initialize.call(this,fs);ax.prototype._render.call(this);ax.prototype._setPosition.call(this);this.mapTypeButtons={};var ff=ao;var fd={top:"0px",cursor:"pointer",width:"49px",height:"46px",zIndex:"800",display:"inline-block",position:"absolute",fontSize:"12px",backgroundColor:"#fff"};var fc={width:"49px",height:"46px",position:"absolute"};var ft={position:"absolute",top:"28px",left:"2px",width:"45px",height:"16px",backgroundColor:ff.NORMAL,opacity:"0.8",filter:"Alpha(opacity=80);"};var fk={position:"absolute",top:"30px",left:"2px",width:"45px",color:"#666666",textAlign:"center",lineHeight:"12px"};if(x.isIE>0&&x.isIE<=8){fk.lineHeight="15px"}x.extend(this._container.style,{top:"10px",width:"49px",height:"98px"});this._container.style.background="url("+dh.imgPath+"blank.gif)";this._container.style.WebkitTransition=this._container.style.transition="top .3s ease-out";var e=H("div");this._menu=e;x.extend(e.style,{position:"absolute",width:"71px",height:"24px",border:"1px solid #ABAEB3",fontSize:"12px",bottom:"-32px",right:"0",backgroundColor:"white",display:"none",cursor:"pointer"});var fi=H("span");fi._checked=this._map.isStreetLayerShow();var fg=aZ[1];e._checkbox=fi;x.extend(fi.style,{background:dA.toCss(fg[0],fg[1]),width:"11px",height:"11px",position:"absolute",cssFloat:"left",top:"7px",left:"4px"});e.appendChild(fi);var fj=H("span");fj.innerHTML="显示路网";x.extend(fj.style,{position:"absolute",top:"5px",marginLeft:"18px"});e.appendChild(fj);fj.onmouseover=g;fj.onmouseout=g;e.onmouseover=g;e.onmouseout=g;this._container.appendChild(e);for(var fm=0,fo=bd.length;fm<fo;++fm){var fu=bd[fm];var fe=ah[fu];var fn=H("div");fn.title=fe.title;fn._name=fu;x.extend(fn.style,fe);x.extend(fn.style,fd);var fl=H("div");fl.style.position="absolute";fl.style.width="49px";fl.style.height="46px";fl.style.left=fl.style.top="0";fl.style.zIndex="999";fn._mask=fl;fn.appendChild(fl);var fh=H("span");fn._captionBg=fh;x.extend(fh.style,ft);fh.onmouseover=g;fh.onmouseout=g;var fq=H("span");fn._innerBox=fq;x.extend(fq.style,fc);var fr=dA.toCss(fe.x,fe.y);fq.style.background=fr;var fp=H("span");fn._caption=fp;fp.innerHTML=fe.text;x.extend(fp.style,fk);fn.appendChild(fq);fq.appendChild(fh);fq.appendChild(fp);fp.onmouseover=g;this._container.appendChild(fn);this.mapTypeButtons[fu]=fn}this._bind(fs);this.updateUI(this._map.mapType);return this._container},_bind:function(i){var e=this;this._container.ondblclick=g;this.mapTypeButtons.B_NORMAL_MAP._mask.onclick=function(){e._map.setMapType("B_NORMAL_MAP")};this.mapTypeButtons.B_SATELLITE_MAP._mask.onclick=function(){e._map.setMapType("B_SATELLITE_MAP")};this.mapTypeButtons.B_EARTH_MAP._mask.onclick=function(){e._map.setMapType("B_EARTH_MAP")};this.mapTypeButtons.B_NORMAL_MAP._mask.onmouseover=function(){e._dehighlightAll();e._highlight(e.mapTypeButtons.B_NORMAL_MAP)};this.mapTypeButtons.B_SATELLITE_MAP._mask.onmouseover=function(){e._dehighlightAll();e._highlight(e.mapTypeButtons.B_SATELLITE_MAP)};this.mapTypeButtons.B_EARTH_MAP._mask.onmouseover=function(){e._dehighlightAll();e._highlight(e.mapTypeButtons.B_EARTH_MAP)};this.mapTypeButtons.B_NORMAL_MAP._mask.onmouseout=this.mapTypeButtons.B_SATELLITE_MAP._mask.onmouseout=this.mapTypeButtons.B_EARTH_MAP._mask.onmouseout=function(){e._dehighlightAll()};this._menu.onclick=function(fc){e._map.showStreetLayer(!e._menu._checkbox._checked);g(fc);return false};this._menu.ondblclick=g;i.addEventListener("onmaptypechange",function(fc){e.updateUI(this.mapType)});i.addEventListener("onstreetlayer_show",function(fc){e._menu._checkbox._checked=true;e._menu._checkbox.style.backgroundPosition=aZ.toCss(true)});i.addEventListener("onstreetlayer_hide",function(fc){e._menu._checkbox._checked=false;e._menu._checkbox.style.backgroundPosition=aZ.toCss(false)});i.addEventListener("forceenableearth",function(fc){if(this.config.enableEarth){e.showButton("B_EARTH_MAP")}})},updateUI:function(fc){this.hideButton(fc);var ff=es[fc];var fd=this.mapTypeButtons[ff.first];fd.style.top="0";this.showButton(ff.first);var e=this.mapTypeButtons[ff.second];e.style.top="50px";this.showButton(ff.second);if(fc!=="B_NORMAL_MAP"){var i=this._map.isStreetLayerShow();var fe=this._menu;fe._checkbox._checked=i;fe._checkbox.style.backgroundPosition=aZ.toCss(i);fe.style.display="";if(this._map.config.enableEarth){fe.style.bottom="-32px"}else{fe.style.bottom="20px"}}else{this._menu.style.display="none"}if(!this._map.config.enableEarth){this.hideButton("B_EARTH_MAP")}},remove:function(){var fd=this.mapTypeButtons;for(var fc=0,e=fd.length;fc<e;++fc){fd[fc]=null}ax.prototype.remove.call(this)},hideButton:function(i){var e=this.mapTypeButtons[i];if(!e){return}if(e.style){e.style.visibility="hidden"}},showButton:function(i){var e=this.mapTypeButtons[i];if(!e){return}if(e.style){e.style.visibility="visible"}},isButtonVisible:function(i){var e=this.mapTypeButtons[i];if(!e){return}return e.style.visibility==="visible"},_highlight:function(e){if(!e){return}e._captionBg.style.backgroundColor=ao.HIGHLIGHT;e._captionBg.style.opacity="1";e._captionBg.style.filter="";e._caption.style.color=ao.HIGHLIGHT_TEXT},_dehighlight:function(e){if(!e){return}e._captionBg.style.backgroundColor=ao.NORMAL;e._captionBg.style.opacity="0.8";e._captionBg.style.filter="Alpha(opacity=80);";e._caption.style.color=ao.NORMAL_TEXT},_dehighlightAll:function(){this._dehighlight(this.mapTypeButtons.B_NORMAL_MAP);this._dehighlight(this.mapTypeButtons.B_EARTH_MAP);this._dehighlight(this.mapTypeButtons.B_SATELLITE_MAP)}});x.extend(bw.prototype,{_asyncDraw:function(){if(this._map){this._i(this._map)}},initialize:function(i){this._map=i;var fd=this._container=document.createElement("div");fd.style.cssText="box-shadow: 0 2px 6px 0 rgba(107,120,137,0.20), 0 4px 10px 0 rgba(91,98,107,0.08);background:rgba(255,255,255,1);border-radius: 4px;cursor:pointer;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;";var e=this._zoomIn=document.createElement("div");e.style.cssText="position:relative;width:39px;height:40px;";e.innerHTML=\'<div style="width:14px;height:14px;position: absolute;left:50%;top:50%;margin-left:-7px;margin-top:-6px;background: url(\'+dh.imgResources.zoomPng+\') 0px 0px;background-size: 15px 75px;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events: none;"></div>\';var fc=this._zoomOut=document.createElement("div");fc.style.cssText="position:relative;width:39px;height:40px;";fc.innerHTML=\'<div style="width:14px;height:14px;position: absolute;left:50%;top:50%;margin-left:-7px;margin-top:-6px;background: url(\'+dh.imgResources.zoomPng+\') 0px -30px;background-size: 15px 75px;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events: none;"></div>\';fd.appendChild(e);fd.appendChild(fc);i.getContainer().appendChild(fd);this.bindEvt();return fd},bindEvt:function(){var fj=this;var e=fj._map;function fi(fk){if(fj._zoomInDisabled){return}fj._zoomInTapped=true;this.style.background="#9b9b9b";fk.preventDefault()}function fe(){if(!fj._zoomInTapped){return}e.zoomIn();fj.updateUI();fj._zoomInTapped=false;this.style.background=""}function ff(fk){if(fj._zoomOutDisabled){return}fj._zoomOutTapped=true;this.style.background="#9b9b9b";fk.preventDefault()}function fc(){if(!fj._zoomOutTapped){return}e.zoomOut();fj.updateUI();fj._zoomOutTapped=false;this.style.background=""}var fg=fj._zoomIn;var fh=fj._zoomOut;var i="mousedown";var fd="mouseup";if(dZ()){i="touchstart";fd="touchend"}fg.addEventListener(i,fi,false);fg.addEventListener(fd,fe,false);fh.addEventListener(i,ff,false);fh.addEventListener(fd,fc,false);fj.zoomChangeHandler=function(){fj.updateUI()};e.addEventListener("zoomend",fj.zoomChangeHandler);e.addEventListener("load",fj.zoomChangeHandler);fj.updateUI()},updateUI:function(){var e=this._map;if(e.getZoom()>=e.getMaxZoom()){this._zoomInDisabled=true;this._zoomIn.childNodes[0].style.backgroundPosition="0px -15px"}else{this._zoomInDisabled=false;this._zoomIn.childNodes[0].style.backgroundPosition="0px 0px"}if(e.getZoom()<=e.getMinZoom()){this._zoomOutDisabled=true;this._zoomOut.childNodes[0].style.backgroundPosition="0px -42px"}else{this._zoomOutDisabled=false;this._zoomOut.childNodes[0].style.backgroundPosition="0px -30px"}}});x.extend(aP.prototype,{_asyncDraw:function(){if(this._map){this._i(this._map)}if(this._startLocationCalled){this.startLocation();this._startLocationCalled=false}},initialize:function(e){ax.prototype.initialize.call(this,e);this._render(e);this._bind(e);return this._container},startLocation:function(){var fc=this;var e=true;if(fc.onLocationStart){function fd(ff){fc._onLocSuccess(ff,true)}function fe(ff){fc._onLocFailure(ff)}e=fc.onLocationStart(fd,fe)}if(e===false){return}if(!navigator.geolocation){return}var i={enableHighAccuracy:this._opts.enableHighAccuracy,maximumAge:1000,timeout:this._opts.timeout};this.watchId&&navigator.geolocation.clearWatch(this.watchId);this.watchId=null;navigator.geolocation.getCurrentPosition(function(ff){fc._onLocSuccess(ff,true)},function(ff){fc._onLocFailure(ff)},i);if(this.watchPosition){this.watchId=navigator.geolocation.watchPosition(function(ff){fc._onLocSuccess(ff,false)},function(ff){},i)}},showLocationAt:function(e){this._userSetLocation=e;if(!this.locMarker){this._addLocOverlay(this._userSetLocation)}else{this._refreshLocOverlayPosition(this._userSetLocation,false)}},stopLocationTrace:function(){if(navigator.geolocation){this.watchId&&navigator.geolocation.clearWatch(this.watchId)}},_render:function(fc){var i=this._container=document.createElement("div");i.style.cssText="width:39px;height:39px;box-shadow: 0 2px 6px 0 rgba(107,120,137,0.20), 0 4px 10px 0 rgba(91,98,107,0.08);background:#fff;cursor:pointer;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;border-radius: 4px;";var fd=this._locBtn=document.createElement("div");fd.style.cssText=\'position: absolute;left: 50%;top: 50%;margin-left: -10px;margin-top: -10px;width: 20px;height: 20px;background: url("\'+dh.imgResources.locNewPng+\'") 0 0;background-size: 48px 116px;\';i.appendChild(fd);var e=this._locFailTip=document.createElement("div");e.innerHTML="定位失败";e.style.cssText="display:none;position:absolute;left:45px;top:50%;width: 52px;height:20px;line-height:20px;margin-top:-10px;font-size:12px;box-shadow:1px 1px 2px rgba(0,0,0,.4);background:rgba(255,255,255,1);border-radius:3px;padding-left:5px;";i.appendChild(e);if(this._visible===false){this._container.style.display="none"}fc.getContainer().appendChild(i);return i},_bind:function(){var e=this;function fc(){e._buttonTapped=true;this.style.background="#9b9b9b"}function i(){if(e._buttonTapped===false){return}e._buttonTapped=false;e.startLocation();this.style.background="#fff"}if(!dZ()){e._container.addEventListener("mousedown",fc,false);e._container.addEventListener("mouseup",i,false)}else{e._container.addEventListener("touchstart",fc,false);e._container.addEventListener("touchend",i,false)}},_onLocSuccess:function(fh,fk){var fg=this;var fi=fh.coords.longitude;var ff=fh.coords.latitude;if(fg._opts.onSuccess){var fd="wgs84ll";if(cU()&&bG()){fd="gcj02ll"}fg._opts.onSuccess({rawCoords:new eU(fi,ff),rawCoordsType:fd})}if(fh.coordsType==="bd09mc"){var i=new eU(fi,ff);if(!fg.locMarker){fg._addLocOverlay(i)}else{fg._refreshLocOverlayPosition(i,fk)}return}var fj=1;if(fh.coordsType==="bd09ll"){fj=5}var fc=fi+","+ff;var fe="locCbk"+Math.floor(Math.random()*10000000000);aG[fe]=function(fm){if(fm&&fm.result&&fm.result.length>0){var fl=fm.result[0];var fn=new eU(fl.x,fl.y);if(!fg.locMarker){fg._addLocOverlay(fn)}else{fg._refreshLocOverlayPosition(fn,fk)}}delete aG[fe]};var e=dh.apiHost+"/geoconv/v1/?coords="+fc+"&from="+fj+"&to=6&ak=1biSUTC4Lo4hgpK3GQoytX3t&callback="+cT+"."+fe;eP.load(e)},_onLocFailure:function(i){if(this._opts.onFail){this._opts.onFail(i)}if(this._opts.showTips){var e=this._locFailTip;e.style.display="block";setTimeout(function(){e.style.display="none"},1000)}},_addLocOverlay:function(i){var fc=this._map;var e=new eH(dh.imgResources.locNewPng,new cB(48,48),{imageSize:new cB(48,116),imageOffset:new cB(0,20)});var fd=this.locMarker=new b6(i,{icon:e,baseZIndex:999999,enableMassClear:false,clickable:false});fc.addOverlay(fd);if(this._opts.autoViewport){if(this._opts.autoZoom){fc.centerAndZoom(i,this.locLevel)}else{fc.setCenter(i)}}if(this.useCompass&&this._isSupportCompass()){this.switchToCompassState()}},_refreshLocOverlayPosition:function(i,e){this.locMarker.setPosition(i);if(this.headingMarker){this.headingMarker.setPosition(i)}if(e&&this._opts.autoViewport){if(this._opts.autoZoom){this._map.centerAndZoom(i,this.locLevel)}else{this._map.setCenter(i)}}},_isSupportCompass:function(){var e=navigator.userAgent.toLowerCase();if(e.indexOf("android")>-1||!window.DeviceOrientationEvent||(e.indexOf("ucweb")>-1&&e.indexOf("linux")>-1)){return false}return true},switchToCompassState:function(){var fc=this;var i=new eH(dh.imgResources.locNewPng,new cB(48,48),{imageSize:new cB(48,116),imageOffset:new cB(0,68),anchor:new cB(24,24)});this.headingMarker=new b6(this.locMarker.getPosition(),{icon:i,baseZIndex:999998,enableMassClear:false,clickable:false});this._map.addOverlay(this.headingMarker);var e=0;var fd=window.orientation;window.addEventListener("deviceorientation",function(fg){var ff;if(!fg.webkitCompassHeading){ff=Math.round(fg.alpha)}else{ff=Math.round(0-fg.webkitCompassHeading)}ff=ff-fd;var fe=Math.abs(e-ff);if(fe>1){fc.headingMarker.setRotation(0-ff);e=ff}},true);window.addEventListener("orientationchange",function(){fd=window.orientation},true)}});');
