Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ export class FreeboardChartLayerComponent
url: string,
minZoom: number,
maxZoom: number,
opacity: number,
zIndex: number
): WebGLTileLayer {
const tiles = new pmtiles.PMTiles(url);
Expand Down Expand Up @@ -137,6 +138,7 @@ export class FreeboardChartLayerComponent
minZoom: minZoom
}),
style: {},
opacity: opacity,
zIndex: zIndex
});
}
Expand All @@ -146,6 +148,7 @@ export class FreeboardChartLayerComponent
url: string,
minZoom: number,
maxZoom: number,
opacity: number,
zIndex: number
): TileLayer<XYZ> {
const tiles = new pmtiles.PMTiles(url);
Expand Down Expand Up @@ -181,6 +184,7 @@ export class FreeboardChartLayerComponent
maxZoom: maxZoom,
minZoom: minZoom
}),
opacity: opacity,
zIndex: zIndex
});
}
Expand Down Expand Up @@ -216,6 +220,7 @@ export class FreeboardChartLayerComponent
? charts[i][1].minZoom - 0.1
: charts[i][1].minZoom;
const maxZ = charts[i][1].maxZoom;
const opacity = charts[i][1].opacity;

if (charts[i][1].type.toLowerCase() === 'mapstylejson') {
const lg = new LayerGroup({
Expand Down Expand Up @@ -306,6 +311,7 @@ export class FreeboardChartLayerComponent
charts[i][1].url,
charts[i][1].minZoom,
charts[i][1].maxZoom,
charts[i][1].opacity,
this.zIndex + parseInt(i)
);
} else {
Expand All @@ -322,7 +328,8 @@ export class FreeboardChartLayerComponent
preload: 0,
zIndex: this.zIndex + parseInt(i),
minZoom: minZ,
maxZoom: maxZ
maxZoom: maxZ,
opacity: opacity
});
}
}
Expand Down
5 changes: 5 additions & 0 deletions src/app/modules/skresources/resource-classes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ export class SKChart {
format: string;
minZoom = 0;
maxZoom = 24;
opacity = 1.0;
type: string;
url: string;
source: string;
Expand All @@ -143,6 +144,10 @@ export class SKChart {
typeof chart?.minzoom !== 'undefined' ? chart.minzoom : this.minZoom;
this.maxZoom =
typeof chart?.maxzoom !== 'undefined' ? chart.maxzoom : this.maxZoom;
this.opacity =
typeof chart?.opacity !== 'undefined' && !isNaN(chart?.opacity)
? chart.opacity / 100
: this.opacity;
this.type = chart?.type ? chart.type : undefined;
this.url = chart?.url ? chart.url : undefined;
this.scale =
Expand Down
1 change: 1 addition & 0 deletions src/app/types/resources/signalk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export interface ChartResource {
format?: string;
minzoom?: number;
maxzoom?: number;
opacity?: number;
type?: string;
scale?: number;
url?: string;
Expand Down