@antv/l7-component 2.9.32-alpha.4 → 2.9.32-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/control/baseControl/buttonControl.d.ts +1 -1
- package/es/control/baseControl/control.d.ts +4 -5
- package/es/control/baseControl/control.js +18 -5
- package/es/control/baseControl/popperControl.d.ts +1 -1
- package/es/control/baseControl/selectControl.d.ts +2 -2
- package/es/control/baseControl/selectControl.js +5 -0
- package/es/control/zoom.d.ts +3 -2
- package/lib/assets/iconfont/iconfont.js +46 -30
- package/lib/constants/index.js +34 -56
- package/lib/control/baseControl/buttonControl.js +194 -105
- package/lib/control/baseControl/control.js +317 -156
- package/lib/control/baseControl/index.js +57 -22
- package/lib/control/baseControl/popperControl.js +136 -102
- package/lib/control/baseControl/selectControl.js +230 -130
- package/lib/control/exportImage.js +175 -81
- package/lib/control/fullscreen.js +157 -102
- package/lib/control/geoLocate.js +143 -67
- package/lib/control/layerControl.js +162 -116
- package/lib/control/logo.js +101 -70
- package/lib/control/mapTheme.js +144 -85
- package/lib/control/mouseLocation.js +112 -71
- package/lib/control/scale.js +180 -127
- package/lib/control/zoom.js +154 -111
- package/lib/index.js +251 -48
- package/lib/interface.js +4 -16
- package/lib/marker-layer.js +367 -249
- package/lib/marker.js +419 -277
- package/lib/popup/layerPopup.js +305 -188
- package/lib/popup/popup.js +602 -339
- package/lib/utils/anchor.js +37 -55
- package/lib/utils/icon.js +13 -32
- package/lib/utils/popper.js +268 -180
- package/lib/utils/screenfull.js +110 -103
- package/package.json +5 -5
package/lib/popup/layerPopup.js
CHANGED
|
@@ -1,200 +1,317 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
-
|
|
22
|
-
// src/popup/layerPopup.ts
|
|
23
|
-
var layerPopup_exports = {};
|
|
24
|
-
__export(layerPopup_exports, {
|
|
25
|
-
LayerPopup: () => LayerPopup,
|
|
26
|
-
default: () => LayerPopup
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
27
7
|
});
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
var
|
|
31
|
-
|
|
32
|
-
var
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
if (!layer) {
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
const layerInfo = {
|
|
79
|
-
...configItem
|
|
80
|
-
};
|
|
81
|
-
if (trigger === "hover") {
|
|
82
|
-
const onMouseMove = this.onLayerMouseMove.bind(this, layer);
|
|
83
|
-
const onMouseOut = this.onLayerMouseOut.bind(this, layer);
|
|
84
|
-
layerInfo.onMouseMove = onMouseMove;
|
|
85
|
-
layerInfo.onMouseOut = onMouseOut;
|
|
86
|
-
layer == null ? void 0 : layer.on("mousemove", onMouseMove);
|
|
87
|
-
layer == null ? void 0 : layer.on("mouseout", onMouseOut);
|
|
88
|
-
} else {
|
|
89
|
-
const onClick = this.onLayerClick.bind(this, layer);
|
|
90
|
-
layerInfo.onClick = onClick;
|
|
91
|
-
layer == null ? void 0 : layer.on("click", onClick);
|
|
92
|
-
}
|
|
93
|
-
const source = layer.getSource();
|
|
94
|
-
const onSourceUpdate = this.onSourceUpdate.bind(this, layer);
|
|
95
|
-
source == null ? void 0 : source.on("update", onSourceUpdate);
|
|
96
|
-
layerInfo.onSourceUpdate = onSourceUpdate;
|
|
97
|
-
this.layerConfigMap.set(layer, layerInfo);
|
|
98
|
-
});
|
|
8
|
+
exports.default = exports.LayerPopup = void 0;
|
|
9
|
+
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
+
|
|
12
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
|
+
|
|
14
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
15
|
+
|
|
16
|
+
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
17
|
+
|
|
18
|
+
var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
|
|
19
|
+
|
|
20
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
21
|
+
|
|
22
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
23
|
+
|
|
24
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
25
|
+
|
|
26
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
27
|
+
|
|
28
|
+
var _l7Utils = require("@antv/l7-utils");
|
|
29
|
+
|
|
30
|
+
var _lodash = require("lodash");
|
|
31
|
+
|
|
32
|
+
var _popup = _interopRequireDefault(require("./popup"));
|
|
33
|
+
|
|
34
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
35
|
+
|
|
36
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
37
|
+
|
|
38
|
+
var LayerPopup = /*#__PURE__*/function (_Popup) {
|
|
39
|
+
(0, _inherits2.default)(LayerPopup, _Popup);
|
|
40
|
+
|
|
41
|
+
var _super = _createSuper(LayerPopup);
|
|
42
|
+
|
|
43
|
+
function LayerPopup() {
|
|
44
|
+
var _this;
|
|
45
|
+
|
|
46
|
+
(0, _classCallCheck2.default)(this, LayerPopup);
|
|
47
|
+
|
|
48
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
49
|
+
args[_key] = arguments[_key];
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
53
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "layerConfigMap", new WeakMap());
|
|
54
|
+
return _this;
|
|
99
55
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
56
|
+
|
|
57
|
+
(0, _createClass2.default)(LayerPopup, [{
|
|
58
|
+
key: "addTo",
|
|
59
|
+
value: function addTo(scene) {
|
|
60
|
+
(0, _get2.default)((0, _getPrototypeOf2.default)(LayerPopup.prototype), "addTo", this).call(this, scene);
|
|
61
|
+
this.bindLayerEvent();
|
|
62
|
+
this.hide();
|
|
63
|
+
return this;
|
|
64
|
+
}
|
|
65
|
+
}, {
|
|
66
|
+
key: "remove",
|
|
67
|
+
value: function remove() {
|
|
68
|
+
(0, _get2.default)((0, _getPrototypeOf2.default)(LayerPopup.prototype), "remove", this).call(this);
|
|
69
|
+
this.unbindLayerEvent();
|
|
70
|
+
return this;
|
|
71
|
+
}
|
|
72
|
+
}, {
|
|
73
|
+
key: "setOptions",
|
|
74
|
+
value: function setOptions(option) {
|
|
75
|
+
this.unbindLayerEvent();
|
|
76
|
+
(0, _get2.default)((0, _getPrototypeOf2.default)(LayerPopup.prototype), "setOptions", this).call(this, option);
|
|
77
|
+
this.bindLayerEvent();
|
|
78
|
+
return this;
|
|
79
|
+
}
|
|
80
|
+
}, {
|
|
81
|
+
key: "getDefault",
|
|
82
|
+
value: function getDefault(option) {
|
|
83
|
+
var isClickTrigger = option.trigger === 'click';
|
|
84
|
+
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _get2.default)((0, _getPrototypeOf2.default)(LayerPopup.prototype), "getDefault", this).call(this, option)), {}, {
|
|
85
|
+
trigger: 'hover',
|
|
86
|
+
followCursor: !isClickTrigger,
|
|
87
|
+
lngLat: {
|
|
88
|
+
lng: 0,
|
|
89
|
+
lat: 0
|
|
90
|
+
},
|
|
91
|
+
offsets: [0, 10],
|
|
92
|
+
closeButton: false,
|
|
93
|
+
closeOnClick: false,
|
|
94
|
+
autoClose: false,
|
|
95
|
+
closeOnEsc: false
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* 绑定对应的图层事件
|
|
100
|
+
* @protected
|
|
101
|
+
*/
|
|
102
|
+
|
|
103
|
+
}, {
|
|
104
|
+
key: "bindLayerEvent",
|
|
105
|
+
value: function bindLayerEvent() {
|
|
106
|
+
var _this2 = this;
|
|
107
|
+
|
|
108
|
+
var _this$popupOption = this.popupOption,
|
|
109
|
+
config = _this$popupOption.config,
|
|
110
|
+
trigger = _this$popupOption.trigger;
|
|
111
|
+
config.forEach(function (configItem) {
|
|
112
|
+
var layer = _this2.getLayerByConfig(configItem);
|
|
113
|
+
|
|
114
|
+
if (!layer) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
var layerInfo = (0, _objectSpread2.default)({}, configItem);
|
|
119
|
+
|
|
120
|
+
if (trigger === 'hover') {
|
|
121
|
+
var onMouseMove = _this2.onLayerMouseMove.bind(_this2, layer);
|
|
122
|
+
|
|
123
|
+
var onMouseOut = _this2.onLayerMouseOut.bind(_this2, layer);
|
|
124
|
+
|
|
125
|
+
layerInfo.onMouseMove = onMouseMove;
|
|
126
|
+
layerInfo.onMouseOut = onMouseOut;
|
|
127
|
+
layer === null || layer === void 0 ? void 0 : layer.on('mousemove', onMouseMove);
|
|
128
|
+
layer === null || layer === void 0 ? void 0 : layer.on('mouseout', onMouseOut);
|
|
129
|
+
} else {
|
|
130
|
+
var onClick = _this2.onLayerClick.bind(_this2, layer);
|
|
131
|
+
|
|
132
|
+
layerInfo.onClick = onClick;
|
|
133
|
+
layer === null || layer === void 0 ? void 0 : layer.on('click', onClick);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
var source = layer.getSource();
|
|
137
|
+
|
|
138
|
+
var onSourceUpdate = _this2.onSourceUpdate.bind(_this2, layer);
|
|
139
|
+
|
|
140
|
+
source === null || source === void 0 ? void 0 : source.on('update', onSourceUpdate);
|
|
141
|
+
layerInfo.onSourceUpdate = onSourceUpdate;
|
|
142
|
+
|
|
143
|
+
_this2.layerConfigMap.set(layer, layerInfo);
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* 解绑对应的图层事件
|
|
148
|
+
* @protected
|
|
149
|
+
*/
|
|
150
|
+
|
|
151
|
+
}, {
|
|
152
|
+
key: "unbindLayerEvent",
|
|
153
|
+
value: function unbindLayerEvent() {
|
|
154
|
+
var _this3 = this;
|
|
155
|
+
|
|
156
|
+
var config = this.popupOption.config;
|
|
157
|
+
config.forEach(function (configItem) {
|
|
158
|
+
var layer = _this3.getLayerByConfig(configItem);
|
|
159
|
+
|
|
160
|
+
var layerInfo = layer && _this3.layerConfigMap.get(layer);
|
|
161
|
+
|
|
162
|
+
if (!layerInfo) {
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
var onMouseMove = layerInfo.onMouseMove,
|
|
167
|
+
onMouseOut = layerInfo.onMouseOut,
|
|
168
|
+
onClick = layerInfo.onClick,
|
|
169
|
+
onSourceUpdate = layerInfo.onSourceUpdate;
|
|
170
|
+
|
|
171
|
+
if (onMouseMove) {
|
|
172
|
+
layer.off('mousemove', onMouseMove);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
if (onMouseOut) {
|
|
176
|
+
layer.off('mouseout', onMouseOut);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
if (onClick) {
|
|
180
|
+
layer.off('click', onClick);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
if (onSourceUpdate) {
|
|
184
|
+
var _layer$getSource;
|
|
185
|
+
|
|
186
|
+
layer === null || layer === void 0 ? void 0 : (_layer$getSource = layer.getSource()) === null || _layer$getSource === void 0 ? void 0 : _layer$getSource.off('update', onSourceUpdate);
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
}, {
|
|
191
|
+
key: "onLayerMouseMove",
|
|
192
|
+
value: function onLayerMouseMove(layer, e) {
|
|
193
|
+
if (!this.isSameFeature(layer, e.featureId)) {
|
|
194
|
+
var frag = this.getLayerInfoFrag(layer, e);
|
|
195
|
+
this.setDOMContent(frag);
|
|
196
|
+
this.displayFeatureInfo = {
|
|
197
|
+
layer: layer,
|
|
198
|
+
featureId: e.featureId
|
|
199
|
+
};
|
|
118
200
|
}
|
|
119
|
-
|
|
120
|
-
|
|
201
|
+
|
|
202
|
+
if (!this.isShow) {
|
|
203
|
+
this.show();
|
|
121
204
|
}
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
onLayerMouseMove(layer, e) {
|
|
125
|
-
if (!this.isSameFeature(layer, e.featureId)) {
|
|
126
|
-
const frag = this.getLayerInfoFrag(layer, e);
|
|
127
|
-
this.setDOMContent(frag);
|
|
128
|
-
this.displayFeatureInfo = {
|
|
129
|
-
layer,
|
|
130
|
-
featureId: e.featureId
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
if (!this.isShow) {
|
|
134
|
-
this.show();
|
|
135
205
|
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
206
|
+
}, {
|
|
207
|
+
key: "onLayerMouseOut",
|
|
208
|
+
value: function onLayerMouseOut(layer, e) {
|
|
209
|
+
this.displayFeatureInfo = undefined;
|
|
210
|
+
|
|
211
|
+
if (this.isShow) {
|
|
212
|
+
this.hide();
|
|
213
|
+
}
|
|
141
214
|
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
this.
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
215
|
+
}, {
|
|
216
|
+
key: "onLayerClick",
|
|
217
|
+
value: function onLayerClick(layer, e) {
|
|
218
|
+
if (this.isShow && this.isSameFeature(layer, e.featureId)) {
|
|
219
|
+
this.hide();
|
|
220
|
+
} else {
|
|
221
|
+
var frag = this.getLayerInfoFrag(layer, e);
|
|
222
|
+
this.setDOMContent(frag);
|
|
223
|
+
this.setLnglat(e.lngLat);
|
|
224
|
+
this.show();
|
|
225
|
+
this.displayFeatureInfo = {
|
|
226
|
+
layer: layer,
|
|
227
|
+
featureId: e.featureId
|
|
228
|
+
};
|
|
229
|
+
}
|
|
155
230
|
}
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
this.displayFeatureInfo
|
|
231
|
+
}, {
|
|
232
|
+
key: "onSourceUpdate",
|
|
233
|
+
value: function onSourceUpdate(layer) {
|
|
234
|
+
var _this$displayFeatureI;
|
|
235
|
+
|
|
236
|
+
if (((_this$displayFeatureI = this.displayFeatureInfo) === null || _this$displayFeatureI === void 0 ? void 0 : _this$displayFeatureI.layer) === layer) {
|
|
237
|
+
this.hide();
|
|
238
|
+
this.displayFeatureInfo = undefined;
|
|
239
|
+
}
|
|
162
240
|
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
241
|
+
/**
|
|
242
|
+
* 通过当前图层和对应选中的元素获取气泡展示的 HTML 内容
|
|
243
|
+
* @param layer
|
|
244
|
+
* @param e
|
|
245
|
+
* @protected
|
|
246
|
+
*/
|
|
247
|
+
|
|
248
|
+
}, {
|
|
249
|
+
key: "getLayerInfoFrag",
|
|
250
|
+
value: function getLayerInfoFrag(layer, e) {
|
|
251
|
+
var layerInfo = this.layerConfigMap.get(layer);
|
|
252
|
+
var frag = document.createDocumentFragment();
|
|
253
|
+
|
|
254
|
+
if (layerInfo) {
|
|
255
|
+
var _feature = e.feature;
|
|
256
|
+
|
|
257
|
+
if (_feature.type === 'Feature' && 'properties' in _feature && 'geometry' in _feature) {
|
|
258
|
+
_feature = _feature.properties;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
var fields = layerInfo.fields;
|
|
262
|
+
fields === null || fields === void 0 ? void 0 : fields.forEach(function (fieldConfig) {
|
|
263
|
+
var _ref = typeof fieldConfig === 'string' ? {
|
|
264
|
+
field: fieldConfig
|
|
265
|
+
} : fieldConfig,
|
|
266
|
+
field = _ref.field,
|
|
267
|
+
formatField = _ref.formatField,
|
|
268
|
+
formatValue = _ref.formatValue,
|
|
269
|
+
getValue = _ref.getValue;
|
|
270
|
+
|
|
271
|
+
var row = _l7Utils.DOM.create('div', 'l7-layer-popup__row');
|
|
272
|
+
|
|
273
|
+
var value = getValue ? getValue(e.feature) : (0, _lodash.get)(_feature, field);
|
|
274
|
+
row.innerHTML = "".concat(formatField ? formatField(field) : field, ": ").concat(formatValue ? formatValue(value) : value);
|
|
275
|
+
frag.appendChild(row);
|
|
276
|
+
});
|
|
171
277
|
}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
const { field, formatField, formatValue, getValue } = typeof fieldConfig === "string" ? { field: fieldConfig } : fieldConfig;
|
|
175
|
-
const row = import_l7_utils.DOM.create("div", "l7-layer-popup__row");
|
|
176
|
-
const value = getValue ? getValue(e.feature) : (0, import_lodash.get)(feature, field);
|
|
177
|
-
row.innerHTML = `${formatField ? formatField(field) : field}: ${formatValue ? formatValue(value) : value}`;
|
|
178
|
-
frag.appendChild(row);
|
|
179
|
-
});
|
|
278
|
+
|
|
279
|
+
return frag;
|
|
180
280
|
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
281
|
+
/**
|
|
282
|
+
* 通过 Layer 配置访问到真实的 Layer 实例
|
|
283
|
+
* @param config
|
|
284
|
+
* @protected
|
|
285
|
+
*/
|
|
286
|
+
|
|
287
|
+
}, {
|
|
288
|
+
key: "getLayerByConfig",
|
|
289
|
+
value: function getLayerByConfig(config) {
|
|
290
|
+
var layer = config.layer;
|
|
291
|
+
|
|
292
|
+
if (layer instanceof Object) {
|
|
293
|
+
return layer;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
if (typeof layer === 'string') {
|
|
297
|
+
return this.layerService.getLayer(layer) || this.layerService.getLayerByName(layer);
|
|
298
|
+
}
|
|
187
299
|
}
|
|
188
|
-
|
|
189
|
-
|
|
300
|
+
/**
|
|
301
|
+
* 判断当前展示的 Feature 是否和上一次查看的一致
|
|
302
|
+
* @param layer
|
|
303
|
+
* @param featureId
|
|
304
|
+
* @protected
|
|
305
|
+
*/
|
|
306
|
+
|
|
307
|
+
}, {
|
|
308
|
+
key: "isSameFeature",
|
|
309
|
+
value: function isSameFeature(layer, featureId) {
|
|
310
|
+
var displayFeatureInfo = this.displayFeatureInfo;
|
|
311
|
+
return displayFeatureInfo && layer === displayFeatureInfo.layer && featureId === displayFeatureInfo.featureId;
|
|
190
312
|
}
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
};
|
|
197
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
198
|
-
0 && (module.exports = {
|
|
199
|
-
LayerPopup
|
|
200
|
-
});
|
|
313
|
+
}]);
|
|
314
|
+
return LayerPopup;
|
|
315
|
+
}(_popup.default);
|
|
316
|
+
|
|
317
|
+
exports.default = exports.LayerPopup = LayerPopup;
|