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/leaflet/";
/******/
/******/
/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(__webpack_require__.s = 504);
/******/ })
/************************************************************************/
/******/ ({

/***/ 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
  }
}


/***/ }),

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

module.exports = require("leaflet");

/***/ }),

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

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

/***/ }),

/***/ 229:
/***/ (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_Popup_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(230);
/* harmony import */ var _node_modules_babel_loader_lib_index_js_node_modules_vue_loader_lib_index_js_vue_loader_options_Popup_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_Popup_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_Popup_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_Popup_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_Popup_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default.a); 

/***/ }),

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

"use strict";


var _interopRequireDefault = __webpack_require__(0);

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _Popper = _interopRequireDefault(__webpack_require__(242));

var _Options = _interopRequireDefault(__webpack_require__(52));

var _VmUpdater = _interopRequireDefault(__webpack_require__(243));

var _Theme = _interopRequireDefault(__webpack_require__(2));

var _mapGetter = _interopRequireDefault(__webpack_require__(28));

var _PopupViewModel = _interopRequireDefault(__webpack_require__(506));

var _default2 = {
  name: 'SmPopup',
  mixins: [_Options.default, _VmUpdater.default, _mapGetter.default, _Theme.default, _Popper.default],
  viewModelProps: ['latLng', 'content'],
  props: {
    latLng: {
      type: [Object, Array],
      default: function _default() {
        return [];
      }
    }
  },
  watch: {
    getBackground: function getBackground() {
      this.changePopupStyle();
    },
    options: function options() {
      this.loaded();
    }
  },
  loaded: function loaded() {
    var _this = this;

    this.setViewModel();
    this.mapObject = this.viewModel.getPopup();
    this.parentContainer = this.$parent; // 如果有父组件有mapObject,则可以绑定在上面(默认绑定在map上面)

    var parentContainerObject = this.parentContainer && this.parentContainer.mapObject || this.map;

    if (parentContainerObject) {
      // 如果有bindpopup方法的就绑定
      if (parentContainerObject.bindPopup) {
        parentContainerObject.bindPopup(this.mapObject);
        this.$nextTick(function () {
          _this.$emit('ready', _this.mapObject);
        });
        return;
      } // 如果是地图，则openOn(this.map)


      this.isMap = this.viewModel.isMap(parentContainerObject);

      if (this.isMap) {
        parentContainerObject.on('click', function (e) {
          var latLng = _this.map.layerPointToLatLng(e.layerPoint);

          _this.viewModel.setLatLng(latLng); // 通过slot进来的content


          if (_this.$el && _this.$el.style) {
            _this.$el.style.display = 'block';
          }

          _this.$nextTick(function () {
            _this.$emit('ready', _this.mapObject);
          });

          _this.$on('ready', _this.viewModel.openOnMap);
        });
      }
    }
  },
  beforeDestroy: function beforeDestroy() {
    if (this.parentContainer) {
      if (this.parentContainer.unbindPopup) {
        this.parentContainer.unbindPopup();
      } else if (this.parentContainer.mapObject && this.parentContainer.mapObject.unbindPopup) {
        this.parentContainer.mapObject.unbindPopup();
      }
    }
  },
  methods: {
    setViewModel: function setViewModel() {
      this.viewModel = new _PopupViewModel.default(this.map, {
        latLng: this.latLng,
        content: this.content || this.$el,
        options: this.options
      });
    },
    changePopupStyle: function changePopupStyle() {
      var popupContent = document.querySelector('.leaflet-popup-content-wrapper');
      var popupTip = document.querySelector('.leaflet-popup-tip');
      var popupCloseBtn = document.querySelector('.leaflet-container a.leaflet-popup-close-button:hover');

      if (popupContent) {
        popupContent.style.background = this.getBackground;
      }

      if (popupTip) {
        popupTip.style.background = this.getBackground;
      }

      if (popupCloseBtn) {
        popupTip.style.color = this.textColorsData;
      }
    }
  }
};
exports.default = _default2;

/***/ }),

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

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _default = {
  props: {
    content: {
      type: String,
      default: '',
      custom: true
    }
  },
  data: function data() {
    return {
      isMap: false
    };
  },
  mounted: function mounted() {
    this.popperOptions = {};
  },
  render: function render(h) {
    if (this.$slots.default) {
      // 如果是其他bindpopup的layer，不要绑定style
      var style = this.isMap ? {
        style: {
          display: 'none'
        }
      } : {};
      return h('div', style, this.$slots.default);
    }

    return null;
  }
};
exports.default = _default;

/***/ }),

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

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

/***/ }),

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

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

/***/ }),

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

"use strict";


var _interopRequireDefault = __webpack_require__(0);

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _leaflet = _interopRequireDefault(__webpack_require__(19));

// @property lastId: Number
// Last unique ID used by [`stamp()`](#util-stamp)
var lastId = 0; // @function stamp(obj: Object): Number
// Returns the unique ID of an object, assigning it one if it doesn't have it.

function stamp(obj) {
  /*eslint-disable */
  obj._leaflet_id = obj._leaflet_id || ++lastId;
  return obj._leaflet_id;
  /* eslint-enable */
}

_leaflet.default.Map.prototype.addLayer = function (layer, name) {
  if (!layer._layerAdd) {
    throw new Error('The provided object is not a Layer.');
  }

  var id = stamp(layer); // 如果layer已存在，返回this

  if (this._layers[id] || this._layers[name]) {
    return this;
  } // 如果用户没有传入name，就生成一个name


  if (!name) {
    name = 'sm-custom' + id;
  } // 如果该name已存在，就生成新的name


  if (this._layers[name]) {
    this.fire('addLayerFailed', 'layer name重复,请输入唯一的name');
    return this;
  } // 将layer和name添加到layersOnMap


  layer.name = name; // 不要将featureLayer加入layersOnMap
  // let _layersId = {};
  // for (let key in this._layers) {
  //   if (this._layers[key]._layers) {
  //     _layersId[key] = [];
  //     for (let key2 in this._layers[key]._layers) {
  //       _layersId[key].push(key2);
  //     }
  //   }
  // }
  // let layersOnMapFlag = true;
  // for (let key in _layersId) {
  //   if (_layersId[key].indexOf(id + '') > -1) {
  //     layersOnMapFlag = false;
  //   }
  // }

  if (!this.layersOnMap) {
    this.layersOnMap = [];
  }

  this.layersOnMap.push({
    name: name,
    layer: layer
  }); // if (layersOnMapFlag) {
  //   this.layersOnMap.push({ name, layer });
  // }

  this._layers[id] = layer;
  layer._mapToAdd = this;

  if (layer.beforeAdd) {
    layer.beforeAdd(this);
  }

  this.whenReady(layer._layerAdd, layer);
  return this;
};

_leaflet.default.Map.prototype.removeLayer = function (layer, name) {
  // 重新构造layersOnMap
  this.layersOnMap = this.layersOnMap.filter(function (l) {
    return l.name !== (layer.name || name);
  }); // 如果是传入图层，就用图层id; 如果传入name,通过name去获取图层id

  var id = stamp(layer) || this._layers[name].id;

  if (!this._layers[id]) {
    return this;
  }

  if (this._loaded) {
    layer.onRemove(this);
  }

  if (layer.getAttribution && this.attributionControl) {
    this.attributionControl.removeAttribution(layer.getAttribution());
  }

  delete this._layers[id];

  if (this._loaded) {
    this.fire('layerremove', {
      layer: layer,
      name: name
    });
    layer.fire('remove');
  }

  layer._map = layer._mapToAdd = null;
  return this;
};

_leaflet.default.Map.include({
  getLayersOnMap: function getLayersOnMap() {
    return this.layersOnMap;
  },
  getLayerById: function getLayerById(id) {
    return this._layers[id];
  },
  getLayerByName: function getLayerByName(name) {
    for (var key in this._layers) {
      if (name === this._layers[key].name) {
        return this._layers[key];
      }
    }
  },
  getAllLayers: function getAllLayers() {
    return this._layers;
  }
});

delete _leaflet.default.Icon.Default.prototype._getIconUrl;

_leaflet.default.Icon.Default.mergeOptions({
  iconRetinaUrl: __webpack_require__(30),
  iconUrl: __webpack_require__(31),
  shadowUrl: __webpack_require__(32)
});

window.L = _leaflet.default;
var _default = _leaflet.default;
exports.default = _default;

/***/ }),

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

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

/***/ }),

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

module.exports = require("leaflet/dist/images/marker-icon-2x.png");

/***/ }),

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

module.exports = require("leaflet/dist/images/marker-icon.png");

/***/ }),

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

module.exports = require("leaflet/dist/images/marker-shadow.png");

/***/ }),

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

"use strict";


var _interopRequireDefault = __webpack_require__(0);

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _Popup = _interopRequireDefault(__webpack_require__(505));

var _init = _interopRequireDefault(__webpack_require__(3));

_Popup.default.install = function (Vue, opts) {
  (0, _init.default)(Vue, opts);
  Vue.component(_Popup.default.options ? _Popup.default.options.name : _Popup.default.name, _Popup.default);
};

var _default = _Popup.default;
exports.default = _default;

/***/ }),

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

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _Popup_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(229);
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _Popup_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 _Popup_vue_vue_type_script_lang_js___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"])(
  _Popup_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"],
  render,
  staticRenderFns,
  false,
  null,
  null,
  null
  
)

/* hot reload */
if (false) { var api; }
component.options.__file = "src/leaflet/popup/Popup.vue"
/* harmony default export */ __webpack_exports__["default"] = (component.exports);

/***/ }),

/***/ 506:
/***/ (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__(6));

var _leafletWrapper = _interopRequireDefault(__webpack_require__(29));

/**
 * @class PopupViewModel
 * @description popup viewModel.
 * @extends leaflet.Evented
 */
var PopupViewModel = /*#__PURE__*/function (_L$Evented) {
  (0, _inheritsLoose2.default)(PopupViewModel, _L$Evented);

  function PopupViewModel(map, options) {
    var _this;

    _this = _L$Evented.call(this) || this;
    _this.map = map;
    _this.mapObject = null;
    _this.options = options.options || {};
    _this.latLng = options.latLng;
    _this.content = options.content;

    _this.createPopup();

    return _this;
  }
  /**
   * @function PopupViewModel.prototype.createPopup
   * @desc 创建popup
   */


  var _proto = PopupViewModel.prototype;

  _proto.createPopup = function createPopup() {
    this.mapObject = _leafletWrapper.default.popup(this.options);
    this.setLatLng();
    this.setContent();
  }
  /**
   * @function PopupViewModel.prototype.setContent
   * @desc 设置popup内容
   * @param {Array} content - 内容。
   */
  ;

  _proto.setContent = function setContent(content) {
    if (content === void 0) {
      content = this.content;
    }

    if (this.mapObject && content) {
      this.mapObject.setContent(content);
    }
  }
  /**
   * @function PopupViewModel.prototype.setLatLng
   * @desc 设置latlng
   * @param {Array} latLng - 坐标
   */
  ;

  _proto.setLatLng = function setLatLng(latLng) {
    if (latLng === void 0) {
      latLng = this.latLng;
    }

    if (this.mapObject && latLng) {
      this.mapObject.setLatLng(latLng);
    }
  }
  /**
   * @function PopupViewModel.prototype.getPopup
   * @desc 获取popup
   */
  ;

  _proto.getPopup = function getPopup() {
    return this.mapObject;
  }
  /**
   * @function PopupViewModel.prototype.openOnMap
   * @desc openOn MAP
   */
  ;

  _proto.openOnMap = function openOnMap() {
    this.mapObject.openOn(this.map);
  }
  /**
   * @function PopupViewModel.prototype.openOnMap
   * @desc openOn MAP
   */
  ;

  _proto.isMap = function isMap(mapObject) {
    return mapObject instanceof _leafletWrapper.default.Map;
  };

  return PopupViewModel;
}(_leafletWrapper.default.Evented);

exports.default = PopupViewModel;

/***/ }),

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

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _default2 = {
  props: {
    options: {
      type: Object,
      default: function _default() {
        return null;
      }
    }
  }
};
exports.default = _default2;

/***/ }),

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

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

/***/ })

/******/ });