@@ -4,7 +4,8 @@ import View from 'Core/View';
4
4
import CameraUtils from 'Utils/CameraUtils' ;
5
5
6
6
import PlanarControls from 'Controls/PlanarControls' ;
7
- import PlanarLayer from './Planar/PlanarLayer' ;
7
+ import PlanarLayer from 'Core/Prefab/Planar/PlanarLayer' ;
8
+ import { ellipsoidSizes } from 'Core/Math/Ellipsoid' ;
8
9
9
10
class PlanarView extends View {
10
11
/**
@@ -29,7 +30,6 @@ class PlanarView extends View {
29
30
*/
30
31
constructor ( viewerDiv , options = { } ) {
31
32
THREE . Object3D . DEFAULT_UP . set ( 0 , 0 , 1 ) ;
32
-
33
33
if ( arguments . length > 2 || options . isExtent ) {
34
34
console . warn ( "Deprecated: change in arguments, 'extent' should be set in options" ) ;
35
35
// eslint-disable-next-line prefer-rest-params
@@ -43,7 +43,7 @@ class PlanarView extends View {
43
43
super ( extent . crs , viewerDiv , options ) ;
44
44
this . isPlanarView = true ;
45
45
46
- const tileLayer = new PlanarLayer ( 'planar' , extent , options . object3d , options ) ;
46
+ const tileLayer = new PlanarLayer ( 'planar' , options . object3d , options ) ;
47
47
this . mainLoop . gfxEngine . label2dRenderer . infoTileLayer = tileLayer . info ;
48
48
49
49
this . addLayer ( tileLayer ) ;
@@ -52,8 +52,10 @@ class PlanarView extends View {
52
52
// Configure camera
53
53
const dim = extent . planarDimensions ( ) ;
54
54
const max = Math . max ( dim . x , dim . y ) ;
55
- this . camera3D . near = 0.1 ;
56
- this . camera3D . far = this . camera3D . isOrthographicCamera ? 2000 : 2 * max ;
55
+ // this.camera3D.near = 0.1;
56
+ // this.camera3D.far = this.camera3D.isOrthographicCamera ? 2000 : 2 * max;
57
+ this . camera3D . near = Math . max ( 15.0 , 0.000002352 * ellipsoidSizes . x ) ;
58
+ this . camera3D . far = ellipsoidSizes . x * 10 ;
57
59
this . camera3D . updateProjectionMatrix ( ) ;
58
60
59
61
const placement = options . placement || { } ;
0 commit comments