This commit is contained in:
2912401452 2021-08-11 13:54:19 +08:00
commit 188401f6d7
79 changed files with 130 additions and 256 deletions

View File

@ -103,7 +103,8 @@ module.exports = api => {
}
],
isCDNBundle ? {} : [
'transform-import-styles'
'transform-import-css-l7'
// 'transform-import-styles' // babel 编译将样式打包到js
],
[
// @see https://github.com/babel/babel/issues/8741#issuecomment-509041135

View File

@ -14,7 +14,7 @@
"message": "chore: publish"
}
},
"version": "2.5.5",
"version": "2.5.8",
"npmClient": "yarn",
"useWorkspaces": true,
"publishConfig": {

View File

@ -50,6 +50,7 @@
"babel-plugin-inline-import": "^3.0.0",
"babel-plugin-inline-webgl-constants": "^1.0.1",
"babel-plugin-lodash": "^3.3.4",
"babel-plugin-transform-import-css-l7": "^0.0.4",
"babel-plugin-transform-import-styles": "^0.0.11",
"babel-plugin-transform-inline-environment-variables": "^0.4.3",
"babel-plugin-transform-node-env-inline": "^0.4.3",
@ -85,7 +86,6 @@
"jest-styled-components": "^6.2.1",
"lerna": "^3.16.4",
"lint-staged": "^9.2.4",
"load-styles": "^2.0.0",
"node-sass": "^4.12.0",
"npm-run-all": "^4.1.5",
"postcss": "^7.0.18",

View File

@ -1,6 +1,6 @@
{
"name": "@antv/l7-component",
"version": "2.5.5",
"version": "2.5.8",
"description": "",
"main": "lib/index.js",
"module": "es/index.js",
@ -25,12 +25,12 @@
"author": "lzxue",
"license": "ISC",
"dependencies": {
"@antv/l7-core": "^2.5.5",
"@antv/l7-utils": "^2.5.5",
"@antv/l7-core": "^2.5.8",
"@antv/l7-utils": "^2.5.8",
"@babel/runtime": "^7.7.7",
"eventemitter3": "^4.0.0",
"inversify": "^5.0.1",
"load-styles": "^2.0.0"
"reflect-metadata": "^0.1.13"
},
"gitHead": "7eb8382ede52d803fae13a85fe6af074400260ee",
"publishConfig": {

View File

@ -1,6 +1,6 @@
{
"name": "@antv/l7-core",
"version": "2.5.5",
"version": "2.5.8",
"description": "",
"main": "lib/index.js",
"module": "es/index.js",
@ -24,7 +24,7 @@
"license": "ISC",
"dependencies": {
"@antv/async-hook": "^2.1.0",
"@antv/l7-utils": "^2.5.5",
"@antv/l7-utils": "^2.5.8",
"@babel/runtime": "^7.7.7",
"@mapbox/tiny-sdf": "^1.1.1",
"ajv": "^6.10.2",
@ -35,7 +35,6 @@
"inversify": "^5.0.1",
"inversify-inject-decorators": "^3.1.0",
"lodash": "^4.17.15",
"merge-json-schemas": "^1.0.0",
"probe.gl": "^3.1.1",
"reflect-metadata": "^0.1.13",
"viewport-mercator-project": "^6.2.1"

View File

@ -44,7 +44,6 @@ export * from './services/asset/IFontService';
export * from './services/component/IControlService';
export * from './services/component/IMarkerService';
export * from './services/component/IPopupService';
export * from './services/log/ILogService';
export * from './services/interaction/IInteractionService';
export * from './services/interaction/IPickingService';

View File

@ -20,7 +20,6 @@ import { IInteractionService } from './services/interaction/IInteractionService'
import { IPickingService } from './services/interaction/IPickingService';
import { ILayerService } from './services/layer/ILayerService';
import { IStyleAttributeService } from './services/layer/IStyleAttributeService';
import { ILogService } from './services/log/ILogService';
import { ISceneService } from './services/scene/ISceneService';
import { IShaderModuleService } from './services/shader/IShaderModuleService';
@ -37,7 +36,6 @@ import InteractionService from './services/interaction/InteractionService';
import PickingService from './services/interaction/PickingService';
import LayerService from './services/layer/LayerService';
import StyleAttributeService from './services/layer/StyleAttributeService';
import LogService from './services/log/LogService';
import SceneService from './services/scene/SceneService';
import ShaderModuleService from './services/shader/ShaderModuleService';
@ -83,10 +81,6 @@ container
.bind<IShaderModuleService>(TYPES.IShaderModuleService)
.to(ShaderModuleService)
.inSingletonScope();
container
.bind<ILogService>(TYPES.ILogService)
.to(LogService)
.inSingletonScope();
// container
// .bind<IFontService>(TYPES.IFontService)
// .to(FontService)

View File

@ -2,6 +2,7 @@ import { LRUCache } from '@antv/l7-utils';
// @ts-ignore
import TinySDF from '@mapbox/tiny-sdf';
import { inject, injectable } from 'inversify';
import 'reflect-metadata';
import { buildMapping } from '../../utils/font_util';
import {
IFontAtlas,

View File

@ -2,6 +2,7 @@
import TinySDF from '@mapbox/tiny-sdf';
import { EventEmitter } from 'eventemitter3';
import { inject, injectable } from 'inversify';
import 'reflect-metadata';
import { TYPES } from '../../types';
import { buildIconMaping } from '../../utils/font_util';
import { ITexture2D } from '../renderer/ITexture2D';

View File

@ -1,5 +1,6 @@
import { mat4 } from 'gl-matrix';
import { inject, injectable } from 'inversify';
import 'reflect-metadata';
import { ICameraService, IViewport } from './ICameraService';
@injectable()

View File

@ -1,5 +1,6 @@
import { DOM } from '@antv/l7-utils';
import { Container, injectable } from 'inversify';
import 'reflect-metadata';
import { TYPES } from '../../types';
import { IMapService } from '../map/IMapService';
import {

View File

@ -1,4 +1,5 @@
import { Container, injectable } from 'inversify';
import 'reflect-metadata';
import { TYPES } from '../../types';
import { IMapService } from '../map/IMapService';
import {

View File

@ -1,4 +1,5 @@
import { Container, injectable } from 'inversify';
import 'reflect-metadata';
import { TYPES } from '../../types';
import { IMapService } from '../map/IMapService';
import { IPopup, IPopupService } from './IPopupService';

View File

@ -1,6 +1,7 @@
// import Ajv from 'ajv';
import { injectable, postConstruct } from 'inversify';
import { merge } from 'lodash';
import 'reflect-metadata';
import { ILayerConfig } from '../layer/ILayerService';
import { IRenderConfig } from '../renderer/IRendererService';
import { IGlobalConfigService, ISceneConfig } from './IConfigService';

View File

@ -1,5 +1,6 @@
import { mat4, vec4 } from 'gl-matrix';
import { inject, injectable } from 'inversify';
import 'reflect-metadata';
import { TYPES } from '../../types';
import { getDistanceScales } from '../../utils/project';
import { ICameraService } from '../camera/ICameraService';

View File

@ -1,9 +1,9 @@
import EventEmitter from 'eventemitter3';
import Hammer from 'hammerjs';
import { inject, injectable } from 'inversify';
import 'reflect-metadata';
// @ts-ignore
import { TYPES } from '../../types';
import { ILogService } from '../log/ILogService';
import { ILngLat, IMapService } from '../map/IMapService';
import { IInteractionService, InteractionEvent } from './IInteractionService';
const DragEventMap: { [key: string]: string } = {
@ -22,9 +22,6 @@ export default class InteractionService extends EventEmitter
@inject(TYPES.IMapService)
private readonly mapService: IMapService;
@inject(TYPES.ILogService)
private readonly logger: ILogService;
private hammertime: HammerManager;
private lastClickTime: number = 0;
@ -91,7 +88,6 @@ export default class InteractionService extends EventEmitter
this.hammertime = hammertime;
// TODO: 根据场景注册事件到 L7 canvas 上
this.logger.debug('add event listeners on canvas');
}
}
private removeEventListenerOnMap() {

View File

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

View File

@ -197,10 +197,7 @@ export interface ILayer {
off(type: string, handler: (...args: any[]) => void): void;
emit(type: string, handler: unknown): void;
once(type: string, handler: (...args: any[]) => void): void;
/**
* JSON Schema
*/
getConfigSchemaForValidation(): object;
isDirty(): boolean;
/**
* 使

View File

@ -1,4 +1,5 @@
import { inject, injectable } from 'inversify';
import 'reflect-metadata';
import { ILayer } from '../..';
import { TYPES } from '../../types';
import Clock from '../../utils/clock';

View File

@ -1,4 +1,5 @@
import { inject, injectable, optional } from 'inversify';
import 'reflect-metadata';
import { TYPES } from '../../types';
import { gl } from '../renderer/gl';
import { IAttribute } from '../renderer/IAttribute';

View File

@ -1,6 +0,0 @@
export interface ILogService {
error(message: string): void;
warn(message: string): void;
info(message: string): void;
debug(message: string): void;
}

View File

@ -1,29 +0,0 @@
import { injectable } from 'inversify';
import Probe, { Log } from 'probe.gl';
import { ILogService } from './ILogService';
// !process.env.NODE_ENV === 'production',
const Logger = new Log({ id: 'L7' }).enable(
// @ts-ignore
process.env.NODE_ENV !== 'production',
);
// // 只输出 debug 级别以上的日志信息
Logger.priority = 5;
@injectable()
export default class LogService implements ILogService {
public error(message: string): void {
Logger.error(message)();
}
public warn(message: string): void {
Logger.probe(1, message)();
}
public info(message: string): void {
Logger.info(3, message)();
}
public debug(message: string): void {
Logger.probe(4, message)();
}
}

View File

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

View File

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

View File

@ -1,4 +1,5 @@
import { injectable } from 'inversify';
import 'reflect-metadata';
import { ILayer } from '../../layer/ILayerService';
import BaseNormalPass from './BaseNormalPass';

View File

@ -1,4 +1,5 @@
import { inject, injectable } from 'inversify';
import 'reflect-metadata';
import { TYPES } from '../../../types';
import { ILayer } from '../../layer/ILayerService';
import {

View File

@ -1,12 +1,12 @@
import { decodePickingColor, DOM, encodePickingColor } from '@antv/l7-utils';
import { inject, injectable } from 'inversify';
import 'reflect-metadata';
import { TYPES } from '../../../types';
import {
IInteractionTarget,
InteractionEvent,
} from '../../interaction/IInteractionService';
import { ILayer } from '../../layer/ILayerService';
import { ILogService } from '../../log/ILogService';
import { ILngLat } from '../../map/IMapService';
import { gl } from '../gl';
import { IFramebuffer } from '../IFramebuffer';
@ -21,9 +21,6 @@ import BaseNormalPass from './BaseNormalPass';
export default class PixelPickingPass<
InitializationOptions = {}
> extends BaseNormalPass<InitializationOptions> {
@inject(TYPES.ILogService)
protected readonly logger: ILogService;
/**
* picking framebuffer attributes
*/
@ -169,7 +166,6 @@ export default class PixelPickingPass<
pickedColors[1] !== 0 ||
pickedColors[2] !== 0
) {
this.logger.debug('picked');
const pickedFeatureIdx = decodePickingColor(pickedColors);
const rawFeature = this.layer
.getSource()

View File

@ -1,4 +1,5 @@
import { inject, injectable, postConstruct } from 'inversify';
import 'reflect-metadata';
import { TYPES } from '../../../types';
import { ILayer } from '../../layer/ILayerService';
import { gl } from '../gl';

View File

@ -1,4 +1,5 @@
import { injectable } from 'inversify';
import 'reflect-metadata';
import { ILayer } from '../../layer/ILayerService';
import { PassType } from '../IMultiPassRenderer';
import BaseNormalPass from './BaseNormalPass';

View File

@ -1,10 +1,10 @@
import { inject, injectable } from 'inversify';
import 'reflect-metadata';
import blendFS from '../../../shaders/post-processing/blend.glsl';
import copyFS from '../../../shaders/post-processing/copy.glsl';
import quadVS from '../../../shaders/post-processing/quad.glsl';
import { TYPES } from '../../../types';
import { ILayer } from '../../layer/ILayerService';
import { ILogService } from '../../log/ILogService';
import { IShaderModuleService } from '../../shader/IShaderModuleService';
import { gl } from '../gl';
import { IFramebuffer } from '../IFramebuffer';
@ -42,9 +42,6 @@ export default class TAAPass<InitializationOptions = {}> extends BaseNormalPass<
@inject(TYPES.IShaderModuleService)
protected readonly shaderModuleService: IShaderModuleService;
@inject(TYPES.ILogService)
protected readonly logger: ILogService;
/**
*
*/
@ -192,8 +189,6 @@ export default class TAAPass<InitializationOptions = {}> extends BaseNormalPass<
}
private doRender(layer: ILayer) {
this.logger.debug(`accumulatingId: ${this.accumulatingId}`);
const { clear, getViewportSize, useFramebuffer } = this.rendererService;
const { width, height } = getViewportSize();
const { jitterScale = 1 } = layer.getLayerConfig();

View File

@ -1,5 +1,6 @@
import { injectable } from 'inversify';
import { isNil } from 'lodash';
import 'reflect-metadata';
import blur from '../../../../shaders/post-processing/blur.glsl';
import quad from '../../../../shaders/post-processing/quad.glsl';
import { IUniform } from '../../IUniform';

View File

@ -1,4 +1,5 @@
import { injectable } from 'inversify';
import 'reflect-metadata';
import colorHalftone from '../../../../shaders/post-processing/colorhalftone.glsl';
import quad from '../../../../shaders/post-processing/quad.glsl';
import BasePostProcessingPass from '../BasePostProcessingPass';

View File

@ -1,4 +1,5 @@
import { injectable } from 'inversify';
import 'reflect-metadata';
import copy from '../../../../shaders/post-processing/copy.glsl';
import quad from '../../../../shaders/post-processing/quad.glsl';
import BasePostProcessingPass from '../BasePostProcessingPass';

View File

@ -1,4 +1,5 @@
import { injectable } from 'inversify';
import 'reflect-metadata';
import hexagonalPixelate from '../../../../shaders/post-processing/hexagonalpixelate.glsl';
import quad from '../../../../shaders/post-processing/quad.glsl';
import BasePostProcessingPass from '../BasePostProcessingPass';

View File

@ -1,4 +1,5 @@
import { injectable } from 'inversify';
import 'reflect-metadata';
import ink from '../../../../shaders/post-processing/ink.glsl';
import quad from '../../../../shaders/post-processing/quad.glsl';
import BasePostProcessingPass from '../BasePostProcessingPass';

View File

@ -1,4 +1,5 @@
import { injectable } from 'inversify';
import 'reflect-metadata';
import noise from '../../../../shaders/post-processing/noise.glsl';
import quad from '../../../../shaders/post-processing/quad.glsl';
import BasePostProcessingPass from '../BasePostProcessingPass';

View File

@ -1,4 +1,5 @@
import { injectable } from 'inversify';
import 'reflect-metadata';
import quad from '../../../../shaders/post-processing/quad.glsl';
import sepia from '../../../../shaders/post-processing/sepia.glsl';
import BasePostProcessingPass from '../BasePostProcessingPass';

View File

@ -4,6 +4,7 @@ import { DOM } from '@antv/l7-utils';
import elementResizeEvent, { unbind } from 'element-resize-event';
import { EventEmitter } from 'eventemitter3';
import { inject, injectable } from 'inversify';
import 'reflect-metadata';
import { TYPES } from '../../types';
import { createRendererContainer } from '../../utils/dom';
import { IFontService } from '../asset/IFontService';
@ -21,7 +22,6 @@ import {
} from '../interaction/IInteractionService';
import { IPickingService } from '../interaction/IPickingService';
import { ILayer, ILayerService } from '../layer/ILayerService';
import { ILogService } from '../log/ILogService';
import { IMapCamera, IMapConfig, IMapService } from '../map/IMapService';
import { IRenderConfig, IRendererService } from '../renderer/IRendererService';
import { IShaderModuleService } from '../shader/IShaderModuleService';
@ -54,9 +54,6 @@ export default class Scene extends EventEmitter implements ISceneService {
@inject(TYPES.IControlService)
private readonly controlService: IControlService;
@inject(TYPES.ILogService)
private readonly logger: ILogService;
@inject(TYPES.IGlobalConfigService)
private readonly configService: IGlobalConfigService;
@ -183,7 +180,6 @@ export default class Scene extends EventEmitter implements ISceneService {
InteractionEvent.Drag,
this.addSceneEvent.bind(this),
);
this.logger.debug(`map ${this.id} loaded`);
});
/**
@ -219,11 +215,9 @@ export default class Scene extends EventEmitter implements ISceneService {
.matchMedia('screen and (-webkit-min-device-pixel-ratio: 1.5)')
.addListener(this.handleWindowResized);
} else {
this.logger.error('容器 id 不存在');
console.error('容器 id 不存在');
}
this.pickingService.init(this.id);
this.logger.debug(`scene ${this.id} renderer loaded`);
});
// TODOinit worker, fontAtlas...
@ -234,7 +228,6 @@ export default class Scene extends EventEmitter implements ISceneService {
}
public addLayer(layer: ILayer) {
this.logger.debug(`add layer ${layer.name} to scene ${this.id}`);
this.layerService.add(layer);
this.render();
}
@ -258,7 +251,6 @@ export default class Scene extends EventEmitter implements ISceneService {
await document.fonts.load(`24px ${this.fontFamily}`, 'L7text');
}
// FIXME: 初始化 marker 容器,可以放到 map 初始化方法中?
this.logger.info(' render inited');
this.layerService.initLayers();
this.controlService.addControls();
this.loaded = true;
@ -270,7 +262,6 @@ export default class Scene extends EventEmitter implements ISceneService {
this.layerService.renderLayers();
// 组件需要等待layer 初始化完成之后添加
this.logger.debug(`scene ${this.id} render`);
this.rendering = false;
}

View File

@ -1,5 +1,6 @@
import { inject, injectable } from 'inversify';
import { uniq } from 'lodash';
import 'reflect-metadata';
import { extractUniforms } from '../../utils/shader-module';
import { IModuleParams, IShaderModuleService } from './IShaderModuleService';

View File

@ -7,7 +7,6 @@ const TYPES = {
ILayerService: Symbol.for('ILayerService'),
ILayerMappingService: Symbol.for('ILayerMappingService'),
ILayerStyleService: Symbol.for('ILayerStyleService'),
ILogService: Symbol.for('ILogService'),
IMapService: Symbol.for('IMapService'),
IMarkerService: Symbol.for('IMarkerService'),
IPopupService: Symbol.for('PopupService'),

View File

@ -1,6 +1,6 @@
{
"name": "@antv/l7",
"version": "2.5.5",
"version": "2.5.8",
"description": "A Large-scale WebGL-powered Geospatial Data Visualization",
"main": "lib/index.js",
"module": "es/index.js",
@ -25,12 +25,12 @@
"author": "antv",
"license": "MIT",
"dependencies": {
"@antv/l7-component": "^2.5.5",
"@antv/l7-core": "^2.5.5",
"@antv/l7-layers": "^2.5.5",
"@antv/l7-maps": "^2.5.5",
"@antv/l7-scene": "^2.5.5",
"@antv/l7-utils": "^2.5.5",
"@antv/l7-component": "^2.5.8",
"@antv/l7-core": "^2.5.8",
"@antv/l7-layers": "^2.5.8",
"@antv/l7-maps": "^2.5.8",
"@antv/l7-scene": "^2.5.8",
"@antv/l7-utils": "^2.5.8",
"@babel/runtime": "^7.7.7"
},
"gitHead": "7eb8382ede52d803fae13a85fe6af074400260ee",

View File

@ -1,2 +1,2 @@
const version = '2.5.5';
const version = '2.5.7';
export { version };

View File

@ -1,6 +1,6 @@
{
"name": "@antv/l7-layers",
"version": "2.5.5",
"version": "2.5.8",
"description": "L7's collection of built-in layers",
"main": "lib/index.js",
"module": "es/index.js",
@ -24,9 +24,9 @@
"license": "ISC",
"dependencies": {
"@antv/async-hook": "^2.1.0",
"@antv/l7-core": "^2.5.5",
"@antv/l7-source": "^2.5.5",
"@antv/l7-utils": "^2.5.5",
"@antv/l7-core": "^2.5.8",
"@antv/l7-source": "^2.5.8",
"@antv/l7-utils": "^2.5.8",
"@babel/runtime": "^7.7.7",
"@mapbox/martini": "^0.2.0",
"@turf/meta": "^6.0.2",

View File

@ -19,7 +19,6 @@ import {
ILayerModelInitializationOptions,
ILayerPlugin,
ILayerService,
ILogService,
IMapService,
IModel,
IModelInitializationOptions,
@ -48,8 +47,6 @@ import { encodePickingColor } from '@antv/l7-utils';
import { EventEmitter } from 'eventemitter3';
import { Container } from 'inversify';
import { isFunction, isObject } from 'lodash';
// @ts-ignore
import mergeJsonSchemas from 'merge-json-schemas';
import { normalizePasses } from '../plugins/MultiPassRendererPlugin';
import { BlendTypes } from '../utils/blend';
import { handleStyleDataMapping } from '../utils/dataMappingStyle';
@ -114,9 +111,6 @@ export default class BaseLayer<ChildLayerStyleOptions = {}> extends EventEmitter
public layerModel: ILayerModel;
@lazyInject(TYPES.ILogService)
protected readonly logger: ILogService;
@lazyInject(TYPES.IGlobalConfigService)
protected readonly configService: IGlobalConfigService;
@ -807,18 +801,6 @@ export default class BaseLayer<ChildLayerStyleOptions = {}> extends EventEmitter
public getEncodedData() {
return this.encodedData;
}
public getConfigSchemaForValidation() {
if (!this.configSchema) {
// 相比 allOf, merge 有一些优势
// @see https://github.com/goodeggs/merge-json-schemas
this.configSchema = mergeJsonSchemas([
baseLayerSchema,
this.getConfigSchema(),
]);
}
return this.configSchema;
}
public getLegendItems(name: string): any {
const scale = this.styleAttributeService.getLayerAttributeScale(name);
if (scale) {

View File

@ -10,6 +10,7 @@ import {
import { generateColorRamp, IColorRamp } from '@antv/l7-utils';
import { mat4 } from 'gl-matrix';
import { inject, injectable } from 'inversify';
import 'reflect-metadata';
import BaseModel from '../../core/BaseModel';
import { HeatmapTriangulation } from '../../core/triangulation';
import heatmap3DFrag from '../shaders/heatmap_3d_frag.glsl';

View File

@ -4,7 +4,6 @@ import {
IEncodeFeature,
ILayer,
ILayerPlugin,
ILogService,
IModel,
IModelUniform,
IRasterParserDataItem,

View File

@ -1,43 +0,0 @@
// import {
// IGlobalConfigService,
// ILayer,
// ILayerPlugin,
// ILogService,
// TYPES,
// } from '@antv/l7-core';
// import { inject, injectable } from 'inversify';
// /**
// * Layer 初始化阶段以及重绘阶段首先校验传入参数,如果校验失败则中断后续插件处理。
// */
// @injectable()
// export default class ConfigSchemaValidationPlugin implements ILayerPlugin {
// @inject(TYPES.IGlobalConfigService)
// private readonly configService: IGlobalConfigService;
// @inject(TYPES.ILogService)
// private readonly logger: ILogService;
// public apply(layer: ILayer) {
// layer.hooks.init.tap('ConfigSchemaValidationPlugin', () => {
// this.configService.registerLayerConfigSchemaValidator(
// layer.name as string,
// layer.getConfigSchemaForValidation(),
// );
// const { valid, errorText } = this.configService.validateLayerConfig(
// layer.name as string,
// layer.getLayerConfig(),
// );
// if (!valid) {
// this.logger.error(errorText || '');
// // 中断 init 过程
// return false;
// }
// });
// layer.hooks.beforeRender.tap('ConfigSchemaValidationPlugin', () => {
// // TODO: 配置项发生变化,需要重新校验
// });
// }
// }

View File

@ -5,7 +5,6 @@ import {
ILayer,
ILayerPlugin,
ILngLat,
ILogService,
IMapService,
IParseDataItem,
IStyleAttribute,
@ -15,15 +14,13 @@ import {
import { rgb2arr, unProjectFlat } from '@antv/l7-utils';
import { inject, injectable } from 'inversify';
import { cloneDeep } from 'lodash';
import 'reflect-metadata';
@injectable()
export default class DataMappingPlugin implements ILayerPlugin {
@inject(TYPES.IGlobalConfigService)
private readonly configService: IGlobalConfigService;
@inject(TYPES.ILogService)
private readonly logger: ILogService;
@inject(TYPES.IMapService)
private readonly mapService: IMapService;
@ -79,7 +76,6 @@ export default class DataMappingPlugin implements ILayerPlugin {
),
);
}
this.logger.debug('remapping finished');
// 处理文本更新
layer.emit('remapping', null);
}

View File

@ -8,6 +8,7 @@ import {
import Source from '@antv/l7-source';
import { injectable } from 'inversify';
import { cloneDeep } from 'lodash';
import 'reflect-metadata';
@injectable()
export default class DataSourcePlugin implements ILayerPlugin {

View File

@ -2,7 +2,6 @@ import {
IGlobalConfigService,
ILayer,
ILayerPlugin,
ILogService,
IScale,
IScaleOptions,
IStyleAttribute,
@ -18,6 +17,7 @@ import { extent, ticks } from 'd3-array';
import * as d3 from 'd3-scale';
import { inject, injectable } from 'inversify';
import { isNil, isString, uniq } from 'lodash';
import 'reflect-metadata';
const dateRegex = /^(?:(?!0000)[0-9]{4}([-/.]+)(?:(?:0?[1-9]|1[0-2])\1(?:0?[1-9]|1[0-9]|2[0-8])|(?:0?[13-9]|1[0-2])\1(?:29|30)|(?:0?[13578]|1[02])\1(?:31))|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)([-/.]?)0?2\2(?:29))(\s+([01]|([01][0-9]|2[0-3])):([0-9]|[0-5][0-9]):([0-9]|[0-5][0-9]))?$/;
@ -40,10 +40,6 @@ const scaleMap = {
export default class FeatureScalePlugin implements ILayerPlugin {
@inject(TYPES.IGlobalConfigService)
private readonly configService: IGlobalConfigService;
@inject(TYPES.ILogService)
private readonly logger: ILogService;
// key = field_attribute name
private scaleCache: {
[field: string]: IStyleScale;
@ -96,7 +92,6 @@ export default class FeatureScalePlugin implements ILayerPlugin {
);
if (attributesToRescale.length) {
this.caculateScalesForAttributes(attributesToRescale, dataArray);
this.logger.debug('rescale finished');
}
}
});

View File

@ -10,6 +10,7 @@ import {
TYPES,
} from '@antv/l7-core';
import { inject, injectable } from 'inversify';
import 'reflect-metadata';
@injectable()
export default class LayerAnimateStylePlugin implements ILayerPlugin {

View File

@ -1,5 +1,6 @@
import { ILayer, ILayerPlugin, IMapService, TYPES } from '@antv/l7-core';
import { injectable } from 'inversify';
import 'reflect-metadata';
/**
* Layer Model
*/

View File

@ -2,6 +2,7 @@ import { ILayer, ILayerPlugin, IMapService, TYPES } from '@antv/l7-core';
import Source from '@antv/l7-source';
import { encodePickingColor, rgb2arr } from '@antv/l7-utils';
import { injectable } from 'inversify';
import 'reflect-metadata';
/**
*
*/

View File

@ -9,6 +9,7 @@ import {
TYPES,
} from '@antv/l7-core';
import { inject, injectable } from 'inversify';
import 'reflect-metadata';
const lightTypeUniformMap = {
directional: {

View File

@ -8,6 +8,7 @@ import {
TYPES,
} from '@antv/l7-core';
import { inject, injectable } from 'inversify';
import 'reflect-metadata';
/**
* 'blurH' -> ['blurH', {}]

View File

@ -13,6 +13,7 @@ import {
rgb2arr,
} from '@antv/l7-utils';
import { injectable } from 'inversify';
import 'reflect-metadata';
const PickingStage = {
NONE: 0.0,

View File

@ -4,21 +4,17 @@ import {
IEncodeFeature,
ILayer,
ILayerPlugin,
ILogService,
IStyleAttributeService,
TYPES,
} from '@antv/l7-core';
import { inject, injectable } from 'inversify';
import { isNumber } from 'lodash';
import 'reflect-metadata';
/**
* Layer indices attribute
*/
@injectable()
export default class RegisterStyleAttributePlugin implements ILayerPlugin {
@inject(TYPES.ILogService)
private readonly logger: ILogService;
public apply(
layer: ILayer,
{

View File

@ -11,6 +11,7 @@ import {
} from '@antv/l7-core';
import { DOM } from '@antv/l7-utils';
import { inject, injectable } from 'inversify';
import 'reflect-metadata';
/**
* Shader Uniform

View File

@ -1,5 +1,6 @@
import { ILayer, ILayerPlugin, IMapService, TYPES } from '@antv/l7-core';
import { injectable } from 'inversify';
import 'reflect-metadata';
/**
* Model
*/

View File

@ -1,20 +1,17 @@
import {
ILayer,
ILayerPlugin,
ILogService,
IStyleAttributeService,
TYPES,
} from '@antv/l7-core';
import { inject, injectable } from 'inversify';
import 'reflect-metadata';
/**
* Layer indices attribute
*/
@injectable()
export default class UpdateStyleAttributePlugin implements ILayerPlugin {
@inject(TYPES.ILogService)
private readonly logger: ILogService;
public apply(
layer: ILayer,
{
@ -65,9 +62,6 @@ export default class UpdateStyleAttributePlugin implements ILayerPlugin {
attribute.featureRange.endIndex,
);
attribute.needRegenerateVertices = false;
this.logger.debug(
`regenerate vertex attributes: ${attribute.name} finished`,
);
});
}
@ -89,7 +83,6 @@ export default class UpdateStyleAttributePlugin implements ILayerPlugin {
attribute.featureRange.endIndex,
);
attribute.needRegenerateVertices = false;
this.logger.debug(`init vertex attributes: ${attribute.name} finished`);
});
}
}

View File

@ -5,7 +5,6 @@ import {
ILayer,
ILayerModel,
ILayerPlugin,
ILogService,
IModel,
IStyleAttributeService,
lazyInject,

View File

@ -4,7 +4,6 @@ import {
IEncodeFeature,
ILayer,
ILayerPlugin,
ILogService,
IModel,
IModelUniform,
IRasterParserDataItem,

View File

@ -4,7 +4,6 @@ import {
IEncodeFeature,
ILayer,
ILayerPlugin,
ILogService,
IModelUniform,
IRasterParserDataItem,
IStyleAttributeService,

View File

@ -1,6 +1,6 @@
{
"name": "@antv/l7-map",
"version": "2.5.5",
"version": "2.5.8",
"description": "l7 map",
"keywords": [],
"author": "thinkinggis <lzx199065@gmail.com>",
@ -37,7 +37,7 @@
},
"homepage": "https://github.com/antvis/L7#readme",
"dependencies": {
"@antv/l7-utils": "^2.5.5",
"@antv/l7-utils": "^2.5.8",
"@babel/runtime": "^7.7.7",
"@mapbox/point-geometry": "^0.1.0",
"@mapbox/unitbezier": "^0.0.0",

View File

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

View File

@ -1,6 +1,6 @@
{
"name": "@antv/l7-maps",
"version": "2.5.5",
"version": "2.5.8",
"description": "",
"main": "lib/index.js",
"module": "es/index.js",
@ -27,16 +27,16 @@
"license": "ISC",
"dependencies": {
"@amap/amap-jsapi-loader": "^0.0.3",
"@antv/l7-core": "^2.5.5",
"@antv/l7-map": "^2.5.5",
"@antv/l7-utils": "^2.5.5",
"@antv/l7-core": "^2.5.8",
"@antv/l7-map": "^2.5.8",
"@antv/l7-utils": "^2.5.8",
"@babel/runtime": "^7.7.7",
"@types/amap-js-api": "^1.4.6",
"@types/mapbox-gl": "^1.11.2",
"gl-matrix": "^3.1.0",
"inversify": "^5.0.1",
"load-styles": "^2.0.0",
"mapbox-gl": "^1.2.1",
"reflect-metadata": "^0.1.13",
"viewport-mercator-project": "^6.2.1"
},
"devDependencies": {

View File

@ -1,6 +1,5 @@
import {
IGlobalConfigService,
ILogService,
IMapConfig,
IMapService,
IMapWrapper,
@ -9,9 +8,6 @@ import {
} from '@antv/l7-core';
import { Container } from 'inversify';
export default class BaseMapWrapper<RawMap> implements IMapWrapper {
@lazyInject(TYPES.ILogService)
protected readonly logger: ILogService;
@lazyInject(TYPES.IGlobalConfigService)
protected readonly configService: IGlobalConfigService;

View File

@ -9,7 +9,6 @@ import {
ICoordinateSystemService,
IGlobalConfigService,
ILngLat,
ILogService,
IMapConfig,
IMapService,
IMercator,
@ -23,6 +22,7 @@ import {
import { DOM } from '@antv/l7-utils';
import { mat4, vec2, vec3 } from 'gl-matrix';
import { inject, injectable } from 'inversify';
import 'reflect-metadata';
import { IAMapEvent, IAMapInstance } from '../../typings/index';
import { toPaddingOptions } from '../utils';
import { Version } from '../version';
@ -64,9 +64,6 @@ export default class AMapService
@inject(TYPES.IGlobalConfigService)
private readonly configService: IGlobalConfigService;
@inject(TYPES.ILogService)
private readonly logger: ILogService;
@inject(TYPES.MapConfig)
private readonly config: Partial<IMapConfig>;
@ -361,7 +358,7 @@ export default class AMapService
};
if (!amapLoaded && !mapInstance) {
if (token === AMAP_API_KEY) {
this.logger.warn(this.configService.getSceneWarninfo('MapToken'));
console.warn(this.configService.getSceneWarninfo('MapToken'));
}
amapLoaded = true;
plugin.push('Map3D');

View File

@ -9,7 +9,6 @@ import {
ICoordinateSystemService,
IGlobalConfigService,
ILngLat,
ILogService,
IMapConfig,
IMapService,
IMercator,
@ -24,6 +23,7 @@ import {
import { DOM } from '@antv/l7-utils';
import { mat4, vec2, vec3 } from 'gl-matrix';
import { inject, injectable } from 'inversify';
import 'reflect-metadata';
import { IAMapEvent, IAMapInstance } from '../../typings/index';
import { toPaddingOptions } from '../utils';
import { Version } from '../version';
@ -73,9 +73,6 @@ export default class AMapService
@inject(TYPES.IGlobalConfigService)
private readonly configService: IGlobalConfigService;
@inject(TYPES.ILogService)
private readonly logger: ILogService;
@inject(TYPES.MapConfig)
private readonly config: Partial<IMapConfig>;
@ -459,7 +456,7 @@ export default class AMapService
this.viewport = new Viewport();
if (!amapLoaded && !mapInstance) {
if (token === AMAP_API_KEY) {
this.logger.warn(this.configService.getSceneWarninfo('MapToken'));
console.warn(this.configService.getSceneWarninfo('MapToken'));
}
amapLoaded = true;
plugin.push('Map3D');

View File

@ -7,7 +7,6 @@ import {
ICoordinateSystemService,
IGlobalConfigService,
ILngLat,
ILogService,
IMapConfig,
IMapService,
IMercator,
@ -22,6 +21,7 @@ import { Map } from '@antv/l7-map';
import { DOM } from '@antv/l7-utils';
import { mat4, vec2, vec3 } from 'gl-matrix';
import { inject, injectable } from 'inversify';
import 'reflect-metadata';
import { Version } from '../version';
import Viewport from './Viewport';
const EventMap: {
@ -49,8 +49,6 @@ export default class L7MapService implements IMapService<Map> {
@inject(TYPES.IGlobalConfigService)
private readonly configService: IGlobalConfigService;
@inject(TYPES.ILogService)
private readonly logger: ILogService;
@inject(TYPES.ICoordinateSystemService)
private readonly coordinateSystemService: ICoordinateSystemService;

View File

@ -7,7 +7,6 @@ import {
ICoordinateSystemService,
IGlobalConfigService,
ILngLat,
ILogService,
IMapConfig,
IMapService,
IMercator,
@ -24,6 +23,7 @@ import { inject, injectable } from 'inversify';
import mapboxgl, { IControl, Map } from 'mapbox-gl';
// tslint:disable-next-line:no-submodule-imports
import 'mapbox-gl/dist/mapbox-gl.css';
import 'reflect-metadata';
import { IMapboxInstance } from '../../typings/index';
import { Version } from '../version';
import Viewport from './Viewport';
@ -56,8 +56,6 @@ export default class MapboxService
@inject(TYPES.IGlobalConfigService)
private readonly configService: IGlobalConfigService;
@inject(TYPES.ILogService)
private readonly logger: ILogService;
@inject(TYPES.ICoordinateSystemService)
private readonly coordinateSystemService: ICoordinateSystemService;
@ -308,7 +306,7 @@ export default class MapboxService
// 判断全局 mapboxgl 对象的加载
if (!mapInstance && !window.mapboxgl) {
// 用户有时传递进来的实例是继承于 mapbox 实例化的,不一定是 mapboxgl 对象。
this.logger.error(this.configService.getSceneWarninfo('SDK'));
console.error(this.configService.getSceneWarninfo('SDK'));
}
if (
@ -317,7 +315,7 @@ export default class MapboxService
!window.mapboxgl.accessToken &&
!mapInstance // 如果用户传递了 mapInstance应该不去干预实例的 accessToken。
) {
this.logger.warn(this.configService.getSceneWarninfo('MapToken'));
console.warn(this.configService.getSceneWarninfo('MapToken'));
}
// 判断是否设置了 accessToken

View File

@ -1,6 +1,6 @@
{
"name": "@antv/l7-renderer",
"version": "2.5.5",
"version": "2.5.8",
"description": "",
"main": "lib/index.js",
"module": "es/index.js",
@ -26,7 +26,7 @@
"gl": "^4.4.0"
},
"dependencies": {
"@antv/l7-core": "^2.5.5",
"@antv/l7-core": "^2.5.8",
"@babel/runtime": "^7.7.7",
"inversify": "^5.0.1",
"lodash": "^4.17.15",

View File

@ -22,6 +22,7 @@ import {
ITexture2DInitializationOptions,
} from '@antv/l7-core';
import { injectable } from 'inversify';
import 'reflect-metadata';
import regl from 'regl';
import ReglAttribute from './ReglAttribute';
import ReglBuffer from './ReglBuffer';

View File

@ -1,6 +1,6 @@
{
"name": "@antv/l7-scene",
"version": "2.5.5",
"version": "2.5.8",
"description": "",
"main": "lib/index.js",
"module": "es/index.js",
@ -23,12 +23,12 @@
"author": "xiaoiver",
"license": "ISC",
"dependencies": {
"@antv/l7-component": "^2.5.5",
"@antv/l7-core": "^2.5.5",
"@antv/l7-layers": "^2.5.5",
"@antv/l7-maps": "^2.5.5",
"@antv/l7-renderer": "^2.5.5",
"@antv/l7-utils": "^2.5.5",
"@antv/l7-component": "^2.5.8",
"@antv/l7-core": "^2.5.8",
"@antv/l7-layers": "^2.5.8",
"@antv/l7-maps": "^2.5.8",
"@antv/l7-renderer": "^2.5.8",
"@antv/l7-utils": "^2.5.8",
"@babel/runtime": "^7.7.7",
"inversify": "^5.0.1",
"mapbox-gl": "^1.2.1",

View File

@ -1,6 +1,6 @@
{
"name": "@antv/l7-source",
"version": "2.5.5",
"version": "2.5.8",
"description": "",
"main": "lib/index.js",
"module": "es/index.js",
@ -26,8 +26,8 @@
"license": "ISC",
"dependencies": {
"@antv/async-hook": "^2.1.0",
"@antv/l7-core": "^2.5.5",
"@antv/l7-utils": "^2.5.5",
"@antv/l7-core": "^2.5.8",
"@antv/l7-utils": "^2.5.8",
"@babel/runtime": "^7.7.7",
"@mapbox/geojson-rewind": "^0.4.0",
"@turf/helpers": "^6.1.4",
@ -38,6 +38,7 @@
"eventemitter3": "^4.0.0",
"inversify": "^5.0.1",
"lodash": "^4.17.15",
"reflect-metadata": "^0.1.13",
"supercluster": "^7.0.0"
},
"devDependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "@antv/l7-three",
"version": "2.5.5",
"version": "2.5.8",
"description": "three for L7 ",
"keywords": [
"3D",
@ -44,9 +44,10 @@
},
"homepage": "https://github.com/antvis/L7#readme",
"dependencies": {
"@antv/l7": "^2.5.5",
"@antv/l7": "^2.5.8",
"@babel/runtime": "^7.7.7",
"inversify": "^5.0.1",
"reflect-metadata": "^0.1.13",
"rollup": "^2.3.3",
"rollup-plugin-less": "^1.1.2"
},

View File

@ -1,5 +1,6 @@
import { IMapService, IMercator, IRendererService, TYPES } from '@antv/l7';
import { inject, injectable } from 'inversify';
import 'reflect-metadata';
import {
AnimationMixer,

View File

@ -1,6 +1,6 @@
{
"name": "@antv/l7-utils",
"version": "2.5.5",
"version": "2.5.8",
"description": "",
"main": "lib/index.js",
"module": "es/index.js",

View File

@ -15,13 +15,22 @@
"jsx-double"
],
"no-bitwise": false,
"no-console": [true, "log"],
"object-literal-sort-keys": false,
"no-implicit-dependencies": [true, "dev"]
"no-implicit-dependencies": [
true,
"dev"
]
},
"globals": {
"AMap": true
},
"linterOptions": {
"exclude": ["**/*.d.ts", "**/data/*.ts", "**/*.{test,story}.ts{,x}", "node_modules/**"]
"exclude": [
"**/*.d.ts",
"**/data/*.ts",
"**/*.{test,story}.ts{,x}",
"node_modules/**"
]
}
}