module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ 	// The module cache
/******/ 	var installedModules = {};
/******/
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/
/******/ 		// Check if module is in cache
/******/ 		if(installedModules[moduleId]) {
/******/ 			return installedModules[moduleId].exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = installedModules[moduleId] = {
/******/ 			i: moduleId,
/******/ 			l: false,
/******/ 			exports: {}
/******/ 		};
/******/
/******/ 		// Execute the module function
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ 		// Flag the module as loaded
/******/ 		module.l = true;
/******/
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/
/******/
/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = modules;
/******/
/******/ 	// expose the module cache
/******/ 	__webpack_require__.c = installedModules;
/******/
/******/ 	// define getter function for harmony exports
/******/ 	__webpack_require__.d = function(exports, name, getter) {
/******/ 		if(!__webpack_require__.o(exports, name)) {
/******/ 			Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ 		}
/******/ 	};
/******/
/******/ 	// 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 });
/******/ 	};
/******/
/******/ 	// create a fake namespace object
/******/ 	// mode & 1: value is a module id, require it
/******/ 	// mode & 2: merge all properties of value into the ns
/******/ 	// mode & 4: return value when already ns object
/******/ 	// mode & 8|1: behave like require
/******/ 	__webpack_require__.t = function(value, mode) {
/******/ 		if(mode & 1) value = __webpack_require__(value);
/******/ 		if(mode & 8) return value;
/******/ 		if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ 		var ns = Object.create(null);
/******/ 		__webpack_require__.r(ns);
/******/ 		Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ 		if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ 		return ns;
/******/ 	};
/******/
/******/ 	// getDefaultExport function for compatibility with non-harmony modules
/******/ 	__webpack_require__.n = function(module) {
/******/ 		var getter = module && module.__esModule ?
/******/ 			function getDefault() { return module['default']; } :
/******/ 			function getModuleExports() { return module; };
/******/ 		__webpack_require__.d(getter, 'a', getter);
/******/ 		return getter;
/******/ 	};
/******/
/******/ 	// Object.prototype.hasOwnProperty.call
/******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ 	// __webpack_public_path__
/******/ 	__webpack_require__.p = "lib/mapboxgl/";
/******/
/******/
/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(__webpack_require__.s = 800);
/******/ })
/************************************************************************/
/******/ ({

/***/ 0:
/***/ (function(module, exports) {

module.exports = require("@babel/runtime/helpers/interopRequireDefault");

/***/ }),

/***/ 1:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
/* globals __VUE_SSR_CONTEXT__ */

// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
// This module is a runtime utility for cleaner component module output and will
// be included in the final webpack user bundle.

function normalizeComponent(
  scriptExports,
  render,
  staticRenderFns,
  functionalTemplate,
  injectStyles,
  scopeId,
  moduleIdentifier /* server only */,
  shadowMode /* vue-cli only */
) {
  // Vue.extend constructor export interop
  var options =
    typeof scriptExports === 'function' ? scriptExports.options : scriptExports

  // render functions
  if (render) {
    options.render = render
    options.staticRenderFns = staticRenderFns
    options._compiled = true
  }

  // functional template
  if (functionalTemplate) {
    options.functional = true
  }

  // scopedId
  if (scopeId) {
    options._scopeId = 'data-v-' + scopeId
  }

  var hook
  if (moduleIdentifier) {
    // server build
    hook = function (context) {
      // 2.3 injection
      context =
        context || // cached call
        (this.$vnode && this.$vnode.ssrContext) || // stateful
        (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
      // 2.2 with runInNewContext: true
      if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
        context = __VUE_SSR_CONTEXT__
      }
      // inject component styles
      if (injectStyles) {
        injectStyles.call(this, context)
      }
      // register component module identifier for async chunk inferrence
      if (context && context._registeredComponents) {
        context._registeredComponents.add(moduleIdentifier)
      }
    }
    // used by ssr in case component is cached and beforeCreate
    // never gets called
    options._ssrRegister = hook
  } else if (injectStyles) {
    hook = shadowMode
      ? function () {
          injectStyles.call(
            this,
            (options.functional ? this.parent : this).$root.$options.shadowRoot
          )
        }
      : injectStyles
  }

  if (hook) {
    if (options.functional) {
      // for template-only hot-reload because in that case the render fn doesn't
      // go through the normalizer
      options._injectStyles = hook
      // register for functional component in vue file
      var originalRender = options.render
      options.render = function renderWithStyleInjection(h, context) {
        hook.call(context)
        return originalRender(h, context)
      }
    } else {
      // inject component registration as beforeCreate hook
      var existing = options.beforeCreate
      options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
    }
  }

  return {
    exports: scriptExports,
    options: options
  }
}


/***/ }),

/***/ 10:
/***/ (function(module, exports) {

module.exports = require("lodash.isplainobject");

/***/ }),

/***/ 11:
/***/ (function(module, exports) {

module.exports = require("@supermap/vue-iclient-mapboxgl/lib/_utils/vue-types/utils.js");

/***/ }),

/***/ 112:
/***/ (function(module, exports) {

module.exports = require("@supermap/vue-iclient-mapboxgl/lib/select");

/***/ }),

/***/ 117:
/***/ (function(module, exports) {

module.exports = require("@supermap/vue-iclient-mapboxgl/lib/_types/draw-event.js");

/***/ }),

/***/ 12:
/***/ (function(module, exports) {

module.exports = require("@supermap/vue-iclient-mapboxgl/lib/_utils/util.js");

/***/ }),

/***/ 16:
/***/ (function(module, exports) {

module.exports = require("@supermap/vue-iclient-mapboxgl/lib/_lang/index.js");

/***/ }),

/***/ 17:
/***/ (function(module, exports) {

module.exports = require("@supermap/vue-iclient-mapboxgl/lib/_mixin/control.js");

/***/ }),

/***/ 2:
/***/ (function(module, exports) {

module.exports = require("@supermap/vue-iclient-mapboxgl/lib/init.js");

/***/ }),

/***/ 21:
/***/ (function(module, exports) {

module.exports = require("lodash.uniqueid");

/***/ }),

/***/ 22:
/***/ (function(module, exports) {

module.exports = require("@supermap/vue-iclient-mapboxgl/lib/_mixin/Card.js");

/***/ }),

/***/ 26:
/***/ (function(module, exports) {

module.exports = require("@supermap/vue-iclient-mapboxgl/lib/message");

/***/ }),

/***/ 27:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _node_modules_babel_loader_lib_index_js_node_modules_ts_loader_index_js_ref_0_1_node_modules_vue_loader_lib_index_js_vue_loader_options_Option_vue_vue_type_script_lang_ts___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(28);
/* harmony import */ var _node_modules_babel_loader_lib_index_js_node_modules_ts_loader_index_js_ref_0_1_node_modules_vue_loader_lib_index_js_vue_loader_options_Option_vue_vue_type_script_lang_ts___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_babel_loader_lib_index_js_node_modules_ts_loader_index_js_ref_0_1_node_modules_vue_loader_lib_index_js_vue_loader_options_Option_vue_vue_type_script_lang_ts___WEBPACK_IMPORTED_MODULE_0__);
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_babel_loader_lib_index_js_node_modules_ts_loader_index_js_ref_0_1_node_modules_vue_loader_lib_index_js_vue_loader_options_Option_vue_vue_type_script_lang_ts___WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_babel_loader_lib_index_js_node_modules_ts_loader_index_js_ref_0_1_node_modules_vue_loader_lib_index_js_vue_loader_options_Option_vue_vue_type_script_lang_ts___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
 /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_node_modules_ts_loader_index_js_ref_0_1_node_modules_vue_loader_lib_index_js_vue_loader_options_Option_vue_vue_type_script_lang_ts___WEBPACK_IMPORTED_MODULE_0___default.a); 

/***/ }),

/***/ 28:
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _interopRequireDefault = __webpack_require__(0);
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.optionTypes = exports.default = void 0;
var _select = _interopRequireDefault(__webpack_require__(51));
var _vueTypes = _interopRequireDefault(__webpack_require__(8));
var _Theme = _interopRequireDefault(__webpack_require__(4));
var _AntdRender = _interopRequireDefault(__webpack_require__(6));
var optionTypes = exports.optionTypes = {
  disabled: _vueTypes.default.bool,
  key: _vueTypes.default.string,
  title: _vueTypes.default.string,
  value: _vueTypes.default.oneOfType([_vueTypes.default.string, _vueTypes.default.number])
};
var _default = exports.default = {
  name: 'SmSelectOption',
  isSelectOption: true,
  defaultComponent: _select.default.Option,
  mixins: [_Theme.default, _AntdRender.default],
  inheritAttrs: false,
  props: optionTypes
};

/***/ }),

/***/ 3:
/***/ (function(module, exports) {

module.exports = require("@babel/runtime/helpers/inheritsLoose");

/***/ }),

/***/ 342:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _node_modules_babel_loader_lib_index_js_node_modules_vue_loader_lib_index_js_vue_loader_options_Measure_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(343);
/* harmony import */ var _node_modules_babel_loader_lib_index_js_node_modules_vue_loader_lib_index_js_vue_loader_options_Measure_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_babel_loader_lib_index_js_node_modules_vue_loader_lib_index_js_vue_loader_options_Measure_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__);
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_babel_loader_lib_index_js_node_modules_vue_loader_lib_index_js_vue_loader_options_Measure_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_babel_loader_lib_index_js_node_modules_vue_loader_lib_index_js_vue_loader_options_Measure_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
 /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_node_modules_vue_loader_lib_index_js_vue_loader_options_Measure_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default.a); 

/***/ }),

/***/ 343:
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _interopRequireDefault = __webpack_require__(0);
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _Theme = _interopRequireDefault(__webpack_require__(4));
var _control = _interopRequireDefault(__webpack_require__(17));
var _mapGetter = _interopRequireDefault(__webpack_require__(7));
var _Card = _interopRequireDefault(__webpack_require__(22));
var _Select = _interopRequireDefault(__webpack_require__(112));
var _Option = _interopRequireDefault(__webpack_require__(84));
var _MeasureViewModel = _interopRequireDefault(__webpack_require__(802));
var _drawEvent = _interopRequireDefault(__webpack_require__(117));
var _lodash = _interopRequireDefault(__webpack_require__(21));
var _util = __webpack_require__(12);
__webpack_require__(90);
var _Message = _interopRequireDefault(__webpack_require__(26));
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
var _default2 = exports.default = {
  name: 'SmMeasure',
  components: {
    SmSelect: _Select.default,
    SmSelectOption: _Option.default
  },
  mixins: [_mapGetter.default, _control.default, _Theme.default, _Card.default],
  props: {
    iconClass: {
      type: String,
      default: 'sm-components-icon-measure'
    },
    headerName: {
      type: String,
      default: function _default() {
        return this.$t('measure.mapMeasure');
      }
    },
    showUnitSelect: {
      // 配置单位选择框是否显示，若不显示，则显示对应的默认单位
      type: Boolean,
      default: true
    },
    distanceDefaultUnit: {
      // 距离默认单位
      type: String,
      default: 'kilometers'
    },
    areaDefaultUnit: {
      // 面积默认单位
      type: String,
      default: 'kilometers'
    },
    continueDraw: {
      // 是否开启多绘制
      type: Boolean,
      default: true
    }
  },
  data: function data() {
    var unitOptions = {
      draw_line_string: {
        kilometers: this.$t('unit.kilometers'),
        miles: this.$t('unit.miles'),
        meters: this.$t('unit.meters'),
        feet: this.$t('unit.feet'),
        yards: this.$t('unit.yards')
      },
      draw_polygon: {
        kilometers: this.$t('unit.squarekilometers'),
        miles: this.$t('unit.squaremiles'),
        meters: this.$t('unit.squaremeters'),
        feet: this.$t('unit.squarefeet'),
        yards: this.$t('unit.squareyards')
      }
    };
    return {
      unitOptions: unitOptions,
      modeGroups: [{
        mode: 'draw_line_string',
        title: this.$t('measure.distance'),
        iconClass: 'sm-components-icon-line'
      }, {
        mode: 'draw_polygon',
        title: this.$t('measure.area'),
        iconClass: 'sm-components-icon-ploygon'
      }, {
        mode: 'delete',
        title: this.$t('measure.delete'),
        iconClass: 'sm-components-icon-delete'
      }],
      activeMode: '',
      result: '',
      activeDistanceUnit: this.distanceDefaultUnit,
      activeAreaUnit: this.areaDefaultUnit,
      modeUnitMap: {
        draw_line_string: 'activeDistanceUnit',
        draw_polygon: 'activeAreaUnit'
      },
      layerId: ''
    };
  },
  computed: {
    getUnitOptions: function getUnitOptions() {
      return this.unitOptions[this.activeMode] || [];
    },
    getResult: function getResult() {
      if (this.result && this.measureFinished) {
        var result = this.result + " " + this.getUnitLabel;
        this.resetActiveMode();
        return result;
      }
      return '';
    },
    getUnitLabel: function getUnitLabel() {
      var units = this.getUnitOptions;
      var modeUnitKey = this.modeUnitMap[this.activeMode];
      var label = units[this[modeUnitKey]];
      return label;
    },
    getAreaSelect: function getAreaSelect() {
      return this.activeMode === 'draw_polygon' && this.showUnitSelect;
    },
    getDistanceSelect: function getDistanceSelect() {
      return this.activeMode === 'draw_line_string' && this.showUnitSelect;
    },
    popupStyle: function popupStyle() {
      return {
        background: this.tablePopupBgStyle.background,
        color: this.getTextColorStyle.color
      };
    }
  },
  watch: {
    distanceDefaultUnit: function distanceDefaultUnit(newVal) {
      this.activeDistanceUnit = newVal;
      this.updateUnit(newVal);
    },
    areaDefaultUnit: function areaDefaultUnit(newVal) {
      this.activeAreaUnit = newVal;
      this.updateUnit(newVal);
    },
    popupStyle: function popupStyle(next) {
      this.setPopupStyle(next);
    }
  },
  created: function created() {
    this.componentName = (0, _lodash.default)(this.$options.name);
    this.viewModel = new _MeasureViewModel.default({
      continueDraw: this.continueDraw,
      componentName: this.componentName
    });
    this.viewModel.on('measure-finished', this.measureFinishedFn);
    this.viewModel.on('measure-start', this.measureStartFn);
    this.viewModel.on('update-unit', this.updateUnitFn);
  },
  mounted: function mounted() {
    _drawEvent.default.$on('draw-reset', this.drawResetFn);
  },
  beforeDestroy: function beforeDestroy() {
    this.viewModel.off('measure-finished', this.measureFinishedFn);
    this.viewModel.off('measure-start', this.measureStartFn);
    this.viewModel.off('update-unit', this.updateUnitFn);
    _drawEvent.default.$off('draw-reset', this.drawResetFn);
  },
  removed: function removed(map, target) {
    _drawEvent.default.$options.deleteDrawingState(target, this.componentName);
    this.resetData(target);
  },
  methods: {
    measureFinishedFn: function measureFinishedFn(e) {
      this.result = e.result;
      this.measureFinished = true;
    },
    measureStartFn: function measureStartFn() {
      this.result = '';
      this.measureFinished = false;
    },
    updateUnitFn: function updateUnitFn(e) {
      this.result = e.result;
    },
    drawResetFn: function drawResetFn(_ref) {
      var componentName = _ref.componentName;
      if (componentName !== this.componentName) {
        this.activeMode = null;
        this.result = '';
      }
    },
    // 切换量算模式
    changeMeasureMode: function changeMeasureMode(mode) {
      var _this = this;
      setTimeout(function () {
        var mapNotLoaded = _this.mapNotLoadedTip();
        if (mapNotLoaded) {
          return;
        }
        if (!_this.map.loaded()) {
          // @ts-ignore
          _Message.default.destroy();
          // @ts-ignore
          _Message.default.warning(_this.$t('warning.mapNotLoaded'));
        } else {
          var modeUnitKey = _this.modeUnitMap[mode];
          var activeUnit = _this[modeUnitKey];
          if (mode === 'delete') {
            _this.viewModel.trash();
            _this.activeMode = null;
            _this.result = '';
            return;
          }
          if (_this.activeMode !== mode || !_this.continueDraw) {
            _this.viewModel.openDraw(mode, activeUnit, _this.setPopupStyle);
            _this.activeMode = mode;
            _this.continueDraw && _drawEvent.default.$emit('draw-reset', {
              componentName: _this.componentName
            });
          } else {
            _this.viewModel.removeDraw(_this.continueDraw);
            _this.activeMode = null;
          }
        }
      }, 0);
    },
    updateUnit: function updateUnit(unit) {
      this.viewModel && this.viewModel.updateUnit(unit);
      this.setPopupStyle();
    },
    getPopupContainer: function getPopupContainer() {
      return this.$el.querySelector('.sm-component-measure__panelContent');
    },
    resetActiveMode: function resetActiveMode() {
      !this.activeModeCache && (this.activeModeCache = this.activeMode);
      this.measureFinished && !this.continueDraw && (this.activeMode = null);
      if (!this.measureFinished && this.continueDraw) {
        this.activeMode = this.activeModeCache;
      }
    },
    resetData: function resetData() {
      this.activeMode = null;
      this.result = '';
      this.continueDraw && _drawEvent.default.$emit('draw-reset', {
        componentName: this.componentName
      });
    },
    // 提供对外方法：清空features
    clear: function clear() {
      this.activeMode = null;
      this.result = '';
      this.viewModel && this.viewModel.clearAllFeatures();
    },
    setPopupStyle: function setPopupStyle(styleData) {
      if (styleData === void 0) {
        styleData = this.popupStyle;
      }
      this.$nextTick(function () {
        var popupContentList = document.querySelectorAll('.sm-component-measure__popup .mapboxgl-popup-content');
        if (popupContentList) {
          popupContentList.forEach(function (item) {
            item.style.color = styleData.color;
            item.style.background = styleData.background;
          });
        }
        (0, _util.setPopupArrowStyle)(styleData.background);
      });
    }
  }
};

/***/ }),

/***/ 38:
/***/ (function(module, exports) {

module.exports = require("@turf/center");

/***/ }),

/***/ 4:
/***/ (function(module, exports) {

module.exports = require("@supermap/vue-iclient-mapboxgl/lib/_mixin/Theme.js");

/***/ }),

/***/ 405:
/***/ (function(module, exports) {

module.exports = require("@turf/length");

/***/ }),

/***/ 406:
/***/ (function(module, exports) {

module.exports = require("@turf/area");

/***/ }),

/***/ 459:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";

// EXPORTS
__webpack_require__.d(__webpack_exports__, "a", function() { return /* reexport */ render; });
__webpack_require__.d(__webpack_exports__, "b", function() { return /* reexport */ staticRenderFns; });

// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./src/mapboxgl/web-map/control/measure/Measure.vue?vue&type=template&id=2b4ae0bb&
var render = function () {
  var _vm = this
  var _h = _vm.$createElement
  var _c = _vm._self._c || _h
  return _c(
    "sm-collapse-card",
    {
      directives: [
        {
          name: "show",
          rawName: "v-show",
          value: _vm.isShow,
          expression: "isShow",
        },
      ],
      staticClass: "sm-component-measure",
      attrs: {
        "icon-class": _vm.iconClass,
        "icon-position": _vm.position,
        "header-name": _vm.headerName,
        "auto-rotate": _vm.autoRotate,
        collapsed: _vm.collapsed,
        background: _vm.background,
        textColor: _vm.textColor,
        "split-line": _vm.splitLine,
      },
    },
    [
      _c(
        "div",
        {
          staticClass: "sm-component-measure__panel",
          style: _vm.headingTextColorStyle,
        },
        [
          _c(
            "div",
            { staticClass: "sm-component-measure__panelContent" },
            [
              _vm._l(_vm.modeGroups, function (group) {
                return _c(
                  "span",
                  {
                    directives: [
                      {
                        name: "show",
                        rawName: "v-show",
                        value:
                          group.mode !== "delete" ||
                          (!_vm.continueDraw && group.mode === "delete"),
                        expression:
                          "group.mode !== 'delete' || (!continueDraw && group.mode === 'delete')",
                      },
                    ],
                    key: group.mode,
                    class: {
                      "sm-component-measure__modeIcon": true,
                      "is-active": _vm.activeMode === group.mode,
                    },
                    style: _vm.subComponentSpanBgStyle,
                    attrs: { title: group.title },
                    on: {
                      click: function ($event) {
                        return _vm.changeMeasureMode(group.mode)
                      },
                    },
                  },
                  [_c("i", { class: group.iconClass })]
                )
              }),
              _c(
                "sm-select",
                {
                  directives: [
                    {
                      name: "show",
                      rawName: "v-show",
                      value: _vm.getDistanceSelect,
                      expression: "getDistanceSelect",
                    },
                  ],
                  staticClass: "sm-component-measure__unit",
                  style: _vm.getTextColorStyle,
                  attrs: {
                    placeholder: _vm.$t("measure.selectPlaceholder"),
                    "get-popup-container": _vm.getPopupContainer,
                  },
                  on: { change: _vm.updateUnit },
                  model: {
                    value: _vm.activeDistanceUnit,
                    callback: function ($$v) {
                      _vm.activeDistanceUnit = $$v
                    },
                    expression: "activeDistanceUnit",
                  },
                },
                _vm._l(_vm.getUnitOptions, function (value, key, index) {
                  return _c(
                    "sm-select-option",
                    { key: index, attrs: { title: value, value: key } },
                    [_vm._v("\n          " + _vm._s(value) + "\n        ")]
                  )
                }),
                1
              ),
              _c(
                "sm-select",
                {
                  directives: [
                    {
                      name: "show",
                      rawName: "v-show",
                      value: _vm.getAreaSelect,
                      expression: "getAreaSelect",
                    },
                  ],
                  staticClass: "sm-component-measure__unit",
                  style: _vm.getTextColorStyle,
                  attrs: {
                    placeholder: _vm.$t("measure.selectPlaceholder"),
                    "get-popup-container": _vm.getPopupContainer,
                  },
                  on: { change: _vm.updateUnit },
                  model: {
                    value: _vm.activeAreaUnit,
                    callback: function ($$v) {
                      _vm.activeAreaUnit = $$v
                    },
                    expression: "activeAreaUnit",
                  },
                },
                _vm._l(_vm.getUnitOptions, function (value, key, index) {
                  return _c(
                    "sm-select-option",
                    { key: index, attrs: { title: value, value: key } },
                    [_vm._v("\n          " + _vm._s(value) + "\n        ")]
                  )
                }),
                1
              ),
              _c(
                "div",
                {
                  directives: [
                    {
                      name: "show",
                      rawName: "v-show",
                      value: !_vm.showUnitSelect && _vm.activeMode,
                      expression: "!showUnitSelect && activeMode",
                    },
                  ],
                  staticClass:
                    "sm-component-measure__unit sm-component-measure__default",
                },
                [_vm._v("\n        " + _vm._s(_vm.getUnitLabel) + "\n      ")]
              ),
            ],
            2
          ),
          _c(
            "div",
            {
              directives: [
                {
                  name: "show",
                  rawName: "v-show",
                  value: _vm.getResult,
                  expression: "getResult",
                },
              ],
              staticClass: "sm-component-measure__calculateResult",
            },
            [
              _c(
                "div",
                {
                  staticClass: "sm-component-measure__calcuTitle",
                  style: _vm.headingTextColorStyle,
                },
                [_vm._v(_vm._s(_vm.$t("measure.measureResult")))]
              ),
              _c(
                "div",
                {
                  staticClass: "sm-component-measure__result",
                  style: _vm.getTextColorStyle,
                },
                [_vm._v(_vm._s(_vm.getResult))]
              ),
            ]
          ),
        ]
      ),
    ]
  )
}
var staticRenderFns = []
render._withStripped = true


// CONCATENATED MODULE: ./src/mapboxgl/web-map/control/measure/Measure.vue?vue&type=template&id=2b4ae0bb&


/***/ }),

/***/ 5:
/***/ (function(module, exports) {

module.exports = require("@supermap/vue-iclient-mapboxgl/static/libs/mapboxgl/mapbox-gl-enhance.js");

/***/ }),

/***/ 51:
/***/ (function(module, exports) {

module.exports = require("ant-design-vue/es/select");

/***/ }),

/***/ 6:
/***/ (function(module, exports) {

module.exports = require("@supermap/vue-iclient-mapboxgl/lib/_mixin/AntdRender.js");

/***/ }),

/***/ 7:
/***/ (function(module, exports) {

module.exports = require("@supermap/vue-iclient-mapboxgl/lib/_mixin/map-getter.js");

/***/ }),

/***/ 8:
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _interopRequireDefault = __webpack_require__(0);
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _lodash = _interopRequireDefault(__webpack_require__(10));
var _utils = __webpack_require__(11);
var VuePropTypes = {
  get any() {
    return (0, _utils.toType)('any', {
      type: null
    });
  },
  get func() {
    return (0, _utils.toType)('function', {
      type: Function
    }).def(currentDefaults.func);
  },
  get bool() {
    return (0, _utils.toType)('boolean', {
      type: Boolean
    }).def(currentDefaults.bool);
  },
  get string() {
    return (0, _utils.toType)('string', {
      type: String
    }).def(currentDefaults.string);
  },
  get number() {
    return (0, _utils.toType)('number', {
      type: Number
    }).def(currentDefaults.number);
  },
  get array() {
    return (0, _utils.toType)('array', {
      type: Array
    }).def(currentDefaults.array);
  },
  get object() {
    return (0, _utils.toType)('object', {
      type: Object
    }).def(currentDefaults.object);
  },
  get integer() {
    return (0, _utils.toType)('integer', {
      type: Number,
      validator: function validator(value) {
        return (0, _utils.isInteger)(value);
      }
    }).def(currentDefaults.integer);
  },
  get symbol() {
    return (0, _utils.toType)('symbol', {
      type: null,
      validator: function validator(value) {
        return typeof value === 'symbol';
      }
    });
  },
  custom: function custom(validatorFn, warnMsg) {
    if (warnMsg === void 0) {
      warnMsg = 'custom validation failed';
    }
    if (typeof validatorFn !== 'function') {
      throw new TypeError('[VueTypes error]: You must provide a function as argument');
    }
    return (0, _utils.toType)(validatorFn.name || '<<anonymous function>>', {
      validator: function validator() {
        var valid = validatorFn.apply(void 0, arguments);
        if (!valid) (0, _utils.warn)(this._vueTypes_name + " - " + warnMsg);
        return valid;
      }
    });
  },
  oneOf: function oneOf(arr) {
    if (!(0, _utils.isArray)(arr)) {
      throw new TypeError('[VueTypes error]: You must provide an array as argument');
    }
    var msg = "oneOf - value should be one of \"" + arr.join('", "') + "\"";
    var allowedTypes = arr.reduce(function (ret, v) {
      if (v !== null && v !== undefined) {
        ret.indexOf(v.constructor) === -1 && ret.push(v.constructor);
      }
      return ret;
    }, []);
    return (0, _utils.toType)('oneOf', {
      type: allowedTypes.length > 0 ? allowedTypes : null,
      validator: function validator(value) {
        var valid = arr.indexOf(value) !== -1;
        if (!valid) (0, _utils.warn)(msg);
        return valid;
      }
    });
  },
  instanceOf: function instanceOf(instanceConstructor) {
    return (0, _utils.toType)('instanceOf', {
      type: instanceConstructor
    });
  },
  oneOfType: function oneOfType(arr) {
    if (!(0, _utils.isArray)(arr)) {
      throw new TypeError('[VueTypes error]: You must provide an array as argument');
    }
    var hasCustomValidators = false;
    var nativeChecks = arr.reduce(function (ret, type) {
      if ((0, _lodash.default)(type)) {
        if (type._vueTypes_name === 'oneOf') {
          return ret.concat(type.type || []);
        }
        if (type.type && !(0, _utils.isFunction)(type.validator)) {
          if ((0, _utils.isArray)(type.type)) return ret.concat(type.type);
          ret.push(type.type);
        } else if ((0, _utils.isFunction)(type.validator)) {
          hasCustomValidators = true;
        }
        return ret;
      }
      ret.push(type);
      return ret;
    }, []);
    if (!hasCustomValidators) {
      // we got just native objects (ie: Array, Object)
      // delegate to Vue native prop check
      return (0, _utils.toType)('oneOfType', {
        type: nativeChecks
      }).def(undefined);
    }
    var typesStr = arr.map(function (type) {
      if (type && (0, _utils.isArray)(type.type)) {
        return type.type.map(_utils.getType);
      }
      return (0, _utils.getType)(type);
    }).reduce(function (ret, type) {
      return ret.concat((0, _utils.isArray)(type) ? type : [type]);
    }, []).join('", "');
    return this.custom(function oneOfType(value) {
      var valid = arr.some(function (type) {
        if (type._vueTypes_name === 'oneOf') {
          return type.type ? (0, _utils.validateType)(type.type, value, true) : true;
        }
        return (0, _utils.validateType)(type, value, true);
      });
      if (!valid) (0, _utils.warn)("oneOfType - value type should be one of \"" + typesStr + "\"");
      return valid;
    }).def(undefined);
  },
  arrayOf: function arrayOf(type) {
    return (0, _utils.toType)('arrayOf', {
      type: Array,
      validator: function validator(values) {
        var valid = values.every(function (value) {
          return (0, _utils.validateType)(type, value);
        });
        if (!valid) (0, _utils.warn)("arrayOf - value must be an array of \"" + (0, _utils.getType)(type) + "\"");
        return valid;
      }
    });
  },
  objectOf: function objectOf(type) {
    return (0, _utils.toType)('objectOf', {
      type: Object,
      validator: function validator(obj) {
        var valid = Object.keys(obj).every(function (key) {
          return (0, _utils.validateType)(type, obj[key]);
        });
        if (!valid) (0, _utils.warn)("objectOf - value must be an object of \"" + (0, _utils.getType)(type) + "\"");
        return valid;
      }
    });
  },
  shape: function shape(obj) {
    var keys = Object.keys(obj);
    var requiredKeys = keys.filter(function (key) {
      return obj[key] && obj[key].required === true;
    });
    var type = (0, _utils.toType)('shape', {
      type: Object,
      validator: function validator(value) {
        var _this = this;
        if (!(0, _lodash.default)(value)) {
          return false;
        }
        var valueKeys = Object.keys(value);

        // check for required keys (if any)
        if (requiredKeys.length > 0 && requiredKeys.some(function (req) {
          return valueKeys.indexOf(req) === -1;
        })) {
          (0, _utils.warn)("shape - at least one of required properties \"" + requiredKeys.join('", "') + "\" is not present");
          return false;
        }
        return valueKeys.every(function (key) {
          if (keys.indexOf(key) === -1) {
            if (_this._vueTypes_isLoose === true) return true;
            (0, _utils.warn)("shape - object is missing \"" + key + "\" property");
            return false;
          }
          var type = obj[key];
          return (0, _utils.validateType)(type, value[key]);
        });
      }
    });
    Object.defineProperty(type, '_vueTypes_isLoose', {
      enumerable: false,
      writable: true,
      value: false
    });
    Object.defineProperty(type, 'loose', {
      get: function get() {
        this._vueTypes_isLoose = true;
        return this;
      },
      enumerable: false
    });
    return type;
  }
};
var typeDefaults = function typeDefaults() {
  return {
    func: undefined,
    bool: undefined,
    string: undefined,
    number: undefined,
    array: undefined,
    object: undefined,
    integer: undefined
  };
};
var currentDefaults = typeDefaults();
Object.defineProperty(VuePropTypes, 'sensibleDefaults', {
  enumerable: false,
  set: function set(value) {
    if (value === false) {
      currentDefaults = {};
    } else if (value === true) {
      currentDefaults = typeDefaults();
    } else if ((0, _lodash.default)(value)) {
      currentDefaults = value;
    }
  },
  get: function get() {
    return currentDefaults;
  }
});
var _default = exports.default = VuePropTypes;

/***/ }),

/***/ 800:
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _interopRequireDefault = __webpack_require__(0);
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _Measure = _interopRequireDefault(__webpack_require__(801));
var _init = _interopRequireDefault(__webpack_require__(2));
_Measure.default.install = function (Vue, opts) {
  (0, _init.default)(Vue, opts);
  Vue.component(_Measure.default.options ? _Measure.default.options.name : _Measure.default.name, _Measure.default);
};
var _default = exports.default = _Measure.default;

/***/ }),

/***/ 801:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _Measure_vue_vue_type_template_id_2b4ae0bb___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(459);
/* harmony import */ var _Measure_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(342);
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _Measure_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _Measure_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__[key]; }) }(__WEBPACK_IMPORT_KEY__));
/* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1);





/* normalize component */

var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])(
  _Measure_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
  _Measure_vue_vue_type_template_id_2b4ae0bb___WEBPACK_IMPORTED_MODULE_0__[/* render */ "a"],
  _Measure_vue_vue_type_template_id_2b4ae0bb___WEBPACK_IMPORTED_MODULE_0__[/* staticRenderFns */ "b"],
  false,
  null,
  null,
  null
  
)

/* harmony default export */ __webpack_exports__["default"] = (component.exports);

/***/ }),

/***/ 802:
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _interopRequireDefault = __webpack_require__(0);
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _inheritsLoose2 = _interopRequireDefault(__webpack_require__(3));
var _mapboxGlEnhance = _interopRequireDefault(__webpack_require__(5));
var _length = _interopRequireDefault(__webpack_require__(405));
var _area = _interopRequireDefault(__webpack_require__(406));
var _center = _interopRequireDefault(__webpack_require__(38));
var _helpers = __webpack_require__(89);
var _util = __webpack_require__(12);
var _index = __webpack_require__(16);
var _drawEvent = _interopRequireDefault(__webpack_require__(117));
/**
 * @class MeasureViewModel
 * @description 量算 viewModel.
 * @param {Object} webmap - webmap实例对象。
 * @extends mapboxgl.Evented
 */
var MeasureViewModel = /*#__PURE__*/function (_mapboxgl$Evented) {
  (0, _inheritsLoose2.default)(MeasureViewModel, _mapboxgl$Evented);
  function MeasureViewModel(options) {
    var _this;
    _this = _mapboxgl$Evented.call(this) || this;
    _this.lenTipNodesList = {}; // 收集测量长度实时生成的popup，以方便后面销毁
    _this.areaTipNodesList = {}; // 收集多绘制情况下 测量面积最后生成的结果popup
    _this.cacheLengthUnitList = {}; // 缓存量算长度每个节点的值跟单位，在修改单位时使用
    _this.cachePolygonUnit = {};
    _this.componentName = options.componentName;
    _this.continueDraw = options.continueDraw;
    return _this;
  }
  var _proto = MeasureViewModel.prototype;
  _proto.setMap = function setMap(mapInfo) {
    var map = mapInfo.map,
      mapTarget = mapInfo.mapTarget;
    this.map = map;
    this.mapTarget = mapTarget;
    this._addDrawControl();
  };
  _proto._addDrawControl = function _addDrawControl() {
    this.draw = _drawEvent.default.$options.getDraw({
      mapTarget: this.mapTarget
    });
    _drawEvent.default.$options.setDrawingState(this.mapTarget, this.componentName, false);
    this._finishDrawBind = this._finishDraw.bind(this);
    this._changeModeBind = this._changeMode.bind(this);
    this.map.on('draw.create', this._finishDrawBind);
    this.map.on('draw.modechange', this._changeModeBind);
  }

  // 绘画结束后计算最后的结果
  ;
  _proto._finishDraw = function _finishDraw(e) {
    if (this._isDrawing()) {
      this._resetEvent();
      switch (this.activeMode) {
        case 'draw_line_string':
          var tempLength = (0, _length.default)(e.features[0], 'kilometers');
          this.result = (0, _helpers.convertLength)(tempLength, 'kilometers', this.activeUnit);
          // 将tipNodesList中key为“id”的字段替换成生成的id值
          this._updateLenPopupNodes(e.features[0].id);
          // 如果是测量长度，销毁实时计算生成的popup
          this._removeHoverPopup();
          break;
        case 'draw_polygon':
          var tempArea = (0, _area.default)(e.features[0]);
          this.result = (0, _helpers.convertArea)(tempArea, 'meters', this.activeUnit);
          this._updateAreaPopupNodes(this.result, e.features[0]);
          break;
      }
      this.ids = this.ids || [];
      this.ids.push((e.features[0] || {}).id);
      this.fire('measure-finished', {
        result: this._getFormatResult(this.result)
      });
    }
  };
  _proto._changeMode = function _changeMode() {
    if (this._isDrawing() && this.continueDraw && this.isEditing) {
      this.draw.changeMode(this.mode);
      this.continueDrawBind = this._continueDraw.bind(this);
      this.map.on('mousedown', this.continueDrawBind);
      this.map.on('mousedown', this.measureNodeDistanceBind);
      this.fire('measure-finished', {
        result: this._getFormatResult(this.result)
      });
    }
  }

  // 开启绘制
  ;
  _proto.openDraw = function openDraw(mode, activeUnit, setPopupStyle) {
    this.setPopupStyle = setPopupStyle;
    _drawEvent.default.$options.setDrawingState(this.mapTarget, this.componentName, true);
    this._resetDraw();
    this._resetEvent();
    this.isEditing = true;
    this.mode = mode;
    this.activeMode = mode;
    this.activeUnit = activeUnit;
    // 绘画线或面
    this.draw.changeMode(mode);
    this.measureNodeDistanceBind = this._measureNodeDistance.bind(this);
    this.map.on('mousedown', this.measureNodeDistanceBind);
  };
  _proto.updateUnit = function updateUnit(unit) {
    if (Object.values(this.lenTipNodesList).length) {
      for (var id in this.lenTipNodesList) {
        var tipNodes = this.lenTipNodesList[id];
        if (tipNodes && tipNodes.length && (this.continueDraw && id !== 'id' || id === 'id')) {
          for (var i = 1; i < tipNodes.length; i++) {
            var transValue = (0, _helpers.convertLength)(this.cacheLengthUnitList[id][i - 1].value, this.cacheLengthUnitList[id][i - 1].unit, unit);
            transValue = this._getFormatResult(transValue);
            this.cacheLengthUnitList[id][i - 1].value = transValue;
            this.cacheLengthUnitList[id][i - 1].unit = unit;
            if (this.activeMode === 'draw_line_string') {
              var uniti18n = (0, _index.geti18n)().t("unit." + unit);
              tipNodes[i] && tipNodes[i].setText(transValue + " " + uniti18n);
            }
          }
        }
      }
      this.result && (this.result = (0, _helpers.convertLength)(this.result, this.activeUnit, unit));
    } else if (this.cachePolygonUnit.value && this.cachePolygonUnit.unit) {
      var _transValue = (0, _helpers.convertArea)(this.cachePolygonUnit.value, this.cachePolygonUnit.unit, unit);
      var _uniti18n = (0, _index.geti18n)().t("unit.square" + unit);
      this.tipHoverDiv && this.tipHoverDiv.setText(_transValue + " " + _uniti18n);
      this.result && (this.result = (0, _helpers.convertArea)(this.result, this.activeUnit, unit));
    }
    this.result && this.fire('update-unit', {
      result: this._getFormatResult(this.result),
      mode: this.mode
    });
    this.activeUnit = unit;
  };
  _proto._resetDraw = function _resetDraw(continueDraw) {
    // 连续绘制情况下 根据ids只删除上一次量算的数据
    if (this.draw && this.continueDraw) {
      this.ids && this.draw.delete(this.ids);
      this.ids = null;
      this._removePopups();
      this._removeHoverPopup();
    }
    this.isOpenMoveEvent = true;
    this.cacheLengthUnitList = {};
    this.measureNodes = []; // 收集测算长度生成每个点的feature数据, 方便后面计算总长度
    this.result = 0;
    if (!continueDraw) {
      this.activeMode = null;
      this.mode = null;
    }
    this.fire('measure-start', {
      result: this._getFormatResult(this.result)
    });
  };
  _proto._continueDraw = function _continueDraw() {
    if (this._isDrawing()) {
      this._resetDraw(true);
      this.map.off('mousemove', this.popupFollowMouseBind);
      this.map.off('mousedown', this.continueDrawBind);
    }
  }

  // 绘画每个点显示tip，同时监听鼠标move事件
  ;
  _proto._measureNodeDistance = function _measureNodeDistance(e) {
    if (this._isDrawing()) {
      var _e$lngLat = e.lngLat,
        lng = _e$lngLat.lng,
        lat = _e$lngLat.lat;
      var to = [lng, lat];
      if (this.isOpenMoveEvent) {
        this.popupFollowMouseBind = this._popupFollowMouse.bind(this);
        this.map.on('mousemove', this.popupFollowMouseBind);
        this.isOpenMoveEvent = false;
      }
      this.measureNodes.push(to);
      if (this.activeMode === 'draw_line_string') {
        this._renderPopupTip(e);
      }
    }
  };
  _proto._popupFollowMouse = function _popupFollowMouse(e) {
    if (this._isDrawing()) {
      var _e$lngLat2 = e.lngLat,
        lng = _e$lngLat2.lng,
        lat = _e$lngLat2.lat;
      var lastPointPos = [lng, lat];
      var popup = this.tipHoverDiv;
      // 实时显示popup只需要一个，如果没有再生成新popup
      if (!popup) {
        popup = new _mapboxGlEnhance.default.Popup({
          closeButton: false,
          closeOnClick: false,
          className: 'sm-component-measure__popup sm-mapboxgl-tabel-popup'
        });
      }
      popup.setLngLat(lastPointPos);
      var measureNodeList = [].concat(this.measureNodes, [lastPointPos]);
      var feature = {
        type: 'Feature',
        geometry: {
          type: "" + (this.activeMode === 'draw_line_string' ? 'LineString' : 'Polygon'),
          coordinates: this.activeMode === 'draw_line_string' ? measureNodeList : [measureNodeList]
        }
      };
      switch (this.activeMode) {
        case 'draw_line_string':
          var tempLength = (0, _length.default)(feature, 'kilometers');
          this.result = (0, _helpers.convertLength)(tempLength, 'kilometers', this.activeUnit);
          break;
        case 'draw_polygon':
          var tempArea = (0, _area.default)(feature);
          this.result = (0, _helpers.convertArea)(tempArea, 'meters', this.activeUnit);
          break;
      }
      var uniti18n;
      if (this.activeMode === 'draw_line_string') {
        uniti18n = (0, _index.geti18n)().t("unit." + this.activeUnit);
      } else if (this.activeMode === 'draw_polygon') {
        uniti18n = (0, _index.geti18n)().t("unit.square" + this.activeUnit);
      }
      popup.setText(this._getFormatResult(this.result) + " " + uniti18n);
      popup.addTo(this.map);
      this.setPopupStyle && this.setPopupStyle();
      this.cachePolygonUnit.value = this.result;
      this.cachePolygonUnit.unit = this.activeUnit;
      this.tipHoverDiv = popup;
    }
  };
  _proto._renderPopupTip = function _renderPopupTip(e) {
    var _e$lngLat3 = e.lngLat,
      lng = _e$lngLat3.lng,
      lat = _e$lngLat3.lat;
    var popup = new _mapboxGlEnhance.default.Popup({
      closeButton: false,
      closeOnClick: false,
      className: 'sm-component-measure__popup sm-mapboxgl-tabel-popup'
    });
    if (this.measureNodes.length > 1) {
      var line = {
        type: 'Feature',
        geometry: {
          type: 'LineString',
          coordinates: this.measureNodes
        }
      };
      // 修改单位
      var tempLength = (0, _length.default)(line, 'kilometers');
      var calcValue = (0, _helpers.convertLength)(tempLength, 'kilometers', this.activeUnit);
      var uniti18n;
      if (this.activeMode === 'draw_line_string') {
        uniti18n = (0, _index.geti18n)().t("unit." + this.activeUnit);
      } else if (this.activeMode === 'draw_polygon') {
        uniti18n = (0, _index.geti18n)().t("unit.square" + this.activeUnit);
      }
      var renderText = this._getFormatResult(calcValue) + " " + uniti18n;
      this.cacheLengthUnitList.id = this.cacheLengthUnitList.id || [];
      this.cacheLengthUnitList.id.push({
        value: this._getFormatResult(calcValue),
        unit: this.activeUnit
      });
      popup.setText(renderText);
    } else {
      popup.setText((0, _index.geti18n)().t('measure.startingPoint'));
      this.cacheLengthUnitList.id = this.cacheLengthUnitList.id || [];
    }
    popup.setLngLat([lng, lat]);
    popup && popup.addTo(this.map);
    this.setPopupStyle && setTimeout(this.setPopupStyle, 0);
    // 这里的key-id只是一个临时的值 在绘画完成后(会生成一个featureId) 这时会把id这个key转换成真实的id值
    this.lenTipNodesList.id = this.lenTipNodesList.id || [];
    this.lenTipNodesList.id.push(popup);
  };
  _proto._getFormatResult = function _getFormatResult(result) {
    return (0, _util.reservedDecimal)(result || this.result, 4);
  };
  _proto._isDrawing = function _isDrawing() {
    return _drawEvent.default.$options.getDrawingState(this.mapTarget, this.componentName) && this.draw;
    // return true;
  };
  _proto._updateLenPopupNodes = function _updateLenPopupNodes(idValue) {
    this.cacheLengthUnitList[idValue] = this.cacheLengthUnitList.id || [];
    delete this.cacheLengthUnitList.id;
    this.lenTipNodesList[idValue] = this.lenTipNodesList.id || [];
    delete this.lenTipNodesList.id;
    for (var id in this.lenTipNodesList) {
      var tipNodes = this.lenTipNodesList[id];
      if (tipNodes && !tipNodes.length) {
        delete this.lenTipNodesList[id];
        delete this.cacheLengthUnitList[id];
      }
    }
  };
  _proto._updateAreaPopupNodes = function _updateAreaPopupNodes(popupResult, feature) {
    // 如果是测量面积，直接利用实时计算生成的popup显示最后结果
    var centerResult = (0, _center.default)(feature);
    var uniti18n = (0, _index.geti18n)().t("unit.square" + this.activeUnit);
    var result = this._getFormatResult(popupResult);
    if (this.continueDraw) {
      this.tipHoverDiv && this.tipHoverDiv.setLngLat(centerResult.geometry.coordinates).setText(result + " " + uniti18n);
    } else {
      this._removeHoverPopup();
      var popup = new _mapboxGlEnhance.default.Popup({
        closeButton: false,
        closeOnClick: false,
        className: 'sm-component-measure__popup sm-mapboxgl-tabel-popup'
      });
      popup.setLngLat(centerResult.geometry.coordinates).setText(result + " " + uniti18n).addTo(this.map);
      this.areaTipNodesList[feature.id] = popup;
    }
    this.setPopupStyle && setTimeout(this.setPopupStyle, 0);
  };
  _proto._resetEvent = function _resetEvent() {
    this.map.off('mousemove', this.popupFollowMouseBind);
    this.map.off('mousedown', this.measureNodeDistanceBind);
    this.map.off('mousedown', this.continueDrawBind);
  };
  _proto._clearEvent = function _clearEvent() {
    this._resetEvent();
    this.map.off('draw.create', this._finishDrawBind);
    this.map.off('draw.modechange', this._changeModeBind);
  };
  _proto._removePopups = function _removePopups() {
    for (var id in this.lenTipNodesList) {
      var tipNodes = this.lenTipNodesList[id];
      if (tipNodes && tipNodes.length) {
        tipNodes.forEach(function (tipNode) {
          return tipNode.remove();
        });
      }
    }
    for (var _id in this.areaTipNodesList) {
      var tipNode = this.areaTipNodesList[_id];
      tipNode && tipNode.remove();
    }
    this.lenTipNodesList = {};
    this.areaTipNodesList = {};
  };
  _proto._removeHoverPopup = function _removeHoverPopup() {
    this.tipHoverDiv && this.tipHoverDiv.remove();
    this.tipHoverDiv = null;
  };
  _proto.trash = function trash() {
    var _this2 = this;
    var selectedIds = this.draw.getSelectedIds();
    selectedIds.forEach(function (item) {
      var matchIndex = _this2.ids.findIndex(function (id) {
        return id === item;
      });
      if (matchIndex > -1) {
        _this2.ids.splice(matchIndex, 1);
        _this2.draw.delete(item);
        var tipNodes = _this2.lenTipNodesList[item] || _this2.areaTipNodesList[item];
        Array.isArray(tipNodes) ? tipNodes.forEach(function (tipNode) {
          return tipNode.remove();
        }) : tipNodes.remove();
      }
    });
  };
  _proto.removeDraw = function removeDraw(continueDraw) {
    this.isEditing = false;
    this.draw.changeMode('simple_select');
    this.ids && this.draw.delete(this.ids);
    this.ids = [];
    this._resetDraw(continueDraw);
    this._resetEvent();
    this._removePopups();
    this._removeHoverPopup();
  };
  _proto.removed = function removed() {
    this.isEditing = false;
    this.ids && this.draw.delete(this.ids);
    this.ids = [];
    this.cacheLengthUnitList = {};
    this.cachePolygonUnit = {};
    this._clearEvent();
    this._removePopups();
    this._removeHoverPopup();
    this.draw = null;
  };
  _proto.clearAllFeatures = function clearAllFeatures() {
    this.removeDraw();
  };
  return MeasureViewModel;
}(_mapboxGlEnhance.default.Evented);
var _default = exports.default = MeasureViewModel;

/***/ }),

/***/ 84:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _Option_vue_vue_type_script_lang_ts___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(27);
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _Option_vue_vue_type_script_lang_ts___WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _Option_vue_vue_type_script_lang_ts___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
/* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1);
var render, staticRenderFns




/* normalize component */

var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(
  _Option_vue_vue_type_script_lang_ts___WEBPACK_IMPORTED_MODULE_0__["default"],
  render,
  staticRenderFns,
  false,
  null,
  null,
  null
  
)

/* harmony default export */ __webpack_exports__["default"] = (component.exports);

/***/ }),

/***/ 89:
/***/ (function(module, exports) {

module.exports = require("@turf/helpers");

/***/ }),

/***/ 90:
/***/ (function(module, exports) {

module.exports = require("@supermap/vue-iclient-mapboxgl/static/libs/mapbox-gl-draw/mapbox-gl-draw.js");

/***/ })

/******/ });