maplibre-gl 3.6.0 → 3.6.1
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/dist/maplibre-gl-csp.js +1 -1
- package/dist/maplibre-gl-csp.js.map +1 -1
- package/dist/maplibre-gl-dev.js +23 -22
- package/dist/maplibre-gl-dev.js.map +1 -1
- package/dist/maplibre-gl.js +2 -2
- package/dist/maplibre-gl.js.map +1 -1
- package/package.json +20 -20
- package/src/ui/camera.test.ts +81 -0
- package/src/ui/camera.ts +3 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "maplibre-gl",
|
|
3
3
|
"description": "BSD licensed community fork of mapbox-gl, a WebGL interactive maps library",
|
|
4
|
-
"version": "3.6.
|
|
4
|
+
"version": "3.6.1",
|
|
5
5
|
"main": "dist/maplibre-gl.js",
|
|
6
6
|
"style": "dist/maplibre-gl.css",
|
|
7
7
|
"license": "BSD-3-Clause",
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
"@mapbox/vector-tile": "^1.3.1",
|
|
22
22
|
"@mapbox/whoots-js": "^3.1.0",
|
|
23
23
|
"@maplibre/maplibre-gl-style-spec": "^19.3.3",
|
|
24
|
-
"@types/geojson": "^7946.0.
|
|
25
|
-
"@types/mapbox__point-geometry": "^0.1.
|
|
24
|
+
"@types/geojson": "^7946.0.13",
|
|
25
|
+
"@types/mapbox__point-geometry": "^0.1.4",
|
|
26
26
|
"@types/mapbox__vector-tile": "^1.3.3",
|
|
27
27
|
"@types/pbf": "^3.0.4",
|
|
28
|
-
"@types/supercluster": "^7.1.
|
|
28
|
+
"@types/supercluster": "^7.1.3",
|
|
29
29
|
"earcut": "^2.2.4",
|
|
30
30
|
"geojson-vt": "^3.2.1",
|
|
31
31
|
"gl-matrix": "^3.4.3",
|
|
@@ -49,30 +49,30 @@
|
|
|
49
49
|
"@rollup/plugin-strip": "^3.0.4",
|
|
50
50
|
"@rollup/plugin-terser": "^0.4.4",
|
|
51
51
|
"@rollup/plugin-typescript": "^11.1.5",
|
|
52
|
-
"@types/benchmark": "^2.1.
|
|
52
|
+
"@types/benchmark": "^2.1.5",
|
|
53
53
|
"@types/cssnano": "^5.0.0",
|
|
54
54
|
"@types/d3": "^7.4.2",
|
|
55
|
-
"@types/diff": "^5.0.
|
|
56
|
-
"@types/earcut": "^2.1.
|
|
57
|
-
"@types/eslint": "^8.44.
|
|
58
|
-
"@types/geojson-vt": "3.2.
|
|
55
|
+
"@types/diff": "^5.0.8",
|
|
56
|
+
"@types/earcut": "^2.1.4",
|
|
57
|
+
"@types/eslint": "^8.44.7",
|
|
58
|
+
"@types/geojson-vt": "3.2.4",
|
|
59
59
|
"@types/gl": "^6.0.4",
|
|
60
60
|
"@types/glob": "^8.1.0",
|
|
61
61
|
"@types/jest": "^29.5.3",
|
|
62
|
-
"@types/jsdom": "^21.1.
|
|
63
|
-
"@types/minimist": "^1.2.
|
|
62
|
+
"@types/jsdom": "^21.1.5",
|
|
63
|
+
"@types/minimist": "^1.2.5",
|
|
64
64
|
"@types/murmurhash-js": "^1.0.5",
|
|
65
|
-
"@types/nise": "^1.4.
|
|
65
|
+
"@types/nise": "^1.4.4",
|
|
66
66
|
"@types/node": "^20.8.3",
|
|
67
|
-
"@types/offscreencanvas": "^2019.7.
|
|
67
|
+
"@types/offscreencanvas": "^2019.7.3",
|
|
68
68
|
"@types/pixelmatch": "^5.2.5",
|
|
69
|
-
"@types/pngjs": "^6.0.
|
|
69
|
+
"@types/pngjs": "^6.0.4",
|
|
70
70
|
"@types/react": "^18.2.35",
|
|
71
71
|
"@types/react-dom": "^18.2.14",
|
|
72
|
-
"@types/request": "^2.48.
|
|
73
|
-
"@types/shuffle-seed": "^1.1.
|
|
74
|
-
"@types/window-or-global": "^1.0.
|
|
75
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
72
|
+
"@types/request": "^2.48.12",
|
|
73
|
+
"@types/shuffle-seed": "^1.1.2",
|
|
74
|
+
"@types/window-or-global": "^1.0.6",
|
|
75
|
+
"@typescript-eslint/eslint-plugin": "^6.10.0",
|
|
76
76
|
"@typescript-eslint/parser": "^6.10.0",
|
|
77
77
|
"address": "^2.0.1",
|
|
78
78
|
"benchmark": "^2.1.4",
|
|
@@ -111,10 +111,10 @@
|
|
|
111
111
|
"postcss-cli": "^10.1.0",
|
|
112
112
|
"postcss-inline-svg": "^6.0.0",
|
|
113
113
|
"pretty-bytes": "^6.1.1",
|
|
114
|
-
"puppeteer": "^21.5.
|
|
114
|
+
"puppeteer": "^21.5.1",
|
|
115
115
|
"react": "^18.2.0",
|
|
116
116
|
"react-dom": "^18.2.0",
|
|
117
|
-
"rollup": "^4.
|
|
117
|
+
"rollup": "^4.4.0",
|
|
118
118
|
"rollup-plugin-sourcemaps": "^0.6.3",
|
|
119
119
|
"rw": "^1.3.3",
|
|
120
120
|
"semver": "^7.5.4",
|
package/src/ui/camera.test.ts
CHANGED
|
@@ -7,6 +7,7 @@ import {setMatchMedia} from '../util/test/util';
|
|
|
7
7
|
import {mercatorZfromAltitude} from '../geo/mercator_coordinate';
|
|
8
8
|
import {Terrain} from '../render/terrain';
|
|
9
9
|
import {LngLat, LngLatLike} from '../geo/lng_lat';
|
|
10
|
+
import {Event} from '../util/evented';
|
|
10
11
|
|
|
11
12
|
beforeEach(() => {
|
|
12
13
|
setMatchMedia();
|
|
@@ -974,6 +975,86 @@ describe('#easeTo', () => {
|
|
|
974
975
|
assertTransitionTime(done, camera, 0, 10);
|
|
975
976
|
camera.easeTo({center: [100, 0], zoom: 3.2, bearing: 90, duration: 1000});
|
|
976
977
|
});
|
|
978
|
+
|
|
979
|
+
test('jumpTo on("move") during easeTo with zoom, pitch, etc', (done) => {
|
|
980
|
+
const camera = createCamera();
|
|
981
|
+
|
|
982
|
+
camera.on('moveend', (e: Event & {done?: true}) => {
|
|
983
|
+
if ('done' in e) {
|
|
984
|
+
setTimeout(() => {
|
|
985
|
+
done();
|
|
986
|
+
}, 50);
|
|
987
|
+
}
|
|
988
|
+
});
|
|
989
|
+
|
|
990
|
+
camera.easeTo({zoom: 20, bearing: 90, pitch: 60, duration: 500}, {done: true});
|
|
991
|
+
camera.once('move', () => {
|
|
992
|
+
camera.jumpTo({pitch: 40});
|
|
993
|
+
});
|
|
994
|
+
|
|
995
|
+
camera.simulateFrame();
|
|
996
|
+
camera.simulateFrame();
|
|
997
|
+
});
|
|
998
|
+
|
|
999
|
+
test('jumpTo on("zoom") during easeTo', (done) => {
|
|
1000
|
+
const camera = createCamera();
|
|
1001
|
+
|
|
1002
|
+
camera.on('moveend', (e: Event & {done?: true}) => {
|
|
1003
|
+
if ('done' in e) {
|
|
1004
|
+
setTimeout(() => {
|
|
1005
|
+
done();
|
|
1006
|
+
}, 50);
|
|
1007
|
+
}
|
|
1008
|
+
});
|
|
1009
|
+
|
|
1010
|
+
camera.easeTo({zoom: 20, duration: 500}, {done: true});
|
|
1011
|
+
camera.once('zoom', () => {
|
|
1012
|
+
camera.jumpTo({pitch: 40});
|
|
1013
|
+
});
|
|
1014
|
+
|
|
1015
|
+
camera.simulateFrame();
|
|
1016
|
+
camera.simulateFrame();
|
|
1017
|
+
});
|
|
1018
|
+
|
|
1019
|
+
test('jumpTo on("pitch") during easeTo', (done) => {
|
|
1020
|
+
const camera = createCamera();
|
|
1021
|
+
|
|
1022
|
+
camera.on('moveend', (e: Event & {done?: true}) => {
|
|
1023
|
+
if ('done' in e) {
|
|
1024
|
+
setTimeout(() => {
|
|
1025
|
+
done();
|
|
1026
|
+
}, 50);
|
|
1027
|
+
}
|
|
1028
|
+
});
|
|
1029
|
+
|
|
1030
|
+
camera.easeTo({pitch: 60, duration: 500}, {done: true});
|
|
1031
|
+
camera.once('pitch', () => {
|
|
1032
|
+
camera.jumpTo({pitch: 40});
|
|
1033
|
+
});
|
|
1034
|
+
|
|
1035
|
+
camera.simulateFrame();
|
|
1036
|
+
camera.simulateFrame();
|
|
1037
|
+
});
|
|
1038
|
+
|
|
1039
|
+
test('jumpTo on("rotate") during easeTo', (done) => {
|
|
1040
|
+
const camera = createCamera();
|
|
1041
|
+
|
|
1042
|
+
camera.on('moveend', (e: Event & {done?: true}) => {
|
|
1043
|
+
if ('done' in e) {
|
|
1044
|
+
setTimeout(() => {
|
|
1045
|
+
done();
|
|
1046
|
+
}, 50);
|
|
1047
|
+
}
|
|
1048
|
+
});
|
|
1049
|
+
|
|
1050
|
+
camera.easeTo({bearing: 90, duration: 500}, {done: true});
|
|
1051
|
+
camera.once('rotate', () => {
|
|
1052
|
+
camera.jumpTo({pitch: 40});
|
|
1053
|
+
});
|
|
1054
|
+
|
|
1055
|
+
camera.simulateFrame();
|
|
1056
|
+
camera.simulateFrame();
|
|
1057
|
+
});
|
|
977
1058
|
});
|
|
978
1059
|
|
|
979
1060
|
describe('#flyTo', () => {
|
package/src/ui/camera.ts
CHANGED
|
@@ -1427,7 +1427,9 @@ export abstract class Camera extends Evented {
|
|
|
1427
1427
|
_renderFrameCallback = () => {
|
|
1428
1428
|
const t = Math.min((browser.now() - this._easeStart) / this._easeOptions.duration, 1);
|
|
1429
1429
|
this._onEaseFrame(this._easeOptions.easing(t));
|
|
1430
|
-
|
|
1430
|
+
|
|
1431
|
+
// if _stop is called during _onEaseFrame from _fireMoveEvents we should avoid a new _requestRenderFrame, checking it by ensuring _easeFrameId was not deleted
|
|
1432
|
+
if (t < 1 && this._easeFrameId) {
|
|
1431
1433
|
this._easeFrameId = this._requestRenderFrame(this._renderFrameCallback);
|
|
1432
1434
|
} else {
|
|
1433
1435
|
this.stop();
|