tileserver-gl-light 5.2.2-pre.0 → 5.3.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.
@@ -126,6 +126,9 @@
126
126
  style: style
127
127
  });
128
128
 
129
+ //disabled at the moment; clarify/disable coordinates off the globe to re-enable
130
+ //map.addControl(new maplibregl.GlobeControl());
131
+
129
132
  map.addControl(new maplibregl.NavigationControl({
130
133
  visualizePitch: true,
131
134
  showZoom: true,
@@ -58,18 +58,39 @@
58
58
  var keyParam = keyMatch ? '?key=' + keyMatch[1] : '';
59
59
 
60
60
  if (preference == 'vector') {
61
- maplibregl.setRTLTextPlugin('{{public_url}}mapbox-gl-rtl-text.js' + keyParam);
61
+ maplibregl.setRTLTextPlugin('{{public_url}}mapbox-gl-rtl-text.js' + keyParam, true);
62
62
  var map = new maplibregl.Map({
63
63
  container: 'map',
64
64
  style: '{{public_url}}styles/{{id}}/style.json' + keyParam,
65
65
  hash: true,
66
66
  maxPitch: 85
67
67
  });
68
+ map.addControl(new maplibregl.GlobeControl());
68
69
  map.addControl(new maplibregl.NavigationControl({
69
70
  visualizePitch: true,
70
71
  showZoom: true,
71
72
  showCompass: true
72
73
  }));
74
+
75
+ //check if terrain is available, before enabling the control
76
+ map.on('style.load', function () {
77
+ var terrainId = null;
78
+ Object.entries(map.getStyle().sources).some(function (source) {
79
+ if (source[1].type == "raster-dem") {
80
+ terrainId = source[0];
81
+ return true;
82
+ }
83
+ });
84
+
85
+ if (terrainId) {
86
+ map.addControl(
87
+ new maplibregl.TerrainControl({
88
+ source: terrainId,
89
+ })
90
+ );
91
+ }
92
+ });
93
+
73
94
  map.addControl(new MaplibreInspect({
74
95
  showMapPopupOnHover: false,
75
96
  showInspectMapPopupOnHover: false,
package/src/render.js CHANGED
@@ -1,8 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  import { createCanvas, Image } from 'canvas';
4
-
5
- import SphericalMercator from '@mapbox/sphericalmercator';
4
+ import { SphericalMercator } from '@mapbox/sphericalmercator';
6
5
 
7
6
  const mercator = new SphericalMercator();
8
7
 
package/src/serve_data.js CHANGED
@@ -7,7 +7,7 @@ import clone from 'clone';
7
7
  import express from 'express';
8
8
  import Pbf from 'pbf';
9
9
  import { VectorTile } from '@mapbox/vector-tile';
10
- import SphericalMercator from '@mapbox/sphericalmercator';
10
+ import { SphericalMercator } from '@mapbox/sphericalmercator';
11
11
 
12
12
  import {
13
13
  fixTileJSONCenter,
@@ -20,7 +20,7 @@ import clone from 'clone';
20
20
  import Color from 'color';
21
21
  import express from 'express';
22
22
  import sanitize from 'sanitize-filename';
23
- import SphericalMercator from '@mapbox/sphericalmercator';
23
+ import { SphericalMercator } from '@mapbox/sphericalmercator';
24
24
  import mlgl from '@maplibre/maplibre-gl-native';
25
25
  import polyline from '@mapbox/polyline';
26
26
  import proj4 from 'proj4';
package/src/server.js CHANGED
@@ -10,7 +10,7 @@ import cors from 'cors';
10
10
  import enableShutdown from 'http-shutdown';
11
11
  import express from 'express';
12
12
  import handlebars from 'handlebars';
13
- import SphericalMercator from '@mapbox/sphericalmercator';
13
+ import { SphericalMercator } from '@mapbox/sphericalmercator';
14
14
  const mercator = new SphericalMercator();
15
15
  import morgan from 'morgan';
16
16
  import { serve_data } from './serve_data.js';