/**
 * vue-cesium - https://github.com/zouyaoji/vue-cesium
 * Vue 2.x components for CesiumJS.
 *
 * @package VueCesium
 * @author zouyaoji <370681295@qq.com>
 * @version 2.2.12
 * @license MIT
 * @homepage https://zouyaoji.top/vue-cesium
 * @copyright (c) 2018-2021, zouyaoji <370681295@qq.com>
 */
import _Object$defineProperties from '@babel/runtime-corejs2/core-js/object/define-properties';
import _regeneratorRuntime from '@babel/runtime-corejs2/regenerator';
import cmp from '../virtualCmp';

var methods = {
  mount: function mount() {
    var geometry, geometryContainer;
    return _regeneratorRuntime.async(function mount$(_context) {
      while (1) {
        switch (_context.prev = _context.next) {
          case 0:
            geometry = this.geometry, geometryContainer = this.geometryContainer;
            return _context.abrupt("return", geometryContainer.setGeometry(geometry));

          case 2:
          case "end":
            return _context.stop();
        }
      }
    }, null, this);
  }
};
var mixinGeometry = {
  mixins: [cmp],
  methods: methods,
  stubVNode: {
    empty: function empty() {
      return this.$options.name;
    }
  },
  created: function created() {
    var _this = this;

    this.renderByParent = true;

    _Object$defineProperties(this, {
      geometry: {
        enumerable: true,
        get: function get() {
          return _this.cesiumObject;
        }
      },
      geometryContainer: {
        enumerable: true,
        get: function get() {
          return _this.$services && _this.$services.geometryContainer;
        }
      }
    });
  }
};

export default mixinGeometry;
