@versatiles/style 5.9.0 → 5.9.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 (56) hide show
  1. package/README.md +1 -0
  2. package/dist/index.d.ts +2 -2
  3. package/dist/index.js +4 -11
  4. package/dist/index.js.map +1 -1
  5. package/package.json +2 -3
  6. package/src/color/abstract.ts +0 -202
  7. package/src/color/hsl.test.ts +0 -176
  8. package/src/color/hsl.ts +0 -193
  9. package/src/color/hsv.test.ts +0 -169
  10. package/src/color/hsv.ts +0 -189
  11. package/src/color/index.test.ts +0 -187
  12. package/src/color/index.ts +0 -37
  13. package/src/color/random.test.ts +0 -111
  14. package/src/color/random.ts +0 -269
  15. package/src/color/rgb.test.ts +0 -218
  16. package/src/color/rgb.ts +0 -371
  17. package/src/color/utils.test.ts +0 -85
  18. package/src/color/utils.ts +0 -17
  19. package/src/guess_style/guess_style.test.ts +0 -140
  20. package/src/guess_style/guess_style.ts +0 -251
  21. package/src/guess_style/index.ts +0 -2
  22. package/src/index.test.ts +0 -131
  23. package/src/index.ts +0 -123
  24. package/src/lib/utils.test.ts +0 -281
  25. package/src/lib/utils.ts +0 -123
  26. package/src/shortbread/index.ts +0 -2
  27. package/src/shortbread/layers.test.ts +0 -81
  28. package/src/shortbread/layers.ts +0 -602
  29. package/src/shortbread/properties.test.ts +0 -44
  30. package/src/shortbread/properties.ts +0 -156
  31. package/src/shortbread/template.test.ts +0 -49
  32. package/src/shortbread/template.ts +0 -336
  33. package/src/style_builder/decorator.test.ts +0 -68
  34. package/src/style_builder/decorator.ts +0 -150
  35. package/src/style_builder/recolor.test.ts +0 -328
  36. package/src/style_builder/recolor.ts +0 -244
  37. package/src/style_builder/style_builder.test.ts +0 -148
  38. package/src/style_builder/style_builder.ts +0 -141
  39. package/src/style_builder/types.ts +0 -154
  40. package/src/styles/LICENSE.md +0 -41
  41. package/src/styles/colorful.test.ts +0 -91
  42. package/src/styles/colorful.ts +0 -1177
  43. package/src/styles/eclipse.ts +0 -11
  44. package/src/styles/empty.ts +0 -10
  45. package/src/styles/graybeard.ts +0 -11
  46. package/src/styles/index.ts +0 -34
  47. package/src/styles/neutrino.ts +0 -427
  48. package/src/styles/satellite.test.ts +0 -146
  49. package/src/styles/satellite.ts +0 -106
  50. package/src/styles/shadow.ts +0 -11
  51. package/src/types/index.ts +0 -5
  52. package/src/types/maplibre.ts +0 -25
  53. package/src/types/tilejson.test.ts +0 -96
  54. package/src/types/tilejson.ts +0 -147
  55. package/src/types/vector_layer.test.ts +0 -68
  56. package/src/types/vector_layer.ts +0 -67
package/README.md CHANGED
@@ -246,6 +246,7 @@ Q-->F
246
246
  R-->F
247
247
  S-->F
248
248
  T-->F
249
+ U-->C
249
250
  U-->S
250
251
  V-->F
251
252
  X-->Y
package/dist/index.d.ts CHANGED
@@ -668,7 +668,7 @@ type StyleBuilderFonts = {
668
668
 
669
669
  interface SatelliteStyleOptions {
670
670
  baseUrl?: string;
671
- rasterTiles?: string[];
671
+ rasterTilejson?: string;
672
672
  overlayTiles?: string[];
673
673
  overlay?: boolean;
674
674
  language?: Language;
@@ -679,7 +679,7 @@ interface SatelliteStyleOptions {
679
679
  rasterSaturation?: number;
680
680
  rasterContrast?: number;
681
681
  }
682
- declare function buildSatelliteStyle(options?: SatelliteStyleOptions): StyleSpecification;
682
+ declare function buildSatelliteStyle(options?: SatelliteStyleOptions): Promise<StyleSpecification>;
683
683
 
684
684
  interface StyleBuilderFunction {
685
685
  (options?: StyleBuilderOptions): StyleSpecification;
package/dist/index.js CHANGED
@@ -4043,10 +4043,9 @@ class Empty extends Colorful {
4043
4043
  }
4044
4044
  }
4045
4045
 
4046
- function buildSatelliteStyle(options) {
4046
+ async function buildSatelliteStyle(options) {
4047
4047
  options ??= {};
4048
4048
  const baseUrl = options.baseUrl ?? 'https://tiles.versatiles.org';
4049
- const rasterTiles = options.rasterTiles ?? [`${baseUrl}/tiles/satellite/{z}/{x}/{y}`];
4050
4049
  const overlay = options.overlay ?? true;
4051
4050
  let style;
4052
4051
  if (overlay) {
@@ -4108,15 +4107,9 @@ function buildSatelliteStyle(options) {
4108
4107
  if (options.rasterContrast != null)
4109
4108
  rasterPaint['raster-contrast'] = options.rasterContrast;
4110
4109
  // Add raster source
4111
- style.sources.satellite = {
4112
- type: 'raster',
4113
- tiles: rasterTiles,
4114
- tileSize: 512,
4115
- attribution: "<a href='https://versatiles.org/sources/'>VersaTiles sources</a>",
4116
- bounds: [-178.187256, -21.401934, 55.846252, 58.061897],
4117
- minzoom: 0,
4118
- maxzoom: 17,
4119
- };
4110
+ const rasterTilejsonUrl = resolveUrl(baseUrl, options.rasterTilejson ?? '/tiles/satellite/tiles.json');
4111
+ const rasterTilejson = (await fetch(rasterTilejsonUrl).then((res) => res.json()));
4112
+ style.sources.satellite = { ...rasterTilejson, type: 'raster' };
4120
4113
  // Add raster layer at bottom
4121
4114
  style.layers.unshift({
4122
4115
  id: 'satellite',