@antv/l7-component 2.18.0 → 2.18.2
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/package.json +6 -6
- package/es/assets/iconfont/iconfont.js +0 -46
- 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 -177
- package/es/control/baseControl/control.d.ts +0 -112
- package/es/control/baseControl/control.js +0 -302
- 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 -120
- package/es/control/baseControl/selectControl.d.ts +0 -46
- package/es/control/baseControl/selectControl.js +0 -204
- package/es/control/exportImage.d.ts +0 -18
- package/es/control/exportImage.js +0 -159
- package/es/control/fullscreen.d.ts +0 -19
- package/es/control/fullscreen.js +0 -119
- package/es/control/geoLocate.d.ts +0 -16
- package/es/control/geoLocate.js +0 -107
- package/es/control/layerSwitch.d.ts +0 -19
- package/es/control/layerSwitch.js +0 -141
- package/es/control/logo.d.ts +0 -13
- package/es/control/logo.js +0 -75
- package/es/control/mapTheme.d.ts +0 -10
- package/es/control/mapTheme.js +0 -110
- package/es/control/mouseLocation.d.ts +0 -15
- package/es/control/mouseLocation.js +0 -83
- package/es/control/scale.d.ts +0 -34
- package/es/control/scale.js +0 -149
- package/es/control/zoom.d.ts +0 -38
- package/es/control/zoom.js +0 -132
- package/es/css/button.less +0 -70
- package/es/css/control.less +0 -71
- package/es/css/index.css +0 -594
- package/es/css/index.less +0 -12
- package/es/css/l7.less +0 -62
- 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 -185
- package/es/css/scale.less +0 -34
- package/es/css/select.less +0 -86
- package/es/css/variables.less +0 -30
- package/es/css/zoom.less +0 -29
- package/es/images/layers.png +0 -0
- package/es/images/layers.svg +0 -1
- package/es/images/logo.png +0 -0
- package/es/images/quanping.svg +0 -12
- package/es/index.d.ts +0 -18
- package/es/index.js +0 -49
- package/es/interface.d.ts +0 -18
- package/es/interface.js +0 -1
- package/es/marker-layer.d.ts +0 -54
- package/es/marker-layer.js +0 -343
- package/es/marker.d.ts +0 -55
- package/es/marker.js +0 -410
- package/es/popup/layerPopup.d.ts +0 -86
- package/es/popup/layerPopup.js +0 -312
- package/es/popup/popup.d.ts +0 -139
- package/es/popup/popup.js +0 -567
- package/es/utils/anchor.d.ts +0 -22
- package/es/utils/anchor.js +0 -31
- 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 -259
- package/es/utils/screenfull.d.ts +0 -2
- package/es/utils/screenfull.js +0 -128
- package/lib/assets/iconfont/iconfont.js +0 -48
- package/lib/constants/index.js +0 -68
- package/lib/control/baseControl/buttonControl.js +0 -183
- package/lib/control/baseControl/control.js +0 -314
- package/lib/control/baseControl/index.js +0 -39
- package/lib/control/baseControl/popperControl.js +0 -126
- package/lib/control/baseControl/selectControl.js +0 -210
- package/lib/control/exportImage.js +0 -165
- package/lib/control/fullscreen.js +0 -125
- package/lib/control/geoLocate.js +0 -113
- package/lib/control/layerSwitch.js +0 -147
- package/lib/control/logo.js +0 -81
- package/lib/control/mapTheme.js +0 -116
- package/lib/control/mouseLocation.js +0 -89
- package/lib/control/scale.js +0 -155
- package/lib/control/zoom.js +0 -138
- package/lib/css/button.less +0 -70
- package/lib/css/control.less +0 -71
- package/lib/css/index.css +0 -594
- package/lib/css/index.less +0 -12
- package/lib/css/l7.less +0 -62
- 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 -185
- package/lib/css/scale.less +0 -34
- package/lib/css/select.less +0 -86
- package/lib/css/variables.less +0 -30
- package/lib/css/zoom.less +0 -29
- package/lib/images/layers.png +0 -0
- package/lib/images/layers.svg +0 -1
- package/lib/images/logo.png +0 -0
- package/lib/images/quanping.svg +0 -12
- package/lib/index.js +0 -169
- package/lib/interface.js +0 -5
- package/lib/marker-layer.js +0 -349
- package/lib/marker.js +0 -417
- package/lib/popup/layerPopup.js +0 -317
- package/lib/popup/popup.js +0 -573
- package/lib/utils/anchor.js +0 -40
- package/lib/utils/icon.js +0 -16
- package/lib/utils/popper.js +0 -263
- package/lib/utils/screenfull.js +0 -136
package/lib/control/zoom.js
DELETED
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = exports.Zoom = void 0;
|
|
8
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
12
|
-
var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
|
|
13
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
14
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
15
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
16
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
17
|
-
var _l7Core = require("@antv/l7-core");
|
|
18
|
-
var _l7Utils = require("@antv/l7-utils");
|
|
19
|
-
var _icon = require("../utils/icon");
|
|
20
|
-
var _baseControl = require("./baseControl");
|
|
21
|
-
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); }; }
|
|
22
|
-
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; } }
|
|
23
|
-
var Zoom = /*#__PURE__*/function (_Control) {
|
|
24
|
-
(0, _inherits2.default)(Zoom, _Control);
|
|
25
|
-
var _super = _createSuper(Zoom);
|
|
26
|
-
function Zoom() {
|
|
27
|
-
var _this;
|
|
28
|
-
(0, _classCallCheck2.default)(this, Zoom);
|
|
29
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
30
|
-
args[_key] = arguments[_key];
|
|
31
|
-
}
|
|
32
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
33
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "zoomIn", function () {
|
|
34
|
-
if (!_this.disabled && _this.mapsService.getZoom() < _this.mapsService.getMaxZoom()) {
|
|
35
|
-
_this.mapsService.zoomIn();
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "zoomOut", function () {
|
|
39
|
-
if (!_this.disabled && _this.mapsService.getZoom() > _this.mapsService.getMinZoom()) {
|
|
40
|
-
_this.mapsService.zoomOut();
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "updateDisabled", function () {
|
|
44
|
-
var mapsService = _this.mapsService;
|
|
45
|
-
_this.zoomInButton.removeAttribute('disabled');
|
|
46
|
-
_this.zoomOutButton.removeAttribute('disabled');
|
|
47
|
-
if (_this.disabled || mapsService.getZoom() <= mapsService.getMinZoom()) {
|
|
48
|
-
_this.zoomOutButton.setAttribute('disabled', 'true');
|
|
49
|
-
}
|
|
50
|
-
if (_this.controlOption.showZoom && _this.zoomNumDiv) {
|
|
51
|
-
_this.zoomNumDiv.innerText = String(Math.floor(mapsService.getZoom()));
|
|
52
|
-
}
|
|
53
|
-
if (_this.disabled || mapsService.getZoom() >= mapsService.getMaxZoom()) {
|
|
54
|
-
_this.zoomInButton.setAttribute('disabled', 'true');
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
return _this;
|
|
58
|
-
}
|
|
59
|
-
(0, _createClass2.default)(Zoom, [{
|
|
60
|
-
key: "getDefault",
|
|
61
|
-
value: function getDefault(option) {
|
|
62
|
-
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _get2.default)((0, _getPrototypeOf2.default)(Zoom.prototype), "getDefault", this).call(this, option)), {}, {
|
|
63
|
-
position: _l7Core.PositionType.BOTTOMRIGHT,
|
|
64
|
-
name: 'zoom',
|
|
65
|
-
zoomInText: (0, _icon.createL7Icon)('l7-icon-enlarge'),
|
|
66
|
-
zoomInTitle: 'Zoom in',
|
|
67
|
-
zoomOutText: (0, _icon.createL7Icon)('l7-icon-narrow'),
|
|
68
|
-
zoomOutTitle: 'Zoom out',
|
|
69
|
-
showZoom: false
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
}, {
|
|
73
|
-
key: "setOptions",
|
|
74
|
-
value: function setOptions(newOptions) {
|
|
75
|
-
(0, _get2.default)((0, _getPrototypeOf2.default)(Zoom.prototype), "setOptions", this).call(this, newOptions);
|
|
76
|
-
if (this.checkUpdateOption(newOptions, ['zoomInText', 'zoomInTitle', 'zoomOutText', 'zoomOutTitle', 'showZoom'])) {
|
|
77
|
-
this.resetButtonGroup(this.container);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}, {
|
|
81
|
-
key: "onAdd",
|
|
82
|
-
value: function onAdd() {
|
|
83
|
-
var container = _l7Utils.DOM.create('div', 'l7-control-zoom');
|
|
84
|
-
this.resetButtonGroup(container);
|
|
85
|
-
this.mapsService.on('zoomend', this.updateDisabled);
|
|
86
|
-
this.mapsService.on('zoomchange', this.updateDisabled);
|
|
87
|
-
return container;
|
|
88
|
-
}
|
|
89
|
-
}, {
|
|
90
|
-
key: "onRemove",
|
|
91
|
-
value: function onRemove() {
|
|
92
|
-
this.mapsService.off('zoomend', this.updateDisabled);
|
|
93
|
-
this.mapsService.off('zoomchange', this.updateDisabled);
|
|
94
|
-
}
|
|
95
|
-
}, {
|
|
96
|
-
key: "disable",
|
|
97
|
-
value: function disable() {
|
|
98
|
-
this.disabled = true;
|
|
99
|
-
this.updateDisabled();
|
|
100
|
-
return this;
|
|
101
|
-
}
|
|
102
|
-
}, {
|
|
103
|
-
key: "enable",
|
|
104
|
-
value: function enable() {
|
|
105
|
-
this.disabled = false;
|
|
106
|
-
this.updateDisabled();
|
|
107
|
-
return this;
|
|
108
|
-
}
|
|
109
|
-
}, {
|
|
110
|
-
key: "resetButtonGroup",
|
|
111
|
-
value: function resetButtonGroup(container) {
|
|
112
|
-
_l7Utils.DOM.clearChildren(container);
|
|
113
|
-
this.zoomInButton = this.createButton(this.controlOption.zoomInText, this.controlOption.zoomInTitle, 'l7-button-control', container, this.zoomIn);
|
|
114
|
-
if (this.controlOption.showZoom) {
|
|
115
|
-
this.zoomNumDiv = this.createButton('0', '', 'l7-button-control l7-control-zoom__number', container);
|
|
116
|
-
}
|
|
117
|
-
this.zoomOutButton = this.createButton(this.controlOption.zoomOutText, this.controlOption.zoomOutTitle, 'l7-button-control', container, this.zoomOut);
|
|
118
|
-
this.updateDisabled();
|
|
119
|
-
}
|
|
120
|
-
}, {
|
|
121
|
-
key: "createButton",
|
|
122
|
-
value: function createButton(html, tile, className, container, fn) {
|
|
123
|
-
var link = _l7Utils.DOM.create('button', className, container);
|
|
124
|
-
if (typeof html === 'string') {
|
|
125
|
-
link.innerHTML = html;
|
|
126
|
-
} else {
|
|
127
|
-
link.append(html);
|
|
128
|
-
}
|
|
129
|
-
link.title = tile;
|
|
130
|
-
if (fn) {
|
|
131
|
-
link.addEventListener('click', fn);
|
|
132
|
-
}
|
|
133
|
-
return link;
|
|
134
|
-
}
|
|
135
|
-
}]);
|
|
136
|
-
return Zoom;
|
|
137
|
-
}(_baseControl.Control);
|
|
138
|
-
exports.default = exports.Zoom = Zoom;
|
package/lib/css/button.less
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
@import 'variables.less';
|
|
2
|
-
|
|
3
|
-
.l7-button-control {
|
|
4
|
-
min-width: @l7-btn-control-size;
|
|
5
|
-
height: @l7-btn-control-size;
|
|
6
|
-
background-color: @l7-control-bg-color;
|
|
7
|
-
border-width: 0;
|
|
8
|
-
border-radius: @l7-btn-control-border-radius;
|
|
9
|
-
outline: 0;
|
|
10
|
-
cursor: pointer;
|
|
11
|
-
transition: all 0.2s;
|
|
12
|
-
display: flex;
|
|
13
|
-
justify-content: center;
|
|
14
|
-
align-items: center;
|
|
15
|
-
padding: 0 ((@l7-btn-control-size - @l7-btn-icon-size) / 2);
|
|
16
|
-
box-shadow: @l7-control-shadow;
|
|
17
|
-
line-height: 16px;
|
|
18
|
-
|
|
19
|
-
.l7-iconfont {
|
|
20
|
-
fill: @l7-control-font-color;
|
|
21
|
-
color: @l7-control-font-color;
|
|
22
|
-
width: @l7-btn-icon-size;
|
|
23
|
-
height: @l7-btn-icon-size;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
&.l7-button-control--row {
|
|
27
|
-
padding: 0 16px 0 13px;
|
|
28
|
-
|
|
29
|
-
* + .l7-button-control__text {
|
|
30
|
-
margin-left: 8px;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
&.l7-button-control--column {
|
|
35
|
-
height: @l7-btn-column-height;
|
|
36
|
-
flex-direction: column;
|
|
37
|
-
.l7-iconfont {
|
|
38
|
-
margin-top: 3px;
|
|
39
|
-
}
|
|
40
|
-
.l7-button-control__text {
|
|
41
|
-
margin-top: 3px;
|
|
42
|
-
font-size: 10px;
|
|
43
|
-
transform: scale(0.83333);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
&:not(:disabled) {
|
|
48
|
-
&:hover {
|
|
49
|
-
background-color: @l7-btn-control-bg-hover-color;
|
|
50
|
-
}
|
|
51
|
-
&:active {
|
|
52
|
-
background-color: @l7-btn-control-bg-active-color;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
&:disabled {
|
|
56
|
-
background-color: @l7-btn-control-disabled-bg-color;
|
|
57
|
-
color: @l7-btn-control-disabled-font-color;
|
|
58
|
-
cursor: not-allowed;
|
|
59
|
-
.l7-iconfont {
|
|
60
|
-
fill: @l7-btn-control-disabled-font-color;
|
|
61
|
-
color: @l7-btn-control-disabled-font-color;
|
|
62
|
-
}
|
|
63
|
-
&:hover {
|
|
64
|
-
background-color: @l7-btn-control-disabled-bg-color;
|
|
65
|
-
}
|
|
66
|
-
&:active {
|
|
67
|
-
background-color: @l7-btn-control-disabled-bg-color;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
package/lib/css/control.less
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
@import 'variables.less';
|
|
2
|
-
|
|
3
|
-
.l7-control-container {
|
|
4
|
-
font: 12px/1.5 'Helvetica Neue', Arial, Helvetica, sans-serif;
|
|
5
|
-
|
|
6
|
-
.l7-control {
|
|
7
|
-
position: relative;
|
|
8
|
-
z-index: @l7-control-z-index;
|
|
9
|
-
float: left;
|
|
10
|
-
clear: both;
|
|
11
|
-
color: @l7-control-font-color;
|
|
12
|
-
font-size: @l7-control-font-size;
|
|
13
|
-
pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
|
|
14
|
-
pointer-events: auto;
|
|
15
|
-
|
|
16
|
-
&.l7-control--hide {
|
|
17
|
-
display: none;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
each(@position-list,{
|
|
22
|
-
.l7-@{value} {
|
|
23
|
-
@{value}: 0;
|
|
24
|
-
display: flex;
|
|
25
|
-
position: absolute;
|
|
26
|
-
z-index: @l7-control-z-index;
|
|
27
|
-
pointer-events: none;
|
|
28
|
-
.l7-control:not(.l7-control--hide) {
|
|
29
|
-
margin-@{value}: @l7-control-space;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
.l7-center {
|
|
35
|
-
position: absolute;
|
|
36
|
-
display: flex;
|
|
37
|
-
justify-content: center;
|
|
38
|
-
&.l7-top,
|
|
39
|
-
&.l7-bottom {
|
|
40
|
-
width: 100%;
|
|
41
|
-
}
|
|
42
|
-
&.l7-left,
|
|
43
|
-
&.l7-right {
|
|
44
|
-
height: 100%;
|
|
45
|
-
}
|
|
46
|
-
.l7-control {
|
|
47
|
-
margin-right: @l7-control-space;
|
|
48
|
-
margin-bottom: @l7-control-space;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.l7-row {
|
|
53
|
-
flex-direction: row;
|
|
54
|
-
&.l7-top {
|
|
55
|
-
align-items: flex-start;
|
|
56
|
-
}
|
|
57
|
-
&.l7-bottom {
|
|
58
|
-
align-items: flex-end;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.l7-column {
|
|
63
|
-
flex-direction: column;
|
|
64
|
-
&.l7-left {
|
|
65
|
-
align-items: flex-start;
|
|
66
|
-
}
|
|
67
|
-
&.l7-right {
|
|
68
|
-
align-items: flex-end;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|