fuchengshen
2022-07-15 e1186e0c9c1a7a47454b73f9cddcf733dce30b32
1
function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function _createClass(t,e,i){return e&&_defineProperties(t.prototype,e),i&&_defineProperties(t,i),t}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return(_setPrototypeOf=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function _createSuper(i){var r=_isNativeReflectConstruct();return function(){var t,e=_getPrototypeOf(i);return _possibleConstructorReturn(this,r?(t=_getPrototypeOf(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}function _possibleConstructorReturn(t,e){if(e&&("object"===_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}function _getPrototypeOf(t){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}!function(n){var t=function(){"use strict";_inherits(e,n.widget.BaseWidget);var t=_createSuper(e);function e(){return _classCallCheck(this,e),t.apply(this,arguments)}return _createClass(e,[{key:"resources",get:function(){return["view.css"]}},{key:"view",get:function(){return{type:"divwindow",url:"view.html",windowOptions:{width:210,height:210}}}},{key:"winCreateOK",value:function(t,e){var r=this,i=this.map.getCenter();this.showInputView(i),$("#btnCenterXY").click(function(){var t=$("#point_jd").val(),e=$("#point_wd").val(),i=$("#point_height").val(),i=new n.LatLngPoint(Number(t),Number(e),Number(i));r.updateMarker(i,!0)})}},{key:"activate",value:function(){this.map.on(n.EventType.click,this.onMapClick,this)}},{key:"disable",value:function(){this.map.off(n.EventType.click,this.onMapClick,this),this.graphic&&(this.map.graphicLayer.removeGraphic(this.graphic,!0),this.graphic=null)}},{key:"onMapClick",value:function(t){t=t.cartesian;t&&(t=n.LatLngPoint.fromCartesian(t),this.updateMarker(t),this.showInputView(t))}},{key:"updateMarker",value:function(t,e){this.graphic?this.graphic.position=t:(this.graphic=new n.graphic.BillboardEntity({position:t,style:{image:this.path+"img/marker.png",horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,scale:.6}}),this.map.graphicLayer.addGraphic(this.graphic)),e&&this.map.flyToGraphic(this.graphic,{radius:2e3})}},{key:"showInputView",value:function(t){$("#point_jd").val(t.lng.toFixed(6)),$("#point_wd").val(t.lat.toFixed(6)),$("#point_height").val(t.alt.toFixed(1))}}]),e}();n.widget.bindClass(t)}((window,mars3d));