diff --git a/demo/index.ts b/demo/index.ts index bbcdd3a..8262da0 100644 --- a/demo/index.ts +++ b/demo/index.ts @@ -29,6 +29,7 @@ async function start() { groundCoveringColor: 'rgba(0, 0, 0, 0.8)', minZoom: 15, maxZoom: 20, + modelsNearCameraFade: 0, }); (window as any).gltfPlugin = plugin; diff --git a/src/defaultOptions.ts b/src/defaultOptions.ts index 7b37910..a17dbcc 100644 --- a/src/defaultOptions.ts +++ b/src/defaultOptions.ts @@ -7,6 +7,7 @@ export const defaultOptions: Required = { }, modelsBaseUrl: '', modelsLoadStrategy: 'waitAll', + modelsNearCameraFade: 2500, labelGroupDefaults: { fontSize: DEFAULT_FONT_SIZE, fontColor: DEFAULT_FONT_COLOR, diff --git a/src/plugin.ts b/src/plugin.ts index 5ae78fa..6dd8e54 100644 --- a/src/plugin.ts +++ b/src/plugin.ts @@ -158,6 +158,7 @@ export class GltfPlugin extends Evented { zIndex: this.options.zIndex, minZoom: options.minZoom ?? this.options.minZoom, maxZoom: options.maxZoom ?? this.options.maxZoom, + nearCameraFade: this.options.modelsNearCameraFade, }); const model: Model = { diff --git a/src/types/plugin.ts b/src/types/plugin.ts index 9e724f1..ef912ee 100644 --- a/src/types/plugin.ts +++ b/src/types/plugin.ts @@ -89,6 +89,7 @@ export interface PluginOptions { minZoom?: number; maxZoom?: number; + modelsNearCameraFade?: number; } /**