@antv/l7-component 2.9.36-alpha.1 → 2.9.37
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.d.ts +27 -0
- package/es/control/BaseControl.js +134 -0
- package/es/control/layer.d.ts +38 -0
- package/es/control/layer.js +340 -0
- package/es/control/logo.d.ts +6 -10
- package/es/control/logo.js +11 -41
- package/es/control/scale.d.ts +10 -20
- package/es/control/scale.js +53 -77
- package/es/control/zoom.d.ts +10 -21
- package/es/control/zoom.js +49 -76
- package/es/css/l7.css +502 -0
- package/es/images/logo.png +0 -0
- package/es/index.d.ts +8 -15
- package/es/index.js +9 -15
- package/es/interface.d.ts +20 -1
- package/es/popup.d.ts +35 -0
- package/es/popup.js +300 -0
- package/lib/control/BaseControl.js +160 -0
- package/lib/control/layer.js +362 -0
- package/lib/control/logo.js +23 -50
- package/lib/control/scale.js +62 -82
- package/lib/control/zoom.js +59 -78
- package/lib/css/l7.css +502 -0
- package/lib/images/logo.png +0 -0
- package/lib/index.js +50 -165
- package/lib/popup.js +317 -0
- package/package.json +5 -8
- package/es/assets/iconfont/iconfont.js +0 -53
- package/es/constants/index.d.ts +0 -60
- package/es/constants/index.js +0 -60
- package/es/control/baseControl/buttonControl.d.ts +0 -59
- package/es/control/baseControl/buttonControl.js +0 -191
- package/es/control/baseControl/control.d.ts +0 -106
- package/es/control/baseControl/control.js +0 -301
- package/es/control/baseControl/index.d.ts +0 -4
- package/es/control/baseControl/index.js +0 -4
- package/es/control/baseControl/popperControl.d.ts +0 -26
- package/es/control/baseControl/popperControl.js +0 -131
- package/es/control/baseControl/selectControl.d.ts +0 -46
- package/es/control/baseControl/selectControl.js +0 -232
- package/es/control/exportImage.d.ts +0 -18
- package/es/control/exportImage.js +0 -163
- package/es/control/fullscreen.d.ts +0 -19
- package/es/control/fullscreen.js +0 -151
- package/es/control/geoLocate.d.ts +0 -16
- package/es/control/geoLocate.js +0 -139
- package/es/control/layerControl.d.ts +0 -21
- package/es/control/layerControl.js +0 -172
- package/es/control/mapTheme.d.ts +0 -10
- package/es/control/mapTheme.js +0 -135
- package/es/control/mouseLocation.d.ts +0 -15
- package/es/control/mouseLocation.js +0 -104
- package/es/css/button.less +0 -70
- package/es/css/control.less +0 -71
- package/es/css/index.css +0 -567
- package/es/css/index.less +0 -12
- package/es/css/l7.less +0 -60
- package/es/css/layerPopup.less +0 -8
- package/es/css/logo.less +0 -18
- package/es/css/mouseLocation.less +0 -9
- package/es/css/popper.less +0 -64
- package/es/css/popup.less +0 -169
- package/es/css/scale.less +0 -34
- package/es/css/select.less +0 -86
- package/es/css/variables.less +0 -28
- package/es/css/zoom.less +0 -21
- package/es/images/quanping.svg +0 -12
- package/es/popup/layerPopup.d.ts +0 -78
- package/es/popup/layerPopup.js +0 -308
- package/es/popup/popup.d.ts +0 -147
- package/es/popup/popup.js +0 -636
- package/es/utils/icon.d.ts +0 -1
- package/es/utils/icon.js +0 -9
- package/es/utils/popper.d.ts +0 -75
- package/es/utils/popper.js +0 -286
- package/es/utils/screenfull.d.ts +0 -2
- package/es/utils/screenfull.js +0 -157
- package/lib/assets/iconfont/iconfont.js +0 -55
- package/lib/constants/index.js +0 -68
- package/lib/control/baseControl/buttonControl.js +0 -207
- package/lib/control/baseControl/control.js +0 -333
- package/lib/control/baseControl/index.js +0 -57
- package/lib/control/baseControl/popperControl.js +0 -142
- package/lib/control/baseControl/selectControl.js +0 -253
- package/lib/control/exportImage.js +0 -177
- package/lib/control/fullscreen.js +0 -164
- package/lib/control/geoLocate.js +0 -154
- package/lib/control/layerControl.js +0 -182
- package/lib/control/mapTheme.js +0 -151
- package/lib/control/mouseLocation.js +0 -120
- package/lib/css/button.less +0 -70
- package/lib/css/control.less +0 -71
- package/lib/css/index.css +0 -567
- package/lib/css/index.less +0 -12
- package/lib/css/l7.less +0 -60
- package/lib/css/layerPopup.less +0 -8
- package/lib/css/logo.less +0 -18
- package/lib/css/mouseLocation.less +0 -9
- package/lib/css/popper.less +0 -64
- package/lib/css/popup.less +0 -169
- package/lib/css/scale.less +0 -34
- package/lib/css/select.less +0 -86
- package/lib/css/variables.less +0 -28
- package/lib/css/zoom.less +0 -21
- package/lib/images/quanping.svg +0 -12
- package/lib/popup/layerPopup.js +0 -317
- package/lib/popup/popup.js +0 -651
- package/lib/utils/icon.js +0 -18
- package/lib/utils/popper.js +0 -297
- package/lib/utils/screenfull.js +0 -167
package/lib/control/zoom.js
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
5
7
|
Object.defineProperty(exports, "__esModule", {
|
|
6
8
|
value: true
|
|
7
9
|
});
|
|
8
|
-
exports.default =
|
|
9
|
-
|
|
10
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
10
|
+
exports.default = void 0;
|
|
11
11
|
|
|
12
12
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
13
|
|
|
@@ -15,23 +15,19 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
|
|
|
15
15
|
|
|
16
16
|
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
17
17
|
|
|
18
|
-
var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
|
|
19
|
-
|
|
20
18
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
21
19
|
|
|
22
20
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
23
21
|
|
|
24
22
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
25
23
|
|
|
26
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
27
|
-
|
|
28
|
-
var _l7Core = require("@antv/l7-core");
|
|
29
|
-
|
|
30
24
|
var _l7Utils = require("@antv/l7-utils");
|
|
31
25
|
|
|
32
|
-
var
|
|
26
|
+
var _BaseControl = _interopRequireWildcard(require("./BaseControl"));
|
|
33
27
|
|
|
34
|
-
|
|
28
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
29
|
+
|
|
30
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
35
31
|
|
|
36
32
|
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); }; }
|
|
37
33
|
|
|
@@ -42,73 +38,39 @@ var Zoom = /*#__PURE__*/function (_Control) {
|
|
|
42
38
|
|
|
43
39
|
var _super = _createSuper(Zoom);
|
|
44
40
|
|
|
45
|
-
function Zoom() {
|
|
41
|
+
function Zoom(cfg) {
|
|
46
42
|
var _this;
|
|
47
43
|
|
|
48
44
|
(0, _classCallCheck2.default)(this, Zoom);
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
args[_key] = arguments[_key];
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
55
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "zoomIn", function () {
|
|
56
|
-
if (!_this.disabled && _this.mapsService.getZoom() < _this.mapsService.getMaxZoom()) {
|
|
57
|
-
_this.mapsService.zoomIn();
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "zoomOut", function () {
|
|
61
|
-
if (!_this.disabled && _this.mapsService.getZoom() > _this.mapsService.getMinZoom()) {
|
|
62
|
-
_this.mapsService.zoomOut();
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "updateDisabled", function () {
|
|
66
|
-
var mapsService = _this.mapsService;
|
|
67
|
-
|
|
68
|
-
_this.zoomInButton.removeAttribute('disabled');
|
|
69
|
-
|
|
70
|
-
_this.zoomOutButton.removeAttribute('disabled');
|
|
71
|
-
|
|
72
|
-
if (_this.disabled || mapsService.getZoom() <= mapsService.getMinZoom()) {
|
|
73
|
-
_this.zoomOutButton.setAttribute('disabled', 'true');
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
if (_this.disabled || mapsService.getZoom() >= mapsService.getMaxZoom()) {
|
|
77
|
-
_this.zoomInButton.setAttribute('disabled', 'true');
|
|
78
|
-
}
|
|
79
|
-
});
|
|
45
|
+
_this = _super.call(this, cfg);
|
|
46
|
+
(0, _l7Utils.bindAll)(['updateDisabled', 'zoomIn', 'zoomOut'], (0, _assertThisInitialized2.default)(_this));
|
|
80
47
|
return _this;
|
|
81
48
|
}
|
|
82
49
|
|
|
83
50
|
(0, _createClass2.default)(Zoom, [{
|
|
84
51
|
key: "getDefault",
|
|
85
|
-
value: function getDefault(
|
|
86
|
-
return
|
|
87
|
-
position:
|
|
88
|
-
|
|
89
|
-
zoomInText: (0, _icon.createL7Icon)('l7-icon-enlarge'),
|
|
52
|
+
value: function getDefault() {
|
|
53
|
+
return {
|
|
54
|
+
position: _BaseControl.PositionType.TOPLEFT,
|
|
55
|
+
zoomInText: '+',
|
|
90
56
|
zoomInTitle: 'Zoom in',
|
|
91
|
-
zoomOutText:
|
|
92
|
-
zoomOutTitle: 'Zoom out'
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}, {
|
|
96
|
-
key: "setOptions",
|
|
97
|
-
value: function setOptions(newOptions) {
|
|
98
|
-
(0, _get2.default)((0, _getPrototypeOf2.default)(Zoom.prototype), "setOptions", this).call(this, newOptions);
|
|
99
|
-
|
|
100
|
-
if (this.checkUpdateOption(newOptions, ['zoomInText', 'zoomInTitle', 'zoomOutText', 'zoomOutTitle'])) {
|
|
101
|
-
this.resetButtonGroup(this.container);
|
|
102
|
-
}
|
|
57
|
+
zoomOutText: '−',
|
|
58
|
+
zoomOutTitle: 'Zoom out',
|
|
59
|
+
name: 'zoom'
|
|
60
|
+
};
|
|
103
61
|
}
|
|
104
62
|
}, {
|
|
105
63
|
key: "onAdd",
|
|
106
64
|
value: function onAdd() {
|
|
107
|
-
var
|
|
65
|
+
var zoomName = 'l7-control-zoom';
|
|
66
|
+
|
|
67
|
+
var container = _l7Utils.DOM.create('div', zoomName + ' l7-bar');
|
|
108
68
|
|
|
109
|
-
this.
|
|
69
|
+
this.zoomInButton = this.createButton(this.controlOption.zoomInText, this.controlOption.zoomInTitle, zoomName + '-in', container, this.zoomIn);
|
|
70
|
+
this.zoomOutButton = this.createButton(this.controlOption.zoomOutText, this.controlOption.zoomOutTitle, zoomName + '-out', container, this.zoomOut);
|
|
110
71
|
this.mapsService.on('zoomend', this.updateDisabled);
|
|
111
72
|
this.mapsService.on('zoomchange', this.updateDisabled);
|
|
73
|
+
this.updateDisabled();
|
|
112
74
|
return container;
|
|
113
75
|
}
|
|
114
76
|
}, {
|
|
@@ -132,31 +94,50 @@ var Zoom = /*#__PURE__*/function (_Control) {
|
|
|
132
94
|
return this;
|
|
133
95
|
}
|
|
134
96
|
}, {
|
|
135
|
-
key: "
|
|
136
|
-
value: function
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
97
|
+
key: "zoomIn",
|
|
98
|
+
value: function zoomIn() {
|
|
99
|
+
if (!this.disabled && this.mapsService.getZoom() < this.mapsService.getMaxZoom()) {
|
|
100
|
+
this.mapsService.zoomIn();
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}, {
|
|
104
|
+
key: "zoomOut",
|
|
105
|
+
value: function zoomOut() {
|
|
106
|
+
if (!this.disabled && this.mapsService.getZoom() > this.mapsService.getMinZoom()) {
|
|
107
|
+
this.mapsService.zoomOut();
|
|
108
|
+
}
|
|
142
109
|
}
|
|
143
110
|
}, {
|
|
144
111
|
key: "createButton",
|
|
145
112
|
value: function createButton(html, tile, className, container, fn) {
|
|
146
|
-
var link = _l7Utils.DOM.create('
|
|
147
|
-
|
|
148
|
-
if (typeof html === 'string') {
|
|
149
|
-
link.innerHTML = html;
|
|
150
|
-
} else {
|
|
151
|
-
link.append(html);
|
|
152
|
-
}
|
|
113
|
+
var link = _l7Utils.DOM.create('a', className, container);
|
|
153
114
|
|
|
115
|
+
link.innerHTML = html;
|
|
154
116
|
link.title = tile;
|
|
117
|
+
link.href = 'javascript:void(0)';
|
|
155
118
|
link.addEventListener('click', fn);
|
|
156
119
|
return link;
|
|
157
120
|
}
|
|
121
|
+
}, {
|
|
122
|
+
key: "updateDisabled",
|
|
123
|
+
value: function updateDisabled() {
|
|
124
|
+
var mapsService = this.mapsService;
|
|
125
|
+
var className = 'l7-disabled';
|
|
126
|
+
|
|
127
|
+
_l7Utils.DOM.removeClass(this.zoomInButton, className);
|
|
128
|
+
|
|
129
|
+
_l7Utils.DOM.removeClass(this.zoomOutButton, className);
|
|
130
|
+
|
|
131
|
+
if (this.disabled || mapsService.getZoom() <= mapsService.getMinZoom()) {
|
|
132
|
+
_l7Utils.DOM.addClass(this.zoomOutButton, className);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
if (this.disabled || mapsService.getZoom() >= mapsService.getMaxZoom()) {
|
|
136
|
+
_l7Utils.DOM.addClass(this.zoomInButton, className);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
158
139
|
}]);
|
|
159
140
|
return Zoom;
|
|
160
|
-
}(
|
|
141
|
+
}(_BaseControl.default);
|
|
161
142
|
|
|
162
|
-
exports.default =
|
|
143
|
+
exports.default = Zoom;
|