@antv/l7-component 2.9.21 → 2.9.23

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.
Files changed (53) hide show
  1. package/es/control/BaseControl.js +5 -26
  2. package/es/control/layer.js +13 -28
  3. package/es/control/logo.js +3 -4
  4. package/es/control/scale.js +6 -11
  5. package/es/control/zoom.js +3 -12
  6. package/es/css/l7.css +502 -0
  7. package/es/images/layers.png +0 -0
  8. package/es/images/layers.svg +1 -0
  9. package/es/images/logo.png +0 -0
  10. package/es/index.js +10 -10
  11. package/es/interface.js +1 -2
  12. package/es/marker-layer.js +27 -27
  13. package/es/marker.js +21 -27
  14. package/es/popup.js +16 -34
  15. package/es/utils/anchor.js +1 -2
  16. package/lib/control/BaseControl.js +100 -163
  17. package/lib/control/layer.js +248 -347
  18. package/lib/control/logo.js +52 -77
  19. package/lib/control/scale.js +112 -165
  20. package/lib/control/zoom.js +95 -143
  21. package/lib/css/l7.css +502 -0
  22. package/lib/images/layers.png +0 -0
  23. package/lib/images/layers.svg +1 -0
  24. package/lib/images/logo.png +0 -0
  25. package/lib/index.js +53 -135
  26. package/lib/interface.js +17 -2
  27. package/lib/marker-layer.js +224 -330
  28. package/lib/marker.js +271 -404
  29. package/lib/popup.js +201 -309
  30. package/lib/utils/anchor.js +54 -37
  31. package/package.json +9 -9
  32. package/es/control/BaseControl.js.map +0 -1
  33. package/es/control/layer.js.map +0 -1
  34. package/es/control/logo.js.map +0 -1
  35. package/es/control/scale.js.map +0 -1
  36. package/es/control/zoom.js.map +0 -1
  37. package/es/index.js.map +0 -1
  38. package/es/interface.js.map +0 -1
  39. package/es/marker-layer.js.map +0 -1
  40. package/es/marker.js.map +0 -1
  41. package/es/popup.js.map +0 -1
  42. package/es/utils/anchor.js.map +0 -1
  43. package/lib/control/BaseControl.js.map +0 -1
  44. package/lib/control/layer.js.map +0 -1
  45. package/lib/control/logo.js.map +0 -1
  46. package/lib/control/scale.js.map +0 -1
  47. package/lib/control/zoom.js.map +0 -1
  48. package/lib/index.js.map +0 -1
  49. package/lib/interface.js.map +0 -1
  50. package/lib/marker-layer.js.map +0 -1
  51. package/lib/marker.js.map +0 -1
  52. package/lib/popup.js.map +0 -1
  53. package/lib/utils/anchor.js.map +0 -1
@@ -1,149 +1,101 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- var _typeof = require("@babel/runtime/helpers/typeof");
6
-
7
- Object.defineProperty(exports, "__esModule", {
8
- value: true
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
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/control/zoom.ts
23
+ var zoom_exports = {};
24
+ __export(zoom_exports, {
25
+ default: () => Zoom
9
26
  });
10
- exports.default = void 0;
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 _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
19
-
20
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
21
-
22
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
23
-
24
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
25
-
26
- var _l7Utils = require("@antv/l7-utils");
27
-
28
- var _BaseControl = _interopRequireWildcard(require("./BaseControl"));
29
-
30
- 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); }
31
-
32
- 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; }
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 Zoom = function (_Control) {
39
- (0, _inherits2.default)(Zoom, _Control);
40
-
41
- var _super = _createSuper(Zoom);
42
-
43
- function Zoom(cfg) {
44
- var _this;
45
-
46
- (0, _classCallCheck2.default)(this, Zoom);
47
- _this = _super.call(this, cfg);
48
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "disabled", void 0);
49
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "zoomInButton", void 0);
50
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "zoomOutButton", void 0);
51
- (0, _l7Utils.bindAll)(['updateDisabled', 'zoomIn', 'zoomOut'], (0, _assertThisInitialized2.default)(_this));
52
- return _this;
27
+ module.exports = __toCommonJS(zoom_exports);
28
+ var import_l7_utils = require("@antv/l7-utils");
29
+ var import_BaseControl = __toESM(require("./BaseControl"));
30
+ var Zoom = class extends import_BaseControl.default {
31
+ constructor(cfg) {
32
+ super(cfg);
33
+ (0, import_l7_utils.bindAll)(["updateDisabled", "zoomIn", "zoomOut"], this);
53
34
  }
54
-
55
- (0, _createClass2.default)(Zoom, [{
56
- key: "getDefault",
57
- value: function getDefault() {
58
- return {
59
- position: _BaseControl.PositionType.TOPLEFT,
60
- zoomInText: '+',
61
- zoomInTitle: 'Zoom in',
62
- zoomOutText: '−',
63
- zoomOutTitle: 'Zoom out',
64
- name: 'zoom'
65
- };
66
- }
67
- }, {
68
- key: "onAdd",
69
- value: function onAdd() {
70
- var zoomName = 'l7-control-zoom';
71
-
72
- var container = _l7Utils.DOM.create('div', zoomName + ' l7-bar');
73
-
74
- this.zoomInButton = this.createButton(this.controlOption.zoomInText, this.controlOption.zoomInTitle, zoomName + '-in', container, this.zoomIn);
75
- this.zoomOutButton = this.createButton(this.controlOption.zoomOutText, this.controlOption.zoomOutTitle, zoomName + '-out', container, this.zoomOut);
76
- this.mapsService.on('zoomend', this.updateDisabled);
77
- this.mapsService.on('zoomchange', this.updateDisabled);
78
- this.updateDisabled();
79
- return container;
80
- }
81
- }, {
82
- key: "onRemove",
83
- value: function onRemove() {
84
- this.mapsService.off('zoomend', this.updateDisabled);
85
- this.mapsService.off('zoomchange', this.updateDisabled);
86
- }
87
- }, {
88
- key: "disable",
89
- value: function disable() {
90
- this.disabled = true;
91
- this.updateDisabled();
92
- return this;
93
- }
94
- }, {
95
- key: "enable",
96
- value: function enable() {
97
- this.disabled = false;
98
- this.updateDisabled();
99
- return this;
100
- }
101
- }, {
102
- key: "zoomIn",
103
- value: function zoomIn() {
104
- if (!this.disabled && this.mapsService.getZoom() < this.mapsService.getMaxZoom()) {
105
- this.mapsService.zoomIn();
106
- }
35
+ getDefault() {
36
+ return {
37
+ position: import_BaseControl.PositionType.TOPLEFT,
38
+ zoomInText: "+",
39
+ zoomInTitle: "Zoom in",
40
+ zoomOutText: "&#x2212;",
41
+ zoomOutTitle: "Zoom out",
42
+ name: "zoom"
43
+ };
44
+ }
45
+ onAdd() {
46
+ const zoomName = "l7-control-zoom";
47
+ const container = import_l7_utils.DOM.create("div", zoomName + " l7-bar");
48
+ this.zoomInButton = this.createButton(this.controlOption.zoomInText, this.controlOption.zoomInTitle, zoomName + "-in", container, this.zoomIn);
49
+ this.zoomOutButton = this.createButton(this.controlOption.zoomOutText, this.controlOption.zoomOutTitle, zoomName + "-out", container, this.zoomOut);
50
+ this.mapsService.on("zoomend", this.updateDisabled);
51
+ this.mapsService.on("zoomchange", this.updateDisabled);
52
+ this.updateDisabled();
53
+ return container;
54
+ }
55
+ onRemove() {
56
+ this.mapsService.off("zoomend", this.updateDisabled);
57
+ this.mapsService.off("zoomchange", this.updateDisabled);
58
+ }
59
+ disable() {
60
+ this.disabled = true;
61
+ this.updateDisabled();
62
+ return this;
63
+ }
64
+ enable() {
65
+ this.disabled = false;
66
+ this.updateDisabled();
67
+ return this;
68
+ }
69
+ zoomIn() {
70
+ if (!this.disabled && this.mapsService.getZoom() < this.mapsService.getMaxZoom()) {
71
+ this.mapsService.zoomIn();
107
72
  }
108
- }, {
109
- key: "zoomOut",
110
- value: function zoomOut() {
111
- if (!this.disabled && this.mapsService.getZoom() > this.mapsService.getMinZoom()) {
112
- this.mapsService.zoomOut();
113
- }
73
+ }
74
+ zoomOut() {
75
+ if (!this.disabled && this.mapsService.getZoom() > this.mapsService.getMinZoom()) {
76
+ this.mapsService.zoomOut();
114
77
  }
115
- }, {
116
- key: "createButton",
117
- value: function createButton(html, tile, className, container, fn) {
118
- var link = _l7Utils.DOM.create('a', className, container);
119
-
120
- link.innerHTML = html;
121
- link.title = tile;
122
- link.href = 'javascript:void(0)';
123
- link.addEventListener('click', fn);
124
- return link;
78
+ }
79
+ createButton(html, tile, className, container, fn) {
80
+ const link = import_l7_utils.DOM.create("a", className, container);
81
+ link.innerHTML = html;
82
+ link.title = tile;
83
+ link.href = "javascript:void(0)";
84
+ link.addEventListener("click", fn);
85
+ return link;
86
+ }
87
+ updateDisabled() {
88
+ const mapsService = this.mapsService;
89
+ const className = "l7-disabled";
90
+ import_l7_utils.DOM.removeClass(this.zoomInButton, className);
91
+ import_l7_utils.DOM.removeClass(this.zoomOutButton, className);
92
+ if (this.disabled || mapsService.getZoom() <= mapsService.getMinZoom()) {
93
+ import_l7_utils.DOM.addClass(this.zoomOutButton, className);
125
94
  }
126
- }, {
127
- key: "updateDisabled",
128
- value: function updateDisabled() {
129
- var mapsService = this.mapsService;
130
- var className = 'l7-disabled';
131
-
132
- _l7Utils.DOM.removeClass(this.zoomInButton, className);
133
-
134
- _l7Utils.DOM.removeClass(this.zoomOutButton, className);
135
-
136
- if (this.disabled || mapsService.getZoom() <= mapsService.getMinZoom()) {
137
- _l7Utils.DOM.addClass(this.zoomOutButton, className);
138
- }
139
-
140
- if (this.disabled || mapsService.getZoom() >= mapsService.getMaxZoom()) {
141
- _l7Utils.DOM.addClass(this.zoomInButton, className);
142
- }
95
+ if (this.disabled || mapsService.getZoom() >= mapsService.getMaxZoom()) {
96
+ import_l7_utils.DOM.addClass(this.zoomInButton, className);
143
97
  }
144
- }]);
145
- return Zoom;
146
- }(_BaseControl.default);
147
-
148
- exports.default = Zoom;
149
- //# sourceMappingURL=zoom.js.map
98
+ }
99
+ };
100
+ // Annotate the CommonJS export names for ESM import in node:
101
+ 0 && (module.exports = {});