File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed
packages/maptalks/src/map Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -723,7 +723,7 @@ Map.include(/** @lends Map.prototype */{
723723 const fov = this . getFov ( ) * Math . PI / 180 ;
724724 const farZ = this . _getCameraFar ( fov , this . getPitch ( ) ) ;
725725 this . cameraFar = farZ ;
726- this . cameraNear = this . cameraCenterDistance / 20 ;
726+ this . cameraNear = this . cameraCenterDistance / 20 * this . options [ 'cameraNearScale' ] ;
727727 // camera projection matrix
728728 const projMatrix = this . projMatrix || createMat4 ( ) ;
729729 const isWebGPU = this . options . renderer === 'gpu' ;
Original file line number Diff line number Diff line change @@ -170,6 +170,7 @@ const options: MapOptionsType = {
170170 'maxFPS' : 0 ,
171171 'debug' : false ,
172172 'cameraFarUndergroundInMeter' : 2000 ,
173+ 'cameraNearScale' : 1 ,
173174
174175 'onlyWebGL1' : false ,
175176 'forceRedrawPerFrame' : false ,
@@ -2944,6 +2945,7 @@ export type MapOptionsType = {
29442945 forceRedrawPerFrame ?: boolean ;
29452946 extensions ?: string [ ] ;
29462947 optionalExtensions ?: string [ ] ;
2948+ cameraNearScale ?: number ;
29472949}
29482950
29492951export type MapCreateOptionsType = {
You can’t perform that action at this time.
0 commit comments