tileserver-gl-light 5.3.0 → 5.3.1-pre.0

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,5 +1,9 @@
1
1
  # tileserver-gl changelog
2
2
 
3
+ ## 5.3.1-pre.0
4
+ * bump maplibre-gl from 5.4.0 to 5.5.0 (https://github.com/maptiler/tileserver-gl/pull/1546). Fixes (https://github.com/maptiler/tileserver-gl/issues/1539) and (https://github.com/maptiler/tileserver-gl/issues/1530)
5
+ * bump @maplibre/maplibre-gl-native from 6.0.0 to 6.1.0 (https://github.com/maptiler/tileserver-gl/pull/1536).
6
+
3
7
  ## 5.3.0
4
8
  * 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
5
9
  * Fix - Various Updates and Fix RTL Plugin Load (https://github.com/maptiler/tileserver-gl/pull/1489) by @okimiko
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tileserver-gl-light",
3
- "version": "5.3.0",
3
+ "version": "5.3.1-pre.0",
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",
@@ -41,10 +41,10 @@
41
41
  "@mapbox/sphericalmercator": "2.0.1",
42
42
  "@mapbox/vector-tile": "2.0.3",
43
43
  "@maplibre/maplibre-gl-inspect": "1.7.1",
44
- "@maplibre/maplibre-gl-style-spec": "23.1.0",
44
+ "@maplibre/maplibre-gl-style-spec": "23.2.2",
45
45
  "@sindresorhus/fnv1a": "3.1.0",
46
46
  "advanced-pool": "0.3.3",
47
- "axios": "^1.8.4",
47
+ "axios": "^1.9.0",
48
48
  "chokidar": "4.0.3",
49
49
  "clone": "2.1.2",
50
50
  "color": "5.0.0",
@@ -56,7 +56,7 @@
56
56
  "http-shutdown": "1.2.2",
57
57
  "leaflet": "1.9.4",
58
58
  "leaflet-hash": "0.2.1",
59
- "maplibre-gl": "5.3.1",
59
+ "maplibre-gl": "5.5.0",
60
60
  "morgan": "1.10.0",
61
61
  "pbf": "4.0.1",
62
62
  "pmtiles": "4.3.0",
@@ -16,23 +16,32 @@ class ElevationInfoControl {
16
16
  this.controlContainer.classList.add("maplibre-ctrl-elevation");
17
17
  this.controlContainer.textContent = "Elevation: Click on Map";
18
18
 
19
+ this.marker = new maplibregl.Marker();
20
+
19
21
  map.on('click', (e) => {
20
22
  var url = this.url;
21
23
  var coord = {"z": Math.floor(map.getZoom()), "x": e.lngLat["lng"].toFixed(7), "y": e.lngLat["lat"].toFixed(7)};
22
- for(var key in coord) {
23
- url = url.replace(new RegExp('{'+ key +'}','g'), coord[key]);
24
- }
24
+ if (map.transform.isPointOnMapSurface(e.point)) {
25
+ for(var key in coord) {
26
+ url = url.replace(new RegExp('{'+ key +'}','g'), coord[key]);
27
+ }
28
+
29
+ this.marker.remove();
30
+ this.marker.setLngLat(e.lngLat).addTo(this.map);
25
31
 
26
- let request = new XMLHttpRequest();
27
- request.open("GET", url, true);
28
- request.onload = () => {
29
- if (request.status !== 200) {
30
- this.controlContainer.textContent = "Elevation: No value";
31
- } else {
32
- this.controlContainer.textContent = `Elevation: ${JSON.parse(request.responseText).elevation} (${JSON.stringify(coord)})`;
32
+ let request = new XMLHttpRequest();
33
+ request.open("GET", url, true);
34
+ request.onload = () => {
35
+ if (request.status !== 200) {
36
+ this.controlContainer.textContent = "Elevation: No value";
37
+ } else {
38
+ this.controlContainer.textContent = `Elevation: ${JSON.parse(request.responseText).elevation} (${JSON.stringify(coord)})`;
39
+ }
33
40
  }
41
+ request.send();
42
+ } else {
43
+ this.controlContainer.textContent = "Elevation: Click on Globe";
34
44
  }
35
- request.send();
36
45
  });
37
46
  return this.controlContainer;
38
47
  }
@@ -47,5 +56,7 @@ class ElevationInfoControl {
47
56
  }
48
57
  this.controlContainer.parentNode.removeChild(this.controlContainer);
49
58
  this.map = undefined;
59
+ this.marker.remove();
60
+ this.marker = undefined;
50
61
  }
51
62
  };