aviation-chart 0.3.20 → 0.3.22
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/dist/nav-sdk.esm.js +1 -53
- package/package.json +2 -1
package/dist/nav-sdk.esm.js
CHANGED
|
@@ -5053,49 +5053,6 @@ function getChartAmmSource(apiUrl) {
|
|
|
5053
5053
|
maxzoom: 18,
|
|
5054
5054
|
};
|
|
5055
5055
|
}
|
|
5056
|
-
function getTerrainSource(apiUrl, terrainUrl) {
|
|
5057
|
-
const url = terrainUrl ?? `${apiUrl.replace(/\/$/, "")}/api/terrain/{z}/{x}/{y}.png`;
|
|
5058
|
-
return {
|
|
5059
|
-
type: "raster-dem",
|
|
5060
|
-
tiles: [url],
|
|
5061
|
-
tileSize: 256,
|
|
5062
|
-
maxzoom: 13,
|
|
5063
|
-
};
|
|
5064
|
-
}
|
|
5065
|
-
const TERRAIN_COLOR_RAMP = [
|
|
5066
|
-
"interpolate", ["linear"], ["elevation"],
|
|
5067
|
-
0, "#a8c98a",
|
|
5068
|
-
600, "#cdd98a",
|
|
5069
|
-
1200, "#e8d79a",
|
|
5070
|
-
2400, "#c79a5b",
|
|
5071
|
-
3600, "#9c6b3f",
|
|
5072
|
-
4500, "#f2efe9",
|
|
5073
|
-
];
|
|
5074
|
-
function getTerrainLayers() {
|
|
5075
|
-
return [
|
|
5076
|
-
{
|
|
5077
|
-
id: "terrain-color",
|
|
5078
|
-
type: "color-relief",
|
|
5079
|
-
source: "terrain",
|
|
5080
|
-
layout: { visibility: "none" },
|
|
5081
|
-
paint: { "color-relief-color": TERRAIN_COLOR_RAMP },
|
|
5082
|
-
},
|
|
5083
|
-
{
|
|
5084
|
-
id: "terrain-hillshade",
|
|
5085
|
-
type: "hillshade",
|
|
5086
|
-
source: "terrain",
|
|
5087
|
-
layout: { visibility: "none" },
|
|
5088
|
-
paint: {
|
|
5089
|
-
"hillshade-shadow-color": "rgba(74,59,42,0.35)",
|
|
5090
|
-
"hillshade-highlight-color": "rgba(255,246,230,0.25)",
|
|
5091
|
-
"hillshade-accent-color": "rgba(74,59,42,0.2)",
|
|
5092
|
-
"hillshade-exaggeration": 0.45,
|
|
5093
|
-
"hillshade-illumination-direction": 315,
|
|
5094
|
-
"hillshade-illumination-anchor": "viewport",
|
|
5095
|
-
},
|
|
5096
|
-
},
|
|
5097
|
-
];
|
|
5098
|
-
}
|
|
5099
5056
|
async function fetchGzJson(url, headers = {}) {
|
|
5100
5057
|
const res = await fetch(url, { headers });
|
|
5101
5058
|
if (!res.ok)
|
|
@@ -6357,15 +6314,6 @@ class MapSDK {
|
|
|
6357
6314
|
continue;
|
|
6358
6315
|
this.map.addLayer(layer, ammBefore);
|
|
6359
6316
|
}
|
|
6360
|
-
if (!this.map.getSource("terrain")) {
|
|
6361
|
-
this.map.addSource("terrain", getTerrainSource(this._chartApiUrl, this.initialOptions.terrainUrl));
|
|
6362
|
-
}
|
|
6363
|
-
for (const layer of getTerrainLayers()) {
|
|
6364
|
-
if (this.map.getLayer(layer.id))
|
|
6365
|
-
continue;
|
|
6366
|
-
const before = ammBefore;
|
|
6367
|
-
this.map.addLayer(layer, before);
|
|
6368
|
-
}
|
|
6369
6317
|
const initialLayers = this.initialOptions.layers ?? {};
|
|
6370
6318
|
const merged = {
|
|
6371
6319
|
...DEFAULT_LAYER_VISIBILITY,
|
|
@@ -6596,7 +6544,7 @@ class MapSDK {
|
|
|
6596
6544
|
this.hideLayers(present);
|
|
6597
6545
|
}
|
|
6598
6546
|
if (group === "terrain") {
|
|
6599
|
-
this.map.setTerrain(visible ? { source: "terrain", exaggeration:
|
|
6547
|
+
this.map.setTerrain(visible ? { source: "terrain", exaggeration: 1 } : null);
|
|
6600
6548
|
}
|
|
6601
6549
|
}
|
|
6602
6550
|
flyTo(option, eventData) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aviation-chart",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.22",
|
|
4
4
|
"description": "KunYu aviation map SDK",
|
|
5
5
|
"main": "dist/nav-sdk.esm.js",
|
|
6
6
|
"module": "dist/nav-sdk.esm.js",
|
|
@@ -71,6 +71,7 @@
|
|
|
71
71
|
"@turf/length": "^6.5.0",
|
|
72
72
|
"documentation": "^14.0.3",
|
|
73
73
|
"lodash": "^4.17.21",
|
|
74
|
+
"maplibre-contour": "^0.1.0",
|
|
74
75
|
"maplibre-gl": "^5.24.0",
|
|
75
76
|
"proj4": "^2.20.2",
|
|
76
77
|
"topojson-client": "^3.1.0",
|