maplibre-gl 3.0.0-pre.2 → 3.0.0-pre.3

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 (58) hide show
  1. package/build/generate-style-code.ts +4 -0
  2. package/build/generate-style-spec.ts +3 -1
  3. package/dist/maplibre-gl-csp-worker.js +1 -1
  4. package/dist/maplibre-gl-csp.js +1 -1
  5. package/dist/maplibre-gl-dev.js +490 -128
  6. package/dist/maplibre-gl.d.ts +156 -29
  7. package/dist/maplibre-gl.js +4 -4
  8. package/dist/style-spec/index.d.ts +7 -3
  9. package/package.json +15 -17
  10. package/src/render/glyph_manager.ts +5 -0
  11. package/src/render/image_manager.ts +2 -2
  12. package/src/source/worker_tile.ts +1 -1
  13. package/src/style/load_sprite.test.ts +206 -0
  14. package/src/style/load_sprite.ts +59 -32
  15. package/src/style/style.test.ts +157 -0
  16. package/src/style/style.ts +189 -8
  17. package/src/style/validate_style.ts +2 -0
  18. package/src/style-spec/CHANGELOG.md +4 -0
  19. package/src/style-spec/README.md +0 -8
  20. package/src/style-spec/bin/{gl-style-format → gl-style-format.js} +7 -7
  21. package/src/style-spec/bin/gl-style-migrate.js +18 -0
  22. package/src/style-spec/bin/gl-style-validate.js +45 -0
  23. package/src/style-spec/feature_filter/feature_filter.test.ts +5 -0
  24. package/src/style-spec/package.json +4 -5
  25. package/src/style-spec/reference/v8.json +3 -3
  26. package/src/style-spec/style-spec.test.ts +2 -1
  27. package/src/style-spec/style-spec.ts +0 -2
  28. package/src/style-spec/types.g.ts +4 -2
  29. package/src/style-spec/validate/validate.ts +4 -1
  30. package/src/style-spec/validate/validate_array.ts +3 -3
  31. package/src/style-spec/validate/validate_function.ts +8 -3
  32. package/src/style-spec/validate/validate_layer.ts +5 -2
  33. package/src/style-spec/validate/validate_light.ts +4 -4
  34. package/src/style-spec/validate/validate_object.ts +3 -2
  35. package/src/style-spec/validate/validate_padding.test.ts +20 -19
  36. package/src/style-spec/validate/validate_padding.ts +2 -2
  37. package/src/style-spec/validate/validate_property.ts +3 -3
  38. package/src/style-spec/validate/validate_source.ts +9 -1
  39. package/src/style-spec/validate/validate_sprite.test.ts +75 -0
  40. package/src/style-spec/validate/validate_sprite.ts +55 -0
  41. package/src/style-spec/validate/validate_terrain.test.ts +6 -5
  42. package/src/style-spec/validate/validate_terrain.ts +3 -3
  43. package/src/style-spec/validate_style.min.ts +24 -10
  44. package/src/ui/handler/scroll_zoom.test.ts +24 -0
  45. package/src/ui/handler/scroll_zoom.ts +15 -5
  46. package/src/ui/handler_manager.ts +51 -36
  47. package/src/ui/map.ts +92 -0
  48. package/src/util/ajax.ts +1 -28
  49. package/src/util/dom.ts +2 -2
  50. package/src/util/style.test.ts +19 -0
  51. package/src/util/style.ts +12 -0
  52. package/src/util/util.ts +47 -2
  53. package/build/generate-debug-index-file.ts +0 -20
  54. package/src/style-spec/bin/gl-style-composite +0 -9
  55. package/src/style-spec/bin/gl-style-migrate +0 -9
  56. package/src/style-spec/bin/gl-style-validate +0 -42
  57. package/src/style-spec/composite.test.ts +0 -107
  58. package/src/style-spec/composite.ts +0 -51
@@ -29,6 +29,8 @@ function nativeType(property) {
29
29
  return 'Color';
30
30
  case 'padding':
31
31
  return 'Padding';
32
+ case 'sprite':
33
+ return 'Sprite';
32
34
  case 'formatted':
33
35
  return 'Formatted';
34
36
  case 'resolvedImage':
@@ -91,6 +93,8 @@ function runtimeType(property) {
91
93
  return 'ColorType';
92
94
  case 'padding':
93
95
  return 'PaddingType';
96
+ case 'sprite':
97
+ return 'SpriteType';
94
98
  case 'formatted':
95
99
  return 'FormattedType';
96
100
  case 'Image':
@@ -122,6 +122,8 @@ export type ColorSpecification = string;
122
122
 
123
123
  export type PaddingSpecification = number | number[];
124
124
 
125
+ export type SpriteSpecification = string | {id: string; url: string}[];
126
+
125
127
  export type FormattedSpecification = string;
126
128
 
127
129
  export type ResolvedImageSpecification = string;
@@ -174,7 +176,7 @@ export type ExpressionSpecification =
174
176
  | ['in', ExpressionInputType | ExpressionSpecification, ExpressionInputType | ExpressionSpecification]
175
177
  | ['index-of', ExpressionInputType | ExpressionSpecification, ExpressionInputType | ExpressionSpecification] // number
176
178
  | ['length', string | ExpressionSpecification]
177
- | ['slice', string | ExpressionSpecification, number | ExpressionSpecification]
179
+ | ['slice', string | ExpressionSpecification, number | ExpressionSpecification, (number | ExpressionSpecification)?]
178
180
  // Decision
179
181
  | ['!', boolean | ExpressionSpecification] // boolean
180
182
  | ['!=', ExpressionInputType | ExpressionSpecification, ExpressionInputType | ExpressionSpecification, CollatorExpressionSpecification?] // boolean