maplibre-gl 2.1.6 → 2.1.8-pre.2

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 (85) hide show
  1. package/build/generate-query-test-fixtures.ts +7 -5
  2. package/build/generate-style-spec.ts +1 -1
  3. package/build/readme.md +1 -1
  4. package/build/rollup_plugins.ts +7 -7
  5. package/dist/maplibre-gl-csp-worker.js +2 -0
  6. package/dist/maplibre-gl-csp-worker.js.map +1 -0
  7. package/dist/maplibre-gl-csp.js +2 -0
  8. package/dist/maplibre-gl-csp.js.map +1 -0
  9. package/dist/maplibre-gl-dev.js +101 -299
  10. package/dist/maplibre-gl.css +1 -1
  11. package/dist/maplibre-gl.d.ts +54 -66
  12. package/dist/maplibre-gl.js +3 -3
  13. package/dist/maplibre-gl.js.map +1 -1
  14. package/package.json +8 -10
  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/bucket/symbol_bucket.ts +1 -1
  19. package/src/data/feature_index.ts +4 -3
  20. package/src/geo/transform.test.ts +14 -0
  21. package/src/geo/transform.ts +4 -4
  22. package/src/render/draw_symbol.test.ts +152 -0
  23. package/src/render/draw_symbol.ts +76 -32
  24. package/src/render/glyph_manager.ts +17 -1
  25. package/src/render/painter.ts +2 -2
  26. package/src/render/program/fill_extrusion_program.ts +1 -1
  27. package/src/render/uniform_binding.ts +1 -1
  28. package/src/source/geojson_source.ts +1 -1
  29. package/src/source/geojson_worker_source.test.ts +1 -1
  30. package/src/source/image_source.ts +1 -1
  31. package/src/source/query_features.ts +4 -3
  32. package/src/source/raster_dem_tile_source.ts +1 -1
  33. package/src/source/raster_tile_source.ts +3 -5
  34. package/src/source/source.ts +1 -1
  35. package/src/source/source_cache.test.ts +66 -0
  36. package/src/source/source_cache.ts +11 -3
  37. package/src/source/tile.ts +3 -2
  38. package/src/source/vector_tile_source.ts +1 -1
  39. package/src/source/vector_tile_worker_source.ts +2 -4
  40. package/src/source/video_source.ts +1 -1
  41. package/src/source/worker.test.ts +1 -1
  42. package/src/source/worker.ts +1 -1
  43. package/src/source/worker_source.ts +1 -1
  44. package/src/source/worker_tile.ts +1 -1
  45. package/src/style/create_style_layer.ts +1 -1
  46. package/src/style/evaluation_parameters.ts +1 -1
  47. package/src/style/light.test.ts +1 -1
  48. package/src/style/light.ts +1 -1
  49. package/src/style/properties.ts +1 -1
  50. package/src/style/style.test.ts +10 -3
  51. package/src/style/style.ts +16 -22
  52. package/src/style/style_layer/background_style_layer.ts +1 -1
  53. package/src/style/style_layer/circle_style_layer.ts +3 -3
  54. package/src/style/style_layer/custom_style_layer.ts +1 -1
  55. package/src/style/style_layer/fill_extrusion_style_layer.ts +2 -2
  56. package/src/style/style_layer/fill_style_layer.ts +1 -1
  57. package/src/style/style_layer/heatmap_style_layer.ts +1 -1
  58. package/src/style/style_layer/hillshade_style_layer.ts +1 -1
  59. package/src/style/style_layer/line_style_layer.ts +1 -1
  60. package/src/style/style_layer/raster_style_layer.ts +1 -1
  61. package/src/style/style_layer/symbol_style_layer.ts +2 -2
  62. package/src/style/style_layer/symbol_style_layer_properties.g.ts +2 -2
  63. package/src/style/style_layer.test.ts +1 -1
  64. package/src/style/style_layer.ts +1 -1
  65. package/src/style/style_layer_index.ts +1 -1
  66. package/src/style-spec/expression/index.ts +1 -1
  67. package/src/style-spec/feature_filter/convert.ts +1 -1
  68. package/src/style-spec/feature_filter/feature_filter.test.ts +1 -1
  69. package/src/style-spec/migrate/expressions.ts +1 -1
  70. package/src/style-spec/reference/v8.json +6 -0
  71. package/src/style-spec/{types.ts → types.g.ts} +1 -1
  72. package/src/style-spec/visit.ts +1 -1
  73. package/src/symbol/collision_index.test.ts +18 -0
  74. package/src/symbol/collision_index.ts +3 -2
  75. package/src/symbol/projection.test.ts +12 -0
  76. package/src/symbol/projection.ts +16 -14
  77. package/src/symbol/symbol_layout.ts +2 -2
  78. package/src/symbol/symbol_size.ts +4 -2
  79. package/src/ui/control/logo_control.test.ts +1 -1
  80. package/src/ui/events.ts +1 -1
  81. package/src/ui/map.test.ts +1 -1
  82. package/src/ui/map.ts +30 -42
  83. package/src/util/ajax.test.ts +12 -4
  84. package/src/util/ajax.ts +16 -7
  85. package/src/util/vectortile_to_geojson.ts +17 -5
@@ -1,8 +1,12 @@
1
- import path from 'path';
1
+ import path, {dirname} from 'path';
2
2
  import fs from 'fs';
3
3
  import glob from 'glob';
4
4
  import localizeURLs from '../test/integration/lib/localize-urls';
5
+ import {fileURLToPath} from 'url';
6
+ import {createRequire} from 'module';
5
7
 
8
+ const __dirname = dirname(fileURLToPath(import.meta.url));
9
+ const requireFn = createRequire(import.meta.url);
6
10
  const OUTPUT_FILE = 'fixtures.json';
7
11
  const rootFixturePath = 'test/integration/query/';
8
12
  const suitePath = 'tests';
@@ -50,7 +54,7 @@ function generateFixtureJson(rootDirectory: string, suiteDirectory: string, outp
50
54
  throw new Error(`${extension} is incompatible , file path ${fixturePath}`);
51
55
  }
52
56
  } catch (e) {
53
- console.log(`Error parsing file: ${fixturePath}`);
57
+ console.log(`Error parsing file: ${fixturePath} ${e.message}`);
54
58
  malformedTests[testName] = true;
55
59
  }
56
60
  }
@@ -101,8 +105,7 @@ function pngToBase64Str(filePath) {
101
105
 
102
106
  function processStyle(testName, style) {
103
107
  const clone = JSON.parse(JSON.stringify(style));
104
-
105
- localizeURLs(clone, 7357);
108
+ localizeURLs(clone, 7357, path.join(__dirname, '../test/integration'), requireFn);
106
109
 
107
110
  clone.metadata = clone.metadata || {};
108
111
 
@@ -118,6 +121,5 @@ function processStyle(testName, style) {
118
121
 
119
122
  return clone;
120
123
  }
121
-
122
124
  // @ts-ignore
123
125
  await generateFixtureJson(rootFixturePath, suitePath);
@@ -114,7 +114,7 @@ function layerType(key) {
114
114
 
115
115
  const layerTypes = Object.keys(spec.layer.type.values);
116
116
 
117
- fs.writeFileSync('src/style-spec/types.ts',
117
+ fs.writeFileSync('src/style-spec/types.g.ts',
118
118
  `// Generated code; do not edit. Edit build/generate-style-spec.ts instead.
119
119
  /* eslint-disable */
120
120
 
package/build/readme.md CHANGED
@@ -8,7 +8,7 @@ The bundeling process can be split into several steps:
8
8
  `npm run build-css`
9
9
  This command will compile the css code and create the css file.
10
10
 
11
- `npm run build-prod` or `npm run build-prod-min` or `npm run build-dev`
11
+ `npm run build-prod` and `npm run build-dev`
12
12
  These commands will use rollup to bundle the code. This is where the magic happens and uses some files in this folder.
13
13
 
14
14
  `banner.ts` is used to create a banner at the beginning of the output file
@@ -17,7 +17,7 @@ export const nodeResolve = resolve({
17
17
  preferBuiltins: false
18
18
  });
19
19
 
20
- export const plugins = (minified: boolean, production: boolean): Plugin[] => [
20
+ export const plugins = (production: boolean): Plugin[] => [
21
21
  minifyStyleSpec(),
22
22
  json(),
23
23
  // https://github.com/zaach/jison/issues/351
@@ -29,20 +29,20 @@ export const plugins = (minified: boolean, production: boolean): Plugin[] => [
29
29
  '_token_stack:': ''
30
30
  }
31
31
  }),
32
- production ? strip({
32
+ production && strip({
33
33
  sourceMap: true,
34
34
  functions: ['PerformanceUtils.*', 'Debug.*']
35
- }) : false,
36
- minified ? terser({
35
+ }),
36
+ production && terser({
37
37
  compress: {
38
38
  // eslint-disable-next-line camelcase
39
39
  pure_getters: true,
40
40
  passes: 3
41
41
  }
42
- }) : false,
43
- production ? unassert({
42
+ }),
43
+ production && unassert({
44
44
  include: ['**/*'], // by default, unassert only includes .js files
45
- }) : false,
45
+ }),
46
46
  nodeResolve,
47
47
  typescript(),
48
48
  commonjs({