@antv/l7-layers 2.7.4 → 2.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/core/BaseLayer.d.ts +5 -0
- package/es/core/BaseLayer.js +75 -7
- package/es/core/BaseLayer.js.map +1 -1
- package/lib/core/BaseLayer.js +76 -7
- package/lib/core/BaseLayer.js.map +1 -1
- package/package.json +5 -5
package/es/core/BaseLayer.d.ts
CHANGED
|
@@ -114,6 +114,10 @@ export default class BaseLayer<ChildLayerStyleOptions = {}> extends EventEmitter
|
|
|
114
114
|
*/
|
|
115
115
|
renderLayers(): void;
|
|
116
116
|
render(): ILayer;
|
|
117
|
+
/**
|
|
118
|
+
* renderMultiPass 专门用于渲染支持 multipass 的 layer
|
|
119
|
+
*/
|
|
120
|
+
renderMultiPass(): Promise<void>;
|
|
117
121
|
active(options: IActiveOption | boolean): this;
|
|
118
122
|
setActive(id: number | {
|
|
119
123
|
x: number;
|
|
@@ -165,6 +169,7 @@ export default class BaseLayer<ChildLayerStyleOptions = {}> extends EventEmitter
|
|
|
165
169
|
needPick(type: string): boolean;
|
|
166
170
|
buildModels(): void;
|
|
167
171
|
rebuildModels(): void;
|
|
172
|
+
renderMulPass(multiPassRenderer: IMultiPassRenderer): Promise<void>;
|
|
168
173
|
renderModels(isPicking?: boolean): this;
|
|
169
174
|
updateStyleAttribute(type: string, field: StyleAttributeField, values?: StyleAttributeOption, updateOptions?: Partial<IStyleAttributeUpdateOptions>): void;
|
|
170
175
|
getShaderPickStat(): boolean;
|
package/es/core/BaseLayer.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
1
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
2
3
|
import _initializerDefineProperty from "@babel/runtime/helpers/initializerDefineProperty";
|
|
3
4
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
@@ -16,6 +17,8 @@ var _excluded = ["passes"],
|
|
|
16
17
|
|
|
17
18
|
var _dec, _class, _descriptor;
|
|
18
19
|
|
|
20
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
21
|
+
|
|
19
22
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
20
23
|
|
|
21
24
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -474,17 +477,57 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
|
|
|
474
477
|
key: "render",
|
|
475
478
|
value: function render() {
|
|
476
479
|
if (this.getEncodedData().length !== 0) {
|
|
477
|
-
|
|
478
|
-
this.multiPassRenderer.render();
|
|
479
|
-
} else if (this.multiPassRenderer) {
|
|
480
|
-
this.renderModels();
|
|
481
|
-
} else {
|
|
482
|
-
this.renderModels();
|
|
483
|
-
}
|
|
480
|
+
this.renderModels();
|
|
484
481
|
}
|
|
485
482
|
|
|
486
483
|
return this;
|
|
487
484
|
}
|
|
485
|
+
}, {
|
|
486
|
+
key: "renderMultiPass",
|
|
487
|
+
value: function () {
|
|
488
|
+
var _renderMultiPass = _asyncToGenerator(_regeneratorRuntime.mark(function _callee() {
|
|
489
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
490
|
+
while (1) {
|
|
491
|
+
switch (_context.prev = _context.next) {
|
|
492
|
+
case 0:
|
|
493
|
+
if (!(this.getEncodedData().length !== 0)) {
|
|
494
|
+
_context.next = 7;
|
|
495
|
+
break;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
if (!(this.multiPassRenderer && this.multiPassRenderer.getRenderFlag())) {
|
|
499
|
+
_context.next = 6;
|
|
500
|
+
break;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
_context.next = 4;
|
|
504
|
+
return this.multiPassRenderer.render();
|
|
505
|
+
|
|
506
|
+
case 4:
|
|
507
|
+
_context.next = 7;
|
|
508
|
+
break;
|
|
509
|
+
|
|
510
|
+
case 6:
|
|
511
|
+
if (this.multiPassRenderer) {
|
|
512
|
+
this.renderModels();
|
|
513
|
+
} else {
|
|
514
|
+
this.renderModels();
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
case 7:
|
|
518
|
+
case "end":
|
|
519
|
+
return _context.stop();
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
}, _callee, this);
|
|
523
|
+
}));
|
|
524
|
+
|
|
525
|
+
function renderMultiPass() {
|
|
526
|
+
return _renderMultiPass.apply(this, arguments);
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
return renderMultiPass;
|
|
530
|
+
}()
|
|
488
531
|
}, {
|
|
489
532
|
key: "active",
|
|
490
533
|
value: function active(options) {
|
|
@@ -940,6 +983,31 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
|
|
|
940
983
|
value: function rebuildModels() {
|
|
941
984
|
throw new Error('Method not implemented.');
|
|
942
985
|
}
|
|
986
|
+
}, {
|
|
987
|
+
key: "renderMulPass",
|
|
988
|
+
value: function () {
|
|
989
|
+
var _renderMulPass = _asyncToGenerator(_regeneratorRuntime.mark(function _callee2(multiPassRenderer) {
|
|
990
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
991
|
+
while (1) {
|
|
992
|
+
switch (_context2.prev = _context2.next) {
|
|
993
|
+
case 0:
|
|
994
|
+
_context2.next = 2;
|
|
995
|
+
return multiPassRenderer.render();
|
|
996
|
+
|
|
997
|
+
case 2:
|
|
998
|
+
case "end":
|
|
999
|
+
return _context2.stop();
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
}, _callee2);
|
|
1003
|
+
}));
|
|
1004
|
+
|
|
1005
|
+
function renderMulPass(_x) {
|
|
1006
|
+
return _renderMulPass.apply(this, arguments);
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
return renderMulPass;
|
|
1010
|
+
}()
|
|
943
1011
|
}, {
|
|
944
1012
|
key: "renderModels",
|
|
945
1013
|
value: function renderModels(isPicking) {
|
package/es/core/BaseLayer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/core/BaseLayer.ts"],"names":["SyncBailHook","SyncHook","SyncWaterfallHook","BlendType","lazyInject","TYPES","encodePickingColor","EventEmitter","normalizePasses","BlendTypes","handleStyleDataMapping","updateShape","layerIdCounter","BaseLayer","IGlobalConfigService","config","dataSourceNeedUpdate","dataMappingNeedUpdate","filterNeedUpdate","featureScaleNeedUpdate","StyleAttrNeedUpdate","init","afterInit","beforeRender","beforeRenderData","afterRender","beforePickingEncode","afterPickingEncode","beforeHighlight","afterHighlight","beforeSelect","afterSelect","beforeDestroy","afterDestroy","enable","dataState","getLayerConfig","autoFit","fitBoundsOptions","fitBounds","emit","reRender","name","id","zIndex","rawConfig","configService","configToUpdate","inited","needUpdateConfig","sceneId","container","get","SceneID","setLayerConfig","sceneContainer","color","bottomColor","plugin","plugins","push","iconService","IIconService","fontService","IFontService","rendererService","IRendererService","layerService","ILayerService","interactionService","IInteractionService","pickingService","IPickingService","mapService","IMapService","cameraService","ICameraService","coordinateService","ICoordinateSystemService","shaderModuleService","IShaderModuleService","postProcessingPassFactory","IFactoryPostProcessingPass","normalPassFactory","IFactoryNormalPass","styleAttributeService","IStyleAttributeService","multiPassRenderer","IMultiPassRenderer","setLayer","pendingStyleAttributes","forEach","attributeName","attributeField","attributeValues","updateOptions","updateStyleAttribute","scale","field","splitValuesAndCallbackInAttribute","getAll","ILayerPlugin","apply","hooks","call","target","type","updateLayerConfig","getDefaultConfig","animateOption","startAnimate","aniamateStatus","values","lastShape","getLayerStyleAttribute","currentShape","options","rawAnimate","data","setSource","sourceOption","clusterZoom","layerSource","setData","on","passes","rest","pass","postProcessingPass","getPostProcessor","getPostProcessingPassByName","styleNeedUpdate","cfg","scaleOptions","rendering","renderLayers","getEncodedData","length","getRenderFlag","render","renderModels","activeOption","enableHighlight","highlightColor","mix","activeMix","x","y","pick","pickedFeatureID","then","setTimeout","option","enableSelect","selectColor","selectMix","blend","layerModelNeedUpdate","visible","index","updateLayerRenderList","currentPickId","selectedFeatureID","zoom","getZoom","minZoom","Infinity","maxZoom","source","getSource","extent","isValid","some","v","Math","abs","isDestroied","off","sourceEvent","destroy","clearAllAttributes","models","cleanRemove","removeAllListeners","model","layerModel","clearModels","getLayerStyleAttributes","filter","attribute","needRescale","needRemapping","needRegenerateVertices","cluster","updateClusterData","encodedData","getLayerAttributeScale","ticks","items","map","item","value","invertExtent","range","triggerHover","box","cb","boxPickLayer","moduleName","vertexShader","fragmentShader","triangulation","segmentNumber","registerModule","vs","fs","getModule","uniforms","createModel","createAttributesAndIndices","attributes","elements","normal","clock","getDelta","animateStartTime","getElapsedTime","stopAnimate","isPick","eventNames","indexOf","isVisible","Error","isPicking","buildModels","draw","getUninforms","getShaderPickStat","time","console","warn","valuesOrCallback","defaultValues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AkB6F,qBAAlB;AACA,aAAK7F,YAAL,CAAkBoE,YAAlB;AACD;AACF;;;WACD,2CACE0G,gBADF,EAEEC,aAFF,EAGE;AACA,aAAO;AACLlI,QAAAA,MAAM,EAAE,YAAWiI,gBAAX,IACJE,SADI,GAEJF,gBAAgB,IAAIC,aAHnB;AAILE,QAAAA,QAAQ,EAAE,YAAWH,gBAAX,IAA+BA,gBAA/B,GAAkDE;AAJvD,OAAP;AAMD;;;;EA/iCiE5O,Y;;;;;;SAA/CM,S","sourcesContent":["// @ts-ignore\nimport { SyncBailHook, SyncHook, SyncWaterfallHook } from '@antv/async-hook';\nimport {\n BlendType,\n gl,\n IActiveOption,\n IAnimateOption,\n ICameraService,\n ICoordinateSystemService,\n IDataState,\n IEncodeFeature,\n IFontService,\n IGlobalConfigService,\n IIconService,\n IInteractionService,\n ILayer,\n ILayerConfig,\n ILayerModel,\n ILayerModelInitializationOptions,\n ILayerPlugin,\n ILayerService,\n IMapService,\n IModel,\n IModelInitializationOptions,\n IMultiPassRenderer,\n IPass,\n IPickingService,\n IPostProcessingPass,\n IRendererService,\n IScale,\n IScaleOptions,\n IShaderModuleService,\n ISource,\n ISourceCFG,\n IStyleAttributeInitializationOptions,\n IStyleAttributeService,\n IStyleAttributeUpdateOptions,\n lazyInject,\n ScaleAttributeType,\n ScaleTypeName,\n ScaleTypes,\n StyleAttributeField,\n StyleAttributeOption,\n TYPES,\n} from '@antv/l7-core';\nimport Source from '@antv/l7-source';\nimport { encodePickingColor } from '@antv/l7-utils';\nimport { EventEmitter } from 'eventemitter3';\nimport { Container } from 'inversify';\nimport { isFunction, isObject } from 'lodash';\nimport { normalizePasses } from '../plugins/MultiPassRendererPlugin';\nimport { BlendTypes } from '../utils/blend';\nimport { handleStyleDataMapping } from '../utils/dataMappingStyle';\nimport { updateShape } from '../utils/updateShape';\nimport baseLayerSchema from './schema';\n/**\n * 分配 layer id\n */\nlet layerIdCounter = 0;\n\nexport default class BaseLayer<ChildLayerStyleOptions = {}> extends EventEmitter\n implements ILayer {\n public id: string = `${layerIdCounter++}`;\n public name: string = `${layerIdCounter}`;\n public type: string;\n public visible: boolean = true;\n public zIndex: number = 0;\n public minZoom: number;\n public maxZoom: number;\n public inited: boolean = false;\n public layerModelNeedUpdate: boolean = false;\n public pickedFeatureID: number | null = null;\n public selectedFeatureID: number | null = null;\n public styleNeedUpdate: boolean = false;\n public rendering: boolean;\n public clusterZoom: number = 0; // 聚合等级标记\n\n public dataState: IDataState = {\n dataSourceNeedUpdate: false,\n dataMappingNeedUpdate: false,\n filterNeedUpdate: false,\n featureScaleNeedUpdate: false,\n StyleAttrNeedUpdate: false,\n };\n // 生命周期钩子\n public hooks = {\n init: new SyncBailHook(),\n afterInit: new SyncBailHook(),\n beforeRender: new SyncBailHook(),\n beforeRenderData: new SyncWaterfallHook(),\n afterRender: new SyncHook(),\n beforePickingEncode: new SyncHook(),\n afterPickingEncode: new SyncHook(),\n beforeHighlight: new SyncHook(['pickedColor']),\n afterHighlight: new SyncHook(),\n beforeSelect: new SyncHook(['pickedColor']),\n afterSelect: new SyncHook(),\n beforeDestroy: new SyncHook(),\n afterDestroy: new SyncHook(),\n };\n\n // 待渲染 model 列表\n public models: IModel[] = [];\n\n // 每个 Layer 都有一个\n public multiPassRenderer: IMultiPassRenderer;\n\n // 注入插件集\n public plugins: ILayerPlugin[];\n\n public sourceOption: {\n data: any;\n options?: ISourceCFG;\n };\n\n public layerModel: ILayerModel;\n\n // TODO: 记录 sceneContainer 供创建子图层的时候使用 如 imageTileLayer\n public sceneContainer: Container | undefined;\n // TODO: 用于保存子图层对象\n public layerChildren: ILayer[] = [];\n\n @lazyInject(TYPES.IGlobalConfigService)\n protected readonly configService: IGlobalConfigService;\n\n // @lazyInject(TYPES.IShaderModuleService)\n // protected readonly shaderModuleService: IShaderModuleService;\n\n protected shaderModuleService: IShaderModuleService;\n protected cameraService: ICameraService;\n\n protected coordinateService: ICoordinateSystemService;\n\n protected iconService: IIconService;\n\n protected fontService: IFontService;\n\n protected pickingService: IPickingService;\n\n protected rendererService: IRendererService;\n\n protected layerService: ILayerService;\n\n protected interactionService: IInteractionService;\n\n protected mapService: IMapService;\n\n protected styleAttributeService: IStyleAttributeService;\n\n protected layerSource: Source;\n\n protected postProcessingPassFactory: (\n name: string,\n ) => IPostProcessingPass<unknown>;\n protected normalPassFactory: (name: string) => IPass<unknown>;\n\n protected animateOptions: IAnimateOption = { enable: false };\n\n /**\n * 图层容器\n */\n private container: Container;\n\n private encodedData: IEncodeFeature[];\n\n private configSchema: object;\n\n private currentPickId: number | null = null;\n\n private rawConfig: Partial<ILayerConfig & ChildLayerStyleOptions>;\n\n private needUpdateConfig: Partial<ILayerConfig & ChildLayerStyleOptions>;\n\n /**\n * 待更新样式属性,在初始化阶段完成注册\n */\n private pendingStyleAttributes: Array<{\n attributeName: string;\n attributeField: StyleAttributeField;\n attributeValues?: StyleAttributeOption;\n defaultName?: string;\n updateOptions?: Partial<IStyleAttributeUpdateOptions>;\n }> = [];\n\n private scaleOptions: IScaleOptions = {};\n\n private animateStartTime: number;\n\n private aniamateStatus: boolean = false;\n\n // TODO: layer 保底颜色\n private bottomColor = 'rgba(0, 0, 0, 0)';\n\n private isDestroied: boolean = false;\n\n // private pickingPassRender: IPass<'pixelPicking'>;\n\n constructor(config: Partial<ILayerConfig & ChildLayerStyleOptions> = {}) {\n super();\n this.name = config.name || this.id;\n this.zIndex = config.zIndex || 0;\n this.rawConfig = config;\n }\n\n public getLayerConfig() {\n return this.configService.getLayerConfig<ChildLayerStyleOptions>(this.id);\n }\n\n public updateLayerConfig(\n configToUpdate: Partial<ILayerConfig | ChildLayerStyleOptions>,\n ) {\n if (!this.inited) {\n this.needUpdateConfig = {\n ...this.needUpdateConfig,\n ...configToUpdate,\n };\n } else {\n const sceneId = this.container.get<string>(TYPES.SceneID);\n\n // @ts-ignore\n handleStyleDataMapping(configToUpdate, this); // 处理 style 中进行数据映射的属性字段\n\n this.configService.setLayerConfig(sceneId, this.id, {\n ...this.configService.getLayerConfig(this.id),\n ...this.needUpdateConfig,\n ...configToUpdate,\n });\n this.needUpdateConfig = {};\n }\n }\n\n /**\n * 注入图层容器,父容器为场景容器\n * RootContainer 1\n * -> SceneContainer 1.*\n * -> LayerContainer 1.*\n */\n public setContainer(container: Container, sceneContainer: Container) {\n this.container = container;\n this.sceneContainer = sceneContainer;\n }\n\n public getContainer() {\n return this.container;\n }\n\n public setBottomColor(color: string) {\n this.bottomColor = color;\n }\n\n public getBottomColor() {\n return this.bottomColor;\n }\n\n public addPlugin(plugin: ILayerPlugin): ILayer {\n // TODO: 控制插件注册顺序\n // @example:\n // pointLayer.addPlugin(new MyCustomPlugin(), {\n // before: 'L7BuiltinPlugin'\n // });\n this.plugins.push(plugin);\n return this;\n }\n\n public init() {\n // 设置配置项\n const sceneId = this.container.get<string>(TYPES.SceneID);\n // 初始化图层配置项\n // const { enableMultiPassRenderer = false } = this.rawConfig;\n // this.configService.setLayerConfig(sceneId, this.id, {\n // enableMultiPassRenderer,\n // });\n this.configService.setLayerConfig(sceneId, this.id, this.rawConfig);\n\n // 全局容器服务\n\n // 场景容器服务\n this.iconService = this.container.get<IIconService>(TYPES.IIconService);\n this.fontService = this.container.get<IFontService>(TYPES.IFontService);\n\n this.rendererService = this.container.get<IRendererService>(\n TYPES.IRendererService,\n );\n this.layerService = this.container.get<ILayerService>(TYPES.ILayerService);\n this.interactionService = this.container.get<IInteractionService>(\n TYPES.IInteractionService,\n );\n\n this.pickingService = this.container.get<IPickingService>(\n TYPES.IPickingService,\n );\n this.mapService = this.container.get<IMapService>(TYPES.IMapService);\n this.cameraService = this.container.get<ICameraService>(\n TYPES.ICameraService,\n );\n this.coordinateService = this.container.get<ICoordinateSystemService>(\n TYPES.ICoordinateSystemService,\n );\n this.shaderModuleService = this.container.get<IShaderModuleService>(\n TYPES.IShaderModuleService,\n );\n this.postProcessingPassFactory = this.container.get(\n TYPES.IFactoryPostProcessingPass,\n );\n this.normalPassFactory = this.container.get(TYPES.IFactoryNormalPass);\n\n // 图层容器服务\n this.styleAttributeService = this.container.get<IStyleAttributeService>(\n TYPES.IStyleAttributeService,\n );\n this.multiPassRenderer = this.container.get<IMultiPassRenderer>(\n TYPES.IMultiPassRenderer,\n );\n this.multiPassRenderer.setLayer(this);\n\n // 完成样式服务注册完成前添加的属性\n this.pendingStyleAttributes.forEach(\n ({ attributeName, attributeField, attributeValues, updateOptions }) => {\n this.styleAttributeService.updateStyleAttribute(\n attributeName,\n {\n // @ts-ignore\n scale: {\n field: attributeField,\n ...this.splitValuesAndCallbackInAttribute(\n // @ts-ignore\n attributeValues,\n // @ts-ignore\n this.getLayerConfig()[attributeName],\n ),\n },\n },\n // @ts-ignore\n updateOptions,\n );\n },\n );\n this.pendingStyleAttributes = [];\n\n // 获取插件集\n this.plugins = this.container.getAll<ILayerPlugin>(TYPES.ILayerPlugin);\n // 完成插件注册,传入场景和图层容器内的服务\n for (const plugin of this.plugins) {\n plugin.apply(this, {\n rendererService: this.rendererService,\n mapService: this.mapService,\n styleAttributeService: this.styleAttributeService,\n normalPassFactory: this.normalPassFactory,\n postProcessingPassFactory: this.postProcessingPassFactory,\n });\n }\n\n // 触发 init 生命周期插件\n this.hooks.init.call();\n // this.pickingPassRender = this.normalPassFactory('pixelPicking');\n // this.pickingPassRender.init(this);\n this.hooks.afterInit.call();\n\n // 触发初始化完成事件;\n this.emit('inited', {\n target: this,\n type: 'inited',\n });\n this.emit('add', {\n target: this,\n type: 'add',\n });\n return this;\n }\n /**\n * Model初始化前需要更新Model样式\n */\n public prepareBuildModel() {\n this.inited = true;\n this.updateLayerConfig({\n ...(this.getDefaultConfig() as object),\n ...this.rawConfig,\n });\n\n // 启动动画\n const { animateOption } = this.getLayerConfig();\n if (animateOption?.enable) {\n this.layerService.startAnimate();\n this.aniamateStatus = true;\n }\n }\n public color(\n field: StyleAttributeField,\n values?: StyleAttributeOption,\n updateOptions?: Partial<IStyleAttributeUpdateOptions>,\n ) {\n // 设置 color、size、shape、style 时由于场景服务尚未完成(并没有调用 scene.addLayer),因此暂时加入待更新属性列表\n this.updateStyleAttribute('color', field, values, updateOptions);\n\n // this.pendingStyleAttributes.push({\n // attributeName: 'color',\n // attributeField: field,\n // attributeValues: values,\n // defaultName: 'colors',\n // updateOptions,\n // });\n return this;\n }\n\n // 为对应的图层传入纹理的编号名称(point/image 在 shape 方法中传入纹理名称的方法并不通用)\n public texture(\n field: StyleAttributeField,\n values?: StyleAttributeOption,\n updateOptions?: Partial<IStyleAttributeUpdateOptions>,\n ) {\n this.updateStyleAttribute('texture', field, values, updateOptions);\n return this;\n }\n\n public rotate(\n field: StyleAttributeField,\n values?: StyleAttributeOption,\n updateOptions?: Partial<IStyleAttributeUpdateOptions>,\n ) {\n this.updateStyleAttribute('rotate', field, values, updateOptions);\n return this;\n }\n public size(\n field: StyleAttributeField,\n values?: StyleAttributeOption,\n updateOptions?: Partial<IStyleAttributeUpdateOptions>,\n ) {\n this.updateStyleAttribute('size', field, values, updateOptions);\n return this;\n }\n // 对mapping后的数据过滤,scale保持不变\n public filter(\n field: StyleAttributeField,\n values?: StyleAttributeOption,\n updateOptions?: Partial<IStyleAttributeUpdateOptions>,\n ) {\n this.updateStyleAttribute('filter', field, values, updateOptions);\n return this;\n }\n\n public shape(\n field: StyleAttributeField,\n values?: StyleAttributeOption,\n updateOptions?: Partial<IStyleAttributeUpdateOptions>,\n ) {\n const lastShape = this.styleAttributeService?.getLayerStyleAttribute(\n 'shape',\n )?.scale?.field;\n const currentShape = field;\n this.updateStyleAttribute('shape', field, values, updateOptions);\n // TODO: 根据 shape 判断是否需要更新 model\n updateShape(this, lastShape, currentShape);\n return this;\n }\n public label(\n field: StyleAttributeField,\n values?: StyleAttributeOption,\n updateOptions?: Partial<IStyleAttributeUpdateOptions>,\n ) {\n this.pendingStyleAttributes.push({\n attributeName: 'label',\n attributeField: field,\n attributeValues: values,\n updateOptions,\n });\n return this;\n }\n public animate(options: IAnimateOption | boolean) {\n let rawAnimate: Partial<IAnimateOption> = {};\n if (isObject(options)) {\n rawAnimate.enable = true;\n rawAnimate = {\n ...rawAnimate,\n ...options,\n };\n } else {\n rawAnimate.enable = options;\n }\n this.updateLayerConfig({\n animateOption: rawAnimate,\n });\n // this.animateOptions = options;\n return this;\n }\n\n public source(data: any, options?: ISourceCFG): ILayer {\n if (data?.data) {\n // 判断是否为source\n this.setSource(data);\n return this;\n }\n this.sourceOption = {\n data,\n options,\n };\n this.clusterZoom = 0;\n return this;\n }\n public setData(data: any, options?: ISourceCFG) {\n if (this.inited) {\n this.layerSource.setData(data, options);\n } else {\n this.on('inited', () => {\n this.layerSource.setData(data, options);\n });\n }\n\n return this;\n }\n public style(\n options: Partial<ChildLayerStyleOptions> & Partial<ILayerConfig>,\n ): ILayer {\n const { passes, ...rest } = options;\n\n // passes 特殊处理\n if (passes) {\n normalizePasses(passes).forEach(\n (pass: [string, { [key: string]: unknown }]) => {\n const postProcessingPass = this.multiPassRenderer\n .getPostProcessor()\n .getPostProcessingPassByName(pass[0]);\n if (postProcessingPass) {\n postProcessingPass.updateOptions(pass[1]);\n }\n },\n );\n }\n\n this.rawConfig = {\n ...this.rawConfig,\n ...rest,\n };\n if (this.container) {\n this.updateLayerConfig(this.rawConfig);\n this.styleNeedUpdate = true;\n }\n return this;\n }\n public scale(field: string | number | IScaleOptions, cfg?: IScale) {\n if (isObject(field)) {\n this.scaleOptions = {\n ...this.scaleOptions,\n ...field,\n };\n } else {\n this.scaleOptions[field] = cfg;\n }\n return this;\n }\n\n /**\n * 渲染所有的图层\n */\n public renderLayers(): void {\n this.rendering = true;\n\n this.layerService.renderLayers();\n\n this.rendering = false;\n }\n\n public render(): ILayer {\n // if (\n // this.needPick() &&\n // this.multiPassRenderer &&\n // this.multiPassRenderer.getRenderFlag()\n // ) {\n // this.multiPassRenderer.render();\n // } else if (this.needPick() && this.multiPassRenderer) {\n // this.renderModels();\n // } else {\n // this.renderModels();\n // }\n\n // TODO: this.getEncodedData().length !== 0 这个判断是为了解决在 2.5.x 引入数据纹理后产生的 空数据渲染导致 texture 超出上限问题\n if (this.getEncodedData().length !== 0) {\n if (this.multiPassRenderer && this.multiPassRenderer.getRenderFlag()) {\n // multi render 开始执行 multiPassRender 的渲染流程\n this.multiPassRenderer.render();\n } else if (this.multiPassRenderer) {\n // renderPass 触发的渲染\n this.renderModels();\n } else {\n this.renderModels();\n }\n\n // this.renderModels();\n }\n // this.renderModels();\n\n // this.multiPassRenderer.render();\n // this.renderModels();\n return this;\n }\n\n public active(options: IActiveOption | boolean) {\n const activeOption: Partial<ILayerConfig> = {};\n activeOption.enableHighlight = isObject(options) ? true : options;\n if (isObject(options)) {\n activeOption.enableHighlight = true;\n if (options.color) {\n activeOption.highlightColor = options.color;\n }\n if (options.mix) {\n activeOption.activeMix = options.mix;\n }\n } else {\n activeOption.enableHighlight = !!options;\n }\n this.updateLayerConfig(activeOption);\n return this;\n }\n public setActive(\n id: number | { x: number; y: number },\n options?: IActiveOption,\n ): void {\n if (isObject(id)) {\n const { x = 0, y = 0 } = id;\n this.updateLayerConfig({\n highlightColor: isObject(options)\n ? options.color\n : this.getLayerConfig().highlightColor,\n activeMix: isObject(options)\n ? options.mix\n : this.getLayerConfig().activeMix,\n });\n this.pick({ x, y });\n } else {\n this.updateLayerConfig({\n pickedFeatureID: id,\n highlightColor: isObject(options)\n ? options.color\n : this.getLayerConfig().highlightColor,\n activeMix: isObject(options)\n ? options.mix\n : this.getLayerConfig().activeMix,\n });\n this.hooks.beforeSelect\n .call(encodePickingColor(id as number) as number[])\n // @ts-ignore\n .then(() => {\n setTimeout(() => {\n this.reRender();\n }, 1);\n });\n }\n }\n\n public select(option: IActiveOption | boolean): ILayer {\n const activeOption: Partial<ILayerConfig> = {};\n activeOption.enableSelect = isObject(option) ? true : option;\n if (isObject(option)) {\n activeOption.enableSelect = true;\n if (option.color) {\n activeOption.selectColor = option.color;\n }\n if (option.mix) {\n activeOption.selectMix = option.mix;\n }\n } else {\n activeOption.enableSelect = !!option;\n }\n this.updateLayerConfig(activeOption);\n return this;\n }\n\n public setSelect(\n id: number | { x: number; y: number },\n options?: IActiveOption,\n ): void {\n if (isObject(id)) {\n const { x = 0, y = 0 } = id;\n this.updateLayerConfig({\n selectColor: isObject(options)\n ? options.color\n : this.getLayerConfig().selectColor,\n selectMix: isObject(options)\n ? options.mix\n : this.getLayerConfig().selectMix,\n });\n this.pick({ x, y });\n } else {\n this.updateLayerConfig({\n pickedFeatureID: id,\n selectColor: isObject(options)\n ? options.color\n : this.getLayerConfig().selectColor,\n selectMix: isObject(options)\n ? options.mix\n : this.getLayerConfig().selectMix,\n });\n this.hooks.beforeSelect\n .call(encodePickingColor(id as number) as number[])\n // @ts-ignore\n .then(() => {\n setTimeout(() => {\n this.reRender();\n }, 1);\n });\n }\n }\n public setBlend(type: keyof typeof BlendType): void {\n this.updateLayerConfig({\n blend: type,\n });\n this.layerModelNeedUpdate = true;\n this.reRender();\n }\n public show(): ILayer {\n this.updateLayerConfig({\n visible: true,\n });\n this.reRender();\n return this;\n }\n\n public hide(): ILayer {\n this.updateLayerConfig({\n visible: false,\n });\n this.reRender();\n return this;\n }\n public setIndex(index: number): ILayer {\n this.zIndex = index;\n this.layerService.updateLayerRenderList();\n this.layerService.renderLayers();\n return this;\n }\n\n public setCurrentPickId(id: number) {\n this.currentPickId = id;\n }\n\n public getCurrentPickId(): number | null {\n return this.currentPickId;\n }\n\n public setCurrentSelectedId(id: number) {\n this.selectedFeatureID = id;\n }\n\n public getCurrentSelectedId(): number | null {\n return this.selectedFeatureID;\n }\n public isVisible(): boolean {\n const zoom = this.mapService.getZoom();\n const {\n visible,\n minZoom = -Infinity,\n maxZoom = Infinity,\n } = this.getLayerConfig();\n return !!visible && zoom >= minZoom && zoom <= maxZoom;\n }\n\n public setMinZoom(minZoom: number): ILayer {\n this.updateLayerConfig({\n minZoom,\n });\n return this;\n }\n\n public getMinZoom(): number {\n const { minZoom } = this.getLayerConfig();\n return minZoom as number;\n }\n\n public getMaxZoom(): number {\n const { maxZoom } = this.getLayerConfig();\n return maxZoom as number;\n }\n\n public get(name: string) {\n const cfg = this.getLayerConfig();\n // @ts-ignore\n return cfg[name];\n }\n\n public setMaxZoom(maxZoom: number): ILayer {\n this.updateLayerConfig({\n maxZoom,\n });\n return this;\n }\n /**\n * zoom to layer Bounds\n */\n public fitBounds(fitBoundsOptions?: unknown): ILayer {\n if (!this.inited) {\n this.updateLayerConfig({\n autoFit: true,\n });\n return this;\n }\n const source = this.getSource();\n const extent = source.extent;\n const isValid = extent.some((v) => Math.abs(v) === Infinity);\n if (isValid) {\n return this;\n }\n this.mapService.fitBounds(\n [\n [extent[0], extent[1]],\n [extent[2], extent[3]],\n ],\n fitBoundsOptions,\n );\n return this;\n }\n\n public destroy() {\n // debugger\n if (this.isDestroied) {\n return;\n }\n this.hooks.beforeDestroy.call();\n // 清除sources事件\n this.layerSource.off('update', this.sourceEvent);\n\n this.multiPassRenderer.destroy();\n // console.log(this.styleAttributeService.getAttributes())\n // 清除所有属性以及关联的 vao == 销毁所有 => model this.models.forEach((model) => model.destroy());\n this.styleAttributeService.clearAllAttributes();\n\n // 执行每个图层单独的 clearModels 方法 (清除一些额外的 texture、program、buffer 等)\n\n this.hooks.afterDestroy.call();\n\n // TODO: 清除各个图层自定义的 models 资源\n // this.layerModel?.clearModels();\n\n this.models = [];\n\n this.layerService.cleanRemove(this);\n\n this.emit('remove', {\n target: this,\n type: 'remove',\n });\n\n this.emit('destroy', {\n target: this,\n type: 'destroy',\n });\n\n this.removeAllListeners();\n // 解绑图层容器中的服务\n // this.container.unbind(TYPES.IStyleAttributeService);\n\n this.isDestroied = true;\n }\n public clear() {\n this.styleAttributeService.clearAllAttributes();\n // 销毁所有 model\n }\n public clearModels() {\n this.models.forEach((model) => model.destroy());\n this.layerModel.clearModels();\n }\n\n public isDirty() {\n return !!(\n this.styleAttributeService.getLayerStyleAttributes() || []\n ).filter(\n (attribute) =>\n attribute.needRescale ||\n attribute.needRemapping ||\n attribute.needRegenerateVertices,\n ).length;\n }\n\n public setSource(source: Source) {\n // 清除旧 sources 事件\n if (this.layerSource) {\n this.layerSource.off('update', this.sourceEvent);\n }\n\n this.layerSource = source;\n this.clusterZoom = 0;\n\n // 已 inited 且启用聚合进行更新聚合数据\n if (this.inited && this.layerSource.cluster) {\n const zoom = this.mapService.getZoom();\n this.layerSource.updateClusterData(zoom);\n }\n // source 可能会复用,会在其它layer被修改\n this.layerSource.on('update', this.sourceEvent);\n }\n public getSource() {\n return this.layerSource;\n }\n\n public getScaleOptions() {\n return this.scaleOptions;\n }\n\n public setEncodedData(encodedData: IEncodeFeature[]) {\n this.encodedData = encodedData;\n }\n public getEncodedData() {\n return this.encodedData;\n }\n public getLegendItems(name: string): any {\n const scale = this.styleAttributeService.getLayerAttributeScale(name);\n if (scale) {\n if (scale.ticks) {\n const items = scale.ticks().map((item: any) => {\n return {\n value: item,\n [name]: scale(item),\n };\n });\n return items;\n } else if (scale.invertExtent) {\n const items = scale.range().map((item: any) => {\n return {\n value: scale.invertExtent(item),\n [name]: item,\n };\n });\n return items;\n }\n } else {\n return [];\n }\n }\n\n public pick({ x, y }: { x: number; y: number }) {\n this.interactionService.triggerHover({ x, y });\n }\n\n public boxSelect(\n box: [number, number, number, number],\n cb: (...args: any[]) => void,\n ) {\n this.pickingService.boxPickLayer(this, box, cb);\n }\n\n public buildLayerModel(\n options: ILayerModelInitializationOptions &\n Partial<IModelInitializationOptions>,\n ): IModel {\n const {\n moduleName,\n vertexShader,\n fragmentShader,\n triangulation,\n segmentNumber,\n ...rest\n } = options;\n this.shaderModuleService.registerModule(moduleName, {\n vs: vertexShader,\n fs: fragmentShader,\n });\n const { vs, fs, uniforms } = this.shaderModuleService.getModule(moduleName);\n const { createModel } = this.rendererService;\n const {\n attributes,\n elements,\n } = this.styleAttributeService.createAttributesAndIndices(\n this.encodedData,\n triangulation,\n segmentNumber,\n );\n return createModel({\n attributes,\n uniforms,\n fs,\n vs,\n elements,\n blend: BlendTypes[BlendType.normal],\n ...rest,\n });\n }\n\n public getTime() {\n return this.layerService.clock.getDelta();\n }\n public setAnimateStartTime() {\n this.animateStartTime = this.layerService.clock.getElapsedTime();\n }\n public stopAnimate() {\n if (this.aniamateStatus) {\n this.layerService.stopAnimate();\n this.aniamateStatus = false;\n this.updateLayerConfig({\n animateOption: {\n enable: false,\n },\n });\n }\n }\n public getLayerAnimateTime(): number {\n return this.layerService.clock.getElapsedTime() - this.animateStartTime;\n }\n\n public needPick(type: string): boolean {\n const {\n enableHighlight = true,\n enableSelect = true,\n } = this.getLayerConfig();\n // 判断layer是否监听事件;\n let isPick =\n this.eventNames().indexOf(type) !== -1 ||\n this.eventNames().indexOf('un' + type) !== -1;\n if ((type === 'click' || type === 'dblclick') && enableSelect) {\n isPick = true;\n }\n if (\n type === 'mousemove' &&\n (enableHighlight ||\n this.eventNames().indexOf('mouseenter') !== -1 ||\n this.eventNames().indexOf('unmousemove') !== -1 ||\n this.eventNames().indexOf('mouseout') !== -1)\n ) {\n isPick = true;\n }\n return this.isVisible() && isPick;\n }\n\n public buildModels() {\n throw new Error('Method not implemented.');\n }\n public rebuildModels() {\n throw new Error('Method not implemented.');\n }\n\n public renderModels(isPicking?: boolean) {\n // TODO: this.getEncodedData().length > 0 这个判断是为了解决在 2.5.x 引入数据纹理后产生的 空数据渲染导致 texture 超出上限问题\n if (this.getEncodedData().length > 0) {\n if (this.layerModelNeedUpdate && this.layerModel) {\n this.models = this.layerModel.buildModels();\n this.hooks.beforeRender.call();\n this.layerModelNeedUpdate = false;\n }\n this.models.forEach((model) => {\n model.draw(\n {\n uniforms: this.layerModel.getUninforms(),\n },\n isPicking,\n );\n });\n }\n return this;\n }\n\n public updateStyleAttribute(\n type: string,\n field: StyleAttributeField,\n values?: StyleAttributeOption,\n updateOptions?: Partial<IStyleAttributeUpdateOptions>,\n ) {\n if (!this.inited) {\n this.pendingStyleAttributes.push({\n attributeName: type,\n attributeField: field,\n attributeValues: values,\n updateOptions,\n });\n } else {\n this.styleAttributeService.updateStyleAttribute(\n type,\n {\n // @ts-ignore\n scale: {\n field,\n ...this.splitValuesAndCallbackInAttribute(\n // @ts-ignore\n values,\n // @ts-ignore\n this.getLayerConfig()[field],\n ),\n },\n },\n // @ts-ignore\n updateOptions,\n );\n }\n }\n\n public getShaderPickStat() {\n return this.layerService.getShaderPickStat();\n }\n\n /**\n * 继承空方法\n * @param time\n */\n public setEarthTime(time: number) {\n console.warn('empty fn');\n }\n\n protected getConfigSchema() {\n throw new Error('Method not implemented.');\n }\n\n protected getModelType(): unknown {\n throw new Error('Method not implemented.');\n }\n protected getDefaultConfig() {\n return {};\n }\n\n private sourceEvent = () => {\n this.dataState.dataSourceNeedUpdate = true;\n const { autoFit, fitBoundsOptions } = this.getLayerConfig();\n if (autoFit) {\n this.fitBounds(fitBoundsOptions);\n }\n // 对外暴露事件\n this.emit('dataUpdate');\n this.reRender();\n };\n\n private reRender() {\n if (this.inited) {\n this.layerService.updateLayerRenderList();\n this.layerService.renderLayers();\n }\n }\n private splitValuesAndCallbackInAttribute(\n valuesOrCallback?: unknown[],\n defaultValues?: unknown[],\n ) {\n return {\n values: isFunction(valuesOrCallback)\n ? undefined\n : valuesOrCallback || defaultValues,\n callback: isFunction(valuesOrCallback) ? valuesOrCallback : undefined,\n };\n }\n}\n"],"file":"BaseLayer.js"}
|
|
1
|
+
{"version":3,"sources":["../../src/core/BaseLayer.ts"],"names":["SyncBailHook","SyncHook","SyncWaterfallHook","BlendType","lazyInject","TYPES","encodePickingColor","EventEmitter","normalizePasses","BlendTypes","handleStyleDataMapping","updateShape","layerIdCounter","BaseLayer","IGlobalConfigService","config","dataSourceNeedUpdate","dataMappingNeedUpdate","filterNeedUpdate","featureScaleNeedUpdate","StyleAttrNeedUpdate","init","afterInit","beforeRender","beforeRenderData","afterRender","beforePickingEncode","afterPickingEncode","beforeHighlight","afterHighlight","beforeSelect","afterSelect","beforeDestroy","afterDestroy","enable","dataState","getLayerConfig","autoFit","fitBoundsOptions","fitBounds","emit","reRender","name","id","zIndex","rawConfig","configService","configToUpdate","inited","needUpdateConfig","sceneId","container","get","SceneID","setLayerConfig","sceneContainer","color","bottomColor","plugin","plugins","push","iconService","IIconService","fontService","IFontService","rendererService","IRendererService","layerService","ILayerService","interactionService","IInteractionService","pickingService","IPickingService","mapService","IMapService","cameraService","ICameraService","coordinateService","ICoordinateSystemService","shaderModuleService","IShaderModuleService","postProcessingPassFactory","IFactoryPostProcessingPass","normalPassFactory","IFactoryNormalPass","styleAttributeService","IStyleAttributeService","multiPassRenderer","IMultiPassRenderer","setLayer","pendingStyleAttributes","forEach","attributeName","attributeField","attributeValues","updateOptions","updateStyleAttribute","scale","field","splitValuesAndCallbackInAttribute","getAll","ILayerPlugin","apply","hooks","call","target","type","updateLayerConfig","getDefaultConfig","animateOption","startAnimate","aniamateStatus","values","lastShape","getLayerStyleAttribute","currentShape","options","rawAnimate","data","setSource","sourceOption","clusterZoom","layerSource","setData","on","passes","rest","pass","postProcessingPass","getPostProcessor","getPostProcessingPassByName","styleNeedUpdate","cfg","scaleOptions","rendering","renderLayers","getEncodedData","length","renderModels","getRenderFlag","render","activeOption","enableHighlight","highlightColor","mix","activeMix","x","y","pick","pickedFeatureID","then","setTimeout","option","enableSelect","selectColor","selectMix","blend","layerModelNeedUpdate","visible","index","updateLayerRenderList","currentPickId","selectedFeatureID","zoom","getZoom","minZoom","Infinity","maxZoom","source","getSource","extent","isValid","some","v","Math","abs","isDestroied","off","sourceEvent","destroy","clearAllAttributes","models","cleanRemove","removeAllListeners","model","layerModel","clearModels","getLayerStyleAttributes","filter","attribute","needRescale","needRemapping","needRegenerateVertices","cluster","updateClusterData","encodedData","getLayerAttributeScale","ticks","items","map","item","value","invertExtent","range","triggerHover","box","cb","boxPickLayer","moduleName","vertexShader","fragmentShader","triangulation","segmentNumber","registerModule","vs","fs","getModule","uniforms","createModel","createAttributesAndIndices","attributes","elements","normal","clock","getDelta","animateStartTime","getElapsedTime","stopAnimate","isPick","eventNames","indexOf","isVisible","Error","isPicking","buildModels","draw","getUninforms","getShaderPickStat","time","console","warn","valuesOrCallback","defaultValues","undefined","callback"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,SAASA,YAAT,EAAuBC,QAAvB,EAAiCC,iBAAjC,QAA0D,kBAA1D;AACA,SACEC,SADF,EAmCEC,UAnCF,EAyCEC,KAzCF,QA0CO,eA1CP;AA4CA,SAASC,kBAAT,QAAmC,gBAAnC;AACA,SAASC,YAAT,QAA6B,eAA7B;AAGA,SAASC,eAAT,QAAgC,oCAAhC;AACA,SAASC,UAAT,QAA2B,gBAA3B;AACA,SAASC,sBAAT,QAAuC,2BAAvC;AACA,SAASC,WAAT,QAA4B,sBAA5B;AAKA,IAAIC,cAAc,GAAG,CAArB;IAEqBC,S,WA8DlBT,UAAU,CAACC,KAAK,CAACS,oBAAP,C;;;;;AA2EX,uBAAyE;AAAA;;AAAA,QAA7DC,MAA6D,uEAAJ,EAAI;;AAAA;;AACvE;;AADuE,mEAvIlDH,cAAc,EAuIoC;;AAAA,qEAtIhDA,cAsIgD;;AAAA;;AAAA,8DApI/C,IAoI+C;;AAAA,6DAnIjD,CAmIiD;;AAAA;;AAAA;;AAAA,6DAhIhD,KAgIgD;;AAAA,2EA/HlC,KA+HkC;;AAAA,sEA9HjC,IA8HiC;;AAAA,wEA7H/B,IA6H+B;;AAAA,sEA5HvC,KA4HuC;;AAAA;;AAAA,kEA1H5C,CA0H4C;;AAAA,gEAxH1C;AAC7BI,MAAAA,oBAAoB,EAAE,KADO;AAE7BC,MAAAA,qBAAqB,EAAE,KAFM;AAG7BC,MAAAA,gBAAgB,EAAE,KAHW;AAI7BC,MAAAA,sBAAsB,EAAE,KAJK;AAK7BC,MAAAA,mBAAmB,EAAE;AALQ,KAwH0C;;AAAA,4DAhH1D;AACbC,MAAAA,IAAI,EAAE,IAAIrB,YAAJ,EADO;AAEbsB,MAAAA,SAAS,EAAE,IAAItB,YAAJ,EAFE;AAGbuB,MAAAA,YAAY,EAAE,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B,CAJC,CAFA;AAFP,SAFF,EAeEH,aAfF;AAiBD;AACF;;;WAED,6BAA2B;AACzB,aAAO,KAAK5B,YAAL,CAAkB0K,iBAAlB,EAAP;AACD;;;WAMD,sBAAoBC,IAApB,EAAkC;AAChCC,MAAAA,OAAO,CAACC,IAAR,CAAa,UAAb;AACD;;;WAED,2BAA4B;AAC1B,YAAM,IAAIR,KAAJ,CAAU,yBAAV,CAAN;AACD;;;WAED,wBAAkC;AAChC,YAAM,IAAIA,KAAJ,CAAU,yBAAV,CAAN;AACD;;;WACD,4BAA6B;AAC3B,aAAO,EAAP;AACD;;;WAaD,oBAAmB;AACjB,UAAI,KAAKxL,MAAT,EAAiB;AACf,aAAKmB,YAAL,CAAkB6F,qBAAlB;AACA,aAAK7F,YAAL,CAAkBoE,YAAlB;AACD;AACF;;;WACD,2CACE0G,gBADF,EAEEC,aAFF,EAGE;AACA,aAAO;AACLlI,QAAAA,MAAM,EAAE,YAAWiI,gBAAX,IACJE,SADI,GAEJF,gBAAgB,IAAIC,aAHnB;AAILE,QAAAA,QAAQ,EAAE,YAAWH,gBAAX,IAA+BA,gBAA/B,GAAkDE;AAJvD,OAAP;AAMD;;;;EA1iCiE5O,Y;;;;;;SAA/CM,S","sourcesContent":["// @ts-ignore\nimport { SyncBailHook, SyncHook, SyncWaterfallHook } from '@antv/async-hook';\nimport {\n BlendType,\n gl,\n IActiveOption,\n IAnimateOption,\n ICameraService,\n ICoordinateSystemService,\n IDataState,\n IEncodeFeature,\n IFontService,\n IGlobalConfigService,\n IIconService,\n IInteractionService,\n ILayer,\n ILayerConfig,\n ILayerModel,\n ILayerModelInitializationOptions,\n ILayerPlugin,\n ILayerService,\n IMapService,\n IModel,\n IModelInitializationOptions,\n IMultiPassRenderer,\n IPass,\n IPickingService,\n IPostProcessingPass,\n IRendererService,\n IScale,\n IScaleOptions,\n IShaderModuleService,\n ISource,\n ISourceCFG,\n IStyleAttributeInitializationOptions,\n IStyleAttributeService,\n IStyleAttributeUpdateOptions,\n lazyInject,\n ScaleAttributeType,\n ScaleTypeName,\n ScaleTypes,\n StyleAttributeField,\n StyleAttributeOption,\n TYPES,\n} from '@antv/l7-core';\nimport Source from '@antv/l7-source';\nimport { encodePickingColor } from '@antv/l7-utils';\nimport { EventEmitter } from 'eventemitter3';\nimport { Container } from 'inversify';\nimport { isFunction, isObject } from 'lodash';\nimport { normalizePasses } from '../plugins/MultiPassRendererPlugin';\nimport { BlendTypes } from '../utils/blend';\nimport { handleStyleDataMapping } from '../utils/dataMappingStyle';\nimport { updateShape } from '../utils/updateShape';\nimport baseLayerSchema from './schema';\n/**\n * 分配 layer id\n */\nlet layerIdCounter = 0;\n\nexport default class BaseLayer<ChildLayerStyleOptions = {}> extends EventEmitter\n implements ILayer {\n public id: string = `${layerIdCounter++}`;\n public name: string = `${layerIdCounter}`;\n public type: string;\n public visible: boolean = true;\n public zIndex: number = 0;\n public minZoom: number;\n public maxZoom: number;\n public inited: boolean = false;\n public layerModelNeedUpdate: boolean = false;\n public pickedFeatureID: number | null = null;\n public selectedFeatureID: number | null = null;\n public styleNeedUpdate: boolean = false;\n public rendering: boolean;\n public clusterZoom: number = 0; // 聚合等级标记\n\n public dataState: IDataState = {\n dataSourceNeedUpdate: false,\n dataMappingNeedUpdate: false,\n filterNeedUpdate: false,\n featureScaleNeedUpdate: false,\n StyleAttrNeedUpdate: false,\n };\n // 生命周期钩子\n public hooks = {\n init: new SyncBailHook(),\n afterInit: new SyncBailHook(),\n beforeRender: new SyncBailHook(),\n beforeRenderData: new SyncWaterfallHook(),\n afterRender: new SyncHook(),\n beforePickingEncode: new SyncHook(),\n afterPickingEncode: new SyncHook(),\n beforeHighlight: new SyncHook(['pickedColor']),\n afterHighlight: new SyncHook(),\n beforeSelect: new SyncHook(['pickedColor']),\n afterSelect: new SyncHook(),\n beforeDestroy: new SyncHook(),\n afterDestroy: new SyncHook(),\n };\n\n // 待渲染 model 列表\n public models: IModel[] = [];\n\n // 每个 Layer 都有一个\n public multiPassRenderer: IMultiPassRenderer;\n\n // 注入插件集\n public plugins: ILayerPlugin[];\n\n public sourceOption: {\n data: any;\n options?: ISourceCFG;\n };\n\n public layerModel: ILayerModel;\n\n // TODO: 记录 sceneContainer 供创建子图层的时候使用 如 imageTileLayer\n public sceneContainer: Container | undefined;\n // TODO: 用于保存子图层对象\n public layerChildren: ILayer[] = [];\n\n @lazyInject(TYPES.IGlobalConfigService)\n protected readonly configService: IGlobalConfigService;\n\n // @lazyInject(TYPES.IShaderModuleService)\n // protected readonly shaderModuleService: IShaderModuleService;\n\n protected shaderModuleService: IShaderModuleService;\n protected cameraService: ICameraService;\n\n protected coordinateService: ICoordinateSystemService;\n\n protected iconService: IIconService;\n\n protected fontService: IFontService;\n\n protected pickingService: IPickingService;\n\n protected rendererService: IRendererService;\n\n protected layerService: ILayerService;\n\n protected interactionService: IInteractionService;\n\n protected mapService: IMapService;\n\n protected styleAttributeService: IStyleAttributeService;\n\n protected layerSource: Source;\n\n protected postProcessingPassFactory: (\n name: string,\n ) => IPostProcessingPass<unknown>;\n protected normalPassFactory: (name: string) => IPass<unknown>;\n\n protected animateOptions: IAnimateOption = { enable: false };\n\n /**\n * 图层容器\n */\n private container: Container;\n\n private encodedData: IEncodeFeature[];\n\n private configSchema: object;\n\n private currentPickId: number | null = null;\n\n private rawConfig: Partial<ILayerConfig & ChildLayerStyleOptions>;\n\n private needUpdateConfig: Partial<ILayerConfig & ChildLayerStyleOptions>;\n\n /**\n * 待更新样式属性,在初始化阶段完成注册\n */\n private pendingStyleAttributes: Array<{\n attributeName: string;\n attributeField: StyleAttributeField;\n attributeValues?: StyleAttributeOption;\n defaultName?: string;\n updateOptions?: Partial<IStyleAttributeUpdateOptions>;\n }> = [];\n\n private scaleOptions: IScaleOptions = {};\n\n private animateStartTime: number;\n\n private aniamateStatus: boolean = false;\n\n // TODO: layer 保底颜色\n private bottomColor = 'rgba(0, 0, 0, 0)';\n\n private isDestroied: boolean = false;\n\n // private pickingPassRender: IPass<'pixelPicking'>;\n\n constructor(config: Partial<ILayerConfig & ChildLayerStyleOptions> = {}) {\n super();\n this.name = config.name || this.id;\n this.zIndex = config.zIndex || 0;\n this.rawConfig = config;\n }\n\n public getLayerConfig() {\n return this.configService.getLayerConfig<ChildLayerStyleOptions>(this.id);\n }\n\n public updateLayerConfig(\n configToUpdate: Partial<ILayerConfig | ChildLayerStyleOptions>,\n ) {\n if (!this.inited) {\n this.needUpdateConfig = {\n ...this.needUpdateConfig,\n ...configToUpdate,\n };\n } else {\n const sceneId = this.container.get<string>(TYPES.SceneID);\n\n // @ts-ignore\n handleStyleDataMapping(configToUpdate, this); // 处理 style 中进行数据映射的属性字段\n\n this.configService.setLayerConfig(sceneId, this.id, {\n ...this.configService.getLayerConfig(this.id),\n ...this.needUpdateConfig,\n ...configToUpdate,\n });\n this.needUpdateConfig = {};\n }\n }\n\n /**\n * 注入图层容器,父容器为场景容器\n * RootContainer 1\n * -> SceneContainer 1.*\n * -> LayerContainer 1.*\n */\n public setContainer(container: Container, sceneContainer: Container) {\n this.container = container;\n this.sceneContainer = sceneContainer;\n }\n\n public getContainer() {\n return this.container;\n }\n\n public setBottomColor(color: string) {\n this.bottomColor = color;\n }\n\n public getBottomColor() {\n return this.bottomColor;\n }\n\n public addPlugin(plugin: ILayerPlugin): ILayer {\n // TODO: 控制插件注册顺序\n // @example:\n // pointLayer.addPlugin(new MyCustomPlugin(), {\n // before: 'L7BuiltinPlugin'\n // });\n this.plugins.push(plugin);\n return this;\n }\n\n public init() {\n // 设置配置项\n const sceneId = this.container.get<string>(TYPES.SceneID);\n // 初始化图层配置项\n // const { enableMultiPassRenderer = false } = this.rawConfig;\n // this.configService.setLayerConfig(sceneId, this.id, {\n // enableMultiPassRenderer,\n // });\n this.configService.setLayerConfig(sceneId, this.id, this.rawConfig);\n\n // 全局容器服务\n\n // 场景容器服务\n this.iconService = this.container.get<IIconService>(TYPES.IIconService);\n this.fontService = this.container.get<IFontService>(TYPES.IFontService);\n\n this.rendererService = this.container.get<IRendererService>(\n TYPES.IRendererService,\n );\n this.layerService = this.container.get<ILayerService>(TYPES.ILayerService);\n this.interactionService = this.container.get<IInteractionService>(\n TYPES.IInteractionService,\n );\n\n this.pickingService = this.container.get<IPickingService>(\n TYPES.IPickingService,\n );\n this.mapService = this.container.get<IMapService>(TYPES.IMapService);\n this.cameraService = this.container.get<ICameraService>(\n TYPES.ICameraService,\n );\n this.coordinateService = this.container.get<ICoordinateSystemService>(\n TYPES.ICoordinateSystemService,\n );\n this.shaderModuleService = this.container.get<IShaderModuleService>(\n TYPES.IShaderModuleService,\n );\n this.postProcessingPassFactory = this.container.get(\n TYPES.IFactoryPostProcessingPass,\n );\n this.normalPassFactory = this.container.get(TYPES.IFactoryNormalPass);\n\n // 图层容器服务\n this.styleAttributeService = this.container.get<IStyleAttributeService>(\n TYPES.IStyleAttributeService,\n );\n this.multiPassRenderer = this.container.get<IMultiPassRenderer>(\n TYPES.IMultiPassRenderer,\n );\n this.multiPassRenderer.setLayer(this);\n\n // 完成样式服务注册完成前添加的属性\n this.pendingStyleAttributes.forEach(\n ({ attributeName, attributeField, attributeValues, updateOptions }) => {\n this.styleAttributeService.updateStyleAttribute(\n attributeName,\n {\n // @ts-ignore\n scale: {\n field: attributeField,\n ...this.splitValuesAndCallbackInAttribute(\n // @ts-ignore\n attributeValues,\n // @ts-ignore\n this.getLayerConfig()[attributeName],\n ),\n },\n },\n // @ts-ignore\n updateOptions,\n );\n },\n );\n this.pendingStyleAttributes = [];\n\n // 获取插件集\n this.plugins = this.container.getAll<ILayerPlugin>(TYPES.ILayerPlugin);\n // 完成插件注册,传入场景和图层容器内的服务\n for (const plugin of this.plugins) {\n plugin.apply(this, {\n rendererService: this.rendererService,\n mapService: this.mapService,\n styleAttributeService: this.styleAttributeService,\n normalPassFactory: this.normalPassFactory,\n postProcessingPassFactory: this.postProcessingPassFactory,\n });\n }\n\n // 触发 init 生命周期插件\n this.hooks.init.call();\n // this.pickingPassRender = this.normalPassFactory('pixelPicking');\n // this.pickingPassRender.init(this);\n this.hooks.afterInit.call();\n\n // 触发初始化完成事件;\n this.emit('inited', {\n target: this,\n type: 'inited',\n });\n this.emit('add', {\n target: this,\n type: 'add',\n });\n return this;\n }\n /**\n * Model初始化前需要更新Model样式\n */\n public prepareBuildModel() {\n this.inited = true;\n this.updateLayerConfig({\n ...(this.getDefaultConfig() as object),\n ...this.rawConfig,\n });\n\n // 启动动画\n const { animateOption } = this.getLayerConfig();\n if (animateOption?.enable) {\n this.layerService.startAnimate();\n this.aniamateStatus = true;\n }\n }\n public color(\n field: StyleAttributeField,\n values?: StyleAttributeOption,\n updateOptions?: Partial<IStyleAttributeUpdateOptions>,\n ) {\n // 设置 color、size、shape、style 时由于场景服务尚未完成(并没有调用 scene.addLayer),因此暂时加入待更新属性列表\n this.updateStyleAttribute('color', field, values, updateOptions);\n\n // this.pendingStyleAttributes.push({\n // attributeName: 'color',\n // attributeField: field,\n // attributeValues: values,\n // defaultName: 'colors',\n // updateOptions,\n // });\n return this;\n }\n\n // 为对应的图层传入纹理的编号名称(point/image 在 shape 方法中传入纹理名称的方法并不通用)\n public texture(\n field: StyleAttributeField,\n values?: StyleAttributeOption,\n updateOptions?: Partial<IStyleAttributeUpdateOptions>,\n ) {\n this.updateStyleAttribute('texture', field, values, updateOptions);\n return this;\n }\n\n public rotate(\n field: StyleAttributeField,\n values?: StyleAttributeOption,\n updateOptions?: Partial<IStyleAttributeUpdateOptions>,\n ) {\n this.updateStyleAttribute('rotate', field, values, updateOptions);\n return this;\n }\n public size(\n field: StyleAttributeField,\n values?: StyleAttributeOption,\n updateOptions?: Partial<IStyleAttributeUpdateOptions>,\n ) {\n this.updateStyleAttribute('size', field, values, updateOptions);\n return this;\n }\n // 对mapping后的数据过滤,scale保持不变\n public filter(\n field: StyleAttributeField,\n values?: StyleAttributeOption,\n updateOptions?: Partial<IStyleAttributeUpdateOptions>,\n ) {\n this.updateStyleAttribute('filter', field, values, updateOptions);\n return this;\n }\n\n public shape(\n field: StyleAttributeField,\n values?: StyleAttributeOption,\n updateOptions?: Partial<IStyleAttributeUpdateOptions>,\n ) {\n const lastShape = this.styleAttributeService?.getLayerStyleAttribute(\n 'shape',\n )?.scale?.field;\n const currentShape = field;\n this.updateStyleAttribute('shape', field, values, updateOptions);\n // TODO: 根据 shape 判断是否需要更新 model\n updateShape(this, lastShape, currentShape);\n return this;\n }\n public label(\n field: StyleAttributeField,\n values?: StyleAttributeOption,\n updateOptions?: Partial<IStyleAttributeUpdateOptions>,\n ) {\n this.pendingStyleAttributes.push({\n attributeName: 'label',\n attributeField: field,\n attributeValues: values,\n updateOptions,\n });\n return this;\n }\n public animate(options: IAnimateOption | boolean) {\n let rawAnimate: Partial<IAnimateOption> = {};\n if (isObject(options)) {\n rawAnimate.enable = true;\n rawAnimate = {\n ...rawAnimate,\n ...options,\n };\n } else {\n rawAnimate.enable = options;\n }\n this.updateLayerConfig({\n animateOption: rawAnimate,\n });\n // this.animateOptions = options;\n return this;\n }\n\n public source(data: any, options?: ISourceCFG): ILayer {\n if (data?.data) {\n // 判断是否为source\n this.setSource(data);\n return this;\n }\n this.sourceOption = {\n data,\n options,\n };\n this.clusterZoom = 0;\n return this;\n }\n public setData(data: any, options?: ISourceCFG) {\n if (this.inited) {\n this.layerSource.setData(data, options);\n } else {\n this.on('inited', () => {\n this.layerSource.setData(data, options);\n });\n }\n\n return this;\n }\n public style(\n options: Partial<ChildLayerStyleOptions> & Partial<ILayerConfig>,\n ): ILayer {\n const { passes, ...rest } = options;\n\n // passes 特殊处理\n if (passes) {\n normalizePasses(passes).forEach(\n (pass: [string, { [key: string]: unknown }]) => {\n const postProcessingPass = this.multiPassRenderer\n .getPostProcessor()\n .getPostProcessingPassByName(pass[0]);\n if (postProcessingPass) {\n postProcessingPass.updateOptions(pass[1]);\n }\n },\n );\n }\n\n this.rawConfig = {\n ...this.rawConfig,\n ...rest,\n };\n if (this.container) {\n this.updateLayerConfig(this.rawConfig);\n this.styleNeedUpdate = true;\n }\n return this;\n }\n public scale(field: string | number | IScaleOptions, cfg?: IScale) {\n if (isObject(field)) {\n this.scaleOptions = {\n ...this.scaleOptions,\n ...field,\n };\n } else {\n this.scaleOptions[field] = cfg;\n }\n return this;\n }\n\n /**\n * 渲染所有的图层\n */\n public renderLayers(): void {\n this.rendering = true;\n\n this.layerService.renderLayers();\n\n this.rendering = false;\n }\n\n public render(): ILayer {\n // TODO: this.getEncodedData().length !== 0 这个判断是为了解决在 2.5.x 引入数据纹理后产生的 空数据渲染导致 texture 超出上限问题\n if (this.getEncodedData().length !== 0) {\n this.renderModels();\n }\n return this;\n }\n\n /**\n * renderMultiPass 专门用于渲染支持 multipass 的 layer\n */\n public async renderMultiPass() {\n if (this.getEncodedData().length !== 0) {\n if (this.multiPassRenderer && this.multiPassRenderer.getRenderFlag()) {\n // multi render 开始执行 multiPassRender 的渲染流程\n await this.multiPassRenderer.render();\n } else if (this.multiPassRenderer) {\n // renderPass 触发的渲染\n this.renderModels();\n } else {\n this.renderModels();\n }\n }\n }\n\n public active(options: IActiveOption | boolean) {\n const activeOption: Partial<ILayerConfig> = {};\n activeOption.enableHighlight = isObject(options) ? true : options;\n if (isObject(options)) {\n activeOption.enableHighlight = true;\n if (options.color) {\n activeOption.highlightColor = options.color;\n }\n if (options.mix) {\n activeOption.activeMix = options.mix;\n }\n } else {\n activeOption.enableHighlight = !!options;\n }\n this.updateLayerConfig(activeOption);\n return this;\n }\n public setActive(\n id: number | { x: number; y: number },\n options?: IActiveOption,\n ): void {\n if (isObject(id)) {\n const { x = 0, y = 0 } = id;\n this.updateLayerConfig({\n highlightColor: isObject(options)\n ? options.color\n : this.getLayerConfig().highlightColor,\n activeMix: isObject(options)\n ? options.mix\n : this.getLayerConfig().activeMix,\n });\n this.pick({ x, y });\n } else {\n this.updateLayerConfig({\n pickedFeatureID: id,\n highlightColor: isObject(options)\n ? options.color\n : this.getLayerConfig().highlightColor,\n activeMix: isObject(options)\n ? options.mix\n : this.getLayerConfig().activeMix,\n });\n this.hooks.beforeSelect\n .call(encodePickingColor(id as number) as number[])\n // @ts-ignore\n .then(() => {\n setTimeout(() => {\n this.reRender();\n }, 1);\n });\n }\n }\n\n public select(option: IActiveOption | boolean): ILayer {\n const activeOption: Partial<ILayerConfig> = {};\n activeOption.enableSelect = isObject(option) ? true : option;\n if (isObject(option)) {\n activeOption.enableSelect = true;\n if (option.color) {\n activeOption.selectColor = option.color;\n }\n if (option.mix) {\n activeOption.selectMix = option.mix;\n }\n } else {\n activeOption.enableSelect = !!option;\n }\n this.updateLayerConfig(activeOption);\n return this;\n }\n\n public setSelect(\n id: number | { x: number; y: number },\n options?: IActiveOption,\n ): void {\n if (isObject(id)) {\n const { x = 0, y = 0 } = id;\n this.updateLayerConfig({\n selectColor: isObject(options)\n ? options.color\n : this.getLayerConfig().selectColor,\n selectMix: isObject(options)\n ? options.mix\n : this.getLayerConfig().selectMix,\n });\n this.pick({ x, y });\n } else {\n this.updateLayerConfig({\n pickedFeatureID: id,\n selectColor: isObject(options)\n ? options.color\n : this.getLayerConfig().selectColor,\n selectMix: isObject(options)\n ? options.mix\n : this.getLayerConfig().selectMix,\n });\n this.hooks.beforeSelect\n .call(encodePickingColor(id as number) as number[])\n // @ts-ignore\n .then(() => {\n setTimeout(() => {\n this.reRender();\n }, 1);\n });\n }\n }\n public setBlend(type: keyof typeof BlendType): void {\n this.updateLayerConfig({\n blend: type,\n });\n this.layerModelNeedUpdate = true;\n this.reRender();\n }\n public show(): ILayer {\n this.updateLayerConfig({\n visible: true,\n });\n this.reRender();\n return this;\n }\n\n public hide(): ILayer {\n this.updateLayerConfig({\n visible: false,\n });\n this.reRender();\n return this;\n }\n public setIndex(index: number): ILayer {\n this.zIndex = index;\n this.layerService.updateLayerRenderList();\n this.layerService.renderLayers();\n return this;\n }\n\n public setCurrentPickId(id: number) {\n this.currentPickId = id;\n }\n\n public getCurrentPickId(): number | null {\n return this.currentPickId;\n }\n\n public setCurrentSelectedId(id: number) {\n this.selectedFeatureID = id;\n }\n\n public getCurrentSelectedId(): number | null {\n return this.selectedFeatureID;\n }\n public isVisible(): boolean {\n const zoom = this.mapService.getZoom();\n const {\n visible,\n minZoom = -Infinity,\n maxZoom = Infinity,\n } = this.getLayerConfig();\n return !!visible && zoom >= minZoom && zoom <= maxZoom;\n }\n\n public setMinZoom(minZoom: number): ILayer {\n this.updateLayerConfig({\n minZoom,\n });\n return this;\n }\n\n public getMinZoom(): number {\n const { minZoom } = this.getLayerConfig();\n return minZoom as number;\n }\n\n public getMaxZoom(): number {\n const { maxZoom } = this.getLayerConfig();\n return maxZoom as number;\n }\n\n public get(name: string) {\n const cfg = this.getLayerConfig();\n // @ts-ignore\n return cfg[name];\n }\n\n public setMaxZoom(maxZoom: number): ILayer {\n this.updateLayerConfig({\n maxZoom,\n });\n return this;\n }\n /**\n * zoom to layer Bounds\n */\n public fitBounds(fitBoundsOptions?: unknown): ILayer {\n if (!this.inited) {\n this.updateLayerConfig({\n autoFit: true,\n });\n return this;\n }\n const source = this.getSource();\n const extent = source.extent;\n const isValid = extent.some((v) => Math.abs(v) === Infinity);\n if (isValid) {\n return this;\n }\n this.mapService.fitBounds(\n [\n [extent[0], extent[1]],\n [extent[2], extent[3]],\n ],\n fitBoundsOptions,\n );\n return this;\n }\n\n public destroy() {\n // debugger\n if (this.isDestroied) {\n return;\n }\n this.hooks.beforeDestroy.call();\n // 清除sources事件\n this.layerSource.off('update', this.sourceEvent);\n\n this.multiPassRenderer.destroy();\n // console.log(this.styleAttributeService.getAttributes())\n // 清除所有属性以及关联的 vao == 销毁所有 => model this.models.forEach((model) => model.destroy());\n this.styleAttributeService.clearAllAttributes();\n\n // 执行每个图层单独的 clearModels 方法 (清除一些额外的 texture、program、buffer 等)\n\n this.hooks.afterDestroy.call();\n\n // TODO: 清除各个图层自定义的 models 资源\n // this.layerModel?.clearModels();\n\n this.models = [];\n\n this.layerService.cleanRemove(this);\n\n this.emit('remove', {\n target: this,\n type: 'remove',\n });\n\n this.emit('destroy', {\n target: this,\n type: 'destroy',\n });\n\n this.removeAllListeners();\n // 解绑图层容器中的服务\n // this.container.unbind(TYPES.IStyleAttributeService);\n\n this.isDestroied = true;\n }\n public clear() {\n this.styleAttributeService.clearAllAttributes();\n // 销毁所有 model\n }\n public clearModels() {\n this.models.forEach((model) => model.destroy());\n this.layerModel.clearModels();\n }\n\n public isDirty() {\n return !!(\n this.styleAttributeService.getLayerStyleAttributes() || []\n ).filter(\n (attribute) =>\n attribute.needRescale ||\n attribute.needRemapping ||\n attribute.needRegenerateVertices,\n ).length;\n }\n\n public setSource(source: Source) {\n // 清除旧 sources 事件\n if (this.layerSource) {\n this.layerSource.off('update', this.sourceEvent);\n }\n\n this.layerSource = source;\n this.clusterZoom = 0;\n\n // 已 inited 且启用聚合进行更新聚合数据\n if (this.inited && this.layerSource.cluster) {\n const zoom = this.mapService.getZoom();\n this.layerSource.updateClusterData(zoom);\n }\n // source 可能会复用,会在其它layer被修改\n this.layerSource.on('update', this.sourceEvent);\n }\n public getSource() {\n return this.layerSource;\n }\n\n public getScaleOptions() {\n return this.scaleOptions;\n }\n\n public setEncodedData(encodedData: IEncodeFeature[]) {\n this.encodedData = encodedData;\n }\n public getEncodedData() {\n return this.encodedData;\n }\n public getLegendItems(name: string): any {\n const scale = this.styleAttributeService.getLayerAttributeScale(name);\n if (scale) {\n if (scale.ticks) {\n const items = scale.ticks().map((item: any) => {\n return {\n value: item,\n [name]: scale(item),\n };\n });\n return items;\n } else if (scale.invertExtent) {\n const items = scale.range().map((item: any) => {\n return {\n value: scale.invertExtent(item),\n [name]: item,\n };\n });\n return items;\n }\n } else {\n return [];\n }\n }\n\n public pick({ x, y }: { x: number; y: number }) {\n this.interactionService.triggerHover({ x, y });\n }\n\n public boxSelect(\n box: [number, number, number, number],\n cb: (...args: any[]) => void,\n ) {\n this.pickingService.boxPickLayer(this, box, cb);\n }\n\n public buildLayerModel(\n options: ILayerModelInitializationOptions &\n Partial<IModelInitializationOptions>,\n ): IModel {\n const {\n moduleName,\n vertexShader,\n fragmentShader,\n triangulation,\n segmentNumber,\n ...rest\n } = options;\n this.shaderModuleService.registerModule(moduleName, {\n vs: vertexShader,\n fs: fragmentShader,\n });\n const { vs, fs, uniforms } = this.shaderModuleService.getModule(moduleName);\n const { createModel } = this.rendererService;\n const {\n attributes,\n elements,\n } = this.styleAttributeService.createAttributesAndIndices(\n this.encodedData,\n triangulation,\n segmentNumber,\n );\n return createModel({\n attributes,\n uniforms,\n fs,\n vs,\n elements,\n blend: BlendTypes[BlendType.normal],\n ...rest,\n });\n }\n\n public getTime() {\n return this.layerService.clock.getDelta();\n }\n public setAnimateStartTime() {\n this.animateStartTime = this.layerService.clock.getElapsedTime();\n }\n public stopAnimate() {\n if (this.aniamateStatus) {\n this.layerService.stopAnimate();\n this.aniamateStatus = false;\n this.updateLayerConfig({\n animateOption: {\n enable: false,\n },\n });\n }\n }\n public getLayerAnimateTime(): number {\n return this.layerService.clock.getElapsedTime() - this.animateStartTime;\n }\n\n public needPick(type: string): boolean {\n const {\n enableHighlight = true,\n enableSelect = true,\n } = this.getLayerConfig();\n // 判断layer是否监听事件;\n let isPick =\n this.eventNames().indexOf(type) !== -1 ||\n this.eventNames().indexOf('un' + type) !== -1;\n if ((type === 'click' || type === 'dblclick') && enableSelect) {\n isPick = true;\n }\n if (\n type === 'mousemove' &&\n (enableHighlight ||\n this.eventNames().indexOf('mouseenter') !== -1 ||\n this.eventNames().indexOf('unmousemove') !== -1 ||\n this.eventNames().indexOf('mouseout') !== -1)\n ) {\n isPick = true;\n }\n return this.isVisible() && isPick;\n }\n\n public buildModels() {\n throw new Error('Method not implemented.');\n }\n public rebuildModels() {\n throw new Error('Method not implemented.');\n }\n\n public async renderMulPass(multiPassRenderer: IMultiPassRenderer) {\n await multiPassRenderer.render();\n }\n\n public renderModels(isPicking?: boolean) {\n // TODO: this.getEncodedData().length > 0 这个判断是为了解决在 2.5.x 引入数据纹理后产生的 空数据渲染导致 texture 超出上限问题\n if (this.getEncodedData().length > 0) {\n if (this.layerModelNeedUpdate && this.layerModel) {\n this.models = this.layerModel.buildModels();\n this.hooks.beforeRender.call();\n this.layerModelNeedUpdate = false;\n }\n this.models.forEach((model) => {\n model.draw(\n {\n uniforms: this.layerModel.getUninforms(),\n },\n isPicking,\n );\n });\n }\n return this;\n }\n\n public updateStyleAttribute(\n type: string,\n field: StyleAttributeField,\n values?: StyleAttributeOption,\n updateOptions?: Partial<IStyleAttributeUpdateOptions>,\n ) {\n if (!this.inited) {\n this.pendingStyleAttributes.push({\n attributeName: type,\n attributeField: field,\n attributeValues: values,\n updateOptions,\n });\n } else {\n this.styleAttributeService.updateStyleAttribute(\n type,\n {\n // @ts-ignore\n scale: {\n field,\n ...this.splitValuesAndCallbackInAttribute(\n // @ts-ignore\n values,\n // @ts-ignore\n this.getLayerConfig()[field],\n ),\n },\n },\n // @ts-ignore\n updateOptions,\n );\n }\n }\n\n public getShaderPickStat() {\n return this.layerService.getShaderPickStat();\n }\n\n /**\n * 继承空方法\n * @param time\n */\n public setEarthTime(time: number) {\n console.warn('empty fn');\n }\n\n protected getConfigSchema() {\n throw new Error('Method not implemented.');\n }\n\n protected getModelType(): unknown {\n throw new Error('Method not implemented.');\n }\n protected getDefaultConfig() {\n return {};\n }\n\n private sourceEvent = () => {\n this.dataState.dataSourceNeedUpdate = true;\n const { autoFit, fitBoundsOptions } = this.getLayerConfig();\n if (autoFit) {\n this.fitBounds(fitBoundsOptions);\n }\n // 对外暴露事件\n this.emit('dataUpdate');\n this.reRender();\n };\n\n private reRender() {\n if (this.inited) {\n this.layerService.updateLayerRenderList();\n this.layerService.renderLayers();\n }\n }\n private splitValuesAndCallbackInAttribute(\n valuesOrCallback?: unknown[],\n defaultValues?: unknown[],\n ) {\n return {\n values: isFunction(valuesOrCallback)\n ? undefined\n : valuesOrCallback || defaultValues,\n callback: isFunction(valuesOrCallback) ? valuesOrCallback : undefined,\n };\n }\n}\n"],"file":"BaseLayer.js"}
|
package/lib/core/BaseLayer.js
CHANGED
|
@@ -7,6 +7,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
|
|
10
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
11
|
+
|
|
12
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
13
|
+
|
|
10
14
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
15
|
|
|
12
16
|
var _initializerDefineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/initializerDefineProperty"));
|
|
@@ -449,17 +453,57 @@ var BaseLayer = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
|
|
|
449
453
|
key: "render",
|
|
450
454
|
value: function render() {
|
|
451
455
|
if (this.getEncodedData().length !== 0) {
|
|
452
|
-
|
|
453
|
-
this.multiPassRenderer.render();
|
|
454
|
-
} else if (this.multiPassRenderer) {
|
|
455
|
-
this.renderModels();
|
|
456
|
-
} else {
|
|
457
|
-
this.renderModels();
|
|
458
|
-
}
|
|
456
|
+
this.renderModels();
|
|
459
457
|
}
|
|
460
458
|
|
|
461
459
|
return this;
|
|
462
460
|
}
|
|
461
|
+
}, {
|
|
462
|
+
key: "renderMultiPass",
|
|
463
|
+
value: function () {
|
|
464
|
+
var _renderMultiPass = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee() {
|
|
465
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
466
|
+
while (1) {
|
|
467
|
+
switch (_context.prev = _context.next) {
|
|
468
|
+
case 0:
|
|
469
|
+
if (!(this.getEncodedData().length !== 0)) {
|
|
470
|
+
_context.next = 7;
|
|
471
|
+
break;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
if (!(this.multiPassRenderer && this.multiPassRenderer.getRenderFlag())) {
|
|
475
|
+
_context.next = 6;
|
|
476
|
+
break;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
_context.next = 4;
|
|
480
|
+
return this.multiPassRenderer.render();
|
|
481
|
+
|
|
482
|
+
case 4:
|
|
483
|
+
_context.next = 7;
|
|
484
|
+
break;
|
|
485
|
+
|
|
486
|
+
case 6:
|
|
487
|
+
if (this.multiPassRenderer) {
|
|
488
|
+
this.renderModels();
|
|
489
|
+
} else {
|
|
490
|
+
this.renderModels();
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
case 7:
|
|
494
|
+
case "end":
|
|
495
|
+
return _context.stop();
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
}, _callee, this);
|
|
499
|
+
}));
|
|
500
|
+
|
|
501
|
+
function renderMultiPass() {
|
|
502
|
+
return _renderMultiPass.apply(this, arguments);
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
return renderMultiPass;
|
|
506
|
+
}()
|
|
463
507
|
}, {
|
|
464
508
|
key: "active",
|
|
465
509
|
value: function active(options) {
|
|
@@ -914,6 +958,31 @@ var BaseLayer = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
|
|
|
914
958
|
value: function rebuildModels() {
|
|
915
959
|
throw new Error('Method not implemented.');
|
|
916
960
|
}
|
|
961
|
+
}, {
|
|
962
|
+
key: "renderMulPass",
|
|
963
|
+
value: function () {
|
|
964
|
+
var _renderMulPass = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee2(multiPassRenderer) {
|
|
965
|
+
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
966
|
+
while (1) {
|
|
967
|
+
switch (_context2.prev = _context2.next) {
|
|
968
|
+
case 0:
|
|
969
|
+
_context2.next = 2;
|
|
970
|
+
return multiPassRenderer.render();
|
|
971
|
+
|
|
972
|
+
case 2:
|
|
973
|
+
case "end":
|
|
974
|
+
return _context2.stop();
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
}, _callee2);
|
|
978
|
+
}));
|
|
979
|
+
|
|
980
|
+
function renderMulPass(_x) {
|
|
981
|
+
return _renderMulPass.apply(this, arguments);
|
|
982
|
+
}
|
|
983
|
+
|
|
984
|
+
return renderMulPass;
|
|
985
|
+
}()
|
|
917
986
|
}, {
|
|
918
987
|
key: "renderModels",
|
|
919
988
|
value: function renderModels(isPicking) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/core/BaseLayer.ts"],"names":["layerIdCounter","BaseLayer","TYPES","IGlobalConfigService","config","dataSourceNeedUpdate","dataMappingNeedUpdate","filterNeedUpdate","featureScaleNeedUpdate","StyleAttrNeedUpdate","init","SyncBailHook","afterInit","beforeRender","beforeRenderData","SyncWaterfallHook","afterRender","SyncHook","beforePickingEncode","afterPickingEncode","beforeHighlight","afterHighlight","beforeSelect","afterSelect","beforeDestroy","afterDestroy","enable","dataState","getLayerConfig","autoFit","fitBoundsOptions","fitBounds","emit","reRender","name","id","zIndex","rawConfig","configService","configToUpdate","inited","needUpdateConfig","sceneId","container","get","SceneID","setLayerConfig","sceneContainer","color","bottomColor","plugin","plugins","push","iconService","IIconService","fontService","IFontService","rendererService","IRendererService","layerService","ILayerService","interactionService","IInteractionService","pickingService","IPickingService","mapService","IMapService","cameraService","ICameraService","coordinateService","ICoordinateSystemService","shaderModuleService","IShaderModuleService","postProcessingPassFactory","IFactoryPostProcessingPass","normalPassFactory","IFactoryNormalPass","styleAttributeService","IStyleAttributeService","multiPassRenderer","IMultiPassRenderer","setLayer","pendingStyleAttributes","forEach","attributeName","attributeField","attributeValues","updateOptions","updateStyleAttribute","scale","field","splitValuesAndCallbackInAttribute","getAll","ILayerPlugin","apply","hooks","call","target","type","updateLayerConfig","getDefaultConfig","animateOption","startAnimate","aniamateStatus","values","lastShape","getLayerStyleAttribute","currentShape","options","rawAnimate","data","setSource","sourceOption","clusterZoom","layerSource","setData","on","passes","rest","pass","postProcessingPass","getPostProcessor","getPostProcessingPassByName","styleNeedUpdate","cfg","scaleOptions","rendering","renderLayers","getEncodedData","length","getRenderFlag","render","renderModels","activeOption","enableHighlight","highlightColor","mix","activeMix","x","y","pick","pickedFeatureID","then","setTimeout","option","enableSelect","selectColor","selectMix","blend","layerModelNeedUpdate","visible","index","updateLayerRenderList","currentPickId","selectedFeatureID","zoom","getZoom","minZoom","Infinity","maxZoom","source","getSource","extent","isValid","some","v","Math","abs","isDestroied","off","sourceEvent","destroy","clearAllAttributes","models","cleanRemove","removeAllListeners","model","layerModel","clearModels","getLayerStyleAttributes","filter","attribute","needRescale","needRemapping","needRegenerateVertices","cluster","updateClusterData","encodedData","getLayerAttributeScale","ticks","items","map","item","value","invertExtent","range","triggerHover","box","cb","boxPickLayer","moduleName","vertexShader","fragmentShader","triangulation","segmentNumber","registerModule","vs","fs","getModule","uniforms","createModel","createAttributesAndIndices","attributes","elements","BlendTypes","BlendType","normal","clock","getDelta","animateStartTime","getElapsedTime","stopAnimate","isPick","eventNames","indexOf","isVisible","Error","isPicking","buildModels","draw","getUninforms","getShaderPickStat","time","console","warn","valuesOrCallback","defaultValues","undefined","callback","EventEmitter"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;;AACA;;AA4CA;;AACA;;AAGA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;AAKA,IAAIA,cAAc,GAAG,CAArB;IAEqBC,S,WA8DlB,wBAAWC,cAAMC,oBAAjB,C;;;;;AA2ED,uBAAyE;AAAA;;AAAA,QAA7DC,MAA6D,uEAAJ,EAAI;AAAA;AACvE;AADuE,+FAvIlDJ,cAAc,EAuIoC;AAAA,iGAtIhDA,cAsIgD;AAAA;AAAA,0FApI/C,IAoI+C;AAAA,yFAnIjD,CAmIiD;AAAA;AAAA;AAAA,yFAhIhD,KAgIgD;AAAA,uGA/HlC,KA+HkC;AAAA,kGA9HjC,IA8HiC;AAAA,oGA7H/B,IA6H+B;AAAA,kGA5HvC,KA4HuC;AAAA;AAAA,8FA1H5C,CA0H4C;AAAA,4FAxH1C;AAC7BK,MAA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AM,IAAIA,KAAJ,CAAU,yBAAV,CAAN;AACD;;;WACD,4BAA6B;AAC3B,aAAO,EAAP;AACD;;;WAaD,oBAAmB;AACjB,UAAI,KAAK1L,MAAT,EAAiB;AACf,aAAKmB,YAAL,CAAkB6F,qBAAlB;AACA,aAAK7F,YAAL,CAAkBoE,YAAlB;AACD;AACF;;;WACD,2CACE4G,gBADF,EAEEC,aAFF,EAGE;AACA,aAAO;AACLpI,QAAAA,MAAM,EAAE,0BAAWmI,gBAAX,IACJE,SADI,GAEJF,gBAAgB,IAAIC,aAHnB;AAILE,QAAAA,QAAQ,EAAE,0BAAWH,gBAAX,IAA+BA,gBAA/B,GAAkDE;AAJvD,OAAP;AAMD;;;EA/iCiEE,0B","sourcesContent":["// @ts-ignore\nimport { SyncBailHook, SyncHook, SyncWaterfallHook } from '@antv/async-hook';\nimport {\n BlendType,\n gl,\n IActiveOption,\n IAnimateOption,\n ICameraService,\n ICoordinateSystemService,\n IDataState,\n IEncodeFeature,\n IFontService,\n IGlobalConfigService,\n IIconService,\n IInteractionService,\n ILayer,\n ILayerConfig,\n ILayerModel,\n ILayerModelInitializationOptions,\n ILayerPlugin,\n ILayerService,\n IMapService,\n IModel,\n IModelInitializationOptions,\n IMultiPassRenderer,\n IPass,\n IPickingService,\n IPostProcessingPass,\n IRendererService,\n IScale,\n IScaleOptions,\n IShaderModuleService,\n ISource,\n ISourceCFG,\n IStyleAttributeInitializationOptions,\n IStyleAttributeService,\n IStyleAttributeUpdateOptions,\n lazyInject,\n ScaleAttributeType,\n ScaleTypeName,\n ScaleTypes,\n StyleAttributeField,\n StyleAttributeOption,\n TYPES,\n} from '@antv/l7-core';\nimport Source from '@antv/l7-source';\nimport { encodePickingColor } from '@antv/l7-utils';\nimport { EventEmitter } from 'eventemitter3';\nimport { Container } from 'inversify';\nimport { isFunction, isObject } from 'lodash';\nimport { normalizePasses } from '../plugins/MultiPassRendererPlugin';\nimport { BlendTypes } from '../utils/blend';\nimport { handleStyleDataMapping } from '../utils/dataMappingStyle';\nimport { updateShape } from '../utils/updateShape';\nimport baseLayerSchema from './schema';\n/**\n * 分配 layer id\n */\nlet layerIdCounter = 0;\n\nexport default class BaseLayer<ChildLayerStyleOptions = {}> extends EventEmitter\n implements ILayer {\n public id: string = `${layerIdCounter++}`;\n public name: string = `${layerIdCounter}`;\n public type: string;\n public visible: boolean = true;\n public zIndex: number = 0;\n public minZoom: number;\n public maxZoom: number;\n public inited: boolean = false;\n public layerModelNeedUpdate: boolean = false;\n public pickedFeatureID: number | null = null;\n public selectedFeatureID: number | null = null;\n public styleNeedUpdate: boolean = false;\n public rendering: boolean;\n public clusterZoom: number = 0; // 聚合等级标记\n\n public dataState: IDataState = {\n dataSourceNeedUpdate: false,\n dataMappingNeedUpdate: false,\n filterNeedUpdate: false,\n featureScaleNeedUpdate: false,\n StyleAttrNeedUpdate: false,\n };\n // 生命周期钩子\n public hooks = {\n init: new SyncBailHook(),\n afterInit: new SyncBailHook(),\n beforeRender: new SyncBailHook(),\n beforeRenderData: new SyncWaterfallHook(),\n afterRender: new SyncHook(),\n beforePickingEncode: new SyncHook(),\n afterPickingEncode: new SyncHook(),\n beforeHighlight: new SyncHook(['pickedColor']),\n afterHighlight: new SyncHook(),\n beforeSelect: new SyncHook(['pickedColor']),\n afterSelect: new SyncHook(),\n beforeDestroy: new SyncHook(),\n afterDestroy: new SyncHook(),\n };\n\n // 待渲染 model 列表\n public models: IModel[] = [];\n\n // 每个 Layer 都有一个\n public multiPassRenderer: IMultiPassRenderer;\n\n // 注入插件集\n public plugins: ILayerPlugin[];\n\n public sourceOption: {\n data: any;\n options?: ISourceCFG;\n };\n\n public layerModel: ILayerModel;\n\n // TODO: 记录 sceneContainer 供创建子图层的时候使用 如 imageTileLayer\n public sceneContainer: Container | undefined;\n // TODO: 用于保存子图层对象\n public layerChildren: ILayer[] = [];\n\n @lazyInject(TYPES.IGlobalConfigService)\n protected readonly configService: IGlobalConfigService;\n\n // @lazyInject(TYPES.IShaderModuleService)\n // protected readonly shaderModuleService: IShaderModuleService;\n\n protected shaderModuleService: IShaderModuleService;\n protected cameraService: ICameraService;\n\n protected coordinateService: ICoordinateSystemService;\n\n protected iconService: IIconService;\n\n protected fontService: IFontService;\n\n protected pickingService: IPickingService;\n\n protected rendererService: IRendererService;\n\n protected layerService: ILayerService;\n\n protected interactionService: IInteractionService;\n\n protected mapService: IMapService;\n\n protected styleAttributeService: IStyleAttributeService;\n\n protected layerSource: Source;\n\n protected postProcessingPassFactory: (\n name: string,\n ) => IPostProcessingPass<unknown>;\n protected normalPassFactory: (name: string) => IPass<unknown>;\n\n protected animateOptions: IAnimateOption = { enable: false };\n\n /**\n * 图层容器\n */\n private container: Container;\n\n private encodedData: IEncodeFeature[];\n\n private configSchema: object;\n\n private currentPickId: number | null = null;\n\n private rawConfig: Partial<ILayerConfig & ChildLayerStyleOptions>;\n\n private needUpdateConfig: Partial<ILayerConfig & ChildLayerStyleOptions>;\n\n /**\n * 待更新样式属性,在初始化阶段完成注册\n */\n private pendingStyleAttributes: Array<{\n attributeName: string;\n attributeField: StyleAttributeField;\n attributeValues?: StyleAttributeOption;\n defaultName?: string;\n updateOptions?: Partial<IStyleAttributeUpdateOptions>;\n }> = [];\n\n private scaleOptions: IScaleOptions = {};\n\n private animateStartTime: number;\n\n private aniamateStatus: boolean = false;\n\n // TODO: layer 保底颜色\n private bottomColor = 'rgba(0, 0, 0, 0)';\n\n private isDestroied: boolean = false;\n\n // private pickingPassRender: IPass<'pixelPicking'>;\n\n constructor(config: Partial<ILayerConfig & ChildLayerStyleOptions> = {}) {\n super();\n this.name = config.name || this.id;\n this.zIndex = config.zIndex || 0;\n this.rawConfig = config;\n }\n\n public getLayerConfig() {\n return this.configService.getLayerConfig<ChildLayerStyleOptions>(this.id);\n }\n\n public updateLayerConfig(\n configToUpdate: Partial<ILayerConfig | ChildLayerStyleOptions>,\n ) {\n if (!this.inited) {\n this.needUpdateConfig = {\n ...this.needUpdateConfig,\n ...configToUpdate,\n };\n } else {\n const sceneId = this.container.get<string>(TYPES.SceneID);\n\n // @ts-ignore\n handleStyleDataMapping(configToUpdate, this); // 处理 style 中进行数据映射的属性字段\n\n this.configService.setLayerConfig(sceneId, this.id, {\n ...this.configService.getLayerConfig(this.id),\n ...this.needUpdateConfig,\n ...configToUpdate,\n });\n this.needUpdateConfig = {};\n }\n }\n\n /**\n * 注入图层容器,父容器为场景容器\n * RootContainer 1\n * -> SceneContainer 1.*\n * -> LayerContainer 1.*\n */\n public setContainer(container: Container, sceneContainer: Container) {\n this.container = container;\n this.sceneContainer = sceneContainer;\n }\n\n public getContainer() {\n return this.container;\n }\n\n public setBottomColor(color: string) {\n this.bottomColor = color;\n }\n\n public getBottomColor() {\n return this.bottomColor;\n }\n\n public addPlugin(plugin: ILayerPlugin): ILayer {\n // TODO: 控制插件注册顺序\n // @example:\n // pointLayer.addPlugin(new MyCustomPlugin(), {\n // before: 'L7BuiltinPlugin'\n // });\n this.plugins.push(plugin);\n return this;\n }\n\n public init() {\n // 设置配置项\n const sceneId = this.container.get<string>(TYPES.SceneID);\n // 初始化图层配置项\n // const { enableMultiPassRenderer = false } = this.rawConfig;\n // this.configService.setLayerConfig(sceneId, this.id, {\n // enableMultiPassRenderer,\n // });\n this.configService.setLayerConfig(sceneId, this.id, this.rawConfig);\n\n // 全局容器服务\n\n // 场景容器服务\n this.iconService = this.container.get<IIconService>(TYPES.IIconService);\n this.fontService = this.container.get<IFontService>(TYPES.IFontService);\n\n this.rendererService = this.container.get<IRendererService>(\n TYPES.IRendererService,\n );\n this.layerService = this.container.get<ILayerService>(TYPES.ILayerService);\n this.interactionService = this.container.get<IInteractionService>(\n TYPES.IInteractionService,\n );\n\n this.pickingService = this.container.get<IPickingService>(\n TYPES.IPickingService,\n );\n this.mapService = this.container.get<IMapService>(TYPES.IMapService);\n this.cameraService = this.container.get<ICameraService>(\n TYPES.ICameraService,\n );\n this.coordinateService = this.container.get<ICoordinateSystemService>(\n TYPES.ICoordinateSystemService,\n );\n this.shaderModuleService = this.container.get<IShaderModuleService>(\n TYPES.IShaderModuleService,\n );\n this.postProcessingPassFactory = this.container.get(\n TYPES.IFactoryPostProcessingPass,\n );\n this.normalPassFactory = this.container.get(TYPES.IFactoryNormalPass);\n\n // 图层容器服务\n this.styleAttributeService = this.container.get<IStyleAttributeService>(\n TYPES.IStyleAttributeService,\n );\n this.multiPassRenderer = this.container.get<IMultiPassRenderer>(\n TYPES.IMultiPassRenderer,\n );\n this.multiPassRenderer.setLayer(this);\n\n // 完成样式服务注册完成前添加的属性\n this.pendingStyleAttributes.forEach(\n ({ attributeName, attributeField, attributeValues, updateOptions }) => {\n this.styleAttributeService.updateStyleAttribute(\n attributeName,\n {\n // @ts-ignore\n scale: {\n field: attributeField,\n ...this.splitValuesAndCallbackInAttribute(\n // @ts-ignore\n attributeValues,\n // @ts-ignore\n this.getLayerConfig()[attributeName],\n ),\n },\n },\n // @ts-ignore\n updateOptions,\n );\n },\n );\n this.pendingStyleAttributes = [];\n\n // 获取插件集\n this.plugins = this.container.getAll<ILayerPlugin>(TYPES.ILayerPlugin);\n // 完成插件注册,传入场景和图层容器内的服务\n for (const plugin of this.plugins) {\n plugin.apply(this, {\n rendererService: this.rendererService,\n mapService: this.mapService,\n styleAttributeService: this.styleAttributeService,\n normalPassFactory: this.normalPassFactory,\n postProcessingPassFactory: this.postProcessingPassFactory,\n });\n }\n\n // 触发 init 生命周期插件\n this.hooks.init.call();\n // this.pickingPassRender = this.normalPassFactory('pixelPicking');\n // this.pickingPassRender.init(this);\n this.hooks.afterInit.call();\n\n // 触发初始化完成事件;\n this.emit('inited', {\n target: this,\n type: 'inited',\n });\n this.emit('add', {\n target: this,\n type: 'add',\n });\n return this;\n }\n /**\n * Model初始化前需要更新Model样式\n */\n public prepareBuildModel() {\n this.inited = true;\n this.updateLayerConfig({\n ...(this.getDefaultConfig() as object),\n ...this.rawConfig,\n });\n\n // 启动动画\n const { animateOption } = this.getLayerConfig();\n if (animateOption?.enable) {\n this.layerService.startAnimate();\n this.aniamateStatus = true;\n }\n }\n public color(\n field: StyleAttributeField,\n values?: StyleAttributeOption,\n updateOptions?: Partial<IStyleAttributeUpdateOptions>,\n ) {\n // 设置 color、size、shape、style 时由于场景服务尚未完成(并没有调用 scene.addLayer),因此暂时加入待更新属性列表\n this.updateStyleAttribute('color', field, values, updateOptions);\n\n // this.pendingStyleAttributes.push({\n // attributeName: 'color',\n // attributeField: field,\n // attributeValues: values,\n // defaultName: 'colors',\n // updateOptions,\n // });\n return this;\n }\n\n // 为对应的图层传入纹理的编号名称(point/image 在 shape 方法中传入纹理名称的方法并不通用)\n public texture(\n field: StyleAttributeField,\n values?: StyleAttributeOption,\n updateOptions?: Partial<IStyleAttributeUpdateOptions>,\n ) {\n this.updateStyleAttribute('texture', field, values, updateOptions);\n return this;\n }\n\n public rotate(\n field: StyleAttributeField,\n values?: StyleAttributeOption,\n updateOptions?: Partial<IStyleAttributeUpdateOptions>,\n ) {\n this.updateStyleAttribute('rotate', field, values, updateOptions);\n return this;\n }\n public size(\n field: StyleAttributeField,\n values?: StyleAttributeOption,\n updateOptions?: Partial<IStyleAttributeUpdateOptions>,\n ) {\n this.updateStyleAttribute('size', field, values, updateOptions);\n return this;\n }\n // 对mapping后的数据过滤,scale保持不变\n public filter(\n field: StyleAttributeField,\n values?: StyleAttributeOption,\n updateOptions?: Partial<IStyleAttributeUpdateOptions>,\n ) {\n this.updateStyleAttribute('filter', field, values, updateOptions);\n return this;\n }\n\n public shape(\n field: StyleAttributeField,\n values?: StyleAttributeOption,\n updateOptions?: Partial<IStyleAttributeUpdateOptions>,\n ) {\n const lastShape = this.styleAttributeService?.getLayerStyleAttribute(\n 'shape',\n )?.scale?.field;\n const currentShape = field;\n this.updateStyleAttribute('shape', field, values, updateOptions);\n // TODO: 根据 shape 判断是否需要更新 model\n updateShape(this, lastShape, currentShape);\n return this;\n }\n public label(\n field: StyleAttributeField,\n values?: StyleAttributeOption,\n updateOptions?: Partial<IStyleAttributeUpdateOptions>,\n ) {\n this.pendingStyleAttributes.push({\n attributeName: 'label',\n attributeField: field,\n attributeValues: values,\n updateOptions,\n });\n return this;\n }\n public animate(options: IAnimateOption | boolean) {\n let rawAnimate: Partial<IAnimateOption> = {};\n if (isObject(options)) {\n rawAnimate.enable = true;\n rawAnimate = {\n ...rawAnimate,\n ...options,\n };\n } else {\n rawAnimate.enable = options;\n }\n this.updateLayerConfig({\n animateOption: rawAnimate,\n });\n // this.animateOptions = options;\n return this;\n }\n\n public source(data: any, options?: ISourceCFG): ILayer {\n if (data?.data) {\n // 判断是否为source\n this.setSource(data);\n return this;\n }\n this.sourceOption = {\n data,\n options,\n };\n this.clusterZoom = 0;\n return this;\n }\n public setData(data: any, options?: ISourceCFG) {\n if (this.inited) {\n this.layerSource.setData(data, options);\n } else {\n this.on('inited', () => {\n this.layerSource.setData(data, options);\n });\n }\n\n return this;\n }\n public style(\n options: Partial<ChildLayerStyleOptions> & Partial<ILayerConfig>,\n ): ILayer {\n const { passes, ...rest } = options;\n\n // passes 特殊处理\n if (passes) {\n normalizePasses(passes).forEach(\n (pass: [string, { [key: string]: unknown }]) => {\n const postProcessingPass = this.multiPassRenderer\n .getPostProcessor()\n .getPostProcessingPassByName(pass[0]);\n if (postProcessingPass) {\n postProcessingPass.updateOptions(pass[1]);\n }\n },\n );\n }\n\n this.rawConfig = {\n ...this.rawConfig,\n ...rest,\n };\n if (this.container) {\n this.updateLayerConfig(this.rawConfig);\n this.styleNeedUpdate = true;\n }\n return this;\n }\n public scale(field: string | number | IScaleOptions, cfg?: IScale) {\n if (isObject(field)) {\n this.scaleOptions = {\n ...this.scaleOptions,\n ...field,\n };\n } else {\n this.scaleOptions[field] = cfg;\n }\n return this;\n }\n\n /**\n * 渲染所有的图层\n */\n public renderLayers(): void {\n this.rendering = true;\n\n this.layerService.renderLayers();\n\n this.rendering = false;\n }\n\n public render(): ILayer {\n // if (\n // this.needPick() &&\n // this.multiPassRenderer &&\n // this.multiPassRenderer.getRenderFlag()\n // ) {\n // this.multiPassRenderer.render();\n // } else if (this.needPick() && this.multiPassRenderer) {\n // this.renderModels();\n // } else {\n // this.renderModels();\n // }\n\n // TODO: this.getEncodedData().length !== 0 这个判断是为了解决在 2.5.x 引入数据纹理后产生的 空数据渲染导致 texture 超出上限问题\n if (this.getEncodedData().length !== 0) {\n if (this.multiPassRenderer && this.multiPassRenderer.getRenderFlag()) {\n // multi render 开始执行 multiPassRender 的渲染流程\n this.multiPassRenderer.render();\n } else if (this.multiPassRenderer) {\n // renderPass 触发的渲染\n this.renderModels();\n } else {\n this.renderModels();\n }\n\n // this.renderModels();\n }\n // this.renderModels();\n\n // this.multiPassRenderer.render();\n // this.renderModels();\n return this;\n }\n\n public active(options: IActiveOption | boolean) {\n const activeOption: Partial<ILayerConfig> = {};\n activeOption.enableHighlight = isObject(options) ? true : options;\n if (isObject(options)) {\n activeOption.enableHighlight = true;\n if (options.color) {\n activeOption.highlightColor = options.color;\n }\n if (options.mix) {\n activeOption.activeMix = options.mix;\n }\n } else {\n activeOption.enableHighlight = !!options;\n }\n this.updateLayerConfig(activeOption);\n return this;\n }\n public setActive(\n id: number | { x: number; y: number },\n options?: IActiveOption,\n ): void {\n if (isObject(id)) {\n const { x = 0, y = 0 } = id;\n this.updateLayerConfig({\n highlightColor: isObject(options)\n ? options.color\n : this.getLayerConfig().highlightColor,\n activeMix: isObject(options)\n ? options.mix\n : this.getLayerConfig().activeMix,\n });\n this.pick({ x, y });\n } else {\n this.updateLayerConfig({\n pickedFeatureID: id,\n highlightColor: isObject(options)\n ? options.color\n : this.getLayerConfig().highlightColor,\n activeMix: isObject(options)\n ? options.mix\n : this.getLayerConfig().activeMix,\n });\n this.hooks.beforeSelect\n .call(encodePickingColor(id as number) as number[])\n // @ts-ignore\n .then(() => {\n setTimeout(() => {\n this.reRender();\n }, 1);\n });\n }\n }\n\n public select(option: IActiveOption | boolean): ILayer {\n const activeOption: Partial<ILayerConfig> = {};\n activeOption.enableSelect = isObject(option) ? true : option;\n if (isObject(option)) {\n activeOption.enableSelect = true;\n if (option.color) {\n activeOption.selectColor = option.color;\n }\n if (option.mix) {\n activeOption.selectMix = option.mix;\n }\n } else {\n activeOption.enableSelect = !!option;\n }\n this.updateLayerConfig(activeOption);\n return this;\n }\n\n public setSelect(\n id: number | { x: number; y: number },\n options?: IActiveOption,\n ): void {\n if (isObject(id)) {\n const { x = 0, y = 0 } = id;\n this.updateLayerConfig({\n selectColor: isObject(options)\n ? options.color\n : this.getLayerConfig().selectColor,\n selectMix: isObject(options)\n ? options.mix\n : this.getLayerConfig().selectMix,\n });\n this.pick({ x, y });\n } else {\n this.updateLayerConfig({\n pickedFeatureID: id,\n selectColor: isObject(options)\n ? options.color\n : this.getLayerConfig().selectColor,\n selectMix: isObject(options)\n ? options.mix\n : this.getLayerConfig().selectMix,\n });\n this.hooks.beforeSelect\n .call(encodePickingColor(id as number) as number[])\n // @ts-ignore\n .then(() => {\n setTimeout(() => {\n this.reRender();\n }, 1);\n });\n }\n }\n public setBlend(type: keyof typeof BlendType): void {\n this.updateLayerConfig({\n blend: type,\n });\n this.layerModelNeedUpdate = true;\n this.reRender();\n }\n public show(): ILayer {\n this.updateLayerConfig({\n visible: true,\n });\n this.reRender();\n return this;\n }\n\n public hide(): ILayer {\n this.updateLayerConfig({\n visible: false,\n });\n this.reRender();\n return this;\n }\n public setIndex(index: number): ILayer {\n this.zIndex = index;\n this.layerService.updateLayerRenderList();\n this.layerService.renderLayers();\n return this;\n }\n\n public setCurrentPickId(id: number) {\n this.currentPickId = id;\n }\n\n public getCurrentPickId(): number | null {\n return this.currentPickId;\n }\n\n public setCurrentSelectedId(id: number) {\n this.selectedFeatureID = id;\n }\n\n public getCurrentSelectedId(): number | null {\n return this.selectedFeatureID;\n }\n public isVisible(): boolean {\n const zoom = this.mapService.getZoom();\n const {\n visible,\n minZoom = -Infinity,\n maxZoom = Infinity,\n } = this.getLayerConfig();\n return !!visible && zoom >= minZoom && zoom <= maxZoom;\n }\n\n public setMinZoom(minZoom: number): ILayer {\n this.updateLayerConfig({\n minZoom,\n });\n return this;\n }\n\n public getMinZoom(): number {\n const { minZoom } = this.getLayerConfig();\n return minZoom as number;\n }\n\n public getMaxZoom(): number {\n const { maxZoom } = this.getLayerConfig();\n return maxZoom as number;\n }\n\n public get(name: string) {\n const cfg = this.getLayerConfig();\n // @ts-ignore\n return cfg[name];\n }\n\n public setMaxZoom(maxZoom: number): ILayer {\n this.updateLayerConfig({\n maxZoom,\n });\n return this;\n }\n /**\n * zoom to layer Bounds\n */\n public fitBounds(fitBoundsOptions?: unknown): ILayer {\n if (!this.inited) {\n this.updateLayerConfig({\n autoFit: true,\n });\n return this;\n }\n const source = this.getSource();\n const extent = source.extent;\n const isValid = extent.some((v) => Math.abs(v) === Infinity);\n if (isValid) {\n return this;\n }\n this.mapService.fitBounds(\n [\n [extent[0], extent[1]],\n [extent[2], extent[3]],\n ],\n fitBoundsOptions,\n );\n return this;\n }\n\n public destroy() {\n // debugger\n if (this.isDestroied) {\n return;\n }\n this.hooks.beforeDestroy.call();\n // 清除sources事件\n this.layerSource.off('update', this.sourceEvent);\n\n this.multiPassRenderer.destroy();\n // console.log(this.styleAttributeService.getAttributes())\n // 清除所有属性以及关联的 vao == 销毁所有 => model this.models.forEach((model) => model.destroy());\n this.styleAttributeService.clearAllAttributes();\n\n // 执行每个图层单独的 clearModels 方法 (清除一些额外的 texture、program、buffer 等)\n\n this.hooks.afterDestroy.call();\n\n // TODO: 清除各个图层自定义的 models 资源\n // this.layerModel?.clearModels();\n\n this.models = [];\n\n this.layerService.cleanRemove(this);\n\n this.emit('remove', {\n target: this,\n type: 'remove',\n });\n\n this.emit('destroy', {\n target: this,\n type: 'destroy',\n });\n\n this.removeAllListeners();\n // 解绑图层容器中的服务\n // this.container.unbind(TYPES.IStyleAttributeService);\n\n this.isDestroied = true;\n }\n public clear() {\n this.styleAttributeService.clearAllAttributes();\n // 销毁所有 model\n }\n public clearModels() {\n this.models.forEach((model) => model.destroy());\n this.layerModel.clearModels();\n }\n\n public isDirty() {\n return !!(\n this.styleAttributeService.getLayerStyleAttributes() || []\n ).filter(\n (attribute) =>\n attribute.needRescale ||\n attribute.needRemapping ||\n attribute.needRegenerateVertices,\n ).length;\n }\n\n public setSource(source: Source) {\n // 清除旧 sources 事件\n if (this.layerSource) {\n this.layerSource.off('update', this.sourceEvent);\n }\n\n this.layerSource = source;\n this.clusterZoom = 0;\n\n // 已 inited 且启用聚合进行更新聚合数据\n if (this.inited && this.layerSource.cluster) {\n const zoom = this.mapService.getZoom();\n this.layerSource.updateClusterData(zoom);\n }\n // source 可能会复用,会在其它layer被修改\n this.layerSource.on('update', this.sourceEvent);\n }\n public getSource() {\n return this.layerSource;\n }\n\n public getScaleOptions() {\n return this.scaleOptions;\n }\n\n public setEncodedData(encodedData: IEncodeFeature[]) {\n this.encodedData = encodedData;\n }\n public getEncodedData() {\n return this.encodedData;\n }\n public getLegendItems(name: string): any {\n const scale = this.styleAttributeService.getLayerAttributeScale(name);\n if (scale) {\n if (scale.ticks) {\n const items = scale.ticks().map((item: any) => {\n return {\n value: item,\n [name]: scale(item),\n };\n });\n return items;\n } else if (scale.invertExtent) {\n const items = scale.range().map((item: any) => {\n return {\n value: scale.invertExtent(item),\n [name]: item,\n };\n });\n return items;\n }\n } else {\n return [];\n }\n }\n\n public pick({ x, y }: { x: number; y: number }) {\n this.interactionService.triggerHover({ x, y });\n }\n\n public boxSelect(\n box: [number, number, number, number],\n cb: (...args: any[]) => void,\n ) {\n this.pickingService.boxPickLayer(this, box, cb);\n }\n\n public buildLayerModel(\n options: ILayerModelInitializationOptions &\n Partial<IModelInitializationOptions>,\n ): IModel {\n const {\n moduleName,\n vertexShader,\n fragmentShader,\n triangulation,\n segmentNumber,\n ...rest\n } = options;\n this.shaderModuleService.registerModule(moduleName, {\n vs: vertexShader,\n fs: fragmentShader,\n });\n const { vs, fs, uniforms } = this.shaderModuleService.getModule(moduleName);\n const { createModel } = this.rendererService;\n const {\n attributes,\n elements,\n } = this.styleAttributeService.createAttributesAndIndices(\n this.encodedData,\n triangulation,\n segmentNumber,\n );\n return createModel({\n attributes,\n uniforms,\n fs,\n vs,\n elements,\n blend: BlendTypes[BlendType.normal],\n ...rest,\n });\n }\n\n public getTime() {\n return this.layerService.clock.getDelta();\n }\n public setAnimateStartTime() {\n this.animateStartTime = this.layerService.clock.getElapsedTime();\n }\n public stopAnimate() {\n if (this.aniamateStatus) {\n this.layerService.stopAnimate();\n this.aniamateStatus = false;\n this.updateLayerConfig({\n animateOption: {\n enable: false,\n },\n });\n }\n }\n public getLayerAnimateTime(): number {\n return this.layerService.clock.getElapsedTime() - this.animateStartTime;\n }\n\n public needPick(type: string): boolean {\n const {\n enableHighlight = true,\n enableSelect = true,\n } = this.getLayerConfig();\n // 判断layer是否监听事件;\n let isPick =\n this.eventNames().indexOf(type) !== -1 ||\n this.eventNames().indexOf('un' + type) !== -1;\n if ((type === 'click' || type === 'dblclick') && enableSelect) {\n isPick = true;\n }\n if (\n type === 'mousemove' &&\n (enableHighlight ||\n this.eventNames().indexOf('mouseenter') !== -1 ||\n this.eventNames().indexOf('unmousemove') !== -1 ||\n this.eventNames().indexOf('mouseout') !== -1)\n ) {\n isPick = true;\n }\n return this.isVisible() && isPick;\n }\n\n public buildModels() {\n throw new Error('Method not implemented.');\n }\n public rebuildModels() {\n throw new Error('Method not implemented.');\n }\n\n public renderModels(isPicking?: boolean) {\n // TODO: this.getEncodedData().length > 0 这个判断是为了解决在 2.5.x 引入数据纹理后产生的 空数据渲染导致 texture 超出上限问题\n if (this.getEncodedData().length > 0) {\n if (this.layerModelNeedUpdate && this.layerModel) {\n this.models = this.layerModel.buildModels();\n this.hooks.beforeRender.call();\n this.layerModelNeedUpdate = false;\n }\n this.models.forEach((model) => {\n model.draw(\n {\n uniforms: this.layerModel.getUninforms(),\n },\n isPicking,\n );\n });\n }\n return this;\n }\n\n public updateStyleAttribute(\n type: string,\n field: StyleAttributeField,\n values?: StyleAttributeOption,\n updateOptions?: Partial<IStyleAttributeUpdateOptions>,\n ) {\n if (!this.inited) {\n this.pendingStyleAttributes.push({\n attributeName: type,\n attributeField: field,\n attributeValues: values,\n updateOptions,\n });\n } else {\n this.styleAttributeService.updateStyleAttribute(\n type,\n {\n // @ts-ignore\n scale: {\n field,\n ...this.splitValuesAndCallbackInAttribute(\n // @ts-ignore\n values,\n // @ts-ignore\n this.getLayerConfig()[field],\n ),\n },\n },\n // @ts-ignore\n updateOptions,\n );\n }\n }\n\n public getShaderPickStat() {\n return this.layerService.getShaderPickStat();\n }\n\n /**\n * 继承空方法\n * @param time\n */\n public setEarthTime(time: number) {\n console.warn('empty fn');\n }\n\n protected getConfigSchema() {\n throw new Error('Method not implemented.');\n }\n\n protected getModelType(): unknown {\n throw new Error('Method not implemented.');\n }\n protected getDefaultConfig() {\n return {};\n }\n\n private sourceEvent = () => {\n this.dataState.dataSourceNeedUpdate = true;\n const { autoFit, fitBoundsOptions } = this.getLayerConfig();\n if (autoFit) {\n this.fitBounds(fitBoundsOptions);\n }\n // 对外暴露事件\n this.emit('dataUpdate');\n this.reRender();\n };\n\n private reRender() {\n if (this.inited) {\n this.layerService.updateLayerRenderList();\n this.layerService.renderLayers();\n }\n }\n private splitValuesAndCallbackInAttribute(\n valuesOrCallback?: unknown[],\n defaultValues?: unknown[],\n ) {\n return {\n values: isFunction(valuesOrCallback)\n ? undefined\n : valuesOrCallback || defaultValues,\n callback: isFunction(valuesOrCallback) ? valuesOrCallback : undefined,\n };\n }\n}\n"],"file":"BaseLayer.js"}
|
|
1
|
+
{"version":3,"sources":["../../src/core/BaseLayer.ts"],"names":["layerIdCounter","BaseLayer","TYPES","IGlobalConfigService","config","dataSourceNeedUpdate","dataMappingNeedUpdate","filterNeedUpdate","featureScaleNeedUpdate","StyleAttrNeedUpdate","init","SyncBailHook","afterInit","beforeRender","beforeRenderData","SyncWaterfallHook","afterRender","SyncHook","beforePickingEncode","afterPickingEncode","beforeHighlight","afterHighlight","beforeSelect","afterSelect","beforeDestroy","afterDestroy","enable","dataState","getLayerConfig","autoFit","fitBoundsOptions","fitBounds","emit","reRender","name","id","zIndex","rawConfig","configService","configToUpdate","inited","needUpdateConfig","sceneId","container","get","SceneID","setLayerConfig","sceneContainer","color","bottomColor","plugin","plugins","push","iconService","IIconService","fontService","IFontService","rendererService","IRendererService","layerService","ILayerService","interactionService","IInteractionService","pickingService","IPickingService","mapService","IMapService","cameraService","ICameraService","coordinateService","ICoordinateSystemService","shaderModuleService","IShaderModuleService","postProcessingPassFactory","IFactoryPostProcessingPass","normalPassFactory","IFactoryNormalPass","styleAttributeService","IStyleAttributeService","multiPassRenderer","IMultiPassRenderer","setLayer","pendingStyleAttributes","forEach","attributeName","attributeField","attributeValues","updateOptions","updateStyleAttribute","scale","field","splitValuesAndCallbackInAttribute","getAll","ILayerPlugin","apply","hooks","call","target","type","updateLayerConfig","getDefaultConfig","animateOption","startAnimate","aniamateStatus","values","lastShape","getLayerStyleAttribute","currentShape","options","rawAnimate","data","setSource","sourceOption","clusterZoom","layerSource","setData","on","passes","rest","pass","postProcessingPass","getPostProcessor","getPostProcessingPassByName","styleNeedUpdate","cfg","scaleOptions","rendering","renderLayers","getEncodedData","length","renderModels","getRenderFlag","render","activeOption","enableHighlight","highlightColor","mix","activeMix","x","y","pick","pickedFeatureID","then","setTimeout","option","enableSelect","selectColor","selectMix","blend","layerModelNeedUpdate","visible","index","updateLayerRenderList","currentPickId","selectedFeatureID","zoom","getZoom","minZoom","Infinity","maxZoom","source","getSource","extent","isValid","some","v","Math","abs","isDestroied","off","sourceEvent","destroy","clearAllAttributes","models","cleanRemove","removeAllListeners","model","layerModel","clearModels","getLayerStyleAttributes","filter","attribute","needRescale","needRemapping","needRegenerateVertices","cluster","updateClusterData","encodedData","getLayerAttributeScale","ticks","items","map","item","value","invertExtent","range","triggerHover","box","cb","boxPickLayer","moduleName","vertexShader","fragmentShader","triangulation","segmentNumber","registerModule","vs","fs","getModule","uniforms","createModel","createAttributesAndIndices","attributes","elements","BlendTypes","BlendType","normal","clock","getDelta","animateStartTime","getElapsedTime","stopAnimate","isPick","eventNames","indexOf","isVisible","Error","isPicking","buildModels","draw","getUninforms","getShaderPickStat","time","console","warn","valuesOrCallback","defaultValues","undefined","callback","EventEmitter"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;;AACA;;AA4CA;;AACA;;AAGA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;AAKA,IAAIA,cAAc,GAAG,CAArB;IAEqBC,S,WA8DlB,wBAAWC,cAAMC,oBAAjB,C;;;;;AA2ED,uBAAyE;AAAA;;AAAA,QAA7DC,MAA6D,uEAAJ,EAAI;AAAA;AACvE;AADuE,+FAvIlDJ,cAAc,EAuIoC;AAAA,iGAtIhDA,cAsIgD;AAAA;AAAA,0FApI/C,IAoI+C;AAAA,yFAnIjD,CAmIiD;AAAA;AAAA;AAAA,yFAhIhD,KAgIgD;AAAA,uGA/HlC,KA+HkC;AAAA,kGA9HjC,IA8HiC;AAAA,oGA7H/B,IA6H+B;AAAA,kGA5HvC,KA4HuC;AAAA;AAAA,8FA1H5C,CA0H4C;AAAA,4FAxH1C;AAC7BK,MAAAA,oBAAoB,EAAE,KADO;AAE7BC,MAAAA,qBAAqB,EAAE,KAFM;AAG7BC,MAAAA,gBAAgB,EAAE,KAHW;AAI7BC,MAAAA,sBAAsB,EAAE,KAJK;AAK7BC,MAAAA,mBAAmB,EAAE;AALQ,KAwH0C;AAAA,wFAhH1D;AACbC,MAAAA,IAAI,EAAE,IAAIC,uBAAJ,EADO;AAEbC,MAAAA,SAAS,EAAE,IAAID,uBAAJ,EAFE;AAGbE,MAAAA,YAAY,EAAE,IAAIF,uBAAJ,EAHD;AAIbG,MAAAA,gBAAgB,EAAE,IAAIC,4BAAJ,EAJL;AAKbC,MAAAA,WAAW,EAAE,IAAIC,mBAAJ,EALA;AAMbC,MAAAA,mBAAmB,EAAE,IAAID,mBAAJ,EANR;AAObE,MAAAA,kBAA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B,UAAI,KAAK1L,MAAT,EAAiB;AACf,aAAKmB,YAAL,CAAkB6F,qBAAlB;AACA,aAAK7F,YAAL,CAAkBoE,YAAlB;AACD;AACF;;;WACD,2CACE4G,gBADF,EAEEC,aAFF,EAGE;AACA,aAAO;AACLpI,QAAAA,MAAM,EAAE,0BAAWmI,gBAAX,IACJE,SADI,GAEJF,gBAAgB,IAAIC,aAHnB;AAILE,QAAAA,QAAQ,EAAE,0BAAWH,gBAAX,IAA+BA,gBAA/B,GAAkDE;AAJvD,OAAP;AAMD;;;EA1iCiEE,0B","sourcesContent":["// @ts-ignore\nimport { SyncBailHook, SyncHook, SyncWaterfallHook } from '@antv/async-hook';\nimport {\n BlendType,\n gl,\n IActiveOption,\n IAnimateOption,\n ICameraService,\n ICoordinateSystemService,\n IDataState,\n IEncodeFeature,\n IFontService,\n IGlobalConfigService,\n IIconService,\n IInteractionService,\n ILayer,\n ILayerConfig,\n ILayerModel,\n ILayerModelInitializationOptions,\n ILayerPlugin,\n ILayerService,\n IMapService,\n IModel,\n IModelInitializationOptions,\n IMultiPassRenderer,\n IPass,\n IPickingService,\n IPostProcessingPass,\n IRendererService,\n IScale,\n IScaleOptions,\n IShaderModuleService,\n ISource,\n ISourceCFG,\n IStyleAttributeInitializationOptions,\n IStyleAttributeService,\n IStyleAttributeUpdateOptions,\n lazyInject,\n ScaleAttributeType,\n ScaleTypeName,\n ScaleTypes,\n StyleAttributeField,\n StyleAttributeOption,\n TYPES,\n} from '@antv/l7-core';\nimport Source from '@antv/l7-source';\nimport { encodePickingColor } from '@antv/l7-utils';\nimport { EventEmitter } from 'eventemitter3';\nimport { Container } from 'inversify';\nimport { isFunction, isObject } from 'lodash';\nimport { normalizePasses } from '../plugins/MultiPassRendererPlugin';\nimport { BlendTypes } from '../utils/blend';\nimport { handleStyleDataMapping } from '../utils/dataMappingStyle';\nimport { updateShape } from '../utils/updateShape';\nimport baseLayerSchema from './schema';\n/**\n * 分配 layer id\n */\nlet layerIdCounter = 0;\n\nexport default class BaseLayer<ChildLayerStyleOptions = {}> extends EventEmitter\n implements ILayer {\n public id: string = `${layerIdCounter++}`;\n public name: string = `${layerIdCounter}`;\n public type: string;\n public visible: boolean = true;\n public zIndex: number = 0;\n public minZoom: number;\n public maxZoom: number;\n public inited: boolean = false;\n public layerModelNeedUpdate: boolean = false;\n public pickedFeatureID: number | null = null;\n public selectedFeatureID: number | null = null;\n public styleNeedUpdate: boolean = false;\n public rendering: boolean;\n public clusterZoom: number = 0; // 聚合等级标记\n\n public dataState: IDataState = {\n dataSourceNeedUpdate: false,\n dataMappingNeedUpdate: false,\n filterNeedUpdate: false,\n featureScaleNeedUpdate: false,\n StyleAttrNeedUpdate: false,\n };\n // 生命周期钩子\n public hooks = {\n init: new SyncBailHook(),\n afterInit: new SyncBailHook(),\n beforeRender: new SyncBailHook(),\n beforeRenderData: new SyncWaterfallHook(),\n afterRender: new SyncHook(),\n beforePickingEncode: new SyncHook(),\n afterPickingEncode: new SyncHook(),\n beforeHighlight: new SyncHook(['pickedColor']),\n afterHighlight: new SyncHook(),\n beforeSelect: new SyncHook(['pickedColor']),\n afterSelect: new SyncHook(),\n beforeDestroy: new SyncHook(),\n afterDestroy: new SyncHook(),\n };\n\n // 待渲染 model 列表\n public models: IModel[] = [];\n\n // 每个 Layer 都有一个\n public multiPassRenderer: IMultiPassRenderer;\n\n // 注入插件集\n public plugins: ILayerPlugin[];\n\n public sourceOption: {\n data: any;\n options?: ISourceCFG;\n };\n\n public layerModel: ILayerModel;\n\n // TODO: 记录 sceneContainer 供创建子图层的时候使用 如 imageTileLayer\n public sceneContainer: Container | undefined;\n // TODO: 用于保存子图层对象\n public layerChildren: ILayer[] = [];\n\n @lazyInject(TYPES.IGlobalConfigService)\n protected readonly configService: IGlobalConfigService;\n\n // @lazyInject(TYPES.IShaderModuleService)\n // protected readonly shaderModuleService: IShaderModuleService;\n\n protected shaderModuleService: IShaderModuleService;\n protected cameraService: ICameraService;\n\n protected coordinateService: ICoordinateSystemService;\n\n protected iconService: IIconService;\n\n protected fontService: IFontService;\n\n protected pickingService: IPickingService;\n\n protected rendererService: IRendererService;\n\n protected layerService: ILayerService;\n\n protected interactionService: IInteractionService;\n\n protected mapService: IMapService;\n\n protected styleAttributeService: IStyleAttributeService;\n\n protected layerSource: Source;\n\n protected postProcessingPassFactory: (\n name: string,\n ) => IPostProcessingPass<unknown>;\n protected normalPassFactory: (name: string) => IPass<unknown>;\n\n protected animateOptions: IAnimateOption = { enable: false };\n\n /**\n * 图层容器\n */\n private container: Container;\n\n private encodedData: IEncodeFeature[];\n\n private configSchema: object;\n\n private currentPickId: number | null = null;\n\n private rawConfig: Partial<ILayerConfig & ChildLayerStyleOptions>;\n\n private needUpdateConfig: Partial<ILayerConfig & ChildLayerStyleOptions>;\n\n /**\n * 待更新样式属性,在初始化阶段完成注册\n */\n private pendingStyleAttributes: Array<{\n attributeName: string;\n attributeField: StyleAttributeField;\n attributeValues?: StyleAttributeOption;\n defaultName?: string;\n updateOptions?: Partial<IStyleAttributeUpdateOptions>;\n }> = [];\n\n private scaleOptions: IScaleOptions = {};\n\n private animateStartTime: number;\n\n private aniamateStatus: boolean = false;\n\n // TODO: layer 保底颜色\n private bottomColor = 'rgba(0, 0, 0, 0)';\n\n private isDestroied: boolean = false;\n\n // private pickingPassRender: IPass<'pixelPicking'>;\n\n constructor(config: Partial<ILayerConfig & ChildLayerStyleOptions> = {}) {\n super();\n this.name = config.name || this.id;\n this.zIndex = config.zIndex || 0;\n this.rawConfig = config;\n }\n\n public getLayerConfig() {\n return this.configService.getLayerConfig<ChildLayerStyleOptions>(this.id);\n }\n\n public updateLayerConfig(\n configToUpdate: Partial<ILayerConfig | ChildLayerStyleOptions>,\n ) {\n if (!this.inited) {\n this.needUpdateConfig = {\n ...this.needUpdateConfig,\n ...configToUpdate,\n };\n } else {\n const sceneId = this.container.get<string>(TYPES.SceneID);\n\n // @ts-ignore\n handleStyleDataMapping(configToUpdate, this); // 处理 style 中进行数据映射的属性字段\n\n this.configService.setLayerConfig(sceneId, this.id, {\n ...this.configService.getLayerConfig(this.id),\n ...this.needUpdateConfig,\n ...configToUpdate,\n });\n this.needUpdateConfig = {};\n }\n }\n\n /**\n * 注入图层容器,父容器为场景容器\n * RootContainer 1\n * -> SceneContainer 1.*\n * -> LayerContainer 1.*\n */\n public setContainer(container: Container, sceneContainer: Container) {\n this.container = container;\n this.sceneContainer = sceneContainer;\n }\n\n public getContainer() {\n return this.container;\n }\n\n public setBottomColor(color: string) {\n this.bottomColor = color;\n }\n\n public getBottomColor() {\n return this.bottomColor;\n }\n\n public addPlugin(plugin: ILayerPlugin): ILayer {\n // TODO: 控制插件注册顺序\n // @example:\n // pointLayer.addPlugin(new MyCustomPlugin(), {\n // before: 'L7BuiltinPlugin'\n // });\n this.plugins.push(plugin);\n return this;\n }\n\n public init() {\n // 设置配置项\n const sceneId = this.container.get<string>(TYPES.SceneID);\n // 初始化图层配置项\n // const { enableMultiPassRenderer = false } = this.rawConfig;\n // this.configService.setLayerConfig(sceneId, this.id, {\n // enableMultiPassRenderer,\n // });\n this.configService.setLayerConfig(sceneId, this.id, this.rawConfig);\n\n // 全局容器服务\n\n // 场景容器服务\n this.iconService = this.container.get<IIconService>(TYPES.IIconService);\n this.fontService = this.container.get<IFontService>(TYPES.IFontService);\n\n this.rendererService = this.container.get<IRendererService>(\n TYPES.IRendererService,\n );\n this.layerService = this.container.get<ILayerService>(TYPES.ILayerService);\n this.interactionService = this.container.get<IInteractionService>(\n TYPES.IInteractionService,\n );\n\n this.pickingService = this.container.get<IPickingService>(\n TYPES.IPickingService,\n );\n this.mapService = this.container.get<IMapService>(TYPES.IMapService);\n this.cameraService = this.container.get<ICameraService>(\n TYPES.ICameraService,\n );\n this.coordinateService = this.container.get<ICoordinateSystemService>(\n TYPES.ICoordinateSystemService,\n );\n this.shaderModuleService = this.container.get<IShaderModuleService>(\n TYPES.IShaderModuleService,\n );\n this.postProcessingPassFactory = this.container.get(\n TYPES.IFactoryPostProcessingPass,\n );\n this.normalPassFactory = this.container.get(TYPES.IFactoryNormalPass);\n\n // 图层容器服务\n this.styleAttributeService = this.container.get<IStyleAttributeService>(\n TYPES.IStyleAttributeService,\n );\n this.multiPassRenderer = this.container.get<IMultiPassRenderer>(\n TYPES.IMultiPassRenderer,\n );\n this.multiPassRenderer.setLayer(this);\n\n // 完成样式服务注册完成前添加的属性\n this.pendingStyleAttributes.forEach(\n ({ attributeName, attributeField, attributeValues, updateOptions }) => {\n this.styleAttributeService.updateStyleAttribute(\n attributeName,\n {\n // @ts-ignore\n scale: {\n field: attributeField,\n ...this.splitValuesAndCallbackInAttribute(\n // @ts-ignore\n attributeValues,\n // @ts-ignore\n this.getLayerConfig()[attributeName],\n ),\n },\n },\n // @ts-ignore\n updateOptions,\n );\n },\n );\n this.pendingStyleAttributes = [];\n\n // 获取插件集\n this.plugins = this.container.getAll<ILayerPlugin>(TYPES.ILayerPlugin);\n // 完成插件注册,传入场景和图层容器内的服务\n for (const plugin of this.plugins) {\n plugin.apply(this, {\n rendererService: this.rendererService,\n mapService: this.mapService,\n styleAttributeService: this.styleAttributeService,\n normalPassFactory: this.normalPassFactory,\n postProcessingPassFactory: this.postProcessingPassFactory,\n });\n }\n\n // 触发 init 生命周期插件\n this.hooks.init.call();\n // this.pickingPassRender = this.normalPassFactory('pixelPicking');\n // this.pickingPassRender.init(this);\n this.hooks.afterInit.call();\n\n // 触发初始化完成事件;\n this.emit('inited', {\n target: this,\n type: 'inited',\n });\n this.emit('add', {\n target: this,\n type: 'add',\n });\n return this;\n }\n /**\n * Model初始化前需要更新Model样式\n */\n public prepareBuildModel() {\n this.inited = true;\n this.updateLayerConfig({\n ...(this.getDefaultConfig() as object),\n ...this.rawConfig,\n });\n\n // 启动动画\n const { animateOption } = this.getLayerConfig();\n if (animateOption?.enable) {\n this.layerService.startAnimate();\n this.aniamateStatus = true;\n }\n }\n public color(\n field: StyleAttributeField,\n values?: StyleAttributeOption,\n updateOptions?: Partial<IStyleAttributeUpdateOptions>,\n ) {\n // 设置 color、size、shape、style 时由于场景服务尚未完成(并没有调用 scene.addLayer),因此暂时加入待更新属性列表\n this.updateStyleAttribute('color', field, values, updateOptions);\n\n // this.pendingStyleAttributes.push({\n // attributeName: 'color',\n // attributeField: field,\n // attributeValues: values,\n // defaultName: 'colors',\n // updateOptions,\n // });\n return this;\n }\n\n // 为对应的图层传入纹理的编号名称(point/image 在 shape 方法中传入纹理名称的方法并不通用)\n public texture(\n field: StyleAttributeField,\n values?: StyleAttributeOption,\n updateOptions?: Partial<IStyleAttributeUpdateOptions>,\n ) {\n this.updateStyleAttribute('texture', field, values, updateOptions);\n return this;\n }\n\n public rotate(\n field: StyleAttributeField,\n values?: StyleAttributeOption,\n updateOptions?: Partial<IStyleAttributeUpdateOptions>,\n ) {\n this.updateStyleAttribute('rotate', field, values, updateOptions);\n return this;\n }\n public size(\n field: StyleAttributeField,\n values?: StyleAttributeOption,\n updateOptions?: Partial<IStyleAttributeUpdateOptions>,\n ) {\n this.updateStyleAttribute('size', field, values, updateOptions);\n return this;\n }\n // 对mapping后的数据过滤,scale保持不变\n public filter(\n field: StyleAttributeField,\n values?: StyleAttributeOption,\n updateOptions?: Partial<IStyleAttributeUpdateOptions>,\n ) {\n this.updateStyleAttribute('filter', field, values, updateOptions);\n return this;\n }\n\n public shape(\n field: StyleAttributeField,\n values?: StyleAttributeOption,\n updateOptions?: Partial<IStyleAttributeUpdateOptions>,\n ) {\n const lastShape = this.styleAttributeService?.getLayerStyleAttribute(\n 'shape',\n )?.scale?.field;\n const currentShape = field;\n this.updateStyleAttribute('shape', field, values, updateOptions);\n // TODO: 根据 shape 判断是否需要更新 model\n updateShape(this, lastShape, currentShape);\n return this;\n }\n public label(\n field: StyleAttributeField,\n values?: StyleAttributeOption,\n updateOptions?: Partial<IStyleAttributeUpdateOptions>,\n ) {\n this.pendingStyleAttributes.push({\n attributeName: 'label',\n attributeField: field,\n attributeValues: values,\n updateOptions,\n });\n return this;\n }\n public animate(options: IAnimateOption | boolean) {\n let rawAnimate: Partial<IAnimateOption> = {};\n if (isObject(options)) {\n rawAnimate.enable = true;\n rawAnimate = {\n ...rawAnimate,\n ...options,\n };\n } else {\n rawAnimate.enable = options;\n }\n this.updateLayerConfig({\n animateOption: rawAnimate,\n });\n // this.animateOptions = options;\n return this;\n }\n\n public source(data: any, options?: ISourceCFG): ILayer {\n if (data?.data) {\n // 判断是否为source\n this.setSource(data);\n return this;\n }\n this.sourceOption = {\n data,\n options,\n };\n this.clusterZoom = 0;\n return this;\n }\n public setData(data: any, options?: ISourceCFG) {\n if (this.inited) {\n this.layerSource.setData(data, options);\n } else {\n this.on('inited', () => {\n this.layerSource.setData(data, options);\n });\n }\n\n return this;\n }\n public style(\n options: Partial<ChildLayerStyleOptions> & Partial<ILayerConfig>,\n ): ILayer {\n const { passes, ...rest } = options;\n\n // passes 特殊处理\n if (passes) {\n normalizePasses(passes).forEach(\n (pass: [string, { [key: string]: unknown }]) => {\n const postProcessingPass = this.multiPassRenderer\n .getPostProcessor()\n .getPostProcessingPassByName(pass[0]);\n if (postProcessingPass) {\n postProcessingPass.updateOptions(pass[1]);\n }\n },\n );\n }\n\n this.rawConfig = {\n ...this.rawConfig,\n ...rest,\n };\n if (this.container) {\n this.updateLayerConfig(this.rawConfig);\n this.styleNeedUpdate = true;\n }\n return this;\n }\n public scale(field: string | number | IScaleOptions, cfg?: IScale) {\n if (isObject(field)) {\n this.scaleOptions = {\n ...this.scaleOptions,\n ...field,\n };\n } else {\n this.scaleOptions[field] = cfg;\n }\n return this;\n }\n\n /**\n * 渲染所有的图层\n */\n public renderLayers(): void {\n this.rendering = true;\n\n this.layerService.renderLayers();\n\n this.rendering = false;\n }\n\n public render(): ILayer {\n // TODO: this.getEncodedData().length !== 0 这个判断是为了解决在 2.5.x 引入数据纹理后产生的 空数据渲染导致 texture 超出上限问题\n if (this.getEncodedData().length !== 0) {\n this.renderModels();\n }\n return this;\n }\n\n /**\n * renderMultiPass 专门用于渲染支持 multipass 的 layer\n */\n public async renderMultiPass() {\n if (this.getEncodedData().length !== 0) {\n if (this.multiPassRenderer && this.multiPassRenderer.getRenderFlag()) {\n // multi render 开始执行 multiPassRender 的渲染流程\n await this.multiPassRenderer.render();\n } else if (this.multiPassRenderer) {\n // renderPass 触发的渲染\n this.renderModels();\n } else {\n this.renderModels();\n }\n }\n }\n\n public active(options: IActiveOption | boolean) {\n const activeOption: Partial<ILayerConfig> = {};\n activeOption.enableHighlight = isObject(options) ? true : options;\n if (isObject(options)) {\n activeOption.enableHighlight = true;\n if (options.color) {\n activeOption.highlightColor = options.color;\n }\n if (options.mix) {\n activeOption.activeMix = options.mix;\n }\n } else {\n activeOption.enableHighlight = !!options;\n }\n this.updateLayerConfig(activeOption);\n return this;\n }\n public setActive(\n id: number | { x: number; y: number },\n options?: IActiveOption,\n ): void {\n if (isObject(id)) {\n const { x = 0, y = 0 } = id;\n this.updateLayerConfig({\n highlightColor: isObject(options)\n ? options.color\n : this.getLayerConfig().highlightColor,\n activeMix: isObject(options)\n ? options.mix\n : this.getLayerConfig().activeMix,\n });\n this.pick({ x, y });\n } else {\n this.updateLayerConfig({\n pickedFeatureID: id,\n highlightColor: isObject(options)\n ? options.color\n : this.getLayerConfig().highlightColor,\n activeMix: isObject(options)\n ? options.mix\n : this.getLayerConfig().activeMix,\n });\n this.hooks.beforeSelect\n .call(encodePickingColor(id as number) as number[])\n // @ts-ignore\n .then(() => {\n setTimeout(() => {\n this.reRender();\n }, 1);\n });\n }\n }\n\n public select(option: IActiveOption | boolean): ILayer {\n const activeOption: Partial<ILayerConfig> = {};\n activeOption.enableSelect = isObject(option) ? true : option;\n if (isObject(option)) {\n activeOption.enableSelect = true;\n if (option.color) {\n activeOption.selectColor = option.color;\n }\n if (option.mix) {\n activeOption.selectMix = option.mix;\n }\n } else {\n activeOption.enableSelect = !!option;\n }\n this.updateLayerConfig(activeOption);\n return this;\n }\n\n public setSelect(\n id: number | { x: number; y: number },\n options?: IActiveOption,\n ): void {\n if (isObject(id)) {\n const { x = 0, y = 0 } = id;\n this.updateLayerConfig({\n selectColor: isObject(options)\n ? options.color\n : this.getLayerConfig().selectColor,\n selectMix: isObject(options)\n ? options.mix\n : this.getLayerConfig().selectMix,\n });\n this.pick({ x, y });\n } else {\n this.updateLayerConfig({\n pickedFeatureID: id,\n selectColor: isObject(options)\n ? options.color\n : this.getLayerConfig().selectColor,\n selectMix: isObject(options)\n ? options.mix\n : this.getLayerConfig().selectMix,\n });\n this.hooks.beforeSelect\n .call(encodePickingColor(id as number) as number[])\n // @ts-ignore\n .then(() => {\n setTimeout(() => {\n this.reRender();\n }, 1);\n });\n }\n }\n public setBlend(type: keyof typeof BlendType): void {\n this.updateLayerConfig({\n blend: type,\n });\n this.layerModelNeedUpdate = true;\n this.reRender();\n }\n public show(): ILayer {\n this.updateLayerConfig({\n visible: true,\n });\n this.reRender();\n return this;\n }\n\n public hide(): ILayer {\n this.updateLayerConfig({\n visible: false,\n });\n this.reRender();\n return this;\n }\n public setIndex(index: number): ILayer {\n this.zIndex = index;\n this.layerService.updateLayerRenderList();\n this.layerService.renderLayers();\n return this;\n }\n\n public setCurrentPickId(id: number) {\n this.currentPickId = id;\n }\n\n public getCurrentPickId(): number | null {\n return this.currentPickId;\n }\n\n public setCurrentSelectedId(id: number) {\n this.selectedFeatureID = id;\n }\n\n public getCurrentSelectedId(): number | null {\n return this.selectedFeatureID;\n }\n public isVisible(): boolean {\n const zoom = this.mapService.getZoom();\n const {\n visible,\n minZoom = -Infinity,\n maxZoom = Infinity,\n } = this.getLayerConfig();\n return !!visible && zoom >= minZoom && zoom <= maxZoom;\n }\n\n public setMinZoom(minZoom: number): ILayer {\n this.updateLayerConfig({\n minZoom,\n });\n return this;\n }\n\n public getMinZoom(): number {\n const { minZoom } = this.getLayerConfig();\n return minZoom as number;\n }\n\n public getMaxZoom(): number {\n const { maxZoom } = this.getLayerConfig();\n return maxZoom as number;\n }\n\n public get(name: string) {\n const cfg = this.getLayerConfig();\n // @ts-ignore\n return cfg[name];\n }\n\n public setMaxZoom(maxZoom: number): ILayer {\n this.updateLayerConfig({\n maxZoom,\n });\n return this;\n }\n /**\n * zoom to layer Bounds\n */\n public fitBounds(fitBoundsOptions?: unknown): ILayer {\n if (!this.inited) {\n this.updateLayerConfig({\n autoFit: true,\n });\n return this;\n }\n const source = this.getSource();\n const extent = source.extent;\n const isValid = extent.some((v) => Math.abs(v) === Infinity);\n if (isValid) {\n return this;\n }\n this.mapService.fitBounds(\n [\n [extent[0], extent[1]],\n [extent[2], extent[3]],\n ],\n fitBoundsOptions,\n );\n return this;\n }\n\n public destroy() {\n // debugger\n if (this.isDestroied) {\n return;\n }\n this.hooks.beforeDestroy.call();\n // 清除sources事件\n this.layerSource.off('update', this.sourceEvent);\n\n this.multiPassRenderer.destroy();\n // console.log(this.styleAttributeService.getAttributes())\n // 清除所有属性以及关联的 vao == 销毁所有 => model this.models.forEach((model) => model.destroy());\n this.styleAttributeService.clearAllAttributes();\n\n // 执行每个图层单独的 clearModels 方法 (清除一些额外的 texture、program、buffer 等)\n\n this.hooks.afterDestroy.call();\n\n // TODO: 清除各个图层自定义的 models 资源\n // this.layerModel?.clearModels();\n\n this.models = [];\n\n this.layerService.cleanRemove(this);\n\n this.emit('remove', {\n target: this,\n type: 'remove',\n });\n\n this.emit('destroy', {\n target: this,\n type: 'destroy',\n });\n\n this.removeAllListeners();\n // 解绑图层容器中的服务\n // this.container.unbind(TYPES.IStyleAttributeService);\n\n this.isDestroied = true;\n }\n public clear() {\n this.styleAttributeService.clearAllAttributes();\n // 销毁所有 model\n }\n public clearModels() {\n this.models.forEach((model) => model.destroy());\n this.layerModel.clearModels();\n }\n\n public isDirty() {\n return !!(\n this.styleAttributeService.getLayerStyleAttributes() || []\n ).filter(\n (attribute) =>\n attribute.needRescale ||\n attribute.needRemapping ||\n attribute.needRegenerateVertices,\n ).length;\n }\n\n public setSource(source: Source) {\n // 清除旧 sources 事件\n if (this.layerSource) {\n this.layerSource.off('update', this.sourceEvent);\n }\n\n this.layerSource = source;\n this.clusterZoom = 0;\n\n // 已 inited 且启用聚合进行更新聚合数据\n if (this.inited && this.layerSource.cluster) {\n const zoom = this.mapService.getZoom();\n this.layerSource.updateClusterData(zoom);\n }\n // source 可能会复用,会在其它layer被修改\n this.layerSource.on('update', this.sourceEvent);\n }\n public getSource() {\n return this.layerSource;\n }\n\n public getScaleOptions() {\n return this.scaleOptions;\n }\n\n public setEncodedData(encodedData: IEncodeFeature[]) {\n this.encodedData = encodedData;\n }\n public getEncodedData() {\n return this.encodedData;\n }\n public getLegendItems(name: string): any {\n const scale = this.styleAttributeService.getLayerAttributeScale(name);\n if (scale) {\n if (scale.ticks) {\n const items = scale.ticks().map((item: any) => {\n return {\n value: item,\n [name]: scale(item),\n };\n });\n return items;\n } else if (scale.invertExtent) {\n const items = scale.range().map((item: any) => {\n return {\n value: scale.invertExtent(item),\n [name]: item,\n };\n });\n return items;\n }\n } else {\n return [];\n }\n }\n\n public pick({ x, y }: { x: number; y: number }) {\n this.interactionService.triggerHover({ x, y });\n }\n\n public boxSelect(\n box: [number, number, number, number],\n cb: (...args: any[]) => void,\n ) {\n this.pickingService.boxPickLayer(this, box, cb);\n }\n\n public buildLayerModel(\n options: ILayerModelInitializationOptions &\n Partial<IModelInitializationOptions>,\n ): IModel {\n const {\n moduleName,\n vertexShader,\n fragmentShader,\n triangulation,\n segmentNumber,\n ...rest\n } = options;\n this.shaderModuleService.registerModule(moduleName, {\n vs: vertexShader,\n fs: fragmentShader,\n });\n const { vs, fs, uniforms } = this.shaderModuleService.getModule(moduleName);\n const { createModel } = this.rendererService;\n const {\n attributes,\n elements,\n } = this.styleAttributeService.createAttributesAndIndices(\n this.encodedData,\n triangulation,\n segmentNumber,\n );\n return createModel({\n attributes,\n uniforms,\n fs,\n vs,\n elements,\n blend: BlendTypes[BlendType.normal],\n ...rest,\n });\n }\n\n public getTime() {\n return this.layerService.clock.getDelta();\n }\n public setAnimateStartTime() {\n this.animateStartTime = this.layerService.clock.getElapsedTime();\n }\n public stopAnimate() {\n if (this.aniamateStatus) {\n this.layerService.stopAnimate();\n this.aniamateStatus = false;\n this.updateLayerConfig({\n animateOption: {\n enable: false,\n },\n });\n }\n }\n public getLayerAnimateTime(): number {\n return this.layerService.clock.getElapsedTime() - this.animateStartTime;\n }\n\n public needPick(type: string): boolean {\n const {\n enableHighlight = true,\n enableSelect = true,\n } = this.getLayerConfig();\n // 判断layer是否监听事件;\n let isPick =\n this.eventNames().indexOf(type) !== -1 ||\n this.eventNames().indexOf('un' + type) !== -1;\n if ((type === 'click' || type === 'dblclick') && enableSelect) {\n isPick = true;\n }\n if (\n type === 'mousemove' &&\n (enableHighlight ||\n this.eventNames().indexOf('mouseenter') !== -1 ||\n this.eventNames().indexOf('unmousemove') !== -1 ||\n this.eventNames().indexOf('mouseout') !== -1)\n ) {\n isPick = true;\n }\n return this.isVisible() && isPick;\n }\n\n public buildModels() {\n throw new Error('Method not implemented.');\n }\n public rebuildModels() {\n throw new Error('Method not implemented.');\n }\n\n public async renderMulPass(multiPassRenderer: IMultiPassRenderer) {\n await multiPassRenderer.render();\n }\n\n public renderModels(isPicking?: boolean) {\n // TODO: this.getEncodedData().length > 0 这个判断是为了解决在 2.5.x 引入数据纹理后产生的 空数据渲染导致 texture 超出上限问题\n if (this.getEncodedData().length > 0) {\n if (this.layerModelNeedUpdate && this.layerModel) {\n this.models = this.layerModel.buildModels();\n this.hooks.beforeRender.call();\n this.layerModelNeedUpdate = false;\n }\n this.models.forEach((model) => {\n model.draw(\n {\n uniforms: this.layerModel.getUninforms(),\n },\n isPicking,\n );\n });\n }\n return this;\n }\n\n public updateStyleAttribute(\n type: string,\n field: StyleAttributeField,\n values?: StyleAttributeOption,\n updateOptions?: Partial<IStyleAttributeUpdateOptions>,\n ) {\n if (!this.inited) {\n this.pendingStyleAttributes.push({\n attributeName: type,\n attributeField: field,\n attributeValues: values,\n updateOptions,\n });\n } else {\n this.styleAttributeService.updateStyleAttribute(\n type,\n {\n // @ts-ignore\n scale: {\n field,\n ...this.splitValuesAndCallbackInAttribute(\n // @ts-ignore\n values,\n // @ts-ignore\n this.getLayerConfig()[field],\n ),\n },\n },\n // @ts-ignore\n updateOptions,\n );\n }\n }\n\n public getShaderPickStat() {\n return this.layerService.getShaderPickStat();\n }\n\n /**\n * 继承空方法\n * @param time\n */\n public setEarthTime(time: number) {\n console.warn('empty fn');\n }\n\n protected getConfigSchema() {\n throw new Error('Method not implemented.');\n }\n\n protected getModelType(): unknown {\n throw new Error('Method not implemented.');\n }\n protected getDefaultConfig() {\n return {};\n }\n\n private sourceEvent = () => {\n this.dataState.dataSourceNeedUpdate = true;\n const { autoFit, fitBoundsOptions } = this.getLayerConfig();\n if (autoFit) {\n this.fitBounds(fitBoundsOptions);\n }\n // 对外暴露事件\n this.emit('dataUpdate');\n this.reRender();\n };\n\n private reRender() {\n if (this.inited) {\n this.layerService.updateLayerRenderList();\n this.layerService.renderLayers();\n }\n }\n private splitValuesAndCallbackInAttribute(\n valuesOrCallback?: unknown[],\n defaultValues?: unknown[],\n ) {\n return {\n values: isFunction(valuesOrCallback)\n ? undefined\n : valuesOrCallback || defaultValues,\n callback: isFunction(valuesOrCallback) ? valuesOrCallback : undefined,\n };\n }\n}\n"],"file":"BaseLayer.js"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antv/l7-layers",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.5",
|
|
4
4
|
"description": "L7's collection of built-in layers",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"license": "ISC",
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@antv/geo-coord": "^1.0.8",
|
|
27
|
-
"@antv/l7-core": "^2.7.
|
|
28
|
-
"@antv/l7-source": "^2.7.
|
|
29
|
-
"@antv/l7-utils": "^2.7.
|
|
27
|
+
"@antv/l7-core": "^2.7.5",
|
|
28
|
+
"@antv/l7-source": "^2.7.5",
|
|
29
|
+
"@antv/l7-utils": "^2.7.5",
|
|
30
30
|
"@babel/runtime": "^7.7.7",
|
|
31
31
|
"@mapbox/martini": "^0.2.0",
|
|
32
32
|
"@turf/meta": "^6.0.2",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@types/gl-matrix": "^2.4.5",
|
|
53
53
|
"@types/lodash": "^4.14.138"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "5af972f3440fce7c20036fa27fd4810224bc2a2a",
|
|
56
56
|
"publishConfig": {
|
|
57
57
|
"access": "public"
|
|
58
58
|
}
|