Merge pull request #735 from antvis/fix_vite

fix: 循环引用
This commit is contained in:
@thinkinggis 2021-08-04 17:17:48 +08:00 committed by GitHub
commit bfd7cbb70d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 25 deletions

View File

@ -1,10 +1,5 @@
import { decodePickingColor, DOM, encodePickingColor } from '@antv/l7-utils'; import { decodePickingColor, DOM, encodePickingColor } from '@antv/l7-utils';
import { inject, injectable } from 'inversify'; import { inject, injectable } from 'inversify';
import {
IMapService,
IRendererService,
IShaderModuleService,
} from '../../index';
import { TYPES } from '../../types'; import { TYPES } from '../../types';
import { IGlobalConfigService, ISceneConfig } from '../config/IConfigService'; import { IGlobalConfigService, ISceneConfig } from '../config/IConfigService';
import { import {
@ -16,6 +11,7 @@ import { ILayer, ILayerService } from '../layer/ILayerService';
import { ILngLat } from '../map/IMapService'; import { ILngLat } from '../map/IMapService';
import { gl } from '../renderer/gl'; import { gl } from '../renderer/gl';
import { IFramebuffer } from '../renderer/IFramebuffer'; import { IFramebuffer } from '../renderer/IFramebuffer';
import { IRendererService } from '../renderer/IRendererService';
import { IPickingService } from './IPickingService'; import { IPickingService } from './IPickingService';
@injectable() @injectable()

View File

@ -1,14 +1,12 @@
import { inject, injectable } from 'inversify'; import { inject, injectable } from 'inversify';
import {
IMapService,
IRendererService,
IShaderModuleService,
} from '../../../index';
import { TYPES } from '../../../types'; import { TYPES } from '../../../types';
import { ICameraService } from '../../camera/ICameraService'; import { ICameraService } from '../../camera/ICameraService';
import { IInteractionService } from '../../interaction/IInteractionService'; import { IInteractionService } from '../../interaction/IInteractionService';
import { ILayer, ILayerService } from '../../layer/ILayerService'; import { ILayer, ILayerService } from '../../layer/ILayerService';
import { IMapService } from '../../map/IMapService';
import { IShaderModuleService } from '../../shader/IShaderModuleService';
import { IPass, PassType } from '../IMultiPassRenderer'; import { IPass, PassType } from '../IMultiPassRenderer';
import { IRendererService } from '../IRendererService';
/** /**
* Pass * Pass

View File

@ -1,11 +1,10 @@
import { inject, injectable } from 'inversify'; import { inject, injectable } from 'inversify';
import { camelCase, isNil, upperFirst } from 'lodash'; import { camelCase, isNil, upperFirst } from 'lodash';
import { import { IShaderModuleService } from '../../shader/IShaderModuleService';
gl, import { gl } from '../gl';
IModel, import { IModel } from '../IModel';
IRendererService, import { IRendererService } from '../IRendererService';
IShaderModuleService,
} from '../../../index';
import quad from '../../../shaders/post-processing/quad.glsl'; import quad from '../../../shaders/post-processing/quad.glsl';
import { TYPES } from '../../../types'; import { TYPES } from '../../../types';
import { ILayer } from '../../layer/ILayerService'; import { ILayer } from '../../layer/ILayerService';

View File

@ -48,16 +48,16 @@ export default class LngLat {
public toArray(): [number, number] { public toArray(): [number, number] {
return [this.lng, this.lat]; return [this.lng, this.lat];
} }
public toBounds(radius: number = 0) { // public toBounds(radius: number = 0) {
const earthCircumferenceInMetersAtEquator = 40075017; // const earthCircumferenceInMetersAtEquator = 40075017;
const latAccuracy = (360 * radius) / earthCircumferenceInMetersAtEquator; // const latAccuracy = (360 * radius) / earthCircumferenceInMetersAtEquator;
const lngAccuracy = latAccuracy / Math.cos((Math.PI / 180) * this.lat); // const lngAccuracy = latAccuracy / Math.cos((Math.PI / 180) * this.lat);
return new LngLatBounds( // return new LngLatBounds(
new LngLat(this.lng - lngAccuracy, this.lat - latAccuracy), // new LngLat(this.lng - lngAccuracy, this.lat - latAccuracy),
new LngLat(this.lng + lngAccuracy, this.lat + latAccuracy), // new LngLat(this.lng + lngAccuracy, this.lat + latAccuracy),
); // );
} // }
public toString() { public toString() {
return `LngLat(${this.lng}, ${this.lat})`; return `LngLat(${this.lng}, ${this.lat})`;
} }