(function webpackUniversalModuleDefinition(root, factory) {
	if(typeof exports === 'object' && typeof module === 'object')
		module.exports = factory(require("vue"), require("@kq_npm/client_common_vue/_utils/gis-utils"), require("@kq_npm/client_common_vue/init.js"));
	else if(typeof define === 'function' && define.amd)
		define(["vue", "@kq_npm/client_common_vue/_utils/gis-utils", "@kq_npm/client_common_vue/init.js"], factory);
	else {
		var a = typeof exports === 'object' ? factory(require("vue"), require("@kq_npm/client_common_vue/_utils/gis-utils"), require("@kq_npm/client_common_vue/init.js")) : factory(root["Vue"], root["@kq_npm/client_common_vue/_utils/gis-utils"], root["@kq_npm/client_common_vue/init.js"]);
		for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
	}
})(this, function(__WEBPACK_EXTERNAL_MODULE__1895__, __WEBPACK_EXTERNAL_MODULE__7135__, __WEBPACK_EXTERNAL_MODULE__7997__) {
return /******/ (function() { // webpackBootstrap
/******/ 	"use strict";
/******/ 	var __webpack_modules__ = ({

/***/ 8800:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": function() { return /* binding */ FixedZoomout3dViewModel; }
/* harmony export */ });
/* harmony import */ var _Users_zpc_Documents_KQGEOSpace_KQGISClientForVue_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8270);

// 三维固定缩放逻辑
class FixedZoomout3dViewModel {
  //三维viewer对象
  constructor(viewer) {
    (0,_Users_zpc_Documents_KQGEOSpace_KQGISClientForVue_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(this, "_viewer", null);

    this._viewer = viewer;
  } //获取相机焦点


  getCameraFocus() {
    if (!this._viewer) return;
    var scene = this._viewer.scene;
    var camera = scene.camera;
    var rayScratch = new Cesium.Ray();
    rayScratch.origin = camera.positionWC;
    rayScratch.direction = camera.directionWC;
    var result = new Cesium.Cartesian3();
    result = scene.globe.pick(rayScratch, scene, result);

    if (result) {
      result = camera.worldToCameraCoordinatesPoint(result, result);
    }

    return result;
  } //地图缩放


  zoom(scale) {
    if (!this._viewer) return;
    var scene = this._viewer.scene;
    var camera = scene.camera;
    var focus = this.getCameraFocus();
    var orientation;

    if (!focus) {
      // Camera direction is not pointing at the globe, so use the ellipsoid horizon point as
      // the focal point.
      var ray = new Cesium.Ray(camera.worldToCameraCoordinatesPoint(scene.globe.ellipsoid.cartographicToCartesian(camera.positionCartographic)), camera.directionWC);
      focus = Cesium.IntersectionTests.grazingAltitudeLocation(ray, scene.globe.ellipsoid);
      orientation = {
        heading: camera.heading,
        pitch: camera.pitch,
        roll: camera.roll
      };
    } else {
      orientation = {
        direction: camera.direction,
        up: camera.up
      };
    }

    var cartesian3Scratch = new Cesium.Cartesian3();
    var direction = Cesium.Cartesian3.subtract(camera.position, focus, cartesian3Scratch);
    var movementVector = Cesium.Cartesian3.multiplyByScalar(direction, scale, direction);
    var endPosition = Cesium.Cartesian3.add(focus, movementVector, focus);
    camera.flyTo({
      destination: endPosition,
      orientation: orientation,
      duration: 0.5,
      convert: false
    });
  }

}

/***/ }),

/***/ 8422:
/***/ (function(module) {

module.exports = require("@element-plus/icons-vue");

/***/ }),

/***/ 7080:
/***/ (function(module) {

module.exports = require("vue-i18n/dist/vue-i18n.cjs.js");

/***/ }),

/***/ 7135:
/***/ (function(module) {

module.exports = __WEBPACK_EXTERNAL_MODULE__7135__;

/***/ }),

/***/ 7997:
/***/ (function(module) {

module.exports = __WEBPACK_EXTERNAL_MODULE__7997__;

/***/ }),

/***/ 1895:
/***/ (function(module) {

module.exports = __WEBPACK_EXTERNAL_MODULE__1895__;

/***/ }),

/***/ 8270:
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": function() { return /* binding */ _defineProperty; }
/* harmony export */ });
function _defineProperty(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, {
      value: value,
      enumerable: true,
      configurable: true,
      writable: true
    });
  } else {
    obj[key] = value;
  }

  return obj;
}

/***/ })

/******/ 	});
/************************************************************************/
/******/ 	// The module cache
/******/ 	var __webpack_module_cache__ = {};
/******/ 	
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/ 		// Check if module is in cache
/******/ 		var cachedModule = __webpack_module_cache__[moduleId];
/******/ 		if (cachedModule !== undefined) {
/******/ 			return cachedModule.exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = __webpack_module_cache__[moduleId] = {
/******/ 			// no module.id needed
/******/ 			// no module.loaded needed
/******/ 			exports: {}
/******/ 		};
/******/ 	
/******/ 		// Execute the module function
/******/ 		__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/ 	
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/compat get default export */
/******/ 	!function() {
/******/ 		// getDefaultExport function for compatibility with non-harmony modules
/******/ 		__webpack_require__.n = function(module) {
/******/ 			var getter = module && module.__esModule ?
/******/ 				function() { return module['default']; } :
/******/ 				function() { return module; };
/******/ 			__webpack_require__.d(getter, { a: getter });
/******/ 			return getter;
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/define property getters */
/******/ 	!function() {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = function(exports, definition) {
/******/ 			for(var key in definition) {
/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
/******/ 	!function() {
/******/ 		__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/make namespace object */
/******/ 	!function() {
/******/ 		// define __esModule on exports
/******/ 		__webpack_require__.r = function(exports) {
/******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 			}
/******/ 			Object.defineProperty(exports, '__esModule', { value: true });
/******/ 		};
/******/ 	}();
/******/ 	
/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
!function() {
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "FixedZoomoutViewModel": function() { return /* reexport */ FixedZoomoutViewModel/* default */.Z; },
  "default": function() { return /* reexport */ FixedZoomout; }
});

// EXTERNAL MODULE: external {"root":"Vue","commonjs":"vue","commonjs2":"vue","amd":"vue"}
var external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_ = __webpack_require__(1895);
// EXTERNAL MODULE: external "@element-plus/icons-vue"
var icons_vue_ = __webpack_require__(8422);
// EXTERNAL MODULE: ./src/webgl/fixedzoomout/FixedZoomoutViewModel.js
var FixedZoomoutViewModel = __webpack_require__(8800);
// EXTERNAL MODULE: external "@kq_npm/client_common_vue/_utils/gis-utils"
var gis_utils_ = __webpack_require__(7135);
// EXTERNAL MODULE: external "vue-i18n/dist/vue-i18n.cjs.js"
var vue_i18n_cjs_js_ = __webpack_require__(7080);
;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/webgl/fixedzoomout/FixedZoomout.vue?vue&type=script&setup=true&lang=js





 // 获取组件传参

const __default__ = {
  name: "Kq3dFixedZoomout"
};
/* harmony default export */ var FixedZoomoutvue_type_script_setup_true_lang_js = (/*#__PURE__*/Object.assign(__default__, {
  props: {
    // 指定组件绑定的scence对象的div的id
    mapTarget: String,
    // 组件大小
    size: {
      type: Number,
      default: 32
    },
    showShadow: {
      type: Boolean,
      default: false
    }
  },

  setup(__props) {
    const props = __props;
    let language = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.ref)({});
    let viewModel = null;
    let btn = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.ref)(null); // 国际化

    let {
      locale,
      messages
    } = (0,vue_i18n_cjs_js_.useI18n)();
    (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.watch)(() => locale.value, (newVal, oldVal) => {
      language.value = messages.value[newVal]["webgl"];
    });
    (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.onMounted)(() => {
      gis_utils_.utils.getWebMap(props.mapTarget, scenceView => {
        if (scenceView) {
          viewModel = new FixedZoomoutViewModel/* default */.Z(scenceView._viewer);
        }
      });
    }); // 按钮点击事件

    function btnClick() {
      btn.value.$el.blur();
      viewModel && viewModel.zoom(0.5);
    }

    return (_ctx, _cache) => {
      const _component_kq_icon = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.resolveComponent)("kq-icon");

      const _component_kq_button = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.resolveComponent)("kq-button");

      return (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.openBlock)(), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createBlock)(_component_kq_button, {
        title: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(language).zoomIn,
        class: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.normalizeClass)([{
          'kq-light-shadow': __props.showShadow
        }]),
        ref_key: "btn",
        ref: btn,
        onClick: btnClick,
        style: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.normalizeStyle)('width:' + __props.size + 'px;height:' + __props.size + 'px;')
      }, {
        default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_icon, {
          size: __props.size / 2
        }, {
          default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(icons_vue_.Plus))]),
          _: 1
          /* STABLE */

        }, 8
        /* PROPS */
        , ["size"])]),
        _: 1
        /* STABLE */

      }, 8
      /* PROPS */
      , ["title", "class", "style"]);
    };
  }

}));
;// CONCATENATED MODULE: ./src/webgl/fixedzoomout/FixedZoomout.vue?vue&type=script&setup=true&lang=js
 
;// CONCATENATED MODULE: ./src/webgl/fixedzoomout/FixedZoomout.vue



const __exports__ = FixedZoomoutvue_type_script_setup_true_lang_js;

/* harmony default export */ var FixedZoomout = (__exports__);
// EXTERNAL MODULE: external "@kq_npm/client_common_vue/init.js"
var init_js_ = __webpack_require__(7997);
var init_js_default = /*#__PURE__*/__webpack_require__.n(init_js_);
;// CONCATENATED MODULE: ./src/webgl/fixedzoomout/index.js




FixedZoomout.install = (Vue, opts) => {
  init_js_default()(Vue, opts);
  Vue.component(FixedZoomout.name, FixedZoomout);
};


}();
/******/ 	return __webpack_exports__;
/******/ })()
;
});