@antv/l7-map 2.9.33 → 2.9.35
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/lib/camera.js +766 -508
- package/lib/earthmap.js +389 -223
- package/lib/geo/edge_insets.js +117 -64
- package/lib/geo/lng_lat.js +86 -65
- package/lib/geo/lng_lat_bounds.js +162 -123
- package/lib/geo/mercator.js +91 -62
- package/lib/geo/point.js +234 -171
- package/lib/geo/simple.js +93 -61
- package/lib/geo/transform.js +982 -472
- package/lib/handler/IHandler.js +4 -16
- package/lib/handler/blockable_map_event.js +84 -63
- package/lib/handler/box_zoom.js +201 -123
- package/lib/handler/click_zoom.js +63 -55
- package/lib/handler/events/event.js +20 -35
- package/lib/handler/events/index.js +28 -35
- package/lib/handler/events/map_mouse_event.js +85 -42
- package/lib/handler/events/map_touch_event.js +116 -45
- package/lib/handler/events/map_wheel_event.js +70 -34
- package/lib/handler/events/render_event.js +50 -31
- package/lib/handler/handler_inertia.js +158 -114
- package/lib/handler/handler_manager.js +640 -381
- package/lib/handler/handler_util.js +11 -29
- package/lib/handler/keyboard.js +155 -114
- package/lib/handler/map_event.js +133 -84
- package/lib/handler/mouse/index.js +28 -35
- package/lib/handler/mouse/mouse_handler.js +126 -90
- package/lib/handler/mouse/mousepan_handler.js +64 -46
- package/lib/handler/mouse/mousepitch_hander.js +64 -44
- package/lib/handler/mouse/mouserotate_hander.js +64 -44
- package/lib/handler/mouse/util.js +22 -40
- package/lib/handler/scroll_zoom.js +318 -176
- package/lib/handler/shim/dblclick_zoom.js +76 -42
- package/lib/handler/shim/drag_pan.js +98 -48
- package/lib/handler/shim/drag_rotate.js +82 -43
- package/lib/handler/shim/touch_zoom_rotate.js +127 -59
- package/lib/handler/tap/single_tap_recognizer.js +113 -84
- package/lib/handler/tap/tap_drag_zoom.js +111 -93
- package/lib/handler/tap/tap_recognizer.js +72 -60
- package/lib/handler/tap/tap_zoom.js +113 -88
- package/lib/handler/touch/index.js +36 -38
- package/lib/handler/touch/touch_pan.js +126 -98
- package/lib/handler/touch/touch_pitch.js +108 -74
- package/lib/handler/touch/touch_rotate.js +93 -59
- package/lib/handler/touch/touch_zoom.js +71 -49
- package/lib/handler/touch/two_touch.js +129 -90
- package/lib/hash.js +149 -100
- package/lib/index.js +43 -20
- package/lib/interface.js +4 -16
- package/lib/map.js +420 -240
- package/lib/util.js +88 -69
- package/lib/utils/Aabb.js +134 -81
- package/lib/utils/dom.js +162 -88
- package/lib/utils/performance.js +46 -54
- package/lib/utils/primitives.js +53 -59
- package/lib/utils/task_queue.js +104 -61
- package/package.json +3 -3
|
@@ -1,105 +1,144 @@
|
|
|
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/handler/touch/two_touch.ts
|
|
23
|
-
var two_touch_exports = {};
|
|
24
|
-
__export(two_touch_exports, {
|
|
25
|
-
default: () => TwoTouchHandler
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
26
7
|
});
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
var
|
|
30
|
-
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
+
|
|
12
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
|
+
|
|
14
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
15
|
+
|
|
16
|
+
var _dom = _interopRequireDefault(require("../../utils/dom"));
|
|
17
|
+
|
|
18
|
+
// @ts-ignore
|
|
19
|
+
var TwoTouchHandler = /*#__PURE__*/function () {
|
|
20
|
+
function TwoTouchHandler() {
|
|
21
|
+
(0, _classCallCheck2.default)(this, TwoTouchHandler);
|
|
31
22
|
this.reset();
|
|
32
23
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
move(points, pinchAround, e) {
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
touchstart(e, points, mapTouches) {
|
|
44
|
-
if (this.firstTwoTouches || mapTouches.length < 2) {
|
|
45
|
-
return;
|
|
24
|
+
|
|
25
|
+
(0, _createClass2.default)(TwoTouchHandler, [{
|
|
26
|
+
key: "reset",
|
|
27
|
+
value: function reset() {
|
|
28
|
+
this.active = false; //@ts-ignore
|
|
29
|
+
|
|
30
|
+
delete this.firstTwoTouches;
|
|
46
31
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
touchmove(e, points, mapTouches) {
|
|
51
|
-
if (!this.firstTwoTouches) {
|
|
32
|
+
}, {
|
|
33
|
+
key: "start",
|
|
34
|
+
value: function start(points) {
|
|
52
35
|
return;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
if (!a || !b) {
|
|
36
|
+
} // eslint-disable-line
|
|
37
|
+
|
|
38
|
+
}, {
|
|
39
|
+
key: "move",
|
|
40
|
+
value: function move(points, pinchAround, e) {
|
|
59
41
|
return;
|
|
42
|
+
} // eslint-disable-line
|
|
43
|
+
|
|
44
|
+
}, {
|
|
45
|
+
key: "touchstart",
|
|
46
|
+
value: function touchstart(e, points, mapTouches) {
|
|
47
|
+
// console.log(e.target, e.targetTouches.length ? e.targetTouches[0].target : null);
|
|
48
|
+
// log('touchstart', points, e.target.innerHTML, e.targetTouches.length ? e.targetTouches[0].target.innerHTML: undefined);
|
|
49
|
+
if (this.firstTwoTouches || mapTouches.length < 2) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
this.firstTwoTouches = [mapTouches[0].identifier, mapTouches[1].identifier]; // implemented by child classes
|
|
54
|
+
|
|
55
|
+
this.start([points[0], points[1]]);
|
|
60
56
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
57
|
+
}, {
|
|
58
|
+
key: "touchmove",
|
|
59
|
+
value: function touchmove(e, points, mapTouches) {
|
|
60
|
+
if (!this.firstTwoTouches) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
e.preventDefault();
|
|
65
|
+
|
|
66
|
+
var _this$firstTwoTouches = (0, _slicedToArray2.default)(this.firstTwoTouches, 2),
|
|
67
|
+
idA = _this$firstTwoTouches[0],
|
|
68
|
+
idB = _this$firstTwoTouches[1];
|
|
69
|
+
|
|
70
|
+
var a = getTouchById(mapTouches, points, idA);
|
|
71
|
+
var b = getTouchById(mapTouches, points, idB);
|
|
72
|
+
|
|
73
|
+
if (!a || !b) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
var pinchAround = this.aroundCenter ? null : a.add(b).div(2); // implemented by child classes
|
|
78
|
+
|
|
79
|
+
return this.move([a, b], pinchAround, e);
|
|
67
80
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
81
|
+
}, {
|
|
82
|
+
key: "touchend",
|
|
83
|
+
value: function touchend(e, points, mapTouches) {
|
|
84
|
+
if (!this.firstTwoTouches) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
var _this$firstTwoTouches2 = (0, _slicedToArray2.default)(this.firstTwoTouches, 2),
|
|
89
|
+
idA = _this$firstTwoTouches2[0],
|
|
90
|
+
idB = _this$firstTwoTouches2[1];
|
|
91
|
+
|
|
92
|
+
var a = getTouchById(mapTouches, points, idA);
|
|
93
|
+
var b = getTouchById(mapTouches, points, idB);
|
|
94
|
+
|
|
95
|
+
if (a && b) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if (this.active) {
|
|
100
|
+
_dom.default.suppressClick();
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
this.reset();
|
|
73
104
|
}
|
|
74
|
-
|
|
75
|
-
|
|
105
|
+
}, {
|
|
106
|
+
key: "touchcancel",
|
|
107
|
+
value: function touchcancel() {
|
|
108
|
+
this.reset();
|
|
76
109
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
110
|
+
}, {
|
|
111
|
+
key: "enable",
|
|
112
|
+
value: function enable(options) {
|
|
113
|
+
this.enabled = true;
|
|
114
|
+
this.aroundCenter = !!options && options.around === 'center';
|
|
115
|
+
}
|
|
116
|
+
}, {
|
|
117
|
+
key: "disable",
|
|
118
|
+
value: function disable() {
|
|
119
|
+
this.enabled = false;
|
|
120
|
+
this.reset();
|
|
121
|
+
}
|
|
122
|
+
}, {
|
|
123
|
+
key: "isEnabled",
|
|
124
|
+
value: function isEnabled() {
|
|
125
|
+
return this.enabled;
|
|
126
|
+
}
|
|
127
|
+
}, {
|
|
128
|
+
key: "isActive",
|
|
129
|
+
value: function isActive() {
|
|
130
|
+
return this.active;
|
|
131
|
+
}
|
|
132
|
+
}]);
|
|
133
|
+
return TwoTouchHandler;
|
|
134
|
+
}();
|
|
135
|
+
|
|
136
|
+
exports.default = TwoTouchHandler;
|
|
137
|
+
|
|
97
138
|
function getTouchById(mapTouches, points, identifier) {
|
|
98
|
-
for (
|
|
139
|
+
for (var i = 0; i < mapTouches.length; i++) {
|
|
99
140
|
if (mapTouches[i].identifier === identifier) {
|
|
100
141
|
return points[i];
|
|
101
142
|
}
|
|
102
143
|
}
|
|
103
|
-
}
|
|
104
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
105
|
-
0 && (module.exports = {});
|
|
144
|
+
}
|
package/lib/hash.js
CHANGED
|
@@ -1,120 +1,169 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
|
|
19
|
-
// src/hash.ts
|
|
20
|
-
var hash_exports = {};
|
|
21
|
-
__export(hash_exports, {
|
|
22
|
-
default: () => hash_default
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
23
7
|
});
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
var
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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({
|
|
34
43
|
center: [+loc[2], +loc[1]],
|
|
35
44
|
zoom: +loc[0],
|
|
36
|
-
bearing,
|
|
45
|
+
bearing: bearing,
|
|
37
46
|
pitch: +(loc[4] || 0)
|
|
38
47
|
});
|
|
48
|
+
|
|
39
49
|
return true;
|
|
40
50
|
}
|
|
51
|
+
|
|
41
52
|
return false;
|
|
42
|
-
};
|
|
43
|
-
this
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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) {
|
|
49
65
|
keyval = part;
|
|
50
66
|
}
|
|
51
67
|
});
|
|
52
|
-
return (keyval ? keyval[1] ||
|
|
68
|
+
return (keyval ? keyval[1] || '' : '').split('/');
|
|
53
69
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
70
|
+
|
|
71
|
+
return hash.split('/');
|
|
72
|
+
});
|
|
73
|
+
(0, _defineProperty2.default)(this, "updateHashUnthrottled", function () {
|
|
74
|
+
var hash = _this.getHashString();
|
|
75
|
+
|
|
58
76
|
try {
|
|
59
|
-
window.history.replaceState(window.history.state,
|
|
60
|
-
} catch (SecurityError) {
|
|
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
|
|
61
81
|
}
|
|
62
|
-
};
|
|
63
|
-
this.hashName = hashName && encodeURIComponent(hashName);
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
addTo(map) {
|
|
67
|
-
this.map = map;
|
|
68
|
-
import_l7_utils.$window.addEventListener("hashchange", this.onHashChange, false);
|
|
69
|
-
this.map.on("moveend", this.updateHash);
|
|
70
|
-
return this;
|
|
71
|
-
}
|
|
72
|
-
remove() {
|
|
73
|
-
import_l7_utils.$window.removeEventListener("hashchange", this.onHashChange, false);
|
|
74
|
-
this.map.off("moveend", this.updateHash);
|
|
75
|
-
delete this.map;
|
|
76
|
-
return this;
|
|
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);
|
|
77
86
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
if (mapFeedback) {
|
|
89
|
-
hash += `/${lng}/${lat}/${zoom}`;
|
|
90
|
-
} else {
|
|
91
|
-
hash += `${zoom}/${lat}/${lng}`;
|
|
92
|
-
}
|
|
93
|
-
if (bearing || pitch) {
|
|
94
|
-
hash += `/${Math.round(bearing * 10) / 10}`;
|
|
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;
|
|
95
97
|
}
|
|
96
|
-
|
|
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;
|
|
98
108
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
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));
|
|
107
157
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
if (!found) {
|
|
111
|
-
parts.push(`${hashName}=${hash}`);
|
|
158
|
+
|
|
159
|
+
return "#".concat(parts.join('&'));
|
|
112
160
|
}
|
|
113
|
-
|
|
161
|
+
|
|
162
|
+
return "#".concat(hash);
|
|
114
163
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
164
|
+
}]);
|
|
165
|
+
return Hash;
|
|
166
|
+
}();
|
|
167
|
+
|
|
168
|
+
var _default = Hash;
|
|
169
|
+
exports.default = _default;
|
package/lib/index.js
CHANGED
|
@@ -1,21 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __copyProps = (to, from, except, desc) => {
|
|
6
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
-
for (let key of __getOwnPropNames(from))
|
|
8
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
-
}
|
|
11
|
-
return to;
|
|
12
|
-
};
|
|
13
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
"use strict";
|
|
15
2
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _map = require("./map");
|
|
8
|
+
|
|
9
|
+
Object.keys(_map).forEach(function (key) {
|
|
10
|
+
if (key === "default" || key === "__esModule") return;
|
|
11
|
+
if (key in exports && exports[key] === _map[key]) return;
|
|
12
|
+
Object.defineProperty(exports, key, {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _map[key];
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
var _earthmap = require("./earthmap");
|
|
21
|
+
|
|
22
|
+
Object.keys(_earthmap).forEach(function (key) {
|
|
23
|
+
if (key === "default" || key === "__esModule") return;
|
|
24
|
+
if (key in exports && exports[key] === _earthmap[key]) return;
|
|
25
|
+
Object.defineProperty(exports, key, {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function get() {
|
|
28
|
+
return _earthmap[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
|
+
});
|
package/lib/interface.js
CHANGED
|
@@ -1,17 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __copyProps = (to, from, except, desc) => {
|
|
6
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
-
for (let key of __getOwnPropNames(from))
|
|
8
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
-
}
|
|
11
|
-
return to;
|
|
12
|
-
};
|
|
13
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
"use strict";
|
|
14
2
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|