1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
| function _typeof(e) {
| return (_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) { return typeof e } : function (e) {
| return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
| })(e)
| }
| function _classCallCheck(e, t) {
| if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
| }
| function _defineProperties(e, t) {
| for (var n = 0; n < t.length; n++) {
| var o = t[n];
| o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, o.key, o)
| }
| } function _createClass(e, t, n) { return t && _defineProperties(e.prototype, t), n && _defineProperties(e, n), e } function _inherits(e, t) { if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function"); e.prototype = Object.create(t && t.prototype, { constructor: { value: e, writable: !0, configurable: !0 } }), t && _setPrototypeOf(e, t) } function _setPrototypeOf(e, t) { return (_setPrototypeOf = Object.setPrototypeOf || function (e, t) { return e.__proto__ = t, e })(e, t) } function _createSuper(n) { var o = _isNativeReflectConstruct(); return function () { var e, t = _getPrototypeOf(n); return _possibleConstructorReturn(this, o ? (e = _getPrototypeOf(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments)) } } function _possibleConstructorReturn(e, t) { if (t && ("object" === _typeof(t) || "function" == typeof t)) return t; if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(e) } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e } function _isNativeReflectConstruct() { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () { })), !0 } catch (e) { return !1 } } function _getPrototypeOf(e) { return (_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) { return e.__proto__ || Object.getPrototypeOf(e) })(e) } !function (n) {
| var e = function () {
| "use strict"; _inherits(t, n.widget.BaseWidget); var e = _createSuper(t); function t() { return _classCallCheck(this, t), e.apply(this, arguments) } return _createClass(t, [{ key: "view", get: function () { return { type: "window", url: "view.html", windowOptions: { width: 250, height: 500 } } } }, { key: "hasManagerBaseMaps", get: function () { return !0 } }, { key: "create", value: function () { } }, { key: "winCreateOK", value: function (e, t) { this.viewWindow = t } }, {
| key: "activate", value: function () {
| this.map.on(n.EventType.addLayer,
| this._onAddLayerHandler, this), this.map.on(n.EventType.removeLayer, this._onRemoveLayerHandler, this)
| }
| }, { key: "disable", value: function () { this.viewWindow = null, this.map.off(n.EventType.addLayer, this._onAddLayerHandler, this), this.map.off(n.EventType.removeLayer, this._onRemoveLayerHandler, this) } }, { key: "_onAddLayerHandler", value: function (e) { this.isActivate && this.viewWindow && (console.log("添加了图层", e), this.viewWindow.updateNode(e.layer)) } }, { key: "_onRemoveLayerHandler", value: function (e) { this.isActivate && this.viewWindow && (console.log("移除了图层", e), this.viewWindow.removeNode(e.layer)) } }, { key: "getLayers", value: function () { return this.map.getLayers({ basemaps: !0, layers: !0 }) } }, { key: "updateLayerShow", value: function (e, t) { (e.show = t) ? (e.isAdded || (this.map.off(n.EventType.addLayer, this._onAddLayerHandler, this), this.map.addLayer(e), this.map.on(n.EventType.addLayer, this._onAddLayerHandler, this)), this.config.autoCenter && !e.options.noCenter && e.flyTo(), (t = e.options).onWidget && n.widget.activate({ uri: t.onWidget, layerItem: t, disableOther: !1 })) : (e = e.options).onWidget && n.widget.disable(e.onWidget) } }]), t
| }(); n.widget.bindClass(e)
| }((window, mars3d));
|
|