@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.
- package/README.md +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +4 -11
- package/dist/index.js.map +1 -1
- package/package.json +2 -3
- package/src/color/abstract.ts +0 -202
- package/src/color/hsl.test.ts +0 -176
- package/src/color/hsl.ts +0 -193
- package/src/color/hsv.test.ts +0 -169
- package/src/color/hsv.ts +0 -189
- package/src/color/index.test.ts +0 -187
- package/src/color/index.ts +0 -37
- package/src/color/random.test.ts +0 -111
- package/src/color/random.ts +0 -269
- package/src/color/rgb.test.ts +0 -218
- package/src/color/rgb.ts +0 -371
- package/src/color/utils.test.ts +0 -85
- package/src/color/utils.ts +0 -17
- package/src/guess_style/guess_style.test.ts +0 -140
- package/src/guess_style/guess_style.ts +0 -251
- package/src/guess_style/index.ts +0 -2
- package/src/index.test.ts +0 -131
- package/src/index.ts +0 -123
- package/src/lib/utils.test.ts +0 -281
- package/src/lib/utils.ts +0 -123
- package/src/shortbread/index.ts +0 -2
- package/src/shortbread/layers.test.ts +0 -81
- package/src/shortbread/layers.ts +0 -602
- package/src/shortbread/properties.test.ts +0 -44
- package/src/shortbread/properties.ts +0 -156
- package/src/shortbread/template.test.ts +0 -49
- package/src/shortbread/template.ts +0 -336
- package/src/style_builder/decorator.test.ts +0 -68
- package/src/style_builder/decorator.ts +0 -150
- package/src/style_builder/recolor.test.ts +0 -328
- package/src/style_builder/recolor.ts +0 -244
- package/src/style_builder/style_builder.test.ts +0 -148
- package/src/style_builder/style_builder.ts +0 -141
- package/src/style_builder/types.ts +0 -154
- package/src/styles/LICENSE.md +0 -41
- package/src/styles/colorful.test.ts +0 -91
- package/src/styles/colorful.ts +0 -1177
- package/src/styles/eclipse.ts +0 -11
- package/src/styles/empty.ts +0 -10
- package/src/styles/graybeard.ts +0 -11
- package/src/styles/index.ts +0 -34
- package/src/styles/neutrino.ts +0 -427
- package/src/styles/satellite.test.ts +0 -146
- package/src/styles/satellite.ts +0 -106
- package/src/styles/shadow.ts +0 -11
- package/src/types/index.ts +0 -5
- package/src/types/maplibre.ts +0 -25
- package/src/types/tilejson.test.ts +0 -96
- package/src/types/tilejson.ts +0 -147
- package/src/types/vector_layer.test.ts +0 -68
- package/src/types/vector_layer.ts +0 -67
package/README.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -668,7 +668,7 @@ type StyleBuilderFonts = {
|
|
|
668
668
|
|
|
669
669
|
interface SatelliteStyleOptions {
|
|
670
670
|
baseUrl?: string;
|
|
671
|
-
|
|
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
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
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',
|