mirror of https://gitee.com/antv-l7/antv-l7
Merge branch 'master' of https://github.com/antvis/L7
This commit is contained in:
commit
188401f6d7
|
@ -103,7 +103,8 @@ module.exports = api => {
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
isCDNBundle ? {} : [
|
isCDNBundle ? {} : [
|
||||||
'transform-import-styles'
|
'transform-import-css-l7'
|
||||||
|
// 'transform-import-styles' // babel 编译将样式打包到js
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
// @see https://github.com/babel/babel/issues/8741#issuecomment-509041135
|
// @see https://github.com/babel/babel/issues/8741#issuecomment-509041135
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
"message": "chore: publish"
|
"message": "chore: publish"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"version": "2.5.5",
|
"version": "2.5.8",
|
||||||
"npmClient": "yarn",
|
"npmClient": "yarn",
|
||||||
"useWorkspaces": true,
|
"useWorkspaces": true,
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
|
|
|
@ -50,6 +50,7 @@
|
||||||
"babel-plugin-inline-import": "^3.0.0",
|
"babel-plugin-inline-import": "^3.0.0",
|
||||||
"babel-plugin-inline-webgl-constants": "^1.0.1",
|
"babel-plugin-inline-webgl-constants": "^1.0.1",
|
||||||
"babel-plugin-lodash": "^3.3.4",
|
"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-import-styles": "^0.0.11",
|
||||||
"babel-plugin-transform-inline-environment-variables": "^0.4.3",
|
"babel-plugin-transform-inline-environment-variables": "^0.4.3",
|
||||||
"babel-plugin-transform-node-env-inline": "^0.4.3",
|
"babel-plugin-transform-node-env-inline": "^0.4.3",
|
||||||
|
@ -85,7 +86,6 @@
|
||||||
"jest-styled-components": "^6.2.1",
|
"jest-styled-components": "^6.2.1",
|
||||||
"lerna": "^3.16.4",
|
"lerna": "^3.16.4",
|
||||||
"lint-staged": "^9.2.4",
|
"lint-staged": "^9.2.4",
|
||||||
"load-styles": "^2.0.0",
|
|
||||||
"node-sass": "^4.12.0",
|
"node-sass": "^4.12.0",
|
||||||
"npm-run-all": "^4.1.5",
|
"npm-run-all": "^4.1.5",
|
||||||
"postcss": "^7.0.18",
|
"postcss": "^7.0.18",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@antv/l7-component",
|
"name": "@antv/l7-component",
|
||||||
"version": "2.5.5",
|
"version": "2.5.8",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"module": "es/index.js",
|
"module": "es/index.js",
|
||||||
|
@ -25,12 +25,12 @@
|
||||||
"author": "lzxue",
|
"author": "lzxue",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@antv/l7-core": "^2.5.5",
|
"@antv/l7-core": "^2.5.8",
|
||||||
"@antv/l7-utils": "^2.5.5",
|
"@antv/l7-utils": "^2.5.8",
|
||||||
"@babel/runtime": "^7.7.7",
|
"@babel/runtime": "^7.7.7",
|
||||||
"eventemitter3": "^4.0.0",
|
"eventemitter3": "^4.0.0",
|
||||||
"inversify": "^5.0.1",
|
"inversify": "^5.0.1",
|
||||||
"load-styles": "^2.0.0"
|
"reflect-metadata": "^0.1.13"
|
||||||
},
|
},
|
||||||
"gitHead": "7eb8382ede52d803fae13a85fe6af074400260ee",
|
"gitHead": "7eb8382ede52d803fae13a85fe6af074400260ee",
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@antv/l7-core",
|
"name": "@antv/l7-core",
|
||||||
"version": "2.5.5",
|
"version": "2.5.8",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"module": "es/index.js",
|
"module": "es/index.js",
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@antv/async-hook": "^2.1.0",
|
"@antv/async-hook": "^2.1.0",
|
||||||
"@antv/l7-utils": "^2.5.5",
|
"@antv/l7-utils": "^2.5.8",
|
||||||
"@babel/runtime": "^7.7.7",
|
"@babel/runtime": "^7.7.7",
|
||||||
"@mapbox/tiny-sdf": "^1.1.1",
|
"@mapbox/tiny-sdf": "^1.1.1",
|
||||||
"ajv": "^6.10.2",
|
"ajv": "^6.10.2",
|
||||||
|
@ -35,7 +35,6 @@
|
||||||
"inversify": "^5.0.1",
|
"inversify": "^5.0.1",
|
||||||
"inversify-inject-decorators": "^3.1.0",
|
"inversify-inject-decorators": "^3.1.0",
|
||||||
"lodash": "^4.17.15",
|
"lodash": "^4.17.15",
|
||||||
"merge-json-schemas": "^1.0.0",
|
|
||||||
"probe.gl": "^3.1.1",
|
"probe.gl": "^3.1.1",
|
||||||
"reflect-metadata": "^0.1.13",
|
"reflect-metadata": "^0.1.13",
|
||||||
"viewport-mercator-project": "^6.2.1"
|
"viewport-mercator-project": "^6.2.1"
|
||||||
|
|
|
@ -44,7 +44,6 @@ export * from './services/asset/IFontService';
|
||||||
export * from './services/component/IControlService';
|
export * from './services/component/IControlService';
|
||||||
export * from './services/component/IMarkerService';
|
export * from './services/component/IMarkerService';
|
||||||
export * from './services/component/IPopupService';
|
export * from './services/component/IPopupService';
|
||||||
export * from './services/log/ILogService';
|
|
||||||
export * from './services/interaction/IInteractionService';
|
export * from './services/interaction/IInteractionService';
|
||||||
export * from './services/interaction/IPickingService';
|
export * from './services/interaction/IPickingService';
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,6 @@ import { IInteractionService } from './services/interaction/IInteractionService'
|
||||||
import { IPickingService } from './services/interaction/IPickingService';
|
import { IPickingService } from './services/interaction/IPickingService';
|
||||||
import { ILayerService } from './services/layer/ILayerService';
|
import { ILayerService } from './services/layer/ILayerService';
|
||||||
import { IStyleAttributeService } from './services/layer/IStyleAttributeService';
|
import { IStyleAttributeService } from './services/layer/IStyleAttributeService';
|
||||||
import { ILogService } from './services/log/ILogService';
|
|
||||||
import { ISceneService } from './services/scene/ISceneService';
|
import { ISceneService } from './services/scene/ISceneService';
|
||||||
import { IShaderModuleService } from './services/shader/IShaderModuleService';
|
import { IShaderModuleService } from './services/shader/IShaderModuleService';
|
||||||
|
|
||||||
|
@ -37,7 +36,6 @@ import InteractionService from './services/interaction/InteractionService';
|
||||||
import PickingService from './services/interaction/PickingService';
|
import PickingService from './services/interaction/PickingService';
|
||||||
import LayerService from './services/layer/LayerService';
|
import LayerService from './services/layer/LayerService';
|
||||||
import StyleAttributeService from './services/layer/StyleAttributeService';
|
import StyleAttributeService from './services/layer/StyleAttributeService';
|
||||||
import LogService from './services/log/LogService';
|
|
||||||
import SceneService from './services/scene/SceneService';
|
import SceneService from './services/scene/SceneService';
|
||||||
import ShaderModuleService from './services/shader/ShaderModuleService';
|
import ShaderModuleService from './services/shader/ShaderModuleService';
|
||||||
|
|
||||||
|
@ -83,10 +81,6 @@ container
|
||||||
.bind<IShaderModuleService>(TYPES.IShaderModuleService)
|
.bind<IShaderModuleService>(TYPES.IShaderModuleService)
|
||||||
.to(ShaderModuleService)
|
.to(ShaderModuleService)
|
||||||
.inSingletonScope();
|
.inSingletonScope();
|
||||||
container
|
|
||||||
.bind<ILogService>(TYPES.ILogService)
|
|
||||||
.to(LogService)
|
|
||||||
.inSingletonScope();
|
|
||||||
// container
|
// container
|
||||||
// .bind<IFontService>(TYPES.IFontService)
|
// .bind<IFontService>(TYPES.IFontService)
|
||||||
// .to(FontService)
|
// .to(FontService)
|
||||||
|
|
|
@ -2,6 +2,7 @@ import { LRUCache } from '@antv/l7-utils';
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import TinySDF from '@mapbox/tiny-sdf';
|
import TinySDF from '@mapbox/tiny-sdf';
|
||||||
import { inject, injectable } from 'inversify';
|
import { inject, injectable } from 'inversify';
|
||||||
|
import 'reflect-metadata';
|
||||||
import { buildMapping } from '../../utils/font_util';
|
import { buildMapping } from '../../utils/font_util';
|
||||||
import {
|
import {
|
||||||
IFontAtlas,
|
IFontAtlas,
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
import TinySDF from '@mapbox/tiny-sdf';
|
import TinySDF from '@mapbox/tiny-sdf';
|
||||||
import { EventEmitter } from 'eventemitter3';
|
import { EventEmitter } from 'eventemitter3';
|
||||||
import { inject, injectable } from 'inversify';
|
import { inject, injectable } from 'inversify';
|
||||||
|
import 'reflect-metadata';
|
||||||
import { TYPES } from '../../types';
|
import { TYPES } from '../../types';
|
||||||
import { buildIconMaping } from '../../utils/font_util';
|
import { buildIconMaping } from '../../utils/font_util';
|
||||||
import { ITexture2D } from '../renderer/ITexture2D';
|
import { ITexture2D } from '../renderer/ITexture2D';
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { mat4 } from 'gl-matrix';
|
import { mat4 } from 'gl-matrix';
|
||||||
import { inject, injectable } from 'inversify';
|
import { inject, injectable } from 'inversify';
|
||||||
|
import 'reflect-metadata';
|
||||||
import { ICameraService, IViewport } from './ICameraService';
|
import { ICameraService, IViewport } from './ICameraService';
|
||||||
|
|
||||||
@injectable()
|
@injectable()
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { DOM } from '@antv/l7-utils';
|
import { DOM } from '@antv/l7-utils';
|
||||||
import { Container, injectable } from 'inversify';
|
import { Container, injectable } from 'inversify';
|
||||||
|
import 'reflect-metadata';
|
||||||
import { TYPES } from '../../types';
|
import { TYPES } from '../../types';
|
||||||
import { IMapService } from '../map/IMapService';
|
import { IMapService } from '../map/IMapService';
|
||||||
import {
|
import {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import { Container, injectable } from 'inversify';
|
import { Container, injectable } from 'inversify';
|
||||||
|
import 'reflect-metadata';
|
||||||
import { TYPES } from '../../types';
|
import { TYPES } from '../../types';
|
||||||
import { IMapService } from '../map/IMapService';
|
import { IMapService } from '../map/IMapService';
|
||||||
import {
|
import {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import { Container, injectable } from 'inversify';
|
import { Container, injectable } from 'inversify';
|
||||||
|
import 'reflect-metadata';
|
||||||
import { TYPES } from '../../types';
|
import { TYPES } from '../../types';
|
||||||
import { IMapService } from '../map/IMapService';
|
import { IMapService } from '../map/IMapService';
|
||||||
import { IPopup, IPopupService } from './IPopupService';
|
import { IPopup, IPopupService } from './IPopupService';
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// import Ajv from 'ajv';
|
// import Ajv from 'ajv';
|
||||||
import { injectable, postConstruct } from 'inversify';
|
import { injectable, postConstruct } from 'inversify';
|
||||||
import { merge } from 'lodash';
|
import { merge } from 'lodash';
|
||||||
|
import 'reflect-metadata';
|
||||||
import { ILayerConfig } from '../layer/ILayerService';
|
import { ILayerConfig } from '../layer/ILayerService';
|
||||||
import { IRenderConfig } from '../renderer/IRendererService';
|
import { IRenderConfig } from '../renderer/IRendererService';
|
||||||
import { IGlobalConfigService, ISceneConfig } from './IConfigService';
|
import { IGlobalConfigService, ISceneConfig } from './IConfigService';
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { mat4, vec4 } from 'gl-matrix';
|
import { mat4, vec4 } from 'gl-matrix';
|
||||||
import { inject, injectable } from 'inversify';
|
import { inject, injectable } from 'inversify';
|
||||||
|
import 'reflect-metadata';
|
||||||
import { TYPES } from '../../types';
|
import { TYPES } from '../../types';
|
||||||
import { getDistanceScales } from '../../utils/project';
|
import { getDistanceScales } from '../../utils/project';
|
||||||
import { ICameraService } from '../camera/ICameraService';
|
import { ICameraService } from '../camera/ICameraService';
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import EventEmitter from 'eventemitter3';
|
import EventEmitter from 'eventemitter3';
|
||||||
import Hammer from 'hammerjs';
|
import Hammer from 'hammerjs';
|
||||||
import { inject, injectable } from 'inversify';
|
import { inject, injectable } from 'inversify';
|
||||||
|
import 'reflect-metadata';
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import { TYPES } from '../../types';
|
import { TYPES } from '../../types';
|
||||||
import { ILogService } from '../log/ILogService';
|
|
||||||
import { ILngLat, IMapService } from '../map/IMapService';
|
import { ILngLat, IMapService } from '../map/IMapService';
|
||||||
import { IInteractionService, InteractionEvent } from './IInteractionService';
|
import { IInteractionService, InteractionEvent } from './IInteractionService';
|
||||||
const DragEventMap: { [key: string]: string } = {
|
const DragEventMap: { [key: string]: string } = {
|
||||||
|
@ -22,9 +22,6 @@ export default class InteractionService extends EventEmitter
|
||||||
@inject(TYPES.IMapService)
|
@inject(TYPES.IMapService)
|
||||||
private readonly mapService: IMapService;
|
private readonly mapService: IMapService;
|
||||||
|
|
||||||
@inject(TYPES.ILogService)
|
|
||||||
private readonly logger: ILogService;
|
|
||||||
|
|
||||||
private hammertime: HammerManager;
|
private hammertime: HammerManager;
|
||||||
|
|
||||||
private lastClickTime: number = 0;
|
private lastClickTime: number = 0;
|
||||||
|
@ -91,7 +88,6 @@ export default class InteractionService extends EventEmitter
|
||||||
this.hammertime = hammertime;
|
this.hammertime = hammertime;
|
||||||
|
|
||||||
// TODO: 根据场景注册事件到 L7 canvas 上
|
// TODO: 根据场景注册事件到 L7 canvas 上
|
||||||
this.logger.debug('add event listeners on canvas');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private removeEventListenerOnMap() {
|
private removeEventListenerOnMap() {
|
||||||
|
|
|
@ -1,10 +1,6 @@
|
||||||
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 {
|
import 'reflect-metadata';
|
||||||
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 +12,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()
|
||||||
|
|
|
@ -197,10 +197,7 @@ export interface ILayer {
|
||||||
off(type: string, handler: (...args: any[]) => void): void;
|
off(type: string, handler: (...args: any[]) => void): void;
|
||||||
emit(type: string, handler: unknown): void;
|
emit(type: string, handler: unknown): void;
|
||||||
once(type: string, handler: (...args: any[]) => void): void;
|
once(type: string, handler: (...args: any[]) => void): void;
|
||||||
/**
|
|
||||||
* JSON Schema 用于校验配置项
|
|
||||||
*/
|
|
||||||
getConfigSchemaForValidation(): object;
|
|
||||||
isDirty(): boolean;
|
isDirty(): boolean;
|
||||||
/**
|
/**
|
||||||
* 直接调用拾取方法,在非鼠标交互场景中使用
|
* 直接调用拾取方法,在非鼠标交互场景中使用
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import { inject, injectable } from 'inversify';
|
import { inject, injectable } from 'inversify';
|
||||||
|
import 'reflect-metadata';
|
||||||
import { ILayer } from '../..';
|
import { ILayer } from '../..';
|
||||||
import { TYPES } from '../../types';
|
import { TYPES } from '../../types';
|
||||||
import Clock from '../../utils/clock';
|
import Clock from '../../utils/clock';
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import { inject, injectable, optional } from 'inversify';
|
import { inject, injectable, optional } from 'inversify';
|
||||||
|
import 'reflect-metadata';
|
||||||
import { TYPES } from '../../types';
|
import { TYPES } from '../../types';
|
||||||
import { gl } from '../renderer/gl';
|
import { gl } from '../renderer/gl';
|
||||||
import { IAttribute } from '../renderer/IAttribute';
|
import { IAttribute } from '../renderer/IAttribute';
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
export interface ILogService {
|
|
||||||
error(message: string): void;
|
|
||||||
warn(message: string): void;
|
|
||||||
info(message: string): void;
|
|
||||||
debug(message: string): void;
|
|
||||||
}
|
|
|
@ -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)();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,14 +1,13 @@
|
||||||
import { inject, injectable } from 'inversify';
|
import { inject, injectable } from 'inversify';
|
||||||
import {
|
import 'reflect-metadata';
|
||||||
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,11 @@
|
||||||
import { inject, injectable } from 'inversify';
|
import { inject, injectable } from 'inversify';
|
||||||
import { camelCase, isNil, upperFirst } from 'lodash';
|
import { camelCase, isNil, upperFirst } from 'lodash';
|
||||||
import {
|
import 'reflect-metadata';
|
||||||
gl,
|
import { IShaderModuleService } from '../../shader/IShaderModuleService';
|
||||||
IModel,
|
import { gl } from '../gl';
|
||||||
IRendererService,
|
import { IModel } from '../IModel';
|
||||||
IShaderModuleService,
|
import { IRendererService } from '../IRendererService';
|
||||||
} 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';
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import { injectable } from 'inversify';
|
import { injectable } from 'inversify';
|
||||||
|
import 'reflect-metadata';
|
||||||
import { ILayer } from '../../layer/ILayerService';
|
import { ILayer } from '../../layer/ILayerService';
|
||||||
import BaseNormalPass from './BaseNormalPass';
|
import BaseNormalPass from './BaseNormalPass';
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import { inject, injectable } from 'inversify';
|
import { inject, injectable } from 'inversify';
|
||||||
|
import 'reflect-metadata';
|
||||||
import { TYPES } from '../../../types';
|
import { TYPES } from '../../../types';
|
||||||
import { ILayer } from '../../layer/ILayerService';
|
import { ILayer } from '../../layer/ILayerService';
|
||||||
import {
|
import {
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
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 'reflect-metadata';
|
||||||
import { TYPES } from '../../../types';
|
import { TYPES } from '../../../types';
|
||||||
import {
|
import {
|
||||||
IInteractionTarget,
|
IInteractionTarget,
|
||||||
InteractionEvent,
|
InteractionEvent,
|
||||||
} from '../../interaction/IInteractionService';
|
} from '../../interaction/IInteractionService';
|
||||||
import { ILayer } from '../../layer/ILayerService';
|
import { ILayer } from '../../layer/ILayerService';
|
||||||
import { ILogService } from '../../log/ILogService';
|
|
||||||
import { ILngLat } from '../../map/IMapService';
|
import { ILngLat } from '../../map/IMapService';
|
||||||
import { gl } from '../gl';
|
import { gl } from '../gl';
|
||||||
import { IFramebuffer } from '../IFramebuffer';
|
import { IFramebuffer } from '../IFramebuffer';
|
||||||
|
@ -21,9 +21,6 @@ import BaseNormalPass from './BaseNormalPass';
|
||||||
export default class PixelPickingPass<
|
export default class PixelPickingPass<
|
||||||
InitializationOptions = {}
|
InitializationOptions = {}
|
||||||
> extends BaseNormalPass<InitializationOptions> {
|
> extends BaseNormalPass<InitializationOptions> {
|
||||||
@inject(TYPES.ILogService)
|
|
||||||
protected readonly logger: ILogService;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* picking framebuffer,供 attributes 颜色编码后输出
|
* picking framebuffer,供 attributes 颜色编码后输出
|
||||||
*/
|
*/
|
||||||
|
@ -169,7 +166,6 @@ export default class PixelPickingPass<
|
||||||
pickedColors[1] !== 0 ||
|
pickedColors[1] !== 0 ||
|
||||||
pickedColors[2] !== 0
|
pickedColors[2] !== 0
|
||||||
) {
|
) {
|
||||||
this.logger.debug('picked');
|
|
||||||
const pickedFeatureIdx = decodePickingColor(pickedColors);
|
const pickedFeatureIdx = decodePickingColor(pickedColors);
|
||||||
const rawFeature = this.layer
|
const rawFeature = this.layer
|
||||||
.getSource()
|
.getSource()
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import { inject, injectable, postConstruct } from 'inversify';
|
import { inject, injectable, postConstruct } from 'inversify';
|
||||||
|
import 'reflect-metadata';
|
||||||
import { TYPES } from '../../../types';
|
import { TYPES } from '../../../types';
|
||||||
import { ILayer } from '../../layer/ILayerService';
|
import { ILayer } from '../../layer/ILayerService';
|
||||||
import { gl } from '../gl';
|
import { gl } from '../gl';
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import { injectable } from 'inversify';
|
import { injectable } from 'inversify';
|
||||||
|
import 'reflect-metadata';
|
||||||
import { ILayer } from '../../layer/ILayerService';
|
import { ILayer } from '../../layer/ILayerService';
|
||||||
import { PassType } from '../IMultiPassRenderer';
|
import { PassType } from '../IMultiPassRenderer';
|
||||||
import BaseNormalPass from './BaseNormalPass';
|
import BaseNormalPass from './BaseNormalPass';
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import { inject, injectable } from 'inversify';
|
import { inject, injectable } from 'inversify';
|
||||||
|
import 'reflect-metadata';
|
||||||
import blendFS from '../../../shaders/post-processing/blend.glsl';
|
import blendFS from '../../../shaders/post-processing/blend.glsl';
|
||||||
import copyFS from '../../../shaders/post-processing/copy.glsl';
|
import copyFS from '../../../shaders/post-processing/copy.glsl';
|
||||||
import quadVS from '../../../shaders/post-processing/quad.glsl';
|
import quadVS from '../../../shaders/post-processing/quad.glsl';
|
||||||
import { TYPES } from '../../../types';
|
import { TYPES } from '../../../types';
|
||||||
import { ILayer } from '../../layer/ILayerService';
|
import { ILayer } from '../../layer/ILayerService';
|
||||||
import { ILogService } from '../../log/ILogService';
|
|
||||||
import { IShaderModuleService } from '../../shader/IShaderModuleService';
|
import { IShaderModuleService } from '../../shader/IShaderModuleService';
|
||||||
import { gl } from '../gl';
|
import { gl } from '../gl';
|
||||||
import { IFramebuffer } from '../IFramebuffer';
|
import { IFramebuffer } from '../IFramebuffer';
|
||||||
|
@ -42,9 +42,6 @@ export default class TAAPass<InitializationOptions = {}> extends BaseNormalPass<
|
||||||
@inject(TYPES.IShaderModuleService)
|
@inject(TYPES.IShaderModuleService)
|
||||||
protected readonly shaderModuleService: 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) {
|
private doRender(layer: ILayer) {
|
||||||
this.logger.debug(`accumulatingId: ${this.accumulatingId}`);
|
|
||||||
|
|
||||||
const { clear, getViewportSize, useFramebuffer } = this.rendererService;
|
const { clear, getViewportSize, useFramebuffer } = this.rendererService;
|
||||||
const { width, height } = getViewportSize();
|
const { width, height } = getViewportSize();
|
||||||
const { jitterScale = 1 } = layer.getLayerConfig();
|
const { jitterScale = 1 } = layer.getLayerConfig();
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { injectable } from 'inversify';
|
import { injectable } from 'inversify';
|
||||||
import { isNil } from 'lodash';
|
import { isNil } from 'lodash';
|
||||||
|
import 'reflect-metadata';
|
||||||
import blur from '../../../../shaders/post-processing/blur.glsl';
|
import blur from '../../../../shaders/post-processing/blur.glsl';
|
||||||
import quad from '../../../../shaders/post-processing/quad.glsl';
|
import quad from '../../../../shaders/post-processing/quad.glsl';
|
||||||
import { IUniform } from '../../IUniform';
|
import { IUniform } from '../../IUniform';
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import { injectable } from 'inversify';
|
import { injectable } from 'inversify';
|
||||||
|
import 'reflect-metadata';
|
||||||
import colorHalftone from '../../../../shaders/post-processing/colorhalftone.glsl';
|
import colorHalftone from '../../../../shaders/post-processing/colorhalftone.glsl';
|
||||||
import quad from '../../../../shaders/post-processing/quad.glsl';
|
import quad from '../../../../shaders/post-processing/quad.glsl';
|
||||||
import BasePostProcessingPass from '../BasePostProcessingPass';
|
import BasePostProcessingPass from '../BasePostProcessingPass';
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import { injectable } from 'inversify';
|
import { injectable } from 'inversify';
|
||||||
|
import 'reflect-metadata';
|
||||||
import copy from '../../../../shaders/post-processing/copy.glsl';
|
import copy from '../../../../shaders/post-processing/copy.glsl';
|
||||||
import quad from '../../../../shaders/post-processing/quad.glsl';
|
import quad from '../../../../shaders/post-processing/quad.glsl';
|
||||||
import BasePostProcessingPass from '../BasePostProcessingPass';
|
import BasePostProcessingPass from '../BasePostProcessingPass';
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import { injectable } from 'inversify';
|
import { injectable } from 'inversify';
|
||||||
|
import 'reflect-metadata';
|
||||||
import hexagonalPixelate from '../../../../shaders/post-processing/hexagonalpixelate.glsl';
|
import hexagonalPixelate from '../../../../shaders/post-processing/hexagonalpixelate.glsl';
|
||||||
import quad from '../../../../shaders/post-processing/quad.glsl';
|
import quad from '../../../../shaders/post-processing/quad.glsl';
|
||||||
import BasePostProcessingPass from '../BasePostProcessingPass';
|
import BasePostProcessingPass from '../BasePostProcessingPass';
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import { injectable } from 'inversify';
|
import { injectable } from 'inversify';
|
||||||
|
import 'reflect-metadata';
|
||||||
import ink from '../../../../shaders/post-processing/ink.glsl';
|
import ink from '../../../../shaders/post-processing/ink.glsl';
|
||||||
import quad from '../../../../shaders/post-processing/quad.glsl';
|
import quad from '../../../../shaders/post-processing/quad.glsl';
|
||||||
import BasePostProcessingPass from '../BasePostProcessingPass';
|
import BasePostProcessingPass from '../BasePostProcessingPass';
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import { injectable } from 'inversify';
|
import { injectable } from 'inversify';
|
||||||
|
import 'reflect-metadata';
|
||||||
import noise from '../../../../shaders/post-processing/noise.glsl';
|
import noise from '../../../../shaders/post-processing/noise.glsl';
|
||||||
import quad from '../../../../shaders/post-processing/quad.glsl';
|
import quad from '../../../../shaders/post-processing/quad.glsl';
|
||||||
import BasePostProcessingPass from '../BasePostProcessingPass';
|
import BasePostProcessingPass from '../BasePostProcessingPass';
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import { injectable } from 'inversify';
|
import { injectable } from 'inversify';
|
||||||
|
import 'reflect-metadata';
|
||||||
import quad from '../../../../shaders/post-processing/quad.glsl';
|
import quad from '../../../../shaders/post-processing/quad.glsl';
|
||||||
import sepia from '../../../../shaders/post-processing/sepia.glsl';
|
import sepia from '../../../../shaders/post-processing/sepia.glsl';
|
||||||
import BasePostProcessingPass from '../BasePostProcessingPass';
|
import BasePostProcessingPass from '../BasePostProcessingPass';
|
||||||
|
|
|
@ -4,6 +4,7 @@ import { DOM } from '@antv/l7-utils';
|
||||||
import elementResizeEvent, { unbind } from 'element-resize-event';
|
import elementResizeEvent, { unbind } from 'element-resize-event';
|
||||||
import { EventEmitter } from 'eventemitter3';
|
import { EventEmitter } from 'eventemitter3';
|
||||||
import { inject, injectable } from 'inversify';
|
import { inject, injectable } from 'inversify';
|
||||||
|
import 'reflect-metadata';
|
||||||
import { TYPES } from '../../types';
|
import { TYPES } from '../../types';
|
||||||
import { createRendererContainer } from '../../utils/dom';
|
import { createRendererContainer } from '../../utils/dom';
|
||||||
import { IFontService } from '../asset/IFontService';
|
import { IFontService } from '../asset/IFontService';
|
||||||
|
@ -21,7 +22,6 @@ import {
|
||||||
} from '../interaction/IInteractionService';
|
} from '../interaction/IInteractionService';
|
||||||
import { IPickingService } from '../interaction/IPickingService';
|
import { IPickingService } from '../interaction/IPickingService';
|
||||||
import { ILayer, ILayerService } from '../layer/ILayerService';
|
import { ILayer, ILayerService } from '../layer/ILayerService';
|
||||||
import { ILogService } from '../log/ILogService';
|
|
||||||
import { IMapCamera, IMapConfig, IMapService } from '../map/IMapService';
|
import { IMapCamera, IMapConfig, IMapService } from '../map/IMapService';
|
||||||
import { IRenderConfig, IRendererService } from '../renderer/IRendererService';
|
import { IRenderConfig, IRendererService } from '../renderer/IRendererService';
|
||||||
import { IShaderModuleService } from '../shader/IShaderModuleService';
|
import { IShaderModuleService } from '../shader/IShaderModuleService';
|
||||||
|
@ -54,9 +54,6 @@ export default class Scene extends EventEmitter implements ISceneService {
|
||||||
@inject(TYPES.IControlService)
|
@inject(TYPES.IControlService)
|
||||||
private readonly controlService: IControlService;
|
private readonly controlService: IControlService;
|
||||||
|
|
||||||
@inject(TYPES.ILogService)
|
|
||||||
private readonly logger: ILogService;
|
|
||||||
|
|
||||||
@inject(TYPES.IGlobalConfigService)
|
@inject(TYPES.IGlobalConfigService)
|
||||||
private readonly configService: IGlobalConfigService;
|
private readonly configService: IGlobalConfigService;
|
||||||
|
|
||||||
|
@ -183,7 +180,6 @@ export default class Scene extends EventEmitter implements ISceneService {
|
||||||
InteractionEvent.Drag,
|
InteractionEvent.Drag,
|
||||||
this.addSceneEvent.bind(this),
|
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)')
|
.matchMedia('screen and (-webkit-min-device-pixel-ratio: 1.5)')
|
||||||
.addListener(this.handleWindowResized);
|
.addListener(this.handleWindowResized);
|
||||||
} else {
|
} else {
|
||||||
this.logger.error('容器 id 不存在');
|
console.error('容器 id 不存在');
|
||||||
}
|
}
|
||||||
this.pickingService.init(this.id);
|
this.pickingService.init(this.id);
|
||||||
|
|
||||||
this.logger.debug(`scene ${this.id} renderer loaded`);
|
|
||||||
});
|
});
|
||||||
// TODO:init worker, fontAtlas...
|
// TODO:init worker, fontAtlas...
|
||||||
|
|
||||||
|
@ -234,7 +228,6 @@ export default class Scene extends EventEmitter implements ISceneService {
|
||||||
}
|
}
|
||||||
|
|
||||||
public addLayer(layer: ILayer) {
|
public addLayer(layer: ILayer) {
|
||||||
this.logger.debug(`add layer ${layer.name} to scene ${this.id}`);
|
|
||||||
this.layerService.add(layer);
|
this.layerService.add(layer);
|
||||||
this.render();
|
this.render();
|
||||||
}
|
}
|
||||||
|
@ -258,7 +251,6 @@ export default class Scene extends EventEmitter implements ISceneService {
|
||||||
await document.fonts.load(`24px ${this.fontFamily}`, 'L7text');
|
await document.fonts.load(`24px ${this.fontFamily}`, 'L7text');
|
||||||
}
|
}
|
||||||
// FIXME: 初始化 marker 容器,可以放到 map 初始化方法中?
|
// FIXME: 初始化 marker 容器,可以放到 map 初始化方法中?
|
||||||
this.logger.info(' render inited');
|
|
||||||
this.layerService.initLayers();
|
this.layerService.initLayers();
|
||||||
this.controlService.addControls();
|
this.controlService.addControls();
|
||||||
this.loaded = true;
|
this.loaded = true;
|
||||||
|
@ -270,7 +262,6 @@ export default class Scene extends EventEmitter implements ISceneService {
|
||||||
this.layerService.renderLayers();
|
this.layerService.renderLayers();
|
||||||
|
|
||||||
// 组件需要等待layer 初始化完成之后添加
|
// 组件需要等待layer 初始化完成之后添加
|
||||||
this.logger.debug(`scene ${this.id} render`);
|
|
||||||
this.rendering = false;
|
this.rendering = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { inject, injectable } from 'inversify';
|
import { inject, injectable } from 'inversify';
|
||||||
import { uniq } from 'lodash';
|
import { uniq } from 'lodash';
|
||||||
|
import 'reflect-metadata';
|
||||||
import { extractUniforms } from '../../utils/shader-module';
|
import { extractUniforms } from '../../utils/shader-module';
|
||||||
import { IModuleParams, IShaderModuleService } from './IShaderModuleService';
|
import { IModuleParams, IShaderModuleService } from './IShaderModuleService';
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@ const TYPES = {
|
||||||
ILayerService: Symbol.for('ILayerService'),
|
ILayerService: Symbol.for('ILayerService'),
|
||||||
ILayerMappingService: Symbol.for('ILayerMappingService'),
|
ILayerMappingService: Symbol.for('ILayerMappingService'),
|
||||||
ILayerStyleService: Symbol.for('ILayerStyleService'),
|
ILayerStyleService: Symbol.for('ILayerStyleService'),
|
||||||
ILogService: Symbol.for('ILogService'),
|
|
||||||
IMapService: Symbol.for('IMapService'),
|
IMapService: Symbol.for('IMapService'),
|
||||||
IMarkerService: Symbol.for('IMarkerService'),
|
IMarkerService: Symbol.for('IMarkerService'),
|
||||||
IPopupService: Symbol.for('PopupService'),
|
IPopupService: Symbol.for('PopupService'),
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@antv/l7",
|
"name": "@antv/l7",
|
||||||
"version": "2.5.5",
|
"version": "2.5.8",
|
||||||
"description": "A Large-scale WebGL-powered Geospatial Data Visualization",
|
"description": "A Large-scale WebGL-powered Geospatial Data Visualization",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"module": "es/index.js",
|
"module": "es/index.js",
|
||||||
|
@ -25,12 +25,12 @@
|
||||||
"author": "antv",
|
"author": "antv",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@antv/l7-component": "^2.5.5",
|
"@antv/l7-component": "^2.5.8",
|
||||||
"@antv/l7-core": "^2.5.5",
|
"@antv/l7-core": "^2.5.8",
|
||||||
"@antv/l7-layers": "^2.5.5",
|
"@antv/l7-layers": "^2.5.8",
|
||||||
"@antv/l7-maps": "^2.5.5",
|
"@antv/l7-maps": "^2.5.8",
|
||||||
"@antv/l7-scene": "^2.5.5",
|
"@antv/l7-scene": "^2.5.8",
|
||||||
"@antv/l7-utils": "^2.5.5",
|
"@antv/l7-utils": "^2.5.8",
|
||||||
"@babel/runtime": "^7.7.7"
|
"@babel/runtime": "^7.7.7"
|
||||||
},
|
},
|
||||||
"gitHead": "7eb8382ede52d803fae13a85fe6af074400260ee",
|
"gitHead": "7eb8382ede52d803fae13a85fe6af074400260ee",
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
const version = '2.5.5';
|
const version = '2.5.7';
|
||||||
export { version };
|
export { version };
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@antv/l7-layers",
|
"name": "@antv/l7-layers",
|
||||||
"version": "2.5.5",
|
"version": "2.5.8",
|
||||||
"description": "L7's collection of built-in layers",
|
"description": "L7's collection of built-in layers",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"module": "es/index.js",
|
"module": "es/index.js",
|
||||||
|
@ -24,9 +24,9 @@
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@antv/async-hook": "^2.1.0",
|
"@antv/async-hook": "^2.1.0",
|
||||||
"@antv/l7-core": "^2.5.5",
|
"@antv/l7-core": "^2.5.8",
|
||||||
"@antv/l7-source": "^2.5.5",
|
"@antv/l7-source": "^2.5.8",
|
||||||
"@antv/l7-utils": "^2.5.5",
|
"@antv/l7-utils": "^2.5.8",
|
||||||
"@babel/runtime": "^7.7.7",
|
"@babel/runtime": "^7.7.7",
|
||||||
"@mapbox/martini": "^0.2.0",
|
"@mapbox/martini": "^0.2.0",
|
||||||
"@turf/meta": "^6.0.2",
|
"@turf/meta": "^6.0.2",
|
||||||
|
|
|
@ -19,7 +19,6 @@ import {
|
||||||
ILayerModelInitializationOptions,
|
ILayerModelInitializationOptions,
|
||||||
ILayerPlugin,
|
ILayerPlugin,
|
||||||
ILayerService,
|
ILayerService,
|
||||||
ILogService,
|
|
||||||
IMapService,
|
IMapService,
|
||||||
IModel,
|
IModel,
|
||||||
IModelInitializationOptions,
|
IModelInitializationOptions,
|
||||||
|
@ -48,8 +47,6 @@ import { encodePickingColor } from '@antv/l7-utils';
|
||||||
import { EventEmitter } from 'eventemitter3';
|
import { EventEmitter } from 'eventemitter3';
|
||||||
import { Container } from 'inversify';
|
import { Container } from 'inversify';
|
||||||
import { isFunction, isObject } from 'lodash';
|
import { isFunction, isObject } from 'lodash';
|
||||||
// @ts-ignore
|
|
||||||
import mergeJsonSchemas from 'merge-json-schemas';
|
|
||||||
import { normalizePasses } from '../plugins/MultiPassRendererPlugin';
|
import { normalizePasses } from '../plugins/MultiPassRendererPlugin';
|
||||||
import { BlendTypes } from '../utils/blend';
|
import { BlendTypes } from '../utils/blend';
|
||||||
import { handleStyleDataMapping } from '../utils/dataMappingStyle';
|
import { handleStyleDataMapping } from '../utils/dataMappingStyle';
|
||||||
|
@ -114,9 +111,6 @@ export default class BaseLayer<ChildLayerStyleOptions = {}> extends EventEmitter
|
||||||
|
|
||||||
public layerModel: ILayerModel;
|
public layerModel: ILayerModel;
|
||||||
|
|
||||||
@lazyInject(TYPES.ILogService)
|
|
||||||
protected readonly logger: ILogService;
|
|
||||||
|
|
||||||
@lazyInject(TYPES.IGlobalConfigService)
|
@lazyInject(TYPES.IGlobalConfigService)
|
||||||
protected readonly configService: IGlobalConfigService;
|
protected readonly configService: IGlobalConfigService;
|
||||||
|
|
||||||
|
@ -807,18 +801,6 @@ export default class BaseLayer<ChildLayerStyleOptions = {}> extends EventEmitter
|
||||||
public getEncodedData() {
|
public getEncodedData() {
|
||||||
return this.encodedData;
|
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 {
|
public getLegendItems(name: string): any {
|
||||||
const scale = this.styleAttributeService.getLayerAttributeScale(name);
|
const scale = this.styleAttributeService.getLayerAttributeScale(name);
|
||||||
if (scale) {
|
if (scale) {
|
||||||
|
|
|
@ -10,6 +10,7 @@ import {
|
||||||
import { generateColorRamp, IColorRamp } from '@antv/l7-utils';
|
import { generateColorRamp, IColorRamp } from '@antv/l7-utils';
|
||||||
import { mat4 } from 'gl-matrix';
|
import { mat4 } from 'gl-matrix';
|
||||||
import { inject, injectable } from 'inversify';
|
import { inject, injectable } from 'inversify';
|
||||||
|
import 'reflect-metadata';
|
||||||
import BaseModel from '../../core/BaseModel';
|
import BaseModel from '../../core/BaseModel';
|
||||||
import { HeatmapTriangulation } from '../../core/triangulation';
|
import { HeatmapTriangulation } from '../../core/triangulation';
|
||||||
import heatmap3DFrag from '../shaders/heatmap_3d_frag.glsl';
|
import heatmap3DFrag from '../shaders/heatmap_3d_frag.glsl';
|
||||||
|
|
|
@ -4,7 +4,6 @@ import {
|
||||||
IEncodeFeature,
|
IEncodeFeature,
|
||||||
ILayer,
|
ILayer,
|
||||||
ILayerPlugin,
|
ILayerPlugin,
|
||||||
ILogService,
|
|
||||||
IModel,
|
IModel,
|
||||||
IModelUniform,
|
IModelUniform,
|
||||||
IRasterParserDataItem,
|
IRasterParserDataItem,
|
||||||
|
|
|
@ -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: 配置项发生变化,需要重新校验
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// }
|
|
|
@ -5,7 +5,6 @@ import {
|
||||||
ILayer,
|
ILayer,
|
||||||
ILayerPlugin,
|
ILayerPlugin,
|
||||||
ILngLat,
|
ILngLat,
|
||||||
ILogService,
|
|
||||||
IMapService,
|
IMapService,
|
||||||
IParseDataItem,
|
IParseDataItem,
|
||||||
IStyleAttribute,
|
IStyleAttribute,
|
||||||
|
@ -15,15 +14,13 @@ import {
|
||||||
import { rgb2arr, unProjectFlat } from '@antv/l7-utils';
|
import { rgb2arr, unProjectFlat } from '@antv/l7-utils';
|
||||||
import { inject, injectable } from 'inversify';
|
import { inject, injectable } from 'inversify';
|
||||||
import { cloneDeep } from 'lodash';
|
import { cloneDeep } from 'lodash';
|
||||||
|
import 'reflect-metadata';
|
||||||
|
|
||||||
@injectable()
|
@injectable()
|
||||||
export default class DataMappingPlugin implements ILayerPlugin {
|
export default class DataMappingPlugin implements ILayerPlugin {
|
||||||
@inject(TYPES.IGlobalConfigService)
|
@inject(TYPES.IGlobalConfigService)
|
||||||
private readonly configService: IGlobalConfigService;
|
private readonly configService: IGlobalConfigService;
|
||||||
|
|
||||||
@inject(TYPES.ILogService)
|
|
||||||
private readonly logger: ILogService;
|
|
||||||
|
|
||||||
@inject(TYPES.IMapService)
|
@inject(TYPES.IMapService)
|
||||||
private readonly mapService: IMapService;
|
private readonly mapService: IMapService;
|
||||||
|
|
||||||
|
@ -79,7 +76,6 @@ export default class DataMappingPlugin implements ILayerPlugin {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
this.logger.debug('remapping finished');
|
|
||||||
// 处理文本更新
|
// 处理文本更新
|
||||||
layer.emit('remapping', null);
|
layer.emit('remapping', null);
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ import {
|
||||||
import Source from '@antv/l7-source';
|
import Source from '@antv/l7-source';
|
||||||
import { injectable } from 'inversify';
|
import { injectable } from 'inversify';
|
||||||
import { cloneDeep } from 'lodash';
|
import { cloneDeep } from 'lodash';
|
||||||
|
import 'reflect-metadata';
|
||||||
|
|
||||||
@injectable()
|
@injectable()
|
||||||
export default class DataSourcePlugin implements ILayerPlugin {
|
export default class DataSourcePlugin implements ILayerPlugin {
|
||||||
|
|
|
@ -2,7 +2,6 @@ import {
|
||||||
IGlobalConfigService,
|
IGlobalConfigService,
|
||||||
ILayer,
|
ILayer,
|
||||||
ILayerPlugin,
|
ILayerPlugin,
|
||||||
ILogService,
|
|
||||||
IScale,
|
IScale,
|
||||||
IScaleOptions,
|
IScaleOptions,
|
||||||
IStyleAttribute,
|
IStyleAttribute,
|
||||||
|
@ -18,6 +17,7 @@ import { extent, ticks } from 'd3-array';
|
||||||
import * as d3 from 'd3-scale';
|
import * as d3 from 'd3-scale';
|
||||||
import { inject, injectable } from 'inversify';
|
import { inject, injectable } from 'inversify';
|
||||||
import { isNil, isString, uniq } from 'lodash';
|
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]))?$/;
|
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 {
|
export default class FeatureScalePlugin implements ILayerPlugin {
|
||||||
@inject(TYPES.IGlobalConfigService)
|
@inject(TYPES.IGlobalConfigService)
|
||||||
private readonly configService: IGlobalConfigService;
|
private readonly configService: IGlobalConfigService;
|
||||||
|
|
||||||
@inject(TYPES.ILogService)
|
|
||||||
private readonly logger: ILogService;
|
|
||||||
|
|
||||||
// key = field_attribute name
|
// key = field_attribute name
|
||||||
private scaleCache: {
|
private scaleCache: {
|
||||||
[field: string]: IStyleScale;
|
[field: string]: IStyleScale;
|
||||||
|
@ -96,7 +92,6 @@ export default class FeatureScalePlugin implements ILayerPlugin {
|
||||||
);
|
);
|
||||||
if (attributesToRescale.length) {
|
if (attributesToRescale.length) {
|
||||||
this.caculateScalesForAttributes(attributesToRescale, dataArray);
|
this.caculateScalesForAttributes(attributesToRescale, dataArray);
|
||||||
this.logger.debug('rescale finished');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -10,6 +10,7 @@ import {
|
||||||
TYPES,
|
TYPES,
|
||||||
} from '@antv/l7-core';
|
} from '@antv/l7-core';
|
||||||
import { inject, injectable } from 'inversify';
|
import { inject, injectable } from 'inversify';
|
||||||
|
import 'reflect-metadata';
|
||||||
|
|
||||||
@injectable()
|
@injectable()
|
||||||
export default class LayerAnimateStylePlugin implements ILayerPlugin {
|
export default class LayerAnimateStylePlugin implements ILayerPlugin {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { ILayer, ILayerPlugin, IMapService, TYPES } from '@antv/l7-core';
|
import { ILayer, ILayerPlugin, IMapService, TYPES } from '@antv/l7-core';
|
||||||
import { injectable } from 'inversify';
|
import { injectable } from 'inversify';
|
||||||
|
import 'reflect-metadata';
|
||||||
/**
|
/**
|
||||||
* Layer Model 初始化,更新,销毁
|
* Layer Model 初始化,更新,销毁
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -2,6 +2,7 @@ import { ILayer, ILayerPlugin, IMapService, TYPES } from '@antv/l7-core';
|
||||||
import Source from '@antv/l7-source';
|
import Source from '@antv/l7-source';
|
||||||
import { encodePickingColor, rgb2arr } from '@antv/l7-utils';
|
import { encodePickingColor, rgb2arr } from '@antv/l7-utils';
|
||||||
import { injectable } from 'inversify';
|
import { injectable } from 'inversify';
|
||||||
|
import 'reflect-metadata';
|
||||||
/**
|
/**
|
||||||
* 更新图层样式,初始图层相关配置
|
* 更新图层样式,初始图层相关配置
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -9,6 +9,7 @@ import {
|
||||||
TYPES,
|
TYPES,
|
||||||
} from '@antv/l7-core';
|
} from '@antv/l7-core';
|
||||||
import { inject, injectable } from 'inversify';
|
import { inject, injectable } from 'inversify';
|
||||||
|
import 'reflect-metadata';
|
||||||
|
|
||||||
const lightTypeUniformMap = {
|
const lightTypeUniformMap = {
|
||||||
directional: {
|
directional: {
|
||||||
|
|
|
@ -8,6 +8,7 @@ import {
|
||||||
TYPES,
|
TYPES,
|
||||||
} from '@antv/l7-core';
|
} from '@antv/l7-core';
|
||||||
import { inject, injectable } from 'inversify';
|
import { inject, injectable } from 'inversify';
|
||||||
|
import 'reflect-metadata';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 'blurH' -> ['blurH', {}]
|
* 'blurH' -> ['blurH', {}]
|
||||||
|
|
|
@ -13,6 +13,7 @@ import {
|
||||||
rgb2arr,
|
rgb2arr,
|
||||||
} from '@antv/l7-utils';
|
} from '@antv/l7-utils';
|
||||||
import { injectable } from 'inversify';
|
import { injectable } from 'inversify';
|
||||||
|
import 'reflect-metadata';
|
||||||
|
|
||||||
const PickingStage = {
|
const PickingStage = {
|
||||||
NONE: 0.0,
|
NONE: 0.0,
|
||||||
|
|
|
@ -4,21 +4,17 @@ import {
|
||||||
IEncodeFeature,
|
IEncodeFeature,
|
||||||
ILayer,
|
ILayer,
|
||||||
ILayerPlugin,
|
ILayerPlugin,
|
||||||
ILogService,
|
|
||||||
IStyleAttributeService,
|
IStyleAttributeService,
|
||||||
TYPES,
|
TYPES,
|
||||||
} from '@antv/l7-core';
|
} from '@antv/l7-core';
|
||||||
import { inject, injectable } from 'inversify';
|
import { inject, injectable } from 'inversify';
|
||||||
import { isNumber } from 'lodash';
|
import 'reflect-metadata';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 在初始化阶段完成属性的注册,以及首次根据 Layer 指定的三角化方法完成 indices 和 attribute 的创建
|
* 在初始化阶段完成属性的注册,以及首次根据 Layer 指定的三角化方法完成 indices 和 attribute 的创建
|
||||||
*/
|
*/
|
||||||
@injectable()
|
@injectable()
|
||||||
export default class RegisterStyleAttributePlugin implements ILayerPlugin {
|
export default class RegisterStyleAttributePlugin implements ILayerPlugin {
|
||||||
@inject(TYPES.ILogService)
|
|
||||||
private readonly logger: ILogService;
|
|
||||||
|
|
||||||
public apply(
|
public apply(
|
||||||
layer: ILayer,
|
layer: ILayer,
|
||||||
{
|
{
|
||||||
|
|
|
@ -11,6 +11,7 @@ import {
|
||||||
} from '@antv/l7-core';
|
} from '@antv/l7-core';
|
||||||
import { DOM } from '@antv/l7-utils';
|
import { DOM } from '@antv/l7-utils';
|
||||||
import { inject, injectable } from 'inversify';
|
import { inject, injectable } from 'inversify';
|
||||||
|
import 'reflect-metadata';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 在渲染之前需要获取当前 Shader 所需 Uniform,例如:
|
* 在渲染之前需要获取当前 Shader 所需 Uniform,例如:
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { ILayer, ILayerPlugin, IMapService, TYPES } from '@antv/l7-core';
|
import { ILayer, ILayerPlugin, IMapService, TYPES } from '@antv/l7-core';
|
||||||
import { injectable } from 'inversify';
|
import { injectable } from 'inversify';
|
||||||
|
import 'reflect-metadata';
|
||||||
/**
|
/**
|
||||||
* Model 更新
|
* Model 更新
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,20 +1,17 @@
|
||||||
import {
|
import {
|
||||||
ILayer,
|
ILayer,
|
||||||
ILayerPlugin,
|
ILayerPlugin,
|
||||||
ILogService,
|
|
||||||
IStyleAttributeService,
|
IStyleAttributeService,
|
||||||
TYPES,
|
TYPES,
|
||||||
} from '@antv/l7-core';
|
} from '@antv/l7-core';
|
||||||
import { inject, injectable } from 'inversify';
|
import { inject, injectable } from 'inversify';
|
||||||
|
import 'reflect-metadata';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 在初始化阶段完成属性的注册,以及首次根据 Layer 指定的三角化方法完成 indices 和 attribute 的创建
|
* 在初始化阶段完成属性的注册,以及首次根据 Layer 指定的三角化方法完成 indices 和 attribute 的创建
|
||||||
*/
|
*/
|
||||||
@injectable()
|
@injectable()
|
||||||
export default class UpdateStyleAttributePlugin implements ILayerPlugin {
|
export default class UpdateStyleAttributePlugin implements ILayerPlugin {
|
||||||
@inject(TYPES.ILogService)
|
|
||||||
private readonly logger: ILogService;
|
|
||||||
|
|
||||||
public apply(
|
public apply(
|
||||||
layer: ILayer,
|
layer: ILayer,
|
||||||
{
|
{
|
||||||
|
@ -65,9 +62,6 @@ export default class UpdateStyleAttributePlugin implements ILayerPlugin {
|
||||||
attribute.featureRange.endIndex,
|
attribute.featureRange.endIndex,
|
||||||
);
|
);
|
||||||
attribute.needRegenerateVertices = false;
|
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.featureRange.endIndex,
|
||||||
);
|
);
|
||||||
attribute.needRegenerateVertices = false;
|
attribute.needRegenerateVertices = false;
|
||||||
this.logger.debug(`init vertex attributes: ${attribute.name} finished`);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,6 @@ import {
|
||||||
ILayer,
|
ILayer,
|
||||||
ILayerModel,
|
ILayerModel,
|
||||||
ILayerPlugin,
|
ILayerPlugin,
|
||||||
ILogService,
|
|
||||||
IModel,
|
IModel,
|
||||||
IStyleAttributeService,
|
IStyleAttributeService,
|
||||||
lazyInject,
|
lazyInject,
|
||||||
|
|
|
@ -4,7 +4,6 @@ import {
|
||||||
IEncodeFeature,
|
IEncodeFeature,
|
||||||
ILayer,
|
ILayer,
|
||||||
ILayerPlugin,
|
ILayerPlugin,
|
||||||
ILogService,
|
|
||||||
IModel,
|
IModel,
|
||||||
IModelUniform,
|
IModelUniform,
|
||||||
IRasterParserDataItem,
|
IRasterParserDataItem,
|
||||||
|
|
|
@ -4,7 +4,6 @@ import {
|
||||||
IEncodeFeature,
|
IEncodeFeature,
|
||||||
ILayer,
|
ILayer,
|
||||||
ILayerPlugin,
|
ILayerPlugin,
|
||||||
ILogService,
|
|
||||||
IModelUniform,
|
IModelUniform,
|
||||||
IRasterParserDataItem,
|
IRasterParserDataItem,
|
||||||
IStyleAttributeService,
|
IStyleAttributeService,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@antv/l7-map",
|
"name": "@antv/l7-map",
|
||||||
"version": "2.5.5",
|
"version": "2.5.8",
|
||||||
"description": "l7 map",
|
"description": "l7 map",
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
"author": "thinkinggis <lzx199065@gmail.com>",
|
"author": "thinkinggis <lzx199065@gmail.com>",
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/antvis/L7#readme",
|
"homepage": "https://github.com/antvis/L7#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@antv/l7-utils": "^2.5.5",
|
"@antv/l7-utils": "^2.5.8",
|
||||||
"@babel/runtime": "^7.7.7",
|
"@babel/runtime": "^7.7.7",
|
||||||
"@mapbox/point-geometry": "^0.1.0",
|
"@mapbox/point-geometry": "^0.1.0",
|
||||||
"@mapbox/unitbezier": "^0.0.0",
|
"@mapbox/unitbezier": "^0.0.0",
|
||||||
|
|
|
@ -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})`;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@antv/l7-maps",
|
"name": "@antv/l7-maps",
|
||||||
"version": "2.5.5",
|
"version": "2.5.8",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"module": "es/index.js",
|
"module": "es/index.js",
|
||||||
|
@ -27,16 +27,16 @@
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@amap/amap-jsapi-loader": "^0.0.3",
|
"@amap/amap-jsapi-loader": "^0.0.3",
|
||||||
"@antv/l7-core": "^2.5.5",
|
"@antv/l7-core": "^2.5.8",
|
||||||
"@antv/l7-map": "^2.5.5",
|
"@antv/l7-map": "^2.5.8",
|
||||||
"@antv/l7-utils": "^2.5.5",
|
"@antv/l7-utils": "^2.5.8",
|
||||||
"@babel/runtime": "^7.7.7",
|
"@babel/runtime": "^7.7.7",
|
||||||
"@types/amap-js-api": "^1.4.6",
|
"@types/amap-js-api": "^1.4.6",
|
||||||
"@types/mapbox-gl": "^1.11.2",
|
"@types/mapbox-gl": "^1.11.2",
|
||||||
"gl-matrix": "^3.1.0",
|
"gl-matrix": "^3.1.0",
|
||||||
"inversify": "^5.0.1",
|
"inversify": "^5.0.1",
|
||||||
"load-styles": "^2.0.0",
|
|
||||||
"mapbox-gl": "^1.2.1",
|
"mapbox-gl": "^1.2.1",
|
||||||
|
"reflect-metadata": "^0.1.13",
|
||||||
"viewport-mercator-project": "^6.2.1"
|
"viewport-mercator-project": "^6.2.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import {
|
import {
|
||||||
IGlobalConfigService,
|
IGlobalConfigService,
|
||||||
ILogService,
|
|
||||||
IMapConfig,
|
IMapConfig,
|
||||||
IMapService,
|
IMapService,
|
||||||
IMapWrapper,
|
IMapWrapper,
|
||||||
|
@ -9,9 +8,6 @@ import {
|
||||||
} from '@antv/l7-core';
|
} from '@antv/l7-core';
|
||||||
import { Container } from 'inversify';
|
import { Container } from 'inversify';
|
||||||
export default class BaseMapWrapper<RawMap> implements IMapWrapper {
|
export default class BaseMapWrapper<RawMap> implements IMapWrapper {
|
||||||
@lazyInject(TYPES.ILogService)
|
|
||||||
protected readonly logger: ILogService;
|
|
||||||
|
|
||||||
@lazyInject(TYPES.IGlobalConfigService)
|
@lazyInject(TYPES.IGlobalConfigService)
|
||||||
protected readonly configService: IGlobalConfigService;
|
protected readonly configService: IGlobalConfigService;
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,6 @@ import {
|
||||||
ICoordinateSystemService,
|
ICoordinateSystemService,
|
||||||
IGlobalConfigService,
|
IGlobalConfigService,
|
||||||
ILngLat,
|
ILngLat,
|
||||||
ILogService,
|
|
||||||
IMapConfig,
|
IMapConfig,
|
||||||
IMapService,
|
IMapService,
|
||||||
IMercator,
|
IMercator,
|
||||||
|
@ -23,6 +22,7 @@ import {
|
||||||
import { DOM } from '@antv/l7-utils';
|
import { DOM } from '@antv/l7-utils';
|
||||||
import { mat4, vec2, vec3 } from 'gl-matrix';
|
import { mat4, vec2, vec3 } from 'gl-matrix';
|
||||||
import { inject, injectable } from 'inversify';
|
import { inject, injectable } from 'inversify';
|
||||||
|
import 'reflect-metadata';
|
||||||
import { IAMapEvent, IAMapInstance } from '../../typings/index';
|
import { IAMapEvent, IAMapInstance } from '../../typings/index';
|
||||||
import { toPaddingOptions } from '../utils';
|
import { toPaddingOptions } from '../utils';
|
||||||
import { Version } from '../version';
|
import { Version } from '../version';
|
||||||
|
@ -64,9 +64,6 @@ export default class AMapService
|
||||||
@inject(TYPES.IGlobalConfigService)
|
@inject(TYPES.IGlobalConfigService)
|
||||||
private readonly configService: IGlobalConfigService;
|
private readonly configService: IGlobalConfigService;
|
||||||
|
|
||||||
@inject(TYPES.ILogService)
|
|
||||||
private readonly logger: ILogService;
|
|
||||||
|
|
||||||
@inject(TYPES.MapConfig)
|
@inject(TYPES.MapConfig)
|
||||||
private readonly config: Partial<IMapConfig>;
|
private readonly config: Partial<IMapConfig>;
|
||||||
|
|
||||||
|
@ -361,7 +358,7 @@ export default class AMapService
|
||||||
};
|
};
|
||||||
if (!amapLoaded && !mapInstance) {
|
if (!amapLoaded && !mapInstance) {
|
||||||
if (token === AMAP_API_KEY) {
|
if (token === AMAP_API_KEY) {
|
||||||
this.logger.warn(this.configService.getSceneWarninfo('MapToken'));
|
console.warn(this.configService.getSceneWarninfo('MapToken'));
|
||||||
}
|
}
|
||||||
amapLoaded = true;
|
amapLoaded = true;
|
||||||
plugin.push('Map3D');
|
plugin.push('Map3D');
|
||||||
|
|
|
@ -9,7 +9,6 @@ import {
|
||||||
ICoordinateSystemService,
|
ICoordinateSystemService,
|
||||||
IGlobalConfigService,
|
IGlobalConfigService,
|
||||||
ILngLat,
|
ILngLat,
|
||||||
ILogService,
|
|
||||||
IMapConfig,
|
IMapConfig,
|
||||||
IMapService,
|
IMapService,
|
||||||
IMercator,
|
IMercator,
|
||||||
|
@ -24,6 +23,7 @@ import {
|
||||||
import { DOM } from '@antv/l7-utils';
|
import { DOM } from '@antv/l7-utils';
|
||||||
import { mat4, vec2, vec3 } from 'gl-matrix';
|
import { mat4, vec2, vec3 } from 'gl-matrix';
|
||||||
import { inject, injectable } from 'inversify';
|
import { inject, injectable } from 'inversify';
|
||||||
|
import 'reflect-metadata';
|
||||||
import { IAMapEvent, IAMapInstance } from '../../typings/index';
|
import { IAMapEvent, IAMapInstance } from '../../typings/index';
|
||||||
import { toPaddingOptions } from '../utils';
|
import { toPaddingOptions } from '../utils';
|
||||||
import { Version } from '../version';
|
import { Version } from '../version';
|
||||||
|
@ -73,9 +73,6 @@ export default class AMapService
|
||||||
@inject(TYPES.IGlobalConfigService)
|
@inject(TYPES.IGlobalConfigService)
|
||||||
private readonly configService: IGlobalConfigService;
|
private readonly configService: IGlobalConfigService;
|
||||||
|
|
||||||
@inject(TYPES.ILogService)
|
|
||||||
private readonly logger: ILogService;
|
|
||||||
|
|
||||||
@inject(TYPES.MapConfig)
|
@inject(TYPES.MapConfig)
|
||||||
private readonly config: Partial<IMapConfig>;
|
private readonly config: Partial<IMapConfig>;
|
||||||
|
|
||||||
|
@ -459,7 +456,7 @@ export default class AMapService
|
||||||
this.viewport = new Viewport();
|
this.viewport = new Viewport();
|
||||||
if (!amapLoaded && !mapInstance) {
|
if (!amapLoaded && !mapInstance) {
|
||||||
if (token === AMAP_API_KEY) {
|
if (token === AMAP_API_KEY) {
|
||||||
this.logger.warn(this.configService.getSceneWarninfo('MapToken'));
|
console.warn(this.configService.getSceneWarninfo('MapToken'));
|
||||||
}
|
}
|
||||||
amapLoaded = true;
|
amapLoaded = true;
|
||||||
plugin.push('Map3D');
|
plugin.push('Map3D');
|
||||||
|
|
|
@ -7,7 +7,6 @@ import {
|
||||||
ICoordinateSystemService,
|
ICoordinateSystemService,
|
||||||
IGlobalConfigService,
|
IGlobalConfigService,
|
||||||
ILngLat,
|
ILngLat,
|
||||||
ILogService,
|
|
||||||
IMapConfig,
|
IMapConfig,
|
||||||
IMapService,
|
IMapService,
|
||||||
IMercator,
|
IMercator,
|
||||||
|
@ -22,6 +21,7 @@ import { Map } from '@antv/l7-map';
|
||||||
import { DOM } from '@antv/l7-utils';
|
import { DOM } from '@antv/l7-utils';
|
||||||
import { mat4, vec2, vec3 } from 'gl-matrix';
|
import { mat4, vec2, vec3 } from 'gl-matrix';
|
||||||
import { inject, injectable } from 'inversify';
|
import { inject, injectable } from 'inversify';
|
||||||
|
import 'reflect-metadata';
|
||||||
import { Version } from '../version';
|
import { Version } from '../version';
|
||||||
import Viewport from './Viewport';
|
import Viewport from './Viewport';
|
||||||
const EventMap: {
|
const EventMap: {
|
||||||
|
@ -49,8 +49,6 @@ export default class L7MapService implements IMapService<Map> {
|
||||||
@inject(TYPES.IGlobalConfigService)
|
@inject(TYPES.IGlobalConfigService)
|
||||||
private readonly configService: IGlobalConfigService;
|
private readonly configService: IGlobalConfigService;
|
||||||
|
|
||||||
@inject(TYPES.ILogService)
|
|
||||||
private readonly logger: ILogService;
|
|
||||||
@inject(TYPES.ICoordinateSystemService)
|
@inject(TYPES.ICoordinateSystemService)
|
||||||
private readonly coordinateSystemService: ICoordinateSystemService;
|
private readonly coordinateSystemService: ICoordinateSystemService;
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@ import {
|
||||||
ICoordinateSystemService,
|
ICoordinateSystemService,
|
||||||
IGlobalConfigService,
|
IGlobalConfigService,
|
||||||
ILngLat,
|
ILngLat,
|
||||||
ILogService,
|
|
||||||
IMapConfig,
|
IMapConfig,
|
||||||
IMapService,
|
IMapService,
|
||||||
IMercator,
|
IMercator,
|
||||||
|
@ -24,6 +23,7 @@ import { inject, injectable } from 'inversify';
|
||||||
import mapboxgl, { IControl, Map } from 'mapbox-gl';
|
import mapboxgl, { IControl, Map } from 'mapbox-gl';
|
||||||
// tslint:disable-next-line:no-submodule-imports
|
// tslint:disable-next-line:no-submodule-imports
|
||||||
import 'mapbox-gl/dist/mapbox-gl.css';
|
import 'mapbox-gl/dist/mapbox-gl.css';
|
||||||
|
import 'reflect-metadata';
|
||||||
import { IMapboxInstance } from '../../typings/index';
|
import { IMapboxInstance } from '../../typings/index';
|
||||||
import { Version } from '../version';
|
import { Version } from '../version';
|
||||||
import Viewport from './Viewport';
|
import Viewport from './Viewport';
|
||||||
|
@ -56,8 +56,6 @@ export default class MapboxService
|
||||||
@inject(TYPES.IGlobalConfigService)
|
@inject(TYPES.IGlobalConfigService)
|
||||||
private readonly configService: IGlobalConfigService;
|
private readonly configService: IGlobalConfigService;
|
||||||
|
|
||||||
@inject(TYPES.ILogService)
|
|
||||||
private readonly logger: ILogService;
|
|
||||||
@inject(TYPES.ICoordinateSystemService)
|
@inject(TYPES.ICoordinateSystemService)
|
||||||
private readonly coordinateSystemService: ICoordinateSystemService;
|
private readonly coordinateSystemService: ICoordinateSystemService;
|
||||||
|
|
||||||
|
@ -308,7 +306,7 @@ export default class MapboxService
|
||||||
// 判断全局 mapboxgl 对象的加载
|
// 判断全局 mapboxgl 对象的加载
|
||||||
if (!mapInstance && !window.mapboxgl) {
|
if (!mapInstance && !window.mapboxgl) {
|
||||||
// 用户有时传递进来的实例是继承于 mapbox 实例化的,不一定是 mapboxgl 对象。
|
// 用户有时传递进来的实例是继承于 mapbox 实例化的,不一定是 mapboxgl 对象。
|
||||||
this.logger.error(this.configService.getSceneWarninfo('SDK'));
|
console.error(this.configService.getSceneWarninfo('SDK'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
@ -317,7 +315,7 @@ export default class MapboxService
|
||||||
!window.mapboxgl.accessToken &&
|
!window.mapboxgl.accessToken &&
|
||||||
!mapInstance // 如果用户传递了 mapInstance,应该不去干预实例的 accessToken。
|
!mapInstance // 如果用户传递了 mapInstance,应该不去干预实例的 accessToken。
|
||||||
) {
|
) {
|
||||||
this.logger.warn(this.configService.getSceneWarninfo('MapToken'));
|
console.warn(this.configService.getSceneWarninfo('MapToken'));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 判断是否设置了 accessToken
|
// 判断是否设置了 accessToken
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@antv/l7-renderer",
|
"name": "@antv/l7-renderer",
|
||||||
"version": "2.5.5",
|
"version": "2.5.8",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"module": "es/index.js",
|
"module": "es/index.js",
|
||||||
|
@ -26,7 +26,7 @@
|
||||||
"gl": "^4.4.0"
|
"gl": "^4.4.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@antv/l7-core": "^2.5.5",
|
"@antv/l7-core": "^2.5.8",
|
||||||
"@babel/runtime": "^7.7.7",
|
"@babel/runtime": "^7.7.7",
|
||||||
"inversify": "^5.0.1",
|
"inversify": "^5.0.1",
|
||||||
"lodash": "^4.17.15",
|
"lodash": "^4.17.15",
|
||||||
|
|
|
@ -22,6 +22,7 @@ import {
|
||||||
ITexture2DInitializationOptions,
|
ITexture2DInitializationOptions,
|
||||||
} from '@antv/l7-core';
|
} from '@antv/l7-core';
|
||||||
import { injectable } from 'inversify';
|
import { injectable } from 'inversify';
|
||||||
|
import 'reflect-metadata';
|
||||||
import regl from 'regl';
|
import regl from 'regl';
|
||||||
import ReglAttribute from './ReglAttribute';
|
import ReglAttribute from './ReglAttribute';
|
||||||
import ReglBuffer from './ReglBuffer';
|
import ReglBuffer from './ReglBuffer';
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@antv/l7-scene",
|
"name": "@antv/l7-scene",
|
||||||
"version": "2.5.5",
|
"version": "2.5.8",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"module": "es/index.js",
|
"module": "es/index.js",
|
||||||
|
@ -23,12 +23,12 @@
|
||||||
"author": "xiaoiver",
|
"author": "xiaoiver",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@antv/l7-component": "^2.5.5",
|
"@antv/l7-component": "^2.5.8",
|
||||||
"@antv/l7-core": "^2.5.5",
|
"@antv/l7-core": "^2.5.8",
|
||||||
"@antv/l7-layers": "^2.5.5",
|
"@antv/l7-layers": "^2.5.8",
|
||||||
"@antv/l7-maps": "^2.5.5",
|
"@antv/l7-maps": "^2.5.8",
|
||||||
"@antv/l7-renderer": "^2.5.5",
|
"@antv/l7-renderer": "^2.5.8",
|
||||||
"@antv/l7-utils": "^2.5.5",
|
"@antv/l7-utils": "^2.5.8",
|
||||||
"@babel/runtime": "^7.7.7",
|
"@babel/runtime": "^7.7.7",
|
||||||
"inversify": "^5.0.1",
|
"inversify": "^5.0.1",
|
||||||
"mapbox-gl": "^1.2.1",
|
"mapbox-gl": "^1.2.1",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@antv/l7-source",
|
"name": "@antv/l7-source",
|
||||||
"version": "2.5.5",
|
"version": "2.5.8",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"module": "es/index.js",
|
"module": "es/index.js",
|
||||||
|
@ -26,8 +26,8 @@
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@antv/async-hook": "^2.1.0",
|
"@antv/async-hook": "^2.1.0",
|
||||||
"@antv/l7-core": "^2.5.5",
|
"@antv/l7-core": "^2.5.8",
|
||||||
"@antv/l7-utils": "^2.5.5",
|
"@antv/l7-utils": "^2.5.8",
|
||||||
"@babel/runtime": "^7.7.7",
|
"@babel/runtime": "^7.7.7",
|
||||||
"@mapbox/geojson-rewind": "^0.4.0",
|
"@mapbox/geojson-rewind": "^0.4.0",
|
||||||
"@turf/helpers": "^6.1.4",
|
"@turf/helpers": "^6.1.4",
|
||||||
|
@ -38,6 +38,7 @@
|
||||||
"eventemitter3": "^4.0.0",
|
"eventemitter3": "^4.0.0",
|
||||||
"inversify": "^5.0.1",
|
"inversify": "^5.0.1",
|
||||||
"lodash": "^4.17.15",
|
"lodash": "^4.17.15",
|
||||||
|
"reflect-metadata": "^0.1.13",
|
||||||
"supercluster": "^7.0.0"
|
"supercluster": "^7.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@antv/l7-three",
|
"name": "@antv/l7-three",
|
||||||
"version": "2.5.5",
|
"version": "2.5.8",
|
||||||
"description": "three for L7 ",
|
"description": "three for L7 ",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"3D",
|
"3D",
|
||||||
|
@ -44,9 +44,10 @@
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/antvis/L7#readme",
|
"homepage": "https://github.com/antvis/L7#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@antv/l7": "^2.5.5",
|
"@antv/l7": "^2.5.8",
|
||||||
"@babel/runtime": "^7.7.7",
|
"@babel/runtime": "^7.7.7",
|
||||||
"inversify": "^5.0.1",
|
"inversify": "^5.0.1",
|
||||||
|
"reflect-metadata": "^0.1.13",
|
||||||
"rollup": "^2.3.3",
|
"rollup": "^2.3.3",
|
||||||
"rollup-plugin-less": "^1.1.2"
|
"rollup-plugin-less": "^1.1.2"
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { IMapService, IMercator, IRendererService, TYPES } from '@antv/l7';
|
import { IMapService, IMercator, IRendererService, TYPES } from '@antv/l7';
|
||||||
import { inject, injectable } from 'inversify';
|
import { inject, injectable } from 'inversify';
|
||||||
|
import 'reflect-metadata';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
AnimationMixer,
|
AnimationMixer,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@antv/l7-utils",
|
"name": "@antv/l7-utils",
|
||||||
"version": "2.5.5",
|
"version": "2.5.8",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"module": "es/index.js",
|
"module": "es/index.js",
|
||||||
|
|
13
tslint.json
13
tslint.json
|
@ -15,13 +15,22 @@
|
||||||
"jsx-double"
|
"jsx-double"
|
||||||
],
|
],
|
||||||
"no-bitwise": false,
|
"no-bitwise": false,
|
||||||
|
"no-console": [true, "log"],
|
||||||
"object-literal-sort-keys": false,
|
"object-literal-sort-keys": false,
|
||||||
"no-implicit-dependencies": [true, "dev"]
|
"no-implicit-dependencies": [
|
||||||
|
true,
|
||||||
|
"dev"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"globals": {
|
"globals": {
|
||||||
"AMap": true
|
"AMap": true
|
||||||
},
|
},
|
||||||
"linterOptions": {
|
"linterOptions": {
|
||||||
"exclude": ["**/*.d.ts", "**/data/*.ts", "**/*.{test,story}.ts{,x}", "node_modules/**"]
|
"exclude": [
|
||||||
|
"**/*.d.ts",
|
||||||
|
"**/data/*.ts",
|
||||||
|
"**/*.{test,story}.ts{,x}",
|
||||||
|
"node_modules/**"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue