@antv/l7-map 2.17.12 → 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 +4 -4
- package/es/camera.d.ts +0 -85
- package/es/camera.js +0 -775
- package/es/css/l7.css +0 -98
- package/es/earthmap.d.ts +0 -66
- package/es/earthmap.js +0 -422
- package/es/geo/edge_insets.d.ts +0 -54
- package/es/geo/edge_insets.js +0 -118
- package/es/geo/lng_lat.d.ts +0 -18
- package/es/geo/lng_lat.js +0 -81
- package/es/geo/lng_lat_bounds.d.ts +0 -24
- package/es/geo/lng_lat_bounds.js +0 -167
- package/es/geo/mercator.d.ts +0 -29
- package/es/geo/mercator.js +0 -92
- package/es/geo/point.d.ts +0 -40
- package/es/geo/point.js +0 -231
- package/es/geo/simple.d.ts +0 -29
- package/es/geo/simple.js +0 -92
- package/es/geo/transform.d.ts +0 -198
- package/es/geo/transform.js +0 -971
- package/es/handler/IHandler.d.ts +0 -34
- package/es/handler/IHandler.js +0 -1
- package/es/handler/blockable_map_event.d.ts +0 -17
- package/es/handler/blockable_map_event.js +0 -83
- package/es/handler/box_zoom.d.ts +0 -59
- package/es/handler/box_zoom.js +0 -200
- package/es/handler/click_zoom.d.ts +0 -16
- package/es/handler/click_zoom.js +0 -59
- package/es/handler/events/event.d.ts +0 -4
- package/es/handler/events/event.js +0 -12
- package/es/handler/events/index.d.ts +0 -4
- package/es/handler/events/index.js +0 -4
- package/es/handler/events/map_mouse_event.d.ts +0 -34
- package/es/handler/events/map_mouse_event.js +0 -75
- package/es/handler/events/map_touch_event.d.ts +0 -57
- package/es/handler/events/map_touch_event.js +0 -105
- package/es/handler/events/map_wheel_event.d.ts +0 -33
- package/es/handler/events/map_wheel_event.js +0 -61
- package/es/handler/events/render_event.d.ts +0 -5
- package/es/handler/events/render_event.js +0 -39
- package/es/handler/handler_inertia.d.ts +0 -23
- package/es/handler/handler_inertia.js +0 -184
- package/es/handler/handler_manager.d.ts +0 -61
- package/es/handler/handler_manager.js +0 -684
- package/es/handler/handler_util.d.ts +0 -4
- package/es/handler/handler_util.js +0 -10
- package/es/handler/keyboard.d.ts +0 -36
- package/es/handler/keyboard.js +0 -162
- package/es/handler/map_event.d.ts +0 -29
- package/es/handler/map_event.js +0 -131
- package/es/handler/mouse/index.d.ts +0 -4
- package/es/handler/mouse/index.js +0 -4
- package/es/handler/mouse/mouse_handler.d.ts +0 -22
- package/es/handler/mouse/mouse_handler.js +0 -131
- package/es/handler/mouse/mousepan_handler.d.ts +0 -10
- package/es/handler/mouse/mousepan_handler.js +0 -54
- package/es/handler/mouse/mousepitch_hander.d.ts +0 -9
- package/es/handler/mouse/mousepitch_hander.js +0 -56
- package/es/handler/mouse/mouserotate_hander.d.ts +0 -9
- package/es/handler/mouse/mouserotate_hander.js +0 -56
- package/es/handler/mouse/util.d.ts +0 -6
- package/es/handler/mouse/util.js +0 -12
- package/es/handler/scroll_zoom.d.ts +0 -93
- package/es/handler/scroll_zoom.js +0 -353
- package/es/handler/shim/dblclick_zoom.d.ts +0 -40
- package/es/handler/shim/dblclick_zoom.js +0 -72
- package/es/handler/shim/drag_pan.d.ts +0 -61
- package/es/handler/shim/drag_pan.js +0 -96
- package/es/handler/shim/drag_rotate.d.ts +0 -46
- package/es/handler/shim/drag_rotate.js +0 -80
- package/es/handler/shim/touch_zoom_rotate.d.ts +0 -70
- package/es/handler/shim/touch_zoom_rotate.js +0 -130
- package/es/handler/tap/single_tap_recognizer.d.ts +0 -20
- package/es/handler/tap/single_tap_recognizer.js +0 -120
- package/es/handler/tap/tap_drag_zoom.d.ts +0 -22
- package/es/handler/tap/tap_drag_zoom.js +0 -114
- package/es/handler/tap/tap_recognizer.d.ts +0 -17
- package/es/handler/tap/tap_recognizer.js +0 -62
- package/es/handler/tap/tap_zoom.d.ts +0 -22
- package/es/handler/tap/tap_zoom.js +0 -115
- package/es/handler/touch/index.d.ts +0 -5
- package/es/handler/touch/index.js +0 -5
- package/es/handler/touch/touch_pan.d.ts +0 -30
- package/es/handler/touch/touch_pan.js +0 -128
- package/es/handler/touch/touch_pitch.d.ts +0 -13
- package/es/handler/touch/touch_pitch.js +0 -110
- package/es/handler/touch/touch_rotate.d.ts +0 -12
- package/es/handler/touch/touch_rotate.js +0 -88
- package/es/handler/touch/touch_zoom.d.ts +0 -12
- package/es/handler/touch/touch_zoom.js +0 -67
- package/es/handler/touch/two_touch.d.ts +0 -23
- package/es/handler/touch/two_touch.js +0 -138
- package/es/hash.d.ts +0 -14
- package/es/hash.js +0 -156
- package/es/index.d.ts +0 -4
- package/es/index.js +0 -4
- package/es/interface.d.ts +0 -34
- package/es/interface.js +0 -1
- package/es/map.d.ts +0 -70
- package/es/map.js +0 -464
- package/es/util.d.ts +0 -25
- package/es/util.js +0 -101
- package/es/utils/Aabb.d.ts +0 -12
- package/es/utils/Aabb.js +0 -133
- package/es/utils/dom.d.ts +0 -4
- package/es/utils/dom.js +0 -218
- package/es/utils/performance.d.ts +0 -17
- package/es/utils/performance.js +0 -62
- package/es/utils/primitives.d.ts +0 -6
- package/es/utils/primitives.js +0 -45
- package/es/utils/task_queue.d.ts +0 -13
- package/es/utils/task_queue.js +0 -106
- package/lib/camera.js +0 -801
- package/lib/css/l7.css +0 -98
- package/lib/earthmap.js +0 -445
- package/lib/geo/edge_insets.js +0 -129
- package/lib/geo/lng_lat.js +0 -94
- package/lib/geo/lng_lat_bounds.js +0 -177
- package/lib/geo/mercator.js +0 -121
- package/lib/geo/point.js +0 -239
- package/lib/geo/simple.js +0 -123
- package/lib/geo/transform.js +0 -1013
- package/lib/handler/IHandler.js +0 -5
- package/lib/handler/blockable_map_event.js +0 -92
- package/lib/handler/box_zoom.js +0 -217
- package/lib/handler/click_zoom.js +0 -67
- package/lib/handler/events/event.js +0 -23
- package/lib/handler/events/index.js +0 -31
- package/lib/handler/events/map_mouse_event.js +0 -87
- package/lib/handler/events/map_touch_event.js +0 -119
- package/lib/handler/events/map_wheel_event.js +0 -72
- package/lib/handler/events/render_event.js +0 -52
- package/lib/handler/handler_inertia.js +0 -193
- package/lib/handler/handler_manager.js +0 -714
- package/lib/handler/handler_util.js +0 -17
- package/lib/handler/keyboard.js +0 -172
- package/lib/handler/map_event.js +0 -140
- package/lib/handler/mouse/index.js +0 -31
- package/lib/handler/mouse/mouse_handler.js +0 -141
- package/lib/handler/mouse/mousepan_handler.js +0 -66
- package/lib/handler/mouse/mousepitch_hander.js +0 -67
- package/lib/handler/mouse/mouserotate_hander.js +0 -67
- package/lib/handler/mouse/util.js +0 -26
- package/lib/handler/scroll_zoom.js +0 -367
- package/lib/handler/shim/dblclick_zoom.js +0 -80
- package/lib/handler/shim/drag_pan.js +0 -105
- package/lib/handler/shim/drag_rotate.js +0 -88
- package/lib/handler/shim/touch_zoom_rotate.js +0 -139
- package/lib/handler/tap/single_tap_recognizer.js +0 -131
- package/lib/handler/tap/tap_drag_zoom.js +0 -124
- package/lib/handler/tap/tap_recognizer.js +0 -78
- package/lib/handler/tap/tap_zoom.js +0 -124
- package/lib/handler/touch/index.js +0 -39
- package/lib/handler/touch/touch_pan.js +0 -138
- package/lib/handler/touch/touch_pitch.js +0 -120
- package/lib/handler/touch/touch_rotate.js +0 -99
- package/lib/handler/touch/touch_zoom.js +0 -78
- package/lib/handler/touch/two_touch.js +0 -148
- package/lib/hash.js +0 -169
- package/lib/index.js +0 -57
- package/lib/interface.js +0 -5
- package/lib/map.js +0 -489
- package/lib/util.js +0 -135
- package/lib/utils/Aabb.js +0 -143
- package/lib/utils/dom.js +0 -233
- package/lib/utils/performance.js +0 -72
- package/lib/utils/primitives.js +0 -57
- package/lib/utils/task_queue.js +0 -115
package/lib/hash.js
DELETED
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
|
|
10
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
|
|
12
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
-
|
|
14
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
|
-
|
|
16
|
-
var _l7Utils = require("@antv/l7-utils");
|
|
17
|
-
|
|
18
|
-
var _lodash = require("lodash");
|
|
19
|
-
|
|
20
|
-
// @ts-ignore
|
|
21
|
-
// tslint:disable-next-line:no-submodule-imports
|
|
22
|
-
|
|
23
|
-
/*
|
|
24
|
-
* Adds the map's position to its page's location hash.
|
|
25
|
-
* Passed as an option to the map object.
|
|
26
|
-
*
|
|
27
|
-
* @returns {Hash} `this`
|
|
28
|
-
*/
|
|
29
|
-
var Hash = /*#__PURE__*/function () {
|
|
30
|
-
function Hash(hashName) {
|
|
31
|
-
var _this = this;
|
|
32
|
-
|
|
33
|
-
(0, _classCallCheck2.default)(this, Hash);
|
|
34
|
-
(0, _defineProperty2.default)(this, "onHashChange", function () {
|
|
35
|
-
var loc = _this.getCurrentHash();
|
|
36
|
-
|
|
37
|
-
if (loc.length >= 3 && !loc.some(function (v) {
|
|
38
|
-
return isNaN(+v);
|
|
39
|
-
})) {
|
|
40
|
-
var bearing = _this.map.dragRotate.isEnabled() && _this.map.touchZoomRotate.isEnabled() ? +(loc[3] || 0) : _this.map.getBearing();
|
|
41
|
-
|
|
42
|
-
_this.map.jumpTo({
|
|
43
|
-
center: [+loc[2], +loc[1]],
|
|
44
|
-
zoom: +loc[0],
|
|
45
|
-
bearing: bearing,
|
|
46
|
-
pitch: +(loc[4] || 0)
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
return true;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
return false;
|
|
53
|
-
});
|
|
54
|
-
(0, _defineProperty2.default)(this, "getCurrentHash", function () {
|
|
55
|
-
// Get the current hash from location, stripped from its number sign
|
|
56
|
-
var hash = window.location.hash.replace('#', '');
|
|
57
|
-
|
|
58
|
-
if (_this.hashName) {
|
|
59
|
-
// Split the parameter-styled hash into parts and find the value we need
|
|
60
|
-
var keyval;
|
|
61
|
-
hash.split('&').map(function (part) {
|
|
62
|
-
return part.split('=');
|
|
63
|
-
}).forEach(function (part) {
|
|
64
|
-
if (part[0] === _this.hashName) {
|
|
65
|
-
keyval = part;
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
return (keyval ? keyval[1] || '' : '').split('/');
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
return hash.split('/');
|
|
72
|
-
});
|
|
73
|
-
(0, _defineProperty2.default)(this, "updateHashUnthrottled", function () {
|
|
74
|
-
var hash = _this.getHashString();
|
|
75
|
-
|
|
76
|
-
try {
|
|
77
|
-
window.history.replaceState(window.history.state, '', hash);
|
|
78
|
-
} catch (SecurityError) {// IE11 does not allow this if the page is within an iframe created
|
|
79
|
-
// with iframe.contentWindow.document.write(...).
|
|
80
|
-
// https://github.com/mapbox/mapbox-gl-js/issues/7410
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
this.hashName = hashName && encodeURIComponent(hashName); // Mobile Safari doesn't allow updating the hash more than 100 times per 30 seconds.
|
|
84
|
-
|
|
85
|
-
this.updateHash = (0, _lodash.throttle)(this.updateHashUnthrottled, 30 * 1000 / 100);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
(0, _createClass2.default)(Hash, [{
|
|
89
|
-
key: "addTo",
|
|
90
|
-
value: function addTo(map) {
|
|
91
|
-
this.map = map;
|
|
92
|
-
|
|
93
|
-
_l7Utils.$window.addEventListener('hashchange', this.onHashChange, false);
|
|
94
|
-
|
|
95
|
-
this.map.on('moveend', this.updateHash);
|
|
96
|
-
return this;
|
|
97
|
-
}
|
|
98
|
-
}, {
|
|
99
|
-
key: "remove",
|
|
100
|
-
value: function remove() {
|
|
101
|
-
_l7Utils.$window.removeEventListener('hashchange', this.onHashChange, false);
|
|
102
|
-
|
|
103
|
-
this.map.off('moveend', this.updateHash); // clearTimeout(this.updateHash());
|
|
104
|
-
// @ts-ignore
|
|
105
|
-
|
|
106
|
-
delete this.map;
|
|
107
|
-
return this;
|
|
108
|
-
}
|
|
109
|
-
}, {
|
|
110
|
-
key: "getHashString",
|
|
111
|
-
value: function getHashString(mapFeedback) {
|
|
112
|
-
var center = this.map.getCenter();
|
|
113
|
-
var zoom = Math.round(this.map.getZoom() * 100) / 100; // derived from equation: 512px * 2^z / 360 / 10^d < 0.5px
|
|
114
|
-
|
|
115
|
-
var precision = Math.ceil((zoom * Math.LN2 + Math.log(512 / 360 / 0.5)) / Math.LN10);
|
|
116
|
-
var m = Math.pow(10, precision);
|
|
117
|
-
var lng = Math.round(center.lng * m) / m;
|
|
118
|
-
var lat = Math.round(center.lat * m) / m;
|
|
119
|
-
var bearing = this.map.getBearing();
|
|
120
|
-
var pitch = this.map.getPitch();
|
|
121
|
-
var hash = '';
|
|
122
|
-
|
|
123
|
-
if (mapFeedback) {
|
|
124
|
-
// new map feedback site has some constraints that don't allow
|
|
125
|
-
// us to use the same hash format as we do for the Map hash option.
|
|
126
|
-
hash += "/".concat(lng, "/").concat(lat, "/").concat(zoom);
|
|
127
|
-
} else {
|
|
128
|
-
hash += "".concat(zoom, "/").concat(lat, "/").concat(lng);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
if (bearing || pitch) {
|
|
132
|
-
hash += "/".concat(Math.round(bearing * 10) / 10);
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
if (pitch) {
|
|
136
|
-
hash += "/".concat(Math.round(pitch));
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
if (this.hashName) {
|
|
140
|
-
var hashName = this.hashName;
|
|
141
|
-
var found = false;
|
|
142
|
-
var parts = window.location.hash.slice(1).split('&').map(function (part) {
|
|
143
|
-
var key = part.split('=')[0];
|
|
144
|
-
|
|
145
|
-
if (key === hashName) {
|
|
146
|
-
found = true;
|
|
147
|
-
return "".concat(key, "=").concat(hash);
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
return part;
|
|
151
|
-
}).filter(function (a) {
|
|
152
|
-
return a;
|
|
153
|
-
});
|
|
154
|
-
|
|
155
|
-
if (!found) {
|
|
156
|
-
parts.push("".concat(hashName, "=").concat(hash));
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
return "#".concat(parts.join('&'));
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
return "#".concat(hash);
|
|
163
|
-
}
|
|
164
|
-
}]);
|
|
165
|
-
return Hash;
|
|
166
|
-
}();
|
|
167
|
-
|
|
168
|
-
var _default = Hash;
|
|
169
|
-
exports.default = _default;
|
package/lib/index.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
var _earthmap = require("./earthmap");
|
|
8
|
-
|
|
9
|
-
Object.keys(_earthmap).forEach(function (key) {
|
|
10
|
-
if (key === "default" || key === "__esModule") return;
|
|
11
|
-
if (key in exports && exports[key] === _earthmap[key]) return;
|
|
12
|
-
Object.defineProperty(exports, key, {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function get() {
|
|
15
|
-
return _earthmap[key];
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
var _mercator = require("./geo/mercator");
|
|
21
|
-
|
|
22
|
-
Object.keys(_mercator).forEach(function (key) {
|
|
23
|
-
if (key === "default" || key === "__esModule") return;
|
|
24
|
-
if (key in exports && exports[key] === _mercator[key]) return;
|
|
25
|
-
Object.defineProperty(exports, key, {
|
|
26
|
-
enumerable: true,
|
|
27
|
-
get: function get() {
|
|
28
|
-
return _mercator[key];
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
var _interface = require("./interface");
|
|
34
|
-
|
|
35
|
-
Object.keys(_interface).forEach(function (key) {
|
|
36
|
-
if (key === "default" || key === "__esModule") return;
|
|
37
|
-
if (key in exports && exports[key] === _interface[key]) return;
|
|
38
|
-
Object.defineProperty(exports, key, {
|
|
39
|
-
enumerable: true,
|
|
40
|
-
get: function get() {
|
|
41
|
-
return _interface[key];
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
var _map = require("./map");
|
|
47
|
-
|
|
48
|
-
Object.keys(_map).forEach(function (key) {
|
|
49
|
-
if (key === "default" || key === "__esModule") return;
|
|
50
|
-
if (key in exports && exports[key] === _map[key]) return;
|
|
51
|
-
Object.defineProperty(exports, key, {
|
|
52
|
-
enumerable: true,
|
|
53
|
-
get: function get() {
|
|
54
|
-
return _map[key];
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
});
|