mirror of https://gitee.com/antv-l7/antv-l7
commit
bfd7cbb70d
|
@ -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()
|
||||||
|
|
|
@ -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 基类
|
||||||
|
|
|
@ -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';
|
||||||
|
|
|
@ -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})`;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue