maplibre-gl 6.0.0 → 6.2.0

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 (181) hide show
  1. package/build/readme.md +0 -2
  2. package/dist/maplibre-gl-dev.mjs +433 -573
  3. package/dist/maplibre-gl-dev.mjs.map +1 -1
  4. package/dist/maplibre-gl-shared-dev.mjs +984 -850
  5. package/dist/maplibre-gl-shared-dev.mjs.map +1 -1
  6. package/dist/maplibre-gl-shared.mjs +2 -2
  7. package/dist/maplibre-gl-shared.mjs.map +1 -1
  8. package/dist/maplibre-gl-worker-dev.mjs +14 -12
  9. package/dist/maplibre-gl-worker-dev.mjs.map +1 -1
  10. package/dist/maplibre-gl-worker.mjs +2 -2
  11. package/dist/maplibre-gl-worker.mjs.map +1 -1
  12. package/dist/maplibre-gl.css +1 -1
  13. package/dist/maplibre-gl.d.ts +119 -42
  14. package/dist/maplibre-gl.mjs +22 -22
  15. package/dist/maplibre-gl.mjs.map +1 -1
  16. package/package.json +20 -22
  17. package/src/css/maplibre-gl.css +4 -0
  18. package/src/data/bucket/circle_bucket.ts +3 -2
  19. package/src/data/bucket/fill_bucket.ts +3 -2
  20. package/src/data/bucket/fill_extrusion_bucket.test.ts +22 -0
  21. package/src/data/bucket/fill_extrusion_bucket.ts +17 -4
  22. package/src/data/bucket/line_bucket.test.ts +5 -5
  23. package/src/data/bucket/line_bucket.ts +3 -2
  24. package/src/data/bucket/round_polygon_corners.test.ts +159 -0
  25. package/src/data/bucket/round_polygon_corners.ts +121 -0
  26. package/src/data/bucket/symbol_bucket.test.ts +7 -7
  27. package/src/data/dem_data.test.ts +23 -23
  28. package/src/data/feature_position_map.test.ts +1 -1
  29. package/src/data/segment.test.ts +14 -14
  30. package/src/geo/bounds.test.ts +4 -4
  31. package/src/geo/lng_lat_bounds.test.ts +1 -1
  32. package/src/geo/projection/covering_tiles.bench.ts +39 -0
  33. package/src/geo/projection/covering_tiles.test.ts +3 -7
  34. package/src/geo/projection/covering_tiles.ts +37 -2
  35. package/src/geo/projection/globe_covering_tiles_details_provider.ts +4 -4
  36. package/src/geo/projection/globe_projection.test.ts +2 -2
  37. package/src/geo/projection/globe_projection.ts +6 -15
  38. package/src/geo/projection/globe_transform.test.ts +3 -6
  39. package/src/geo/projection/globe_transform.ts +4 -7
  40. package/src/geo/projection/mercator_covering_tiles_details_provider.ts +4 -4
  41. package/src/geo/projection/mercator_projection.ts +1 -13
  42. package/src/geo/projection/mercator_transform.test.ts +1 -1
  43. package/src/geo/projection/mercator_transform.ts +2 -1
  44. package/src/geo/projection/mercator_utils.test.ts +8 -8
  45. package/src/geo/projection/projection.ts +0 -27
  46. package/src/geo/projection/projection_data.ts +8 -0
  47. package/src/geo/projection/projection_factory.ts +3 -3
  48. package/src/geo/projection/vertical_perspective_projection.ts +3 -60
  49. package/src/geo/projection/vertical_perspective_transform.ts +16 -23
  50. package/src/geo/transform_interface.ts +1 -2
  51. package/src/index.test.ts +7 -12
  52. package/src/index.ts +4 -2
  53. package/src/render/glyph_manager.test.ts +7 -22
  54. package/src/render/painter.test.ts +2 -0
  55. package/src/render/painter.ts +8 -11
  56. package/src/render/subdivision.bench.ts +39 -0
  57. package/src/render/subdivision.test.ts +22 -23
  58. package/src/render/subdivision.ts +46 -0
  59. package/src/render/terrain.test.ts +68 -34
  60. package/src/render/terrain.ts +69 -26
  61. package/src/shaders/glsl/_projection_globe.fragment.glsl +12 -0
  62. package/src/shaders/glsl/_projection_globe.fragment.glsl.g.ts +2 -0
  63. package/src/shaders/glsl/_projection_globe.vertex.glsl +29 -10
  64. package/src/shaders/glsl/_projection_globe.vertex.glsl.g.ts +1 -1
  65. package/src/shaders/glsl/_projection_mercator.fragment.glsl +4 -0
  66. package/src/shaders/glsl/_projection_mercator.fragment.glsl.g.ts +2 -0
  67. package/src/shaders/glsl/line.fragment.glsl +2 -0
  68. package/src/shaders/glsl/line.fragment.glsl.g.ts +1 -1
  69. package/src/shaders/glsl/line_gradient.fragment.glsl +2 -0
  70. package/src/shaders/glsl/line_gradient.fragment.glsl.g.ts +1 -1
  71. package/src/shaders/glsl/line_gradient_sdf.fragment.glsl +2 -0
  72. package/src/shaders/glsl/line_gradient_sdf.fragment.glsl.g.ts +1 -1
  73. package/src/shaders/glsl/line_pattern.fragment.glsl +2 -0
  74. package/src/shaders/glsl/line_pattern.fragment.glsl.g.ts +1 -1
  75. package/src/shaders/glsl/line_sdf.fragment.glsl +2 -0
  76. package/src/shaders/glsl/line_sdf.fragment.glsl.g.ts +1 -1
  77. package/src/shaders/shaders.ts +4 -6
  78. package/src/source/canvas_source.test.ts +1 -1
  79. package/src/source/geojson_source.test.ts +32 -4
  80. package/src/source/geojson_source.ts +41 -0
  81. package/src/source/geojson_source_diff.test.ts +2 -2
  82. package/src/source/geojson_worker_source.test.ts +9 -5
  83. package/src/source/image_source.test.ts +137 -62
  84. package/src/source/image_source.ts +49 -12
  85. package/src/source/raster_dem_tile_source.test.ts +2 -2
  86. package/src/source/raster_tile_source.test.ts +64 -9
  87. package/src/source/raster_tile_source.ts +2 -1
  88. package/src/source/rtl_text_plugin_main_thread.test.ts +14 -14
  89. package/src/source/source.test.ts +8 -8
  90. package/src/source/vector_tile_source.test.ts +1 -1
  91. package/src/source/vector_tile_worker_source.test.ts +7 -5
  92. package/src/source/video_source.test.ts +1 -1
  93. package/src/source/worker.test.ts +1 -1
  94. package/src/source/worker_tile.test.ts +10 -8
  95. package/src/style/light.test.ts +9 -9
  96. package/src/style/light.ts +3 -3
  97. package/src/style/load_glyph_range.test.ts +8 -8
  98. package/src/style/load_sprite.test.ts +1 -1
  99. package/src/style/properties.test.ts +94 -2
  100. package/src/style/properties.ts +30 -1
  101. package/src/style/sky.test.ts +9 -9
  102. package/src/style/sky.ts +2 -2
  103. package/src/style/style.test.ts +38 -36
  104. package/src/style/style.ts +3 -3
  105. package/src/style/style_layer/color_relief_style_layer.test.ts +1 -1
  106. package/src/style/style_layer/fill_extrusion_style_layer.ts +6 -3
  107. package/src/style/style_layer/fill_extrusion_style_layer_properties.g.ts +14 -1
  108. package/src/style/style_layer/raster_style_layer.test.ts +2 -2
  109. package/src/style/style_layer.test.ts +5 -51
  110. package/src/style/validate_style.test.ts +1 -1
  111. package/src/symbol/collision_index.test.ts +1 -1
  112. package/src/symbol/grid_index.test.ts +1 -1
  113. package/src/tile/terrain_tile_manager.test.ts +2 -2
  114. package/src/tile/tile_id.test.ts +5 -5
  115. package/src/tile/tile_manager.test.ts +113 -72
  116. package/src/tile/tile_manager.ts +2 -2
  117. package/src/tile/tile_manager_in_view_tiles.test.ts +2 -2
  118. package/src/ui/camera.test.ts +138 -135
  119. package/src/ui/control/geolocate_control.test.ts +7 -30
  120. package/src/ui/handler/dblclick_zoom.test.ts +2 -2
  121. package/src/ui/handler/mouse.ts +15 -7
  122. package/src/ui/handler/mouse_handler_interface.test.ts +21 -1
  123. package/src/ui/handler/scroll_zoom.test.ts +2 -0
  124. package/src/ui/handler_manager.test.ts +7 -7
  125. package/src/ui/hash.test.ts +1 -0
  126. package/src/ui/map.ts +45 -20
  127. package/src/ui/map_tests/map_basic.test.ts +11 -23
  128. package/src/ui/map_tests/map_calculate_camera_options.test.ts +6 -6
  129. package/src/ui/map_tests/map_events.test.ts +5 -7
  130. package/src/ui/map_tests/map_global_state.test.ts +3 -3
  131. package/src/ui/map_tests/map_images.test.ts +4 -3
  132. package/src/ui/map_tests/map_is_moving.test.ts +1 -1
  133. package/src/ui/map_tests/map_is_rotating.test.ts +1 -1
  134. package/src/ui/map_tests/map_layer.test.ts +2 -1
  135. package/src/ui/map_tests/map_options.test.ts +1 -5
  136. package/src/ui/map_tests/map_pitch.test.ts +6 -6
  137. package/src/ui/map_tests/map_refresh_tiles.test.ts +2 -2
  138. package/src/ui/map_tests/map_render.test.ts +1 -1
  139. package/src/ui/map_tests/map_set_lod_params.test.ts +1 -1
  140. package/src/ui/map_tests/map_style.test.ts +9 -1
  141. package/src/ui/map_tests/map_terrain.test.ts +41 -1
  142. package/src/ui/map_tests/map_zoom.test.ts +15 -15
  143. package/src/ui/marker.test.ts +71 -14
  144. package/src/ui/marker.ts +30 -6
  145. package/src/ui/popup.test.ts +3 -3
  146. package/src/util/actor.test.ts +6 -6
  147. package/src/util/ajax.test.ts +27 -39
  148. package/src/util/browser.test.ts +7 -9
  149. package/src/util/create_tile_mesh.test.ts +2 -2
  150. package/src/util/dispatcher.test.ts +1 -1
  151. package/src/util/evented.test.ts +4 -1
  152. package/src/util/fast_maths.test.ts +4 -4
  153. package/src/util/image_request.test.ts +6 -4
  154. package/src/util/primitives/bounding_volume_cache.ts +3 -1
  155. package/src/util/struct_array.test.ts +2 -2
  156. package/src/util/task_queue.test.ts +1 -1
  157. package/src/util/test/util.ts +1 -0
  158. package/src/util/time_control.test.ts +2 -2
  159. package/src/util/transferable_grid_index.test.ts +1 -1
  160. package/src/util/util.test.ts +27 -13
  161. package/src/util/verticalize_punctuation.test.ts +4 -4
  162. package/src/util/web_worker_transfer.test.ts +5 -5
  163. package/src/webgl/draw/draw_custom.test.ts +13 -13
  164. package/src/webgl/draw/draw_debug.test.ts +1 -1
  165. package/src/webgl/draw/draw_fill.test.ts +13 -12
  166. package/src/webgl/draw/draw_symbol.test.ts +17 -16
  167. package/src/webgl/program/program_uniforms.ts +0 -3
  168. package/src/webgl/program/projection_program.ts +12 -10
  169. package/src/webgl/program/terrain_program.test.ts +2 -2
  170. package/src/webgl/program.ts +6 -4
  171. package/src/webgl/render_to_texture.test.ts +5 -5
  172. package/src/webgl/state.test.ts +1 -1
  173. package/src/webgl/texture.test.ts +3 -3
  174. package/src/webgl/vertex_buffer.test.ts +1 -1
  175. package/build/rolldown_plugins.ts +0 -18
  176. package/src/geo/projection/globe_projection_error_measurement.ts +0 -229
  177. package/src/shaders/glsl/projection_error_measurement.fragment.glsl +0 -5
  178. package/src/shaders/glsl/projection_error_measurement.fragment.glsl.g.ts +0 -2
  179. package/src/shaders/glsl/projection_error_measurement.vertex.glsl +0 -22
  180. package/src/shaders/glsl/projection_error_measurement.vertex.glsl.g.ts +0 -2
  181. package/src/webgl/program/projection_error_measurement_program.ts +0 -23
@@ -42,7 +42,7 @@ function createCamera(options?: Partial<CameraInitOptions>, globe?: boolean, jum
42
42
  camera.transform.resize(512, 512, true);
43
43
 
44
44
  if (globe) {
45
- const projectionObjects = createProjectionFromName('globe', options.transformConstrain);
45
+ const projectionObjects = createProjectionFromName('globe', options.transformConstrain, {});
46
46
  camera.migrateProjection(projectionObjects.transform, projectionObjects.cameraHelper);
47
47
  }
48
48
 
@@ -126,7 +126,7 @@ describe('calculateCameraOptionsFromTo', () => {
126
126
  });
127
127
 
128
128
  test('same To as From error', () => {
129
- expect(() => camera.calculateCameraOptionsFromTo({lng: 0, lat: 0}, 0, {lng: 0, lat: 0}, 0)).toThrow();
129
+ expect(() => camera.calculateCameraOptionsFromTo({lng: 0, lat: 0}, 0, {lng: 0, lat: 0}, 0)).toThrow('Can\'t calculate camera options with same From and To');
130
130
  });
131
131
  });
132
132
 
@@ -1046,14 +1046,14 @@ describe('easeTo', () => {
1046
1046
  const {camera, queue} = createCamera();
1047
1047
  const stub = vi.spyOn(timeControl, 'now');
1048
1048
 
1049
- stub.mockImplementation(() => 0);
1049
+ stub.mockReturnValue(0);
1050
1050
  camera.easeTo({center: [100, 0], duration: 10});
1051
1051
 
1052
1052
  let promise = camera.once('moveend');
1053
1053
 
1054
1054
  // setTimeout to avoid a synchronous callback
1055
1055
  setTimeout(() => {
1056
- stub.mockImplementation(() => 10);
1056
+ stub.mockReturnValue(10);
1057
1057
  queue.run();
1058
1058
  }, 0);
1059
1059
 
@@ -1063,7 +1063,7 @@ describe('easeTo', () => {
1063
1063
 
1064
1064
  // setTimeout to avoid a synchronous callback
1065
1065
  setTimeout(() => {
1066
- stub.mockImplementation(() => 20);
1066
+ stub.mockReturnValue(20);
1067
1067
  queue.run();
1068
1068
  }, 0);
1069
1069
 
@@ -1072,11 +1072,12 @@ describe('easeTo', () => {
1072
1072
  promise = camera.once('moveend');
1073
1073
 
1074
1074
  setTimeout(() => {
1075
- stub.mockImplementation(() => 30);
1075
+ stub.mockReturnValue(30);
1076
1076
  queue.run();
1077
1077
  }, 0);
1078
1078
 
1079
1079
  await promise;
1080
+ expect(camera.getCenter().lng).toBeCloseTo(-60);
1080
1081
  });
1081
1082
 
1082
1083
  test('pans eastward across the antimeridian', async () => {
@@ -1094,15 +1095,15 @@ describe('easeTo', () => {
1094
1095
 
1095
1096
  const promise = camera.once('moveend');
1096
1097
 
1097
- stub.mockImplementation(() => 0);
1098
+ stub.mockReturnValue(0);
1098
1099
  camera.easeTo({center: [-170, 0], duration: 10});
1099
1100
 
1100
1101
  setTimeout(() => {
1101
- stub.mockImplementation(() => 1);
1102
+ stub.mockReturnValue(1);
1102
1103
  queue.run();
1103
1104
 
1104
1105
  setTimeout(() => {
1105
- stub.mockImplementation(() => 10);
1106
+ stub.mockReturnValue(10);
1106
1107
  queue.run();
1107
1108
  }, 0);
1108
1109
  }, 0);
@@ -1137,15 +1138,15 @@ describe('easeTo', () => {
1137
1138
 
1138
1139
  const promise = camera.once('moveend');
1139
1140
 
1140
- stub.mockImplementation(() => 0);
1141
+ stub.mockReturnValue(0);
1141
1142
  camera.easeTo({center: [170, 0], duration: 10});
1142
1143
 
1143
1144
  setTimeout(() => {
1144
- stub.mockImplementation(() => 1);
1145
+ stub.mockReturnValue(1);
1145
1146
  queue.run();
1146
1147
 
1147
1148
  setTimeout(() => {
1148
- stub.mockImplementation(() => 10);
1149
+ stub.mockReturnValue(10);
1149
1150
  queue.run();
1150
1151
  }, 0);
1151
1152
  }, 0);
@@ -1180,13 +1181,13 @@ describe('easeTo', () => {
1180
1181
  const promise = camera.once('moveend');
1181
1182
 
1182
1183
  setTimeout(() => {
1183
- stubNow.mockImplementation(() => 0);
1184
+ stubNow.mockReturnValue(0);
1184
1185
  queue.run();
1185
1186
 
1186
1187
  camera.easeTo({center: [100, 0], zoom: 3.2, bearing: 90, duration: 200, essential: true});
1187
1188
 
1188
1189
  setTimeout(() => {
1189
- stubNow.mockImplementation(() => 200);
1190
+ stubNow.mockReturnValue(200);
1190
1191
  queue.run();
1191
1192
  }, 0);
1192
1193
  }, 0);
@@ -1286,11 +1287,11 @@ describe('easeTo', () => {
1286
1287
  const {camera, queue} = createCamera({terrain});
1287
1288
  const stubNow = vi.spyOn(timeControl, 'now');
1288
1289
 
1289
- stubNow.mockImplementation(() => 0);
1290
+ stubNow.mockReturnValue(0);
1290
1291
 
1291
1292
  camera.easeTo({bearing: 97, duration: 500});
1292
1293
 
1293
- stubNow.mockImplementation(() => 100);
1294
+ stubNow.mockReturnValue(100);
1294
1295
  queue.run();
1295
1296
 
1296
1297
  terrain = {
@@ -1298,10 +1299,10 @@ describe('easeTo', () => {
1298
1299
  getElevationForLngLatZoom: () => 0
1299
1300
  } as any as Terrain;
1300
1301
 
1301
- stubNow.mockImplementation(() => 500);
1302
+ stubNow.mockReturnValue(500);
1302
1303
  queue.run();
1303
1304
 
1304
- expect(camera.getBearing()).toEqual(97);
1305
+ expect(camera.getBearing()).toBe(97);
1305
1306
  });
1306
1307
 
1307
1308
  test('respects zoomSnap', () => {
@@ -1361,10 +1362,10 @@ describe('flyTo', () => {
1361
1362
 
1362
1363
  const promise = camera.once('moveend');
1363
1364
 
1364
- stub.mockImplementation(() => 0);
1365
+ stub.mockReturnValue(0);
1365
1366
  camera.flyTo({zoom: 19, center: pos, duration: 2});
1366
1367
 
1367
- stub.mockImplementation(() => 3);
1368
+ stub.mockReturnValue(3);
1368
1369
  queue.run();
1369
1370
 
1370
1371
  await promise;
@@ -1552,16 +1553,16 @@ describe('flyTo', () => {
1552
1553
  const promise = camera.once('moveend');
1553
1554
 
1554
1555
  const stub = vi.spyOn(timeControl, 'now');
1555
- stub.mockImplementation(() => 0);
1556
+ stub.mockReturnValue(0);
1556
1557
 
1557
1558
  camera.flyTo({center: [100, 0], duration: 10}, eventData);
1558
1559
 
1559
1560
  setTimeout(() => {
1560
- stub.mockImplementation(() => 1);
1561
+ stub.mockReturnValue(1);
1561
1562
  queue.run();
1562
1563
 
1563
1564
  setTimeout(() => {
1564
- stub.mockImplementation(() => 10);
1565
+ stub.mockReturnValue(10);
1565
1566
  queue.run();
1566
1567
  }, 0);
1567
1568
  }, 0);
@@ -1595,9 +1596,9 @@ describe('flyTo', () => {
1595
1596
  const stub = vi.spyOn(timeControl, 'now');
1596
1597
 
1597
1598
  const {camera, queue} = createCamera();
1598
- stub.mockImplementation(() => 0);
1599
+ stub.mockReturnValue(0);
1599
1600
  camera.easeTo({pitch: 10, bearing: 100, duration: 1000});
1600
- stub.mockImplementation(() => 100);
1601
+ stub.mockReturnValue(100);
1601
1602
  queue.run();
1602
1603
  camera.easeTo({elevation: 1, duration: 0});
1603
1604
  expect(camera.getRoll()).toBe(0);
@@ -1607,9 +1608,9 @@ describe('flyTo', () => {
1607
1608
  const stub = vi.spyOn(timeControl, 'now');
1608
1609
 
1609
1610
  const {camera, queue} = createCamera(null, true);
1610
- stub.mockImplementation(() => 0);
1611
+ stub.mockReturnValue(0);
1611
1612
  camera.easeTo({pitch: 10, bearing: 100, duration: 1000});
1612
- stub.mockImplementation(() => 100);
1613
+ stub.mockReturnValue(100);
1613
1614
  queue.run();
1614
1615
  camera.easeTo({elevation: 1, duration: 0});
1615
1616
  expect(camera.getRoll()).toBe(0);
@@ -1619,9 +1620,9 @@ describe('flyTo', () => {
1619
1620
  const stub = vi.spyOn(timeControl, 'now');
1620
1621
 
1621
1622
  const {camera, queue} = createCamera();
1622
- stub.mockImplementation(() => 0);
1623
+ stub.mockReturnValue(0);
1623
1624
  camera.easeTo({pitch: 10, bearing: 20, roll: 30, duration: 1000});
1624
- stub.mockImplementation(() => 500);
1625
+ stub.mockReturnValue(500);
1625
1626
  queue.run();
1626
1627
  camera.easeTo({elevation: 1, duration: 0});
1627
1628
  expect(camera.getRoll()).toBeCloseTo(25.041890412598942);
@@ -1633,9 +1634,9 @@ describe('flyTo', () => {
1633
1634
  const stub = vi.spyOn(timeControl, 'now');
1634
1635
 
1635
1636
  const {camera, queue} = createCamera(null, true);
1636
- stub.mockImplementation(() => 0);
1637
+ stub.mockReturnValue(0);
1637
1638
  camera.easeTo({pitch: 10, bearing: 20, roll: 30, duration: 1000});
1638
- stub.mockImplementation(() => 500);
1639
+ stub.mockReturnValue(500);
1639
1640
  queue.run();
1640
1641
  camera.easeTo({elevation: 1, duration: 0});
1641
1642
  expect(camera.getRoll()).toBeCloseTo(25.041890412598942);
@@ -1646,21 +1647,21 @@ describe('flyTo', () => {
1646
1647
  test('can be called from within a moveend event handler', async () => {
1647
1648
  const {camera, queue} = createCamera();
1648
1649
  const stub = vi.spyOn(timeControl, 'now');
1649
- stub.mockImplementation(() => 0);
1650
+ stub.mockReturnValue(0);
1650
1651
 
1651
1652
  camera.flyTo({center: [100, 0], duration: 10});
1652
1653
  let promise = camera.once('moveend');
1653
1654
 
1654
1655
  setTimeout(() => {
1655
- stub.mockImplementation(() => 10);
1656
+ stub.mockReturnValue(10);
1656
1657
  queue.run();
1657
1658
 
1658
1659
  setTimeout(() => {
1659
- stub.mockImplementation(() => 20);
1660
+ stub.mockReturnValue(20);
1660
1661
  queue.run();
1661
1662
 
1662
1663
  setTimeout(() => {
1663
- stub.mockImplementation(() => 30);
1664
+ stub.mockReturnValue(30);
1664
1665
  queue.run();
1665
1666
  }, 0);
1666
1667
  }, 0);
@@ -1671,6 +1672,8 @@ describe('flyTo', () => {
1671
1672
  await promise;
1672
1673
  camera.flyTo({center: [300, 0], duration: 10});
1673
1674
  await camera.once('moveend');
1675
+
1676
+ expect(camera.getCenter().lng).toBeCloseTo(-60);
1674
1677
  });
1675
1678
 
1676
1679
  test('ascends', async () => {
@@ -1687,16 +1690,16 @@ describe('flyTo', () => {
1687
1690
  const promise = camera.once('moveend');
1688
1691
 
1689
1692
  const stub = vi.spyOn(timeControl, 'now');
1690
- stub.mockImplementation(() => 0);
1693
+ stub.mockReturnValue(0);
1691
1694
 
1692
1695
  camera.flyTo({center: [100, 0], zoom: 18, duration: 10});
1693
1696
 
1694
1697
  setTimeout(() => {
1695
- stub.mockImplementation(() => 1);
1698
+ stub.mockReturnValue(1);
1696
1699
  queue.run();
1697
1700
 
1698
1701
  setTimeout(() => {
1699
- stub.mockImplementation(() => 10);
1702
+ stub.mockReturnValue(10);
1700
1703
  queue.run();
1701
1704
  }, 0);
1702
1705
  }, 0);
@@ -1719,15 +1722,15 @@ describe('flyTo', () => {
1719
1722
 
1720
1723
  const promise = camera.once('moveend');
1721
1724
 
1722
- stub.mockImplementation(() => 0);
1725
+ stub.mockReturnValue(0);
1723
1726
  camera.flyTo({center: [10, 0], duration: 20});
1724
1727
 
1725
1728
  setTimeout(() => {
1726
- stub.mockImplementation(() => 1);
1729
+ stub.mockReturnValue(1);
1727
1730
  queue.run();
1728
1731
 
1729
1732
  setTimeout(() => {
1730
- stub.mockImplementation(() => 20);
1733
+ stub.mockReturnValue(20);
1731
1734
  queue.run();
1732
1735
  }, 0);
1733
1736
  }, 0);
@@ -1751,15 +1754,15 @@ describe('flyTo', () => {
1751
1754
 
1752
1755
  const promise = camera.once('moveend');
1753
1756
 
1754
- stub.mockImplementation(() => 0);
1757
+ stub.mockReturnValue(0);
1755
1758
  camera.flyTo({center: [-10, 0], duration: 20});
1756
1759
 
1757
1760
  setTimeout(() => {
1758
- stub.mockImplementation(() => 1);
1761
+ stub.mockReturnValue(1);
1759
1762
  queue.run();
1760
1763
 
1761
1764
  setTimeout(() => {
1762
- stub.mockImplementation(() => 20);
1765
+ stub.mockReturnValue(20);
1763
1766
  queue.run();
1764
1767
  }, 0);
1765
1768
  }, 0);
@@ -1783,15 +1786,15 @@ describe('flyTo', () => {
1783
1786
 
1784
1787
  const promise = camera.once('moveend');
1785
1788
 
1786
- stub.mockImplementation(() => 0);
1789
+ stub.mockReturnValue(0);
1787
1790
  camera.flyTo({center: [-170, 0], duration: 20});
1788
1791
 
1789
1792
  setTimeout(() => {
1790
- stub.mockImplementation(() => 1);
1793
+ stub.mockReturnValue(1);
1791
1794
  queue.run();
1792
1795
 
1793
1796
  setTimeout(() => {
1794
- stub.mockImplementation(() => 20);
1797
+ stub.mockReturnValue(20);
1795
1798
  queue.run();
1796
1799
  }, 0);
1797
1800
  }, 0);
@@ -1814,15 +1817,15 @@ describe('flyTo', () => {
1814
1817
 
1815
1818
  const promise = camera.once('moveend');
1816
1819
 
1817
- stub.mockImplementation(() => 0);
1820
+ stub.mockReturnValue(0);
1818
1821
  camera.flyTo({center: [170, 0], duration: 10});
1819
1822
 
1820
1823
  setTimeout(() => {
1821
- stub.mockImplementation(() => 1);
1824
+ stub.mockReturnValue(1);
1822
1825
  queue.run();
1823
1826
 
1824
1827
  setTimeout(() => {
1825
- stub.mockImplementation(() => 10);
1828
+ stub.mockReturnValue(10);
1826
1829
  queue.run();
1827
1830
  }, 0);
1828
1831
  }, 0);
@@ -1845,15 +1848,15 @@ describe('flyTo', () => {
1845
1848
 
1846
1849
  const promise = camera.once('moveend');
1847
1850
 
1848
- stub.mockImplementation(() => 0);
1851
+ stub.mockReturnValue(0);
1849
1852
  camera.flyTo({center: [-170, 0], duration: 10});
1850
1853
 
1851
1854
  setTimeout(() => {
1852
- stub.mockImplementation(() => 1);
1855
+ stub.mockReturnValue(1);
1853
1856
  queue.run();
1854
1857
 
1855
1858
  setTimeout(() => {
1856
- stub.mockImplementation(() => 10);
1859
+ stub.mockReturnValue(10);
1857
1860
  queue.run();
1858
1861
  }, 0);
1859
1862
  }, 0);
@@ -1877,15 +1880,15 @@ describe('flyTo', () => {
1877
1880
 
1878
1881
  const promise = camera.once('moveend');
1879
1882
 
1880
- stub.mockImplementation(() => 0);
1883
+ stub.mockReturnValue(0);
1881
1884
  camera.flyTo({center: [170, 0], duration: 10});
1882
1885
 
1883
1886
  setTimeout(() => {
1884
- stub.mockImplementation(() => 1);
1887
+ stub.mockReturnValue(1);
1885
1888
  queue.run();
1886
1889
 
1887
1890
  setTimeout(() => {
1888
- stub.mockImplementation(() => 10);
1891
+ stub.mockReturnValue(10);
1889
1892
  queue.run();
1890
1893
  }, 0);
1891
1894
  }, 0);
@@ -1908,15 +1911,15 @@ describe('flyTo', () => {
1908
1911
 
1909
1912
  const promise = camera.once('moveend');
1910
1913
 
1911
- stub.mockImplementation(() => 0);
1914
+ stub.mockReturnValue(0);
1912
1915
  camera.flyTo({center: [170, 0], duration: 10});
1913
1916
 
1914
1917
  setTimeout(() => {
1915
- stub.mockImplementation(() => 1);
1918
+ stub.mockReturnValue(1);
1916
1919
  queue.run();
1917
1920
 
1918
1921
  setTimeout(() => {
1919
- stub.mockImplementation(() => 10);
1922
+ stub.mockReturnValue(10);
1920
1923
  queue.run();
1921
1924
  }, 0);
1922
1925
  }, 0);
@@ -1937,7 +1940,7 @@ describe('flyTo', () => {
1937
1940
  const promise = camera.once('moveend');
1938
1941
 
1939
1942
  const duration = 10;
1940
- stub.mockImplementation(() => 0);
1943
+ stub.mockReturnValue(0);
1941
1944
  camera.flyTo({center: [1, 0], zoom: 20, minZoom, duration});
1942
1945
 
1943
1946
  await simulateAllAnimationFrames(stub, camera, queue, duration);
@@ -1960,7 +1963,7 @@ describe('flyTo', () => {
1960
1963
  const promise = camera.once('moveend');
1961
1964
 
1962
1965
  const duration = 10;
1963
- stub.mockImplementation(() => 0);
1966
+ stub.mockReturnValue(0);
1964
1967
  camera.flyTo({center: [1, 0], zoom: 20, duration});
1965
1968
 
1966
1969
  await simulateAllAnimationFrames(stub, camera, queue, duration);
@@ -1977,11 +1980,11 @@ describe('flyTo', () => {
1977
1980
  const promise = camera.once('moveend');
1978
1981
 
1979
1982
  const stub = vi.spyOn(timeControl, 'now');
1980
- stub.mockImplementation(() => 0);
1983
+ stub.mockReturnValue(0);
1981
1984
  camera.flyTo({center: [12, 34], zoom: 30, duration: 10});
1982
1985
 
1983
1986
  setTimeout(() => {
1984
- stub.mockImplementation(() => 10);
1987
+ stub.mockReturnValue(10);
1985
1988
  queue.run();
1986
1989
  }, 0);
1987
1990
 
@@ -1999,11 +2002,11 @@ describe('flyTo', () => {
1999
2002
  const promise = camera.once('moveend');
2000
2003
 
2001
2004
  const stub = vi.spyOn(timeControl, 'now');
2002
- stub.mockImplementation(() => 0);
2005
+ stub.mockReturnValue(0);
2003
2006
  camera.flyTo({center: [12, 34], zoom: 1, duration: 10});
2004
2007
 
2005
2008
  setTimeout(() => {
2006
- stub.mockImplementation(() => 10);
2009
+ stub.mockReturnValue(10);
2007
2010
  queue.run();
2008
2011
  }, 0);
2009
2012
 
@@ -2026,15 +2029,15 @@ describe('flyTo', () => {
2026
2029
 
2027
2030
  const promise = camera.once('moveend');
2028
2031
  const stub = vi.spyOn(timeControl, 'now');
2029
- stub.mockImplementation(() => 0);
2032
+ stub.mockReturnValue(0);
2030
2033
  camera.flyTo({center: [40, 0], zoom: 10, duration: 10});
2031
2034
 
2032
2035
  await new Promise(resolve => setTimeout(resolve, 0));
2033
- stub.mockImplementation(() => 5);
2036
+ stub.mockReturnValue(5);
2034
2037
  queue.run();
2035
2038
 
2036
2039
  await new Promise(resolve => setTimeout(resolve, 0));
2037
- stub.mockImplementation(() => 10);
2040
+ stub.mockReturnValue(10);
2038
2041
  queue.run();
2039
2042
 
2040
2043
  await promise;
@@ -2097,11 +2100,11 @@ describe('flyTo', () => {
2097
2100
  camera.setCenter([-10, 0]);
2098
2101
  const moveEnded = camera.once('moveend');
2099
2102
 
2100
- stub.mockImplementation(() => 0);
2103
+ stub.mockReturnValue(0);
2101
2104
  camera.flyTo({center: [10, 0], duration: 20, freezeElevation: false});
2102
- stub.mockImplementation(() => 1);
2105
+ stub.mockReturnValue(1);
2103
2106
  queue.run();
2104
- stub.mockImplementation(() => 20);
2107
+ stub.mockReturnValue(20);
2105
2108
  queue.run();
2106
2109
  await moveEnded;
2107
2110
  expect(terrainCallbacks.prepare).toBe(1);
@@ -2121,11 +2124,11 @@ describe('flyTo', () => {
2121
2124
  camera.setCenter([-10, 0]);
2122
2125
  const moveEnded = camera.once('moveend');
2123
2126
 
2124
- stub.mockImplementation(() => 0);
2127
+ stub.mockReturnValue(0);
2125
2128
  camera.flyTo({center: [10, 0], duration: 20, freezeElevation: true});
2126
- stub.mockImplementation(() => 1);
2129
+ stub.mockReturnValue(1);
2127
2130
  queue.run();
2128
- stub.mockImplementation(() => 20);
2131
+ stub.mockReturnValue(20);
2129
2132
  queue.run();
2130
2133
  await moveEnded;
2131
2134
  expect(terrainCallbacks.prepare).toBe(1);
@@ -2191,10 +2194,10 @@ describe('isEasing', () => {
2191
2194
  const {camera, queue} = createCamera();
2192
2195
  const promise = camera.once('moveend');
2193
2196
  const stub = vi.spyOn(timeControl, 'now');
2194
- stub.mockImplementation(() => 0);
2197
+ stub.mockReturnValue(0);
2195
2198
  camera.panTo([100, 0], {duration: 1});
2196
2199
  setTimeout(() => {
2197
- stub.mockImplementation(() => 1);
2200
+ stub.mockReturnValue(1);
2198
2201
  queue.run();
2199
2202
  }, 0);
2200
2203
 
@@ -2213,10 +2216,10 @@ describe('isEasing', () => {
2213
2216
  const {camera, queue} = createCamera();
2214
2217
  const promise = camera.once('moveend');
2215
2218
  const stub = vi.spyOn(timeControl, 'now');
2216
- stub.mockImplementation(() => 0);
2219
+ stub.mockReturnValue(0);
2217
2220
  camera.zoomTo(3.2, {duration: 1});
2218
2221
  setTimeout(() => {
2219
- stub.mockImplementation(() => 1);
2222
+ stub.mockReturnValue(1);
2220
2223
  queue.run();
2221
2224
  }, 0);
2222
2225
 
@@ -2234,10 +2237,10 @@ describe('isEasing', () => {
2234
2237
  const {camera, queue} = createCamera();
2235
2238
  const promise = camera.once('moveend');
2236
2239
  const stub = vi.spyOn(timeControl, 'now');
2237
- stub.mockImplementation(() => 0);
2240
+ stub.mockReturnValue(0);
2238
2241
  camera.rotateTo(90, {duration: 1});
2239
2242
  setTimeout(() => {
2240
- stub.mockImplementation(() => 1);
2243
+ stub.mockReturnValue(1);
2241
2244
  queue.run();
2242
2245
  }, 0);
2243
2246
 
@@ -2309,11 +2312,11 @@ describe('stop', () => {
2309
2312
  camera.on('moveend', spy);
2310
2313
 
2311
2314
  const stub = vi.spyOn(timeControl, 'now');
2312
- stub.mockImplementation(() => 0);
2315
+ stub.mockReturnValue(0);
2313
2316
  camera.panTo([100, 0], {duration: 1}, eventData);
2314
2317
 
2315
2318
  setTimeout(() => {
2316
- stub.mockImplementation(() => 1);
2319
+ stub.mockReturnValue(1);
2317
2320
  queue.run();
2318
2321
  }, 0);
2319
2322
 
@@ -2605,7 +2608,7 @@ describe('transformCameraUpdate', () => {
2605
2608
  test('invoke transformCameraUpdate callback during easeTo', async () => {
2606
2609
  const {camera, queue} = createCamera();
2607
2610
  const stub = vi.spyOn(timeControl, 'now');
2608
- stub.mockImplementation(() => 0);
2611
+ stub.mockReturnValue(0);
2609
2612
 
2610
2613
  let callbackCount = 0;
2611
2614
  let eventCount = 0;
@@ -2624,11 +2627,11 @@ describe('transformCameraUpdate', () => {
2624
2627
  camera.easeTo({center: [100, 0], duration: 10});
2625
2628
 
2626
2629
  setTimeout(() => {
2627
- stub.mockImplementation(() => 1);
2630
+ stub.mockReturnValue(1);
2628
2631
  queue.run();
2629
2632
 
2630
2633
  setTimeout(() => {
2631
- stub.mockImplementation(() => 10);
2634
+ stub.mockReturnValue(10);
2632
2635
  queue.run();
2633
2636
  }, 0);
2634
2637
  }, 0);
@@ -2639,7 +2642,7 @@ describe('transformCameraUpdate', () => {
2639
2642
  test('invoke transformCameraUpdate callback during flyTo', async () => {
2640
2643
  const {camera, queue} = createCamera();
2641
2644
  const stub = vi.spyOn(timeControl, 'now');
2642
- stub.mockImplementation(() => 0);
2645
+ stub.mockReturnValue(0);
2643
2646
 
2644
2647
  let callbackCount = 0;
2645
2648
  let eventCount = 0;
@@ -2658,11 +2661,11 @@ describe('transformCameraUpdate', () => {
2658
2661
  camera.flyTo({center: [100, 0], duration: 10});
2659
2662
 
2660
2663
  setTimeout(() => {
2661
- stub.mockImplementation(() => 1);
2664
+ stub.mockReturnValue(1);
2662
2665
  queue.run();
2663
2666
 
2664
2667
  setTimeout(() => {
2665
- stub.mockImplementation(() => 10);
2668
+ stub.mockReturnValue(10);
2666
2669
  queue.run();
2667
2670
  }, 0);
2668
2671
  }, 0);
@@ -2951,11 +2954,11 @@ describe('easeTo globe projection', () => {
2951
2954
  const stub = vi.spyOn(timeControl, 'now');
2952
2955
  const promise = camera.once('moveend');
2953
2956
 
2954
- stub.mockImplementation(() => 0);
2957
+ stub.mockReturnValue(0);
2955
2958
 
2956
2959
  camera.easeTo({center: [100, 0], duration: 100, padding: {left: 100}});
2957
2960
 
2958
- stub.mockImplementation(() => 50);
2961
+ stub.mockReturnValue(50);
2959
2962
  queue.run();
2960
2963
 
2961
2964
  const padding = camera.getPadding();
@@ -2965,7 +2968,7 @@ describe('easeTo globe projection', () => {
2965
2968
  expect(padding.right).toBe(0);
2966
2969
  expect(padding.top).toBe(0);
2967
2970
 
2968
- stub.mockImplementation(() => 100);
2971
+ stub.mockReturnValue(100);
2969
2972
  queue.run();
2970
2973
 
2971
2974
  await promise;
@@ -3123,15 +3126,15 @@ describe('easeTo globe projection', () => {
3123
3126
 
3124
3127
  const promise = camera.once('moveend');
3125
3128
 
3126
- stub.mockImplementation(() => 0);
3129
+ stub.mockReturnValue(0);
3127
3130
  camera.easeTo({center: [-170, 0], duration: 10});
3128
3131
 
3129
3132
  setTimeout(() => {
3130
- stub.mockImplementation(() => 1);
3133
+ stub.mockReturnValue(1);
3131
3134
  queue.run();
3132
3135
 
3133
3136
  setTimeout(() => {
3134
- stub.mockImplementation(() => 10);
3137
+ stub.mockReturnValue(10);
3135
3138
  queue.run();
3136
3139
  }, 0);
3137
3140
  }, 0);
@@ -3165,15 +3168,15 @@ describe('easeTo globe projection', () => {
3165
3168
 
3166
3169
  const promise = camera.once('moveend');
3167
3170
 
3168
- stub.mockImplementation(() => 0);
3171
+ stub.mockReturnValue(0);
3169
3172
  camera.easeTo({center: [170, 0], duration: 10});
3170
3173
 
3171
3174
  setTimeout(() => {
3172
- stub.mockImplementation(() => 1);
3175
+ stub.mockReturnValue(1);
3173
3176
  queue.run();
3174
3177
 
3175
3178
  setTimeout(() => {
3176
- stub.mockImplementation(() => 10);
3179
+ stub.mockReturnValue(10);
3177
3180
  queue.run();
3178
3181
  }, 0);
3179
3182
  }, 0);
@@ -3256,10 +3259,10 @@ describe('flyTo globe projection', () => {
3256
3259
 
3257
3260
  const promise = camera.once('zoomend');
3258
3261
 
3259
- stub.mockImplementation(() => 0);
3262
+ stub.mockReturnValue(0);
3260
3263
  camera.flyTo({zoom: 19, center: pos, duration: 2});
3261
3264
 
3262
- stub.mockImplementation(() => 3);
3265
+ stub.mockReturnValue(3);
3263
3266
  queue.run();
3264
3267
 
3265
3268
  await promise;
@@ -3334,11 +3337,11 @@ describe('flyTo globe projection', () => {
3334
3337
  const stub = vi.spyOn(timeControl, 'now');
3335
3338
  const promise = camera.once('moveend');
3336
3339
 
3337
- stub.mockImplementation(() => 0);
3340
+ stub.mockReturnValue(0);
3338
3341
 
3339
3342
  camera.flyTo({center: [100, 0], duration: 100, padding: {left: 100}});
3340
3343
 
3341
- stub.mockImplementation(() => 100);
3344
+ stub.mockReturnValue(100);
3342
3345
  queue.run();
3343
3346
 
3344
3347
  const padding = camera.getPadding();
@@ -3348,7 +3351,7 @@ describe('flyTo globe projection', () => {
3348
3351
  expect(padding.right).toBe(0);
3349
3352
  expect(padding.top).toBe(0);
3350
3353
 
3351
- stub.mockImplementation(() => 100);
3354
+ stub.mockReturnValue(100);
3352
3355
  queue.run();
3353
3356
 
3354
3357
  await promise;
@@ -3499,16 +3502,16 @@ describe('flyTo globe projection', () => {
3499
3502
  const promise = camera.once('moveend');
3500
3503
 
3501
3504
  const stub = vi.spyOn(timeControl, 'now');
3502
- stub.mockImplementation(() => 0);
3505
+ stub.mockReturnValue(0);
3503
3506
 
3504
3507
  camera.flyTo({center: [100, 0], duration: 10}, eventData);
3505
3508
 
3506
3509
  setTimeout(() => {
3507
- stub.mockImplementation(() => 1);
3510
+ stub.mockReturnValue(1);
3508
3511
  queue.run();
3509
3512
 
3510
3513
  setTimeout(() => {
3511
- stub.mockImplementation(() => 10);
3514
+ stub.mockReturnValue(10);
3512
3515
  queue.run();
3513
3516
  }, 0);
3514
3517
  }, 0);
@@ -3546,16 +3549,16 @@ describe('flyTo globe projection', () => {
3546
3549
  const promise = camera.once('moveend');
3547
3550
 
3548
3551
  const stub = vi.spyOn(timeControl, 'now');
3549
- stub.mockImplementation(() => 0);
3552
+ stub.mockReturnValue(0);
3550
3553
 
3551
3554
  camera.flyTo({center: [100, 0], zoom: 18, duration: 10});
3552
3555
 
3553
3556
  setTimeout(() => {
3554
- stub.mockImplementation(() => 1);
3557
+ stub.mockReturnValue(1);
3555
3558
  queue.run();
3556
3559
 
3557
3560
  setTimeout(() => {
3558
- stub.mockImplementation(() => 10);
3561
+ stub.mockReturnValue(10);
3559
3562
  queue.run();
3560
3563
  }, 0);
3561
3564
  }, 0);
@@ -3579,15 +3582,15 @@ describe('flyTo globe projection', () => {
3579
3582
 
3580
3583
  const promise = camera.once('moveend');
3581
3584
 
3582
- stub.mockImplementation(() => 0);
3585
+ stub.mockReturnValue(0);
3583
3586
  camera.flyTo({center: [10, 0], duration: 20});
3584
3587
 
3585
3588
  setTimeout(() => {
3586
- stub.mockImplementation(() => 1);
3589
+ stub.mockReturnValue(1);
3587
3590
  queue.run();
3588
3591
 
3589
3592
  setTimeout(() => {
3590
- stub.mockImplementation(() => 20);
3593
+ stub.mockReturnValue(20);
3591
3594
  queue.run();
3592
3595
  }, 0);
3593
3596
  }, 0);
@@ -3611,15 +3614,15 @@ describe('flyTo globe projection', () => {
3611
3614
 
3612
3615
  const promise = camera.once('moveend');
3613
3616
 
3614
- stub.mockImplementation(() => 0);
3617
+ stub.mockReturnValue(0);
3615
3618
  camera.flyTo({center: [-10, 0], duration: 20});
3616
3619
 
3617
3620
  setTimeout(() => {
3618
- stub.mockImplementation(() => 1);
3621
+ stub.mockReturnValue(1);
3619
3622
  queue.run();
3620
3623
 
3621
3624
  setTimeout(() => {
3622
- stub.mockImplementation(() => 20);
3625
+ stub.mockReturnValue(20);
3623
3626
  queue.run();
3624
3627
  }, 0);
3625
3628
  }, 0);
@@ -3643,15 +3646,15 @@ describe('flyTo globe projection', () => {
3643
3646
 
3644
3647
  const promise = camera.once('moveend');
3645
3648
 
3646
- stub.mockImplementation(() => 0);
3649
+ stub.mockReturnValue(0);
3647
3650
  camera.flyTo({center: [-170, 0], duration: 20});
3648
3651
 
3649
3652
  setTimeout(() => {
3650
- stub.mockImplementation(() => 1);
3653
+ stub.mockReturnValue(1);
3651
3654
  queue.run();
3652
3655
 
3653
3656
  setTimeout(() => {
3654
- stub.mockImplementation(() => 20);
3657
+ stub.mockReturnValue(20);
3655
3658
  queue.run();
3656
3659
  }, 0);
3657
3660
  }, 0);
@@ -3675,15 +3678,15 @@ describe('flyTo globe projection', () => {
3675
3678
 
3676
3679
  const promise = camera.once('moveend');
3677
3680
 
3678
- stub.mockImplementation(() => 0);
3681
+ stub.mockReturnValue(0);
3679
3682
  camera.flyTo({center: [170, 0], duration: 10});
3680
3683
 
3681
3684
  setTimeout(() => {
3682
- stub.mockImplementation(() => 1);
3685
+ stub.mockReturnValue(1);
3683
3686
  queue.run();
3684
3687
 
3685
3688
  setTimeout(() => {
3686
- stub.mockImplementation(() => 10);
3689
+ stub.mockReturnValue(10);
3687
3690
  queue.run();
3688
3691
  }, 0);
3689
3692
  }, 0);
@@ -3707,15 +3710,15 @@ describe('flyTo globe projection', () => {
3707
3710
 
3708
3711
  const promise = camera.once('moveend');
3709
3712
 
3710
- stub.mockImplementation(() => 0);
3713
+ stub.mockReturnValue(0);
3711
3714
  camera.flyTo({center: [-170, 0], duration: 10});
3712
3715
 
3713
3716
  setTimeout(() => {
3714
- stub.mockImplementation(() => 1);
3717
+ stub.mockReturnValue(1);
3715
3718
  queue.run();
3716
3719
 
3717
3720
  setTimeout(() => {
3718
- stub.mockImplementation(() => 10);
3721
+ stub.mockReturnValue(10);
3719
3722
  queue.run();
3720
3723
  }, 0);
3721
3724
  }, 0);
@@ -3739,15 +3742,15 @@ describe('flyTo globe projection', () => {
3739
3742
 
3740
3743
  const promise = camera.once('moveend');
3741
3744
 
3742
- stub.mockImplementation(() => 0);
3745
+ stub.mockReturnValue(0);
3743
3746
  camera.flyTo({center: [170, 0], duration: 10});
3744
3747
 
3745
3748
  setTimeout(() => {
3746
- stub.mockImplementation(() => 1);
3749
+ stub.mockReturnValue(1);
3747
3750
  queue.run();
3748
3751
 
3749
3752
  setTimeout(() => {
3750
- stub.mockImplementation(() => 10);
3753
+ stub.mockReturnValue(10);
3751
3754
  queue.run();
3752
3755
  }, 0);
3753
3756
  }, 0);
@@ -3770,15 +3773,15 @@ describe('flyTo globe projection', () => {
3770
3773
 
3771
3774
  const promise = camera.once('moveend');
3772
3775
 
3773
- stub.mockImplementation(() => 0);
3776
+ stub.mockReturnValue(0);
3774
3777
  camera.flyTo({center: [170, 0], duration: 10});
3775
3778
 
3776
3779
  setTimeout(() => {
3777
- stub.mockImplementation(() => 1);
3780
+ stub.mockReturnValue(1);
3778
3781
  queue.run();
3779
3782
 
3780
3783
  setTimeout(() => {
3781
- stub.mockImplementation(() => 10);
3784
+ stub.mockReturnValue(10);
3782
3785
  queue.run();
3783
3786
  }, 0);
3784
3787
  }, 0);
@@ -3799,7 +3802,7 @@ describe('flyTo globe projection', () => {
3799
3802
  const promise = camera.once('moveend');
3800
3803
 
3801
3804
  const duration = 10;
3802
- stub.mockImplementation(() => 0);
3805
+ stub.mockReturnValue(0);
3803
3806
  camera.flyTo({center: [1, 0], zoom: 20, minZoom, duration});
3804
3807
 
3805
3808
  await simulateAllAnimationFrames(stub, camera, queue,duration);
@@ -3822,7 +3825,7 @@ describe('flyTo globe projection', () => {
3822
3825
  const promise = camera.once('moveend');
3823
3826
 
3824
3827
  const duration = 10;
3825
- stub.mockImplementation(() => 0);
3828
+ stub.mockReturnValue(0);
3826
3829
  camera.flyTo({center: [1, 0], zoom: 20, duration});
3827
3830
 
3828
3831
  await simulateAllAnimationFrames(stub, camera, queue,duration);
@@ -3840,11 +3843,11 @@ describe('flyTo globe projection', () => {
3840
3843
  const promise = camera.once('moveend');
3841
3844
 
3842
3845
  const stub = vi.spyOn(timeControl, 'now');
3843
- stub.mockImplementation(() => 0);
3846
+ stub.mockReturnValue(0);
3844
3847
  camera.flyTo({center: [12, 34], zoom: 30, duration: 10});
3845
3848
 
3846
3849
  setTimeout(() => {
3847
- stub.mockImplementation(() => 10);
3850
+ stub.mockReturnValue(10);
3848
3851
  queue.run();
3849
3852
  }, 0);
3850
3853
 
@@ -3864,11 +3867,11 @@ describe('flyTo globe projection', () => {
3864
3867
  const promise = camera.once('moveend');
3865
3868
 
3866
3869
  const stub = vi.spyOn(timeControl, 'now');
3867
- stub.mockImplementation(() => 0);
3870
+ stub.mockReturnValue(0);
3868
3871
  camera.flyTo({center: target, zoom: 1, duration: 10});
3869
3872
 
3870
3873
  setTimeout(() => {
3871
- stub.mockImplementation(() => 10);
3874
+ stub.mockReturnValue(10);
3872
3875
  queue.run();
3873
3876
  }, 0);
3874
3877