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 = 929);
/******/ })
/************************************************************************/
/******/ ({

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

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

/***/ }),

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

module.exports = require("vue");

/***/ }),

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

"use strict";


var _interopRequireDefault = __webpack_require__(0);
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _SourceModel = _interopRequireDefault(__webpack_require__(44));
var _LayerModel = _interopRequireDefault(__webpack_require__(45));
var SourceListModel = /*#__PURE__*/function () {
  function SourceListModel(options) {
    this.map = options.map;
    this.style = this.map.getStyle();
    this.layers = this.map.getStyle().layers;
    this.overlayLayers = this.map.overlayLayersManager;
    this.detailLayers = null;
    this.sourceList = {};
    this.sourceNames = [];
    this._initLayers();
    this._initSource();
    this.excludeSourceNames = ['tdt-search-', 'tdt-route-', 'smmeasure', 'mapbox-gl-draw'];
  }
  var _proto = SourceListModel.prototype;
  _proto.getSourceList = function getSourceList() {
    var sourceList = {};
    for (var key in this.sourceList) {
      if (key && this.excludeSource(key)) {
        sourceList[key] = this.sourceList[key];
      }
    }
    return sourceList;
  };
  _proto.getSourceNames = function getSourceNames() {
    var _this = this;
    var names = [];
    this.sourceNames.forEach(function (element) {
      if (element && _this.excludeSource(element)) {
        names.push(element);
      }
    });
    return names;
  };
  _proto.excludeSource = function excludeSource(key) {
    for (var i = 0; i < this.excludeSourceNames.length; i++) {
      if (key.indexOf(this.excludeSourceNames[i]) >= 0) {
        return false;
      }
    }
    return true;
  };
  _proto.getLegendStyle = function getLegendStyle(sourceName) {
    if (sourceName) {
      return this.sourceList[sourceName] ? this.sourceList[sourceName].style : '';
    }
    var sourceList = Object.values(this.sourceList) || [];
    var styles = sourceList.filter(function (item) {
      return !!item.style;
    });
    return styles;
  };
  _proto.getLayers = function getLayers() {
    return this.detailLayers;
  };
  _proto.getLayersBySourceLayer = function getLayersBySourceLayer(sourceName, sourceLayer) {
    return this.sourceList[sourceName].sourceLayerList[sourceLayer];
  };
  _proto.getSourceLayersBySource = function getSourceLayersBySource(sourceName) {
    return this.sourceList[sourceName].sourceLayerList;
  };
  _proto.addSourceStyle = function addSourceStyle(sourceName, sourceStyle) {
    if (this.sourceList[sourceName]) {
      this.sourceList[sourceName].style = sourceStyle;
    }
  };
  _proto._initLayers = function _initLayers() {
    var _this2 = this;
    this.layers && (this.detailLayers = this.layers.map(function (layer) {
      return _this2.map.getLayer(layer.id);
    }));
    var overLayerList = Object.values(this.overlayLayers);
    overLayerList.forEach(function (overlayer) {
      if (overlayer.id) {
        _this2.detailLayers.push({
          id: overlayer.id,
          visibility: overlayer.visibility ? 'visible' : 'none',
          source: overlayer.id
        });
      }
    });
  };
  _proto._initSource = function _initSource() {
    var _this3 = this;
    this.detailLayers && this.detailLayers.forEach(function (layer) {
      if (!_this3.sourceList[layer.source]) {
        var source = _this3.map.getSource(layer.source);
        _this3.sourceList[layer.source] = new _SourceModel.default({
          source: layer.source,
          type: source && source.type
        });
        _this3.sourceNames.push(layer.source);
      }
      _this3.sourceList[layer.source].addLayer(new _LayerModel.default(layer), layer.sourceLayer);
    });
  };
  return SourceListModel;
}();
var _default = exports.default = SourceListModel;

/***/ }),

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

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var SourceModel = /*#__PURE__*/function () {
  function SourceModel(options) {
    this.id = options.source;
    this.sourceLayerList = {};
    this.layers = [];
    this.type = options.type;
  }
  var _proto = SourceModel.prototype;
  _proto.addLayer = function addLayer(layer, sourceLayer) {
    if (sourceLayer) {
      if (!this.sourceLayerList[sourceLayer]) {
        this.sourceLayerList[sourceLayer] = [];
      }
      this.sourceLayerList[sourceLayer].push(layer);
    } else {
      this.sourceLayerList = undefined;
    }
    this.layers.push(layer);
    if ([layer.visibility, this.visibility].includes('visible')) {
      this.visibility = 'visible';
    } else {
      this.visibility = 'none';
    }
  };
  return SourceModel;
}();
var _default = exports.default = SourceModel;

/***/ }),

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

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
/**
 * @class LayerModel
 * @description 图层数据模型。
 * @param {Object} options - 图层参数。
 * @param {String} [options.id] - 图层 ID。
 * @param {Number} [options.maxzoom] - 最大缩放级别。
 * @param {Number} [options.minzoom] - 最小缩放级别。
 * @param {GeoJSONObject} [options.source] - 数据源。
 * @param {String} [options.type] - 图层类型。
 * @param {String} [options.visibility] - 图层是否可见。
 * @category Model
 */
var LayerModel = function LayerModel(options) {
  if (options === void 0) {
    options = {};
  }
  this.id = options.id;
  this.maxzoom = options.maxzoom;
  this.minzoom = options.minzoom;
  this.source = options.source;
  this.sourceLayer = options.sourceLayer;
  this.type = options.type;
  this.visibility = options.visibility || 'visible';
};
var _default = exports.default = LayerModel;

/***/ }),

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

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

/***/ }),

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

"use strict";


var _interopRequireDefault = __webpack_require__(0);
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _vue = _interopRequireDefault(__webpack_require__(13));
var _globalEvent = _interopRequireDefault(__webpack_require__(46));
var _SourceListModel = _interopRequireDefault(__webpack_require__(43));
var _default = exports.default = new _vue.default({
  mapCache: {},
  webMapCache: {},
  getMap: function getMap(mapTarget) {
    return this.mapCache[mapTarget];
  },
  getAllMaps: function getAllMaps() {
    return this.mapCache;
  },
  setMap: function setMap(mapTarget, map) {
    this.mapCache[mapTarget] = map;
  },
  deleteMap: function deleteMap(mapTarget) {
    if (this.mapCache[mapTarget]) {
      _globalEvent.default.$emit('delete-map', mapTarget);
      delete this.mapCache[mapTarget];
    }
  },
  getWebMap: function getWebMap(webmapTarget) {
    return this.webMapCache[webmapTarget];
  },
  getAllWebMap: function getAllWebMap() {
    return this.webMapCache;
  },
  setWebMap: function setWebMap(webmapTarget, webmap) {
    this.webMapCache[webmapTarget] = webmap;
  },
  deleteWebMap: function deleteWebMap(webmapTarget) {
    delete this.webMapCache[webmapTarget];
  },
  getMapSource: function getMapSource(mapTarget) {
    var sources = [];
    var map = this.getMap(mapTarget);
    if (map) {
      var sourceListModel = new _SourceListModel.default({
        map: map
      });
      var sourceList = sourceListModel.getSourceList();
      for (var key in sourceList) {
        if (key) {
          var layers = sourceList[key].layers || [];
          layers.forEach(function (item) {
            if (item.source && item.type !== 'raster') {
              sources.push(item.source);
            }
          });
        }
      }
    }
    return sources;
  }
});

/***/ })

/******/ });