maplibre-gl 2.1.6 → 2.1.7

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 (66) hide show
  1. package/build/generate-query-test-fixtures.ts +7 -5
  2. package/build/generate-style-spec.ts +1 -1
  3. package/dist/maplibre-gl-csp-worker.js +2 -0
  4. package/dist/maplibre-gl-csp-worker.js.map +1 -0
  5. package/dist/maplibre-gl-csp.js +2 -0
  6. package/dist/maplibre-gl-csp.js.map +1 -0
  7. package/dist/maplibre-gl-dev.js +20 -3
  8. package/dist/maplibre-gl-unminified.js +39041 -0
  9. package/dist/maplibre-gl-unminified.js.map +1 -0
  10. package/dist/maplibre-gl.css +1 -1
  11. package/dist/maplibre-gl.d.ts +5 -14
  12. package/dist/maplibre-gl.js +2 -2
  13. package/dist/maplibre-gl.js.map +1 -1
  14. package/package.json +1 -2
  15. package/src/css/maplibre-gl.css +22 -48
  16. package/src/data/bucket/fill_bucket.test.ts +1 -1
  17. package/src/data/bucket/line_bucket.test.ts +1 -1
  18. package/src/data/feature_index.ts +1 -1
  19. package/src/render/glyph_manager.ts +17 -1
  20. package/src/render/uniform_binding.ts +1 -1
  21. package/src/source/geojson_source.ts +1 -1
  22. package/src/source/geojson_worker_source.test.ts +1 -1
  23. package/src/source/image_source.ts +1 -1
  24. package/src/source/query_features.ts +1 -1
  25. package/src/source/raster_dem_tile_source.ts +1 -1
  26. package/src/source/raster_tile_source.ts +1 -1
  27. package/src/source/source.ts +1 -1
  28. package/src/source/source_cache.test.ts +12 -0
  29. package/src/source/source_cache.ts +5 -1
  30. package/src/source/tile.ts +1 -1
  31. package/src/source/vector_tile_source.ts +1 -1
  32. package/src/source/video_source.ts +1 -1
  33. package/src/source/worker.test.ts +1 -1
  34. package/src/source/worker.ts +1 -1
  35. package/src/source/worker_source.ts +1 -1
  36. package/src/source/worker_tile.ts +1 -1
  37. package/src/style/create_style_layer.ts +1 -1
  38. package/src/style/evaluation_parameters.ts +1 -1
  39. package/src/style/light.test.ts +1 -1
  40. package/src/style/light.ts +1 -1
  41. package/src/style/properties.ts +1 -1
  42. package/src/style/style.test.ts +1 -1
  43. package/src/style/style.ts +1 -1
  44. package/src/style/style_layer/background_style_layer.ts +1 -1
  45. package/src/style/style_layer/circle_style_layer.ts +1 -1
  46. package/src/style/style_layer/custom_style_layer.ts +1 -1
  47. package/src/style/style_layer/fill_extrusion_style_layer.ts +1 -1
  48. package/src/style/style_layer/fill_style_layer.ts +1 -1
  49. package/src/style/style_layer/heatmap_style_layer.ts +1 -1
  50. package/src/style/style_layer/hillshade_style_layer.ts +1 -1
  51. package/src/style/style_layer/line_style_layer.ts +1 -1
  52. package/src/style/style_layer/raster_style_layer.ts +1 -1
  53. package/src/style/style_layer/symbol_style_layer.ts +1 -1
  54. package/src/style/style_layer.test.ts +1 -1
  55. package/src/style/style_layer.ts +1 -1
  56. package/src/style/style_layer_index.ts +1 -1
  57. package/src/style-spec/expression/index.ts +1 -1
  58. package/src/style-spec/feature_filter/convert.ts +1 -1
  59. package/src/style-spec/feature_filter/feature_filter.test.ts +1 -1
  60. package/src/style-spec/migrate/expressions.ts +1 -1
  61. package/src/style-spec/{types.ts → types.g.ts} +0 -0
  62. package/src/style-spec/visit.ts +1 -1
  63. package/src/ui/control/logo_control.test.ts +1 -1
  64. package/src/ui/events.ts +1 -1
  65. package/src/ui/map.test.ts +1 -1
  66. package/src/ui/map.ts +11 -6
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": "2.1.6",
4
+ "version": "2.1.7",
5
5
  "main": "dist/maplibre-gl.js",
6
6
  "style": "dist/maplibre-gl.css",
7
7
  "license": "BSD-3-Clause",
@@ -94,7 +94,6 @@
94
94
  "eslint-plugin-react": "^7.28.0",
95
95
  "gl": "^5.0.0",
96
96
  "glob": "^7.2.0",
97
- "husky": "^7.0.4",
98
97
  "is-builtin-module": "^3.1.0",
99
98
  "jest": "^27.5.1",
100
99
  "jest-canvas-mock": "^2.3.1",
@@ -13,8 +13,8 @@
13
13
  top: 0;
14
14
  }
15
15
 
16
- .maplibregl-map:-webkit-full-screen,
17
- .mapboxgl-map:-webkit-full-screen {
16
+ .maplibregl-map:fullscreen,
17
+ .mapboxgl-map:fullscreen {
18
18
  width: 100%;
19
19
  height: 100%;
20
20
  }
@@ -23,8 +23,6 @@
23
23
  .maplibregl-ctrl-group button.maplibregl-ctrl-compass,
24
24
  .mapboxgl-canvas-container.mapboxgl-interactive,
25
25
  .mapboxgl-ctrl-group button.mapboxgl-ctrl-compass {
26
- cursor: -webkit-grab;
27
- cursor: -moz-grab;
28
26
  cursor: grab;
29
27
  -moz-user-select: none;
30
28
  -webkit-user-select: none;
@@ -41,8 +39,6 @@
41
39
  .maplibregl-ctrl-group button.maplibregl-ctrl-compass:active,
42
40
  .mapboxgl-canvas-container.mapboxgl-interactive:active,
43
41
  .mapboxgl-ctrl-group button.mapboxgl-ctrl-compass:active {
44
- cursor: -webkit-grabbing;
45
- cursor: -moz-grabbing;
46
42
  cursor: grabbing;
47
43
  }
48
44
 
@@ -117,8 +113,6 @@
117
113
 
118
114
  .maplibregl-ctrl-group:not(:empty),
119
115
  .mapboxgl-ctrl-group:not(:empty) {
120
- -moz-box-shadow: 0 0 2px rgb(0 0 0 / 10%);
121
- -webkit-box-shadow: 0 0 2px rgb(0 0 0 / 10%);
122
116
  box-shadow: 0 0 0 2px rgb(0 0 0 / 10%);
123
117
  }
124
118
 
@@ -398,10 +392,6 @@
398
392
 
399
393
  .maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon,
400
394
  .mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-waiting .mapboxgl-ctrl-icon {
401
- -webkit-animation: maplibregl-spin 2s infinite linear;
402
- -moz-animation: maplibregl-spin 2s infinite linear;
403
- -o-animation: maplibregl-spin 2s infinite linear;
404
- -ms-animation: maplibregl-spin 2s infinite linear;
405
395
  animation: maplibregl-spin 2s infinite linear;
406
396
  }
407
397
 
@@ -449,24 +439,24 @@
449
439
  }
450
440
  }
451
441
 
452
- @-webkit-keyframes maplibregl-spin {
453
- 0% { -webkit-transform: rotate(0deg); }
454
- 100% { -webkit-transform: rotate(360deg); }
442
+ @keyframes maplibregl-spin {
443
+ 0% { transform: rotate(0deg); }
444
+ 100% { transform: rotate(360deg); }
455
445
  }
456
446
 
457
- @-moz-keyframes maplibregl-spin {
458
- 0% { -moz-transform: rotate(0deg); }
459
- 100% { -moz-transform: rotate(360deg); }
447
+ @keyframes maplibregl-spin {
448
+ 0% { transform: rotate(0deg); }
449
+ 100% { transform: rotate(360deg); }
460
450
  }
461
451
 
462
- @-o-keyframes maplibregl-spin {
463
- 0% { -o-transform: rotate(0deg); }
464
- 100% { -o-transform: rotate(360deg); }
452
+ @keyframes maplibregl-spin {
453
+ 0% { transform: rotate(0deg); }
454
+ 100% { transform: rotate(360deg); }
465
455
  }
466
456
 
467
- @-ms-keyframes maplibregl-spin {
468
- 0% { -ms-transform: rotate(0deg); }
469
- 100% { -ms-transform: rotate(360deg); }
457
+ @keyframes maplibregl-spin {
458
+ 0% { transform: rotate(0deg); }
459
+ 100% { transform: rotate(360deg); }
470
460
  }
471
461
 
472
462
  @keyframes maplibregl-spin {
@@ -662,7 +652,6 @@ a.mapboxgl-ctrl-logo.mapboxgl-compact {
662
652
  position: absolute;
663
653
  top: 0;
664
654
  left: 0;
665
- display: -webkit-flex;
666
655
  display: flex;
667
656
  will-change: transform;
668
657
  pointer-events: none;
@@ -674,7 +663,6 @@ a.mapboxgl-ctrl-logo.mapboxgl-compact {
674
663
  .mapboxgl-popup-anchor-top,
675
664
  .mapboxgl-popup-anchor-top-left,
676
665
  .mapboxgl-popup-anchor-top-right {
677
- -webkit-flex-direction: column;
678
666
  flex-direction: column;
679
667
  }
680
668
 
@@ -684,19 +672,16 @@ a.mapboxgl-ctrl-logo.mapboxgl-compact {
684
672
  .mapboxgl-popup-anchor-bottom,
685
673
  .mapboxgl-popup-anchor-bottom-left,
686
674
  .mapboxgl-popup-anchor-bottom-right {
687
- -webkit-flex-direction: column-reverse;
688
675
  flex-direction: column-reverse;
689
676
  }
690
677
 
691
678
  .maplibregl-popup-anchor-left,
692
679
  .mapboxgl-popup-anchor-left {
693
- -webkit-flex-direction: row;
694
680
  flex-direction: row;
695
681
  }
696
682
 
697
683
  .maplibregl-popup-anchor-right,
698
684
  .mapboxgl-popup-anchor-right {
699
- -webkit-flex-direction: row-reverse;
700
685
  flex-direction: row-reverse;
701
686
  }
702
687
 
@@ -710,7 +695,6 @@ a.mapboxgl-ctrl-logo.mapboxgl-compact {
710
695
 
711
696
  .maplibregl-popup-anchor-top .maplibregl-popup-tip,
712
697
  .mapboxgl-popup-anchor-top .mapboxgl-popup-tip {
713
- -webkit-align-self: center;
714
698
  align-self: center;
715
699
  border-top: none;
716
700
  border-bottom-color: #fff;
@@ -718,7 +702,6 @@ a.mapboxgl-ctrl-logo.mapboxgl-compact {
718
702
 
719
703
  .maplibregl-popup-anchor-top-left .maplibregl-popup-tip,
720
704
  .mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip {
721
- -webkit-align-self: flex-start;
722
705
  align-self: flex-start;
723
706
  border-top: none;
724
707
  border-left: none;
@@ -727,7 +710,6 @@ a.mapboxgl-ctrl-logo.mapboxgl-compact {
727
710
 
728
711
  .maplibregl-popup-anchor-top-right .maplibregl-popup-tip,
729
712
  .mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip {
730
- -webkit-align-self: flex-end;
731
713
  align-self: flex-end;
732
714
  border-top: none;
733
715
  border-right: none;
@@ -736,7 +718,6 @@ a.mapboxgl-ctrl-logo.mapboxgl-compact {
736
718
 
737
719
  .maplibregl-popup-anchor-bottom .maplibregl-popup-tip,
738
720
  .mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip {
739
- -webkit-align-self: center;
740
721
  align-self: center;
741
722
  border-bottom: none;
742
723
  border-top-color: #fff;
@@ -744,7 +725,6 @@ a.mapboxgl-ctrl-logo.mapboxgl-compact {
744
725
 
745
726
  .maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip,
746
727
  .mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip {
747
- -webkit-align-self: flex-start;
748
728
  align-self: flex-start;
749
729
  border-bottom: none;
750
730
  border-left: none;
@@ -753,7 +733,6 @@ a.mapboxgl-ctrl-logo.mapboxgl-compact {
753
733
 
754
734
  .maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip,
755
735
  .mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip {
756
- -webkit-align-self: flex-end;
757
736
  align-self: flex-end;
758
737
  border-bottom: none;
759
738
  border-right: none;
@@ -762,7 +741,6 @@ a.mapboxgl-ctrl-logo.mapboxgl-compact {
762
741
 
763
742
  .maplibregl-popup-anchor-left .maplibregl-popup-tip,
764
743
  .mapboxgl-popup-anchor-left .mapboxgl-popup-tip {
765
- -webkit-align-self: center;
766
744
  align-self: center;
767
745
  border-left: none;
768
746
  border-right-color: #fff;
@@ -770,7 +748,6 @@ a.mapboxgl-ctrl-logo.mapboxgl-compact {
770
748
 
771
749
  .maplibregl-popup-anchor-right .maplibregl-popup-tip,
772
750
  .mapboxgl-popup-anchor-right .mapboxgl-popup-tip {
773
- -webkit-align-self: center;
774
751
  align-self: center;
775
752
  border-right: none;
776
753
  border-left-color: #fff;
@@ -867,9 +844,6 @@ a.mapboxgl-ctrl-logo.mapboxgl-compact {
867
844
  height: 15px;
868
845
  border-radius: 50%;
869
846
  position: absolute;
870
- -webkit-animation: maplibregl-user-location-dot-pulse 2s infinite;
871
- -moz-animation: maplibregl-user-location-dot-pulse 2s infinite;
872
- -ms-animation: maplibregl-user-location-dot-pulse 2s infinite;
873
847
  animation: maplibregl-user-location-dot-pulse 2s infinite;
874
848
  }
875
849
 
@@ -887,16 +861,16 @@ a.mapboxgl-ctrl-logo.mapboxgl-compact {
887
861
  box-shadow: 0 0 3px rgb(0 0 0 / 35%);
888
862
  }
889
863
 
890
- @-webkit-keyframes maplibregl-user-location-dot-pulse {
891
- 0% { -webkit-transform: scale(1); opacity: 1; }
892
- 70% { -webkit-transform: scale(3); opacity: 0; }
893
- 100% { -webkit-transform: scale(1); opacity: 0; }
864
+ @keyframes maplibregl-user-location-dot-pulse {
865
+ 0% { transform: scale(1); opacity: 1; }
866
+ 70% { transform: scale(3); opacity: 0; }
867
+ 100% { transform: scale(1); opacity: 0; }
894
868
  }
895
869
 
896
- @-ms-keyframes maplibregl-user-location-dot-pulse {
897
- 0% { -ms-transform: scale(1); opacity: 1; }
898
- 70% { -ms-transform: scale(3); opacity: 0; }
899
- 100% { -ms-transform: scale(1); opacity: 0; }
870
+ @keyframes maplibregl-user-location-dot-pulse {
871
+ 0% { transform: scale(1); opacity: 1; }
872
+ 70% { transform: scale(3); opacity: 0; }
873
+ 100% { transform: scale(1); opacity: 0; }
900
874
  }
901
875
 
902
876
  @keyframes maplibregl-user-location-dot-pulse {
@@ -7,7 +7,7 @@ import Point from '@mapbox/point-geometry';
7
7
  import segment from '../segment';
8
8
  import FillBucket from './fill_bucket';
9
9
  import FillStyleLayer from '../../style/style_layer/fill_style_layer';
10
- import {LayerSpecification} from '../../style-spec/types';
10
+ import {LayerSpecification} from '../../style-spec/types.g';
11
11
  import EvaluationParameters from '../../style/evaluation_parameters';
12
12
  import ZoomHistory from '../../style/zoom_history';
13
13
  import {BucketFeature, BucketParameters} from '../bucket';
@@ -6,7 +6,7 @@ import Point from '@mapbox/point-geometry';
6
6
  import segment from '../segment';
7
7
  import LineBucket from './line_bucket';
8
8
  import LineStyleLayer from '../../style/style_layer/line_style_layer';
9
- import {LayerSpecification} from '../../style-spec/types';
9
+ import {LayerSpecification} from '../../style-spec/types.g';
10
10
  import EvaluationParameters from '../../style/evaluation_parameters';
11
11
  import {BucketFeature, BucketParameters} from '../bucket';
12
12
 
@@ -21,7 +21,7 @@ import {mat4} from 'gl-matrix';
21
21
  import type StyleLayer from '../style/style_layer';
22
22
  import type {FeatureFilter} from '../style-spec/feature_filter';
23
23
  import type Transform from '../geo/transform';
24
- import type {FilterSpecification, PromoteIdSpecification} from '../style-spec/types';
24
+ import type {FilterSpecification, PromoteIdSpecification} from '../style-spec/types.g';
25
25
  import type {FeatureState} from '../style-spec/expression';
26
26
  import type {VectorTileFeature, VectorTileLayer} from '@mapbox/vector-tile';
27
27
 
@@ -196,6 +196,22 @@ export default class GlyphManager {
196
196
  }
197
197
 
198
198
  const char = tinySDF.draw(String.fromCharCode(id));
199
+
200
+ /**
201
+ * TinySDF's "top" is the distance from the alphabetic baseline to the top of the glyph.
202
+ * Server-generated fonts specify "top" relative to an origin above the em box (the origin
203
+ * comes from FreeType, but I'm unclear on exactly how it's derived)
204
+ * ref: https://github.com/mapbox/sdf-glyph-foundry
205
+ *
206
+ * Server fonts don't yet include baseline information, so we can't line up exactly with them
207
+ * (and they don't line up with each other)
208
+ * ref: https://github.com/mapbox/node-fontnik/pull/160
209
+ *
210
+ * To approximately align TinySDF glyphs with server-provided glyphs, we use this baseline adjustment
211
+ * factor calibrated to be in between DIN Pro and Arial Unicode (but closer to Arial Unicode)
212
+ */
213
+ const topAdjustment = 27;
214
+
199
215
  return {
200
216
  id,
201
217
  bitmap: new AlphaImage({width: char.width || 30, height: char.height || 30}, char.data),
@@ -203,7 +219,7 @@ export default class GlyphManager {
203
219
  width: char.glyphWidth || 24,
204
220
  height: char.glyphHeight || 24,
205
221
  left: char.glyphLeft || 0,
206
- top: char.glyphTop || -8,
222
+ top: char.glyphTop - topAdjustment || -8,
207
223
  advance: char.glyphAdvance || 24
208
224
  }
209
225
  };
@@ -7,7 +7,7 @@ type $ObjMap<T extends {}, F extends (v: any) => any> = {
7
7
  [K in keyof T]: F extends (v: T[K]) => infer R ? R : never;
8
8
  };
9
9
 
10
- export type UniformValues<Us extends any> = $ObjMap<Us, <V>(u: Uniform<V>) => V>;
10
+ export type UniformValues<Us extends {}> = $ObjMap<Us, <V>(u: Uniform<V>) => V>;
11
11
  export type UniformLocations = {[_: string]: WebGLUniformLocation};
12
12
 
13
13
  abstract class Uniform<T> {
@@ -11,7 +11,7 @@ import type Dispatcher from '../util/dispatcher';
11
11
  import type Tile from './tile';
12
12
  import type Actor from '../util/actor';
13
13
  import type {Callback} from '../types/callback';
14
- import type {GeoJSONSourceSpecification, PromoteIdSpecification} from '../style-spec/types';
14
+ import type {GeoJSONSourceSpecification, PromoteIdSpecification} from '../style-spec/types.g';
15
15
  import type {MapSourceDataType} from '../ui/events';
16
16
 
17
17
  export type GeoJSONSourceOptions = GeoJSONSourceSpecification & {
@@ -2,7 +2,7 @@ import GeoJSONWorkerSource, {LoadGeoJSONParameters} from './geojson_worker_sourc
2
2
  import StyleLayerIndex from '../style/style_layer_index';
3
3
  import {OverscaledTileID} from './tile_id';
4
4
  import perf from '../util/performance';
5
- import {LayerSpecification} from '../style-spec/types';
5
+ import {LayerSpecification} from '../style-spec/types.g';
6
6
  import Actor from '../util/actor';
7
7
  import {WorkerTileParameters} from './worker_source';
8
8
  import {setPerformance} from '../util/test/util';
@@ -18,7 +18,7 @@ import type VertexBuffer from '../gl/vertex_buffer';
18
18
  import type {
19
19
  ImageSourceSpecification,
20
20
  VideoSourceSpecification
21
- } from '../style-spec/types';
21
+ } from '../style-spec/types.g';
22
22
 
23
23
  export type Coordinates = [[number, number], [number, number], [number, number], [number, number]];
24
24
 
@@ -3,7 +3,7 @@ import type StyleLayer from '../style/style_layer';
3
3
  import type CollisionIndex from '../symbol/collision_index';
4
4
  import type Transform from '../geo/transform';
5
5
  import type {RetainedQueryData} from '../symbol/placement';
6
- import type {FilterSpecification} from '../style-spec/types';
6
+ import type {FilterSpecification} from '../style-spec/types.g';
7
7
  import type Point from '@mapbox/point-geometry';
8
8
  import assert from 'assert';
9
9
  import {mat4} from 'gl-matrix';
@@ -12,7 +12,7 @@ import type {Source} from './source';
12
12
  import type Dispatcher from '../util/dispatcher';
13
13
  import type Tile from './tile';
14
14
  import type {Callback} from '../types/callback';
15
- import type {RasterDEMSourceSpecification} from '../style-spec/types';
15
+ import type {RasterDEMSourceSpecification} from '../style-spec/types.g';
16
16
 
17
17
  class RasterDEMTileSource extends RasterTileSource implements Source {
18
18
  encoding: 'mapbox' | 'terrarium';
@@ -18,7 +18,7 @@ import type {Cancelable} from '../types/cancelable';
18
18
  import type {
19
19
  RasterSourceSpecification,
20
20
  RasterDEMSourceSpecification
21
- } from '../style-spec/types';
21
+ } from '../style-spec/types.g';
22
22
 
23
23
  class RasterTileSource extends Evented implements Source {
24
24
  type: 'raster' | 'raster-dem';
@@ -84,7 +84,7 @@ import video from '../source/video_source';
84
84
  import image from '../source/image_source';
85
85
  import canvas from '../source/canvas_source';
86
86
 
87
- import type {SourceSpecification} from '../style-spec/types';
87
+ import type {SourceSpecification} from '../style-spec/types.g';
88
88
 
89
89
  const sourceTypes = {
90
90
  vector,
@@ -436,6 +436,18 @@ describe('SourceCache / Source lifecycle', () => {
436
436
  sourceCache.onAdd(undefined);
437
437
  });
438
438
 
439
+ test('loaded() false after source begins loading following error', done => {
440
+ const sourceCache = createSourceCache({error: 'Error loading source'}).on('error', () => {
441
+ sourceCache.on('dataloading', () => {
442
+ expect(sourceCache.loaded()).toBeFalsy();
443
+ done();
444
+ });
445
+ sourceCache.getSource().fire(new Event('dataloading'));
446
+ });
447
+
448
+ sourceCache.onAdd(undefined);
449
+ });
450
+
439
451
  test('reloads tiles after a data event where source is updated', () => {
440
452
  const transform = new Transform();
441
453
  transform.resize(511, 511);
@@ -20,7 +20,7 @@ import type Dispatcher from '../util/dispatcher';
20
20
  import type Transform from '../geo/transform';
21
21
  import type {TileState} from './tile';
22
22
  import type {Callback} from '../types/callback';
23
- import type {SourceSpecification} from '../style-spec/types';
23
+ import type {SourceSpecification} from '../style-spec/types.g';
24
24
 
25
25
  /**
26
26
  * `SourceCache` is responsible for
@@ -84,6 +84,10 @@ class SourceCache extends Evented {
84
84
  }
85
85
  });
86
86
 
87
+ this.on('dataloading', () => {
88
+ this._sourceErrored = false;
89
+ });
90
+
87
91
  this.on('error', () => {
88
92
  this._sourceErrored = true;
89
93
  });
@@ -29,7 +29,7 @@ import type Framebuffer from '../gl/framebuffer';
29
29
  import type Transform from '../geo/transform';
30
30
  import type {LayerFeatureStates} from './source_state';
31
31
  import type {Cancelable} from '../types/cancelable';
32
- import type {FilterSpecification} from '../style-spec/types';
32
+ import type {FilterSpecification} from '../style-spec/types.g';
33
33
  import type Point from '@mapbox/point-geometry';
34
34
  import {mat4} from 'gl-matrix';
35
35
  import type {VectorTileLayer} from '@mapbox/vector-tile';
@@ -13,7 +13,7 @@ import type Dispatcher from '../util/dispatcher';
13
13
  import type Tile from './tile';
14
14
  import type {Callback} from '../types/callback';
15
15
  import type {Cancelable} from '../types/cancelable';
16
- import type {VectorSourceSpecification, PromoteIdSpecification} from '../style-spec/types';
16
+ import type {VectorSourceSpecification, PromoteIdSpecification} from '../style-spec/types.g';
17
17
 
18
18
  /**
19
19
  * A source containing vector tiles in [Mapbox Vector Tile format](https://docs.mapbox.com/vector-tiles/reference/).
@@ -10,7 +10,7 @@ import ValidationError from '../style-spec/error/validation_error';
10
10
  import type Map from '../ui/map';
11
11
  import type Dispatcher from '../util/dispatcher';
12
12
  import type {Evented} from '../util/evented';
13
- import type {VideoSourceSpecification} from '../style-spec/types';
13
+ import type {VideoSourceSpecification} from '../style-spec/types.g';
14
14
 
15
15
  /**
16
16
  * A data source containing video.
@@ -1,6 +1,6 @@
1
1
  import {fakeServer} from 'nise';
2
2
  import Worker from './worker';
3
- import {LayerSpecification} from '../style-spec/types';
3
+ import {LayerSpecification} from '../style-spec/types.g';
4
4
  import {Cancelable} from '../types/cancelable';
5
5
  import {WorkerGlobalScopeInterface} from '../util/web_worker';
6
6
  import {CanonicalTileID, OverscaledTileID} from './tile_id';
@@ -19,7 +19,7 @@ import type {
19
19
 
20
20
  import type {WorkerGlobalScopeInterface} from '../util/web_worker';
21
21
  import type {Callback} from '../types/callback';
22
- import type {LayerSpecification} from '../style-spec/types';
22
+ import type {LayerSpecification} from '../style-spec/types.g';
23
23
  import type {PluginState} from './rtl_text_plugin';
24
24
 
25
25
  /**
@@ -9,7 +9,7 @@ import type {CollisionBoxArray} from '../data/array_types.g';
9
9
  import type DEMData from '../data/dem_data';
10
10
  import type {StyleGlyph} from '../style/style_glyph';
11
11
  import type {StyleImage} from '../style/style_image';
12
- import type {PromoteIdSpecification} from '../style-spec/types';
12
+ import type {PromoteIdSpecification} from '../style-spec/types.g';
13
13
 
14
14
  export type TileParameters = {
15
15
  source: string;
@@ -24,7 +24,7 @@ import type {
24
24
  WorkerTileParameters,
25
25
  WorkerTileCallback,
26
26
  } from '../source/worker_source';
27
- import type {PromoteIdSpecification} from '../style-spec/types';
27
+ import type {PromoteIdSpecification} from '../style-spec/types.g';
28
28
  import type {VectorTile} from '@mapbox/vector-tile';
29
29
 
30
30
  class WorkerTile {
@@ -10,7 +10,7 @@ import raster from './style_layer/raster_style_layer';
10
10
  import CustomStyleLayer from './style_layer/custom_style_layer';
11
11
  import type {CustomLayerInterface} from './style_layer/custom_style_layer';
12
12
 
13
- import type {LayerSpecification} from '../style-spec/types';
13
+ import type {LayerSpecification} from '../style-spec/types.g';
14
14
 
15
15
  const subclasses = {
16
16
  circle,
@@ -2,7 +2,7 @@ import ZoomHistory from './zoom_history';
2
2
  import {isStringInSupportedScript} from '../util/script_detection';
3
3
  import {plugin as rtlTextPlugin} from '../source/rtl_text_plugin';
4
4
 
5
- import type {TransitionSpecification} from '../style-spec/types';
5
+ import type {TransitionSpecification} from '../style-spec/types.g';
6
6
 
7
7
  export type CrossfadeParameters = {
8
8
  fromScale: number;
@@ -3,7 +3,7 @@ import styleSpec from '../style-spec/reference/latest';
3
3
  import Color from '../style-spec/util/color';
4
4
  import {sphericalToCartesian} from '../util/util';
5
5
  import EvaluationParameters from './evaluation_parameters';
6
- import {LightSpecification} from '../style-spec/types';
6
+ import {LightSpecification} from '../style-spec/types.g';
7
7
  import {TransitionParameters} from './properties';
8
8
 
9
9
  const spec = styleSpec.light;
@@ -21,7 +21,7 @@ import type {
21
21
  TransitionParameters
22
22
  } from './properties';
23
23
 
24
- import type {LightSpecification} from '../style-spec/types';
24
+ import type {LightSpecification} from '../style-spec/types.g';
25
25
 
26
26
  type LightPosition = {
27
27
  x: number;
@@ -10,7 +10,7 @@ import {StylePropertySpecification} from '../style-spec/style-spec';
10
10
  import {
11
11
  TransitionSpecification,
12
12
  PropertyValueSpecification
13
- } from '../style-spec/types';
13
+ } from '../style-spec/types.g';
14
14
 
15
15
  import {
16
16
  normalizePropertyExpression,
@@ -15,7 +15,7 @@ import {OverscaledTileID} from '../source/tile_id';
15
15
  import {fakeXhr, fakeServer} from 'nise';
16
16
  import {WorkerGlobalScopeInterface} from '../util/web_worker';
17
17
  import EvaluationParameters from './evaluation_parameters';
18
- import {LayerSpecification, GeoJSONSourceSpecification, FilterSpecification, SourceSpecification} from '../style-spec/types';
18
+ import {LayerSpecification, GeoJSONSourceSpecification, FilterSpecification, SourceSpecification} from '../style-spec/types.g';
19
19
  import {SourceClass} from '../source/source';
20
20
  import GeoJSONSource from '../source/geojson_source';
21
21
 
@@ -57,7 +57,7 @@ import type {
57
57
  StyleSpecification,
58
58
  LightSpecification,
59
59
  SourceSpecification
60
- } from '../style-spec/types';
60
+ } from '../style-spec/types.g';
61
61
  import type {CustomLayerInterface} from './style_layer/custom_style_layer';
62
62
  import type {Validator} from './validate_style';
63
63
  import type {OverscaledTileID} from '../source/tile_id';
@@ -4,7 +4,7 @@ import properties, {BackgroundPaintPropsPossiblyEvaluated} from './background_st
4
4
  import {Transitionable, Transitioning, PossiblyEvaluated} from '../properties';
5
5
 
6
6
  import type {BackgroundPaintProps} from './background_style_layer_properties.g';
7
- import type {LayerSpecification} from '../../style-spec/types';
7
+ import type {LayerSpecification} from '../../style-spec/types.g';
8
8
 
9
9
  class BackgroundStyleLayer extends StyleLayer {
10
10
  _transitionablePaint: Transitionable<BackgroundPaintProps>;
@@ -11,7 +11,7 @@ import type {FeatureState} from '../../style-spec/expression';
11
11
  import type Transform from '../../geo/transform';
12
12
  import type {Bucket, BucketParameters} from '../../data/bucket';
13
13
  import type {CircleLayoutProps, CirclePaintProps} from './circle_style_layer_properties.g';
14
- import type {LayerSpecification} from '../../style-spec/types';
14
+ import type {LayerSpecification} from '../../style-spec/types.g';
15
15
  import type {VectorTileFeature} from '@mapbox/vector-tile';
16
16
 
17
17
  class CircleStyleLayer extends StyleLayer {
@@ -2,7 +2,7 @@ import StyleLayer from '../style_layer';
2
2
  import type Map from '../../ui/map';
3
3
  import assert from 'assert';
4
4
  import {mat4} from 'gl-matrix';
5
- import {LayerSpecification} from '../../style-spec/types';
5
+ import {LayerSpecification} from '../../style-spec/types.g';
6
6
 
7
7
  type CustomRenderMethod = (gl: WebGLRenderingContext, matrix: mat4) => void;
8
8
 
@@ -11,7 +11,7 @@ import type {FeatureState} from '../../style-spec/expression';
11
11
  import type {BucketParameters} from '../../data/bucket';
12
12
  import type {FillExtrusionPaintProps} from './fill_extrusion_style_layer_properties.g';
13
13
  import type Transform from '../../geo/transform';
14
- import type {LayerSpecification} from '../../style-spec/types';
14
+ import type {LayerSpecification} from '../../style-spec/types.g';
15
15
  import type {VectorTileFeature} from '@mapbox/vector-tile';
16
16
 
17
17
  export class Point3D extends Point {
@@ -12,7 +12,7 @@ import type Point from '@mapbox/point-geometry';
12
12
  import type {FillLayoutProps, FillPaintProps} from './fill_style_layer_properties.g';
13
13
  import type EvaluationParameters from '../evaluation_parameters';
14
14
  import type Transform from '../../geo/transform';
15
- import type {LayerSpecification} from '../../style-spec/types';
15
+ import type {LayerSpecification} from '../../style-spec/types.g';
16
16
  import type {VectorTileFeature} from '@mapbox/vector-tile';
17
17
 
18
18
  class FillStyleLayer extends StyleLayer {
@@ -9,7 +9,7 @@ import {Transitionable, Transitioning, PossiblyEvaluated} from '../properties';
9
9
  import type Texture from '../../render/texture';
10
10
  import type Framebuffer from '../../gl/framebuffer';
11
11
  import type {HeatmapPaintProps} from './heatmap_style_layer_properties.g';
12
- import type {LayerSpecification} from '../../style-spec/types';
12
+ import type {LayerSpecification} from '../../style-spec/types.g';
13
13
 
14
14
  class HeatmapStyleLayer extends StyleLayer {
15
15
 
@@ -4,7 +4,7 @@ import properties, {HillshadePaintPropsPossiblyEvaluated} from './hillshade_styl
4
4
  import {Transitionable, Transitioning, PossiblyEvaluated} from '../properties';
5
5
 
6
6
  import type {HillshadePaintProps} from './hillshade_style_layer_properties.g';
7
- import type {LayerSpecification} from '../../style-spec/types';
7
+ import type {LayerSpecification} from '../../style-spec/types.g';
8
8
 
9
9
  class HillshadeStyleLayer extends StyleLayer {
10
10
  _transitionablePaint: Transitionable<HillshadePaintProps>;
@@ -14,7 +14,7 @@ import type {FeatureState, ZoomConstantExpression} from '../../style-spec/expres
14
14
  import type {Bucket, BucketParameters} from '../../data/bucket';
15
15
  import type {LineLayoutProps, LinePaintProps} from './line_style_layer_properties.g';
16
16
  import type Transform from '../../geo/transform';
17
- import type {LayerSpecification} from '../../style-spec/types';
17
+ import type {LayerSpecification} from '../../style-spec/types.g';
18
18
  import type {VectorTileFeature} from '@mapbox/vector-tile';
19
19
 
20
20
  class LineFloorwidthProperty extends DataDrivenProperty<number> {