tileserver-gl-light 5.4.0-pre.0 → 5.4.0-pre.1

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/CHANGELOG.md CHANGED
@@ -1,11 +1,13 @@
1
1
  # tileserver-gl changelog
2
2
 
3
- ## 5.4.0-pre.0
3
+ ## 5.4.0-pre.1
4
4
  * Fix the issue where the tile URL cannot be correctly parsed with the HTTPS protocol when using an nginx proxy service (https://github.com/maptiler/tileserver-gl/pull/1578) by @dakanggo
5
5
  * Use jemalloc as memory allocator in the docker image (https://github.com/maptiler/tileserver-gl/pull/1574) by @MichielMortier
6
6
  * Rasters: Add tileSize to TileJSON (https://github.com/maptiler/tileserver-gl/pull/1559) by @roblabs
7
7
  * Allow a 'sparse' option per data source (https://github.com/maptiler/tileserver-gl/pull/1558) by @acalcutt
8
8
  * Updates Maplibre-gl-js to v5.6.0 and adds color-relief support (note: this is not yet supported by maplibre-native) (https://github.com/maptiler/tileserver-gl/pull/1591)
9
+ * Fix getPublicUrl to handle relative and absolute URLs (https://github.com/maptiler/tileserver-gl/pull/1472) by @Monnte
10
+ * Workaround for 'hillshade-method' not yet being suported in maplibre-native (https://github.com/maptiler/tileserver-gl/pull/1620) by @acalcutt
9
11
 
10
12
  ## 5.3.0
11
13
  * Fix - Include public\resources js files on npm publish by specifying included files in package.json (https://github.com/maptiler/tileserver-gl/pull/1490) by @acalcutt
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tileserver-gl-light",
3
- "version": "5.4.0-pre.0",
3
+ "version": "5.4.0-pre.1",
4
4
  "description": "Map tile server for JSON GL styles - serving vector tiles",
5
5
  "main": "src/main.js",
6
6
  "bin": "src/main.js",
@@ -39,12 +39,12 @@
39
39
  "@mapbox/mbtiles": "0.12.1",
40
40
  "@mapbox/polyline": "^1.2.1",
41
41
  "@mapbox/sphericalmercator": "2.0.1",
42
- "@mapbox/vector-tile": "2.0.3",
42
+ "@mapbox/vector-tile": "2.0.4",
43
43
  "@maplibre/maplibre-gl-inspect": "1.7.1",
44
44
  "@maplibre/maplibre-gl-style-spec": "23.3.0",
45
45
  "@sindresorhus/fnv1a": "3.1.0",
46
46
  "advanced-pool": "0.3.3",
47
- "axios": "^1.9.0",
47
+ "axios": "^1.10.0",
48
48
  "chokidar": "4.0.3",
49
49
  "clone": "2.1.2",
50
50
  "color": "5.0.0",
@@ -60,7 +60,7 @@
60
60
  "morgan": "1.10.0",
61
61
  "pbf": "4.0.1",
62
62
  "pmtiles": "4.3.0",
63
- "proj4": "2.17.0",
63
+ "proj4": "2.19.4",
64
64
  "sanitize-filename": "1.6.3",
65
65
  "semver": "^7.7.2",
66
66
  "tileserver-gl-styles": "2.0.0"
@@ -1276,13 +1276,65 @@ export const serve_rendered = {
1276
1276
 
1277
1277
  for (const layer of styleJSON.layers || []) {
1278
1278
  if (layer && layer.paint) {
1279
+ const layerIdForWarning = layer.id || 'unnamed-layer';
1280
+
1279
1281
  // Remove (flatten) 3D buildings
1280
1282
  if (layer.paint['fill-extrusion-height']) {
1283
+ if (verbose) {
1284
+ console.warn(
1285
+ `Warning: Layer '${layerIdForWarning}' in style '${id}' has property 'fill-extrusion-height'. ` +
1286
+ `3D extrusion may appear distorted or misleading when rendered as a static image due to camera angle limitations. ` +
1287
+ `It will be flattened (set to 0) in rendered images. ` +
1288
+ `Note: This property will still work with MapLibre GL JS vector maps.`,
1289
+ );
1290
+ }
1281
1291
  layer.paint['fill-extrusion-height'] = 0;
1282
1292
  }
1283
1293
  if (layer.paint['fill-extrusion-base']) {
1294
+ if (verbose) {
1295
+ console.warn(
1296
+ `Warning: Layer '${layerIdForWarning}' in style '${id}' has property 'fill-extrusion-base'. ` +
1297
+ `3D extrusion may appear distorted or misleading when rendered as a static image due to camera angle limitations. ` +
1298
+ `It will be flattened (set to 0) in rendered images. ` +
1299
+ `Note: This property will still work with MapLibre GL JS vector maps.`,
1300
+ );
1301
+ }
1284
1302
  layer.paint['fill-extrusion-base'] = 0;
1285
1303
  }
1304
+
1305
+ // --- Remove hillshade properties incompatible with MapLibre Native ---
1306
+ const hillshadePropertiesToRemove = [
1307
+ 'hillshade-method',
1308
+ 'hillshade-illumination-direction',
1309
+ 'hillshade-highlight-color',
1310
+ ];
1311
+
1312
+ for (const prop of hillshadePropertiesToRemove) {
1313
+ if (prop in layer.paint) {
1314
+ if (verbose) {
1315
+ console.warn(
1316
+ `Warning: Layer '${layerIdForWarning}' in style '${id}' has property '${prop}'. ` +
1317
+ `This property is not supported by MapLibre Native. ` +
1318
+ `It will be removed in rendered images. ` +
1319
+ `Note: This property will still work with MapLibre GL JS vector maps.`,
1320
+ );
1321
+ }
1322
+ delete layer.paint[prop];
1323
+ }
1324
+ }
1325
+
1326
+ // --- Remove 'hillshade-shadow-color' if it is an array. It can only be a string in MapLibre Native ---
1327
+ if (Array.isArray(layer.paint['hillshade-shadow-color'])) {
1328
+ if (verbose) {
1329
+ console.warn(
1330
+ `Warning: Layer '${layerIdForWarning}' in style '${id}' has property 'hillshade-shadow-color'. ` +
1331
+ `An array value is not supported by MapLibre Native for this property (expected string/color). ` +
1332
+ `It will be removed in rendered images. ` +
1333
+ `Note: Using an array for this property will still work with MapLibre GL JS vector maps.`,
1334
+ );
1335
+ }
1336
+ delete layer.paint['hillshade-shadow-color'];
1337
+ }
1286
1338
  }
1287
1339
  }
1288
1340
 
package/src/utils.js CHANGED
@@ -119,7 +119,11 @@ function getUrlObject(req) {
119
119
  */
120
120
  export function getPublicUrl(publicUrl, req) {
121
121
  if (publicUrl) {
122
- return publicUrl;
122
+ try {
123
+ return new URL(publicUrl).toString();
124
+ } catch {
125
+ return new URL(publicUrl, getUrlObject(req)).toString();
126
+ }
123
127
  }
124
128
  return getUrlObject(req).toString();
125
129
  }
package/test/style.js CHANGED
@@ -25,7 +25,7 @@ describe('Styles', function () {
25
25
  expect(res.body.sources).to.be.a('object');
26
26
  expect(res.body.glyphs).to.be.a('string');
27
27
  expect(res.body.sprite).to.be.a('string');
28
- expect(res.body.sprite).to.be.equal('/test/styles/test-style/sprite');
28
+ expect(res.body.sprite).to.contain('/test/styles/test-style/sprite');
29
29
  expect(res.body.layers).to.be.a('array');
30
30
  })
31
31
  .end(done);