maplibre-gl 3.0.0-pre.5 → 3.0.0-pre.6

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 (48) hide show
  1. package/README.md +1 -1
  2. package/build/generate-style-code.ts +5 -5
  3. package/dist/maplibre-gl-csp-worker.js +1 -1
  4. package/dist/maplibre-gl-csp-worker.js.map +1 -1
  5. package/dist/maplibre-gl-csp.js +1 -1
  6. package/dist/maplibre-gl-csp.js.map +1 -1
  7. package/dist/maplibre-gl-dev.js +278 -432
  8. package/dist/maplibre-gl-dev.js.map +1 -1
  9. package/dist/maplibre-gl.d.ts +17 -29
  10. package/dist/maplibre-gl.js +7 -3
  11. package/dist/maplibre-gl.js.map +1 -1
  12. package/package.json +22 -20
  13. package/src/geo/lng_lat_bounds.test.ts +15 -1
  14. package/src/geo/lng_lat_bounds.ts +4 -0
  15. package/src/gl/context.ts +35 -31
  16. package/src/gl/state.test.ts +4 -4
  17. package/src/gl/value.ts +11 -11
  18. package/src/gl/webgl2.ts +12 -0
  19. package/src/index.ts +3 -3
  20. package/src/render/draw_heatmap.ts +4 -2
  21. package/src/render/painter.ts +2 -51
  22. package/src/render/vertex_array_object.ts +15 -30
  23. package/src/source/raster_dem_tile_source.ts +1 -1
  24. package/src/source/raster_tile_source.test.ts +31 -0
  25. package/src/source/raster_tile_source.ts +2 -2
  26. package/src/source/source_cache.test.ts +30 -0
  27. package/src/source/source_cache.ts +1 -1
  28. package/src/style/light.ts +9 -8
  29. package/src/style/style_layer/background_style_layer_properties.g.ts +3 -4
  30. package/src/style/style_layer/circle_style_layer_properties.g.ts +5 -6
  31. package/src/style/style_layer/fill_extrusion_style_layer_properties.g.ts +3 -4
  32. package/src/style/style_layer/fill_style_layer_properties.g.ts +5 -6
  33. package/src/style/style_layer/heatmap_style_layer_properties.g.ts +3 -4
  34. package/src/style/style_layer/hillshade_style_layer_properties.g.ts +3 -4
  35. package/src/style/style_layer/line_style_layer.ts +6 -3
  36. package/src/style/style_layer/line_style_layer_properties.g.ts +5 -6
  37. package/src/style/style_layer/raster_style_layer_properties.g.ts +3 -4
  38. package/src/style/style_layer/symbol_style_layer_properties.g.ts +5 -6
  39. package/src/ui/control/geolocate_control.test.ts +20 -3
  40. package/src/ui/control/geolocate_control.ts +6 -5
  41. package/src/ui/map/requestRenderFrame.test.ts +18 -2
  42. package/src/ui/map.test.ts +41 -0
  43. package/src/ui/map.ts +20 -47
  44. package/src/util/ajax.ts +4 -3
  45. package/src/util/image_request.test.ts +137 -89
  46. package/src/util/image_request.ts +104 -33
  47. package/src/util/test/util.ts +10 -2
  48. package/src/util/worker_pool.ts +3 -1
package/README.md CHANGED
@@ -68,7 +68,7 @@ Maplibre v1 is completely backward compatible with Mapbox v1. This compatibility
68
68
 
69
69
  #### CDN Links
70
70
 
71
- > MapLibre GL JS is distributed via [unpkg.com](https://unpkg.com). For more information, please see [MapLibre GL is on unpkg.com](./docs/README-unpkg.md#maplibre-gl-on-unpkgcom).
71
+ > MapLibre GL JS is distributed via [unpkg.com](https://unpkg.com). For more information, please see [MapLibre GL is on unpkg.com](./documents_and_diagrams/README-unpkg.md#maplibre-gl-on-unpkgcom).
72
72
 
73
73
  ```diff
74
74
  - <script src="https://api.mapbox.com/mapbox-gl-js/v#.#.#/mapbox-gl.js"></script>
@@ -223,7 +223,8 @@ export type ${layerType}LayoutPropsPossiblyEvaluated = {`);
223
223
  output.push(
224
224
  `};
225
225
 
226
- const layout: Properties<${layerType}LayoutProps> = new Properties({`);
226
+ let layout: Properties<${layerType}LayoutProps>;
227
+ const getLayout = () => layout = layout || new Properties({`);
227
228
 
228
229
  for (const property of layoutProperties) {
229
230
  output.push(
@@ -263,7 +264,8 @@ export type ${layerType}PaintPropsPossiblyEvaluated = {`);
263
264
 
264
265
  output.push(
265
266
  `
266
- const paint: Properties<${layerType}PaintProps> = new Properties({`);
267
+ let paint: Properties<${layerType}PaintProps>;
268
+ const getPaint = () => paint = paint || new Properties({`);
267
269
 
268
270
  for (const property of paintProperties) {
269
271
  output.push(
@@ -273,9 +275,7 @@ const paint: Properties<${layerType}PaintProps> = new Properties({`);
273
275
  output.push(
274
276
  `});
275
277
 
276
- export default ({ paint${layoutProperties.length ? ', layout' : ''} } as {
277
- paint: Properties<${layerType}PaintProps>${layoutProperties.length ? `,\n layout: Properties<${layerType}LayoutProps>` : ''}
278
- });`);
278
+ export default ({ get paint() { return getPaint() }${layoutProperties.length ? ', get layout() { return getLayout() }' : ''} });`);
279
279
 
280
280
  return output.join('\n');
281
281
  }