Skip to content

Commit

Permalink
support custom nearCameraFade
Browse files Browse the repository at this point in the history
  • Loading branch information
alxart committed Jul 9, 2024
1 parent 2cfe1e7 commit b4d5929
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions demo/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/defaultOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export const defaultOptions: Required<PluginOptions> = {
},
modelsBaseUrl: '',
modelsLoadStrategy: 'waitAll',
modelsNearCameraFade: 2500,
labelGroupDefaults: {
fontSize: DEFAULT_FONT_SIZE,
fontColor: DEFAULT_FONT_COLOR,
Expand Down
1 change: 1 addition & 0 deletions src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ export class GltfPlugin extends Evented<GltfPluginEventTable> {
zIndex: this.options.zIndex,
minZoom: options.minZoom ?? this.options.minZoom,
maxZoom: options.maxZoom ?? this.options.maxZoom,
nearCameraFade: this.options.modelsNearCameraFade,
});

const model: Model = {
Expand Down
1 change: 1 addition & 0 deletions src/types/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ export interface PluginOptions {

minZoom?: number;
maxZoom?: number;
modelsNearCameraFade?: number;
}

/**
Expand Down

0 comments on commit b4d5929

Please sign in to comment.