@antv/l7-layers 2.5.36 → 2.5.37-mini
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/lib/core/BaseModel.js +1 -1
- package/lib/core/BaseModel.js.map +1 -1
- package/lib/heatmap/models/heatmap.js +12 -17
- package/lib/heatmap/models/heatmap.js.map +1 -1
- package/lib/plugins/LayerStylePlugin.js.map +1 -1
- package/lib/plugins/ShaderUniformPlugin.js +3 -1
- package/lib/plugins/ShaderUniformPlugin.js.map +1 -1
- package/lib/point/models/image.js.map +1 -1
- package/package.json +5 -5
- package/CHANGELOG.md +0 -492
- package/LICENSE.md +0 -21
- package/es/citybuliding/building.d.ts +0 -17
- package/es/citybuliding/building.js +0 -79
- package/es/citybuliding/building.js.map +0 -1
- package/es/citybuliding/models/build.d.ts +0 -13
- package/es/citybuliding/models/build.js +0 -124
- package/es/citybuliding/models/build.js.map +0 -1
- package/es/core/BaseLayer.d.ts +0 -174
- package/es/core/BaseLayer.js +0 -974
- package/es/core/BaseLayer.js.map +0 -1
- package/es/core/BaseModel.d.ts +0 -135
- package/es/core/BaseModel.js +0 -412
- package/es/core/BaseModel.js.map +0 -1
- package/es/core/interface.d.ts +0 -19
- package/es/core/interface.js +0 -7
- package/es/core/interface.js.map +0 -1
- package/es/core/schema.d.ts +0 -27
- package/es/core/schema.js +0 -23
- package/es/core/schema.js.map +0 -1
- package/es/core/shape/Path.d.ts +0 -39
- package/es/core/shape/Path.js +0 -57
- package/es/core/shape/Path.js.map +0 -1
- package/es/core/shape/extrude.d.ts +0 -17
- package/es/core/shape/extrude.js +0 -143
- package/es/core/shape/extrude.js.map +0 -1
- package/es/core/triangulation.d.ts +0 -109
- package/es/core/triangulation.js +0 -328
- package/es/core/triangulation.js.map +0 -1
- package/es/earth/index.d.ts +0 -17
- package/es/earth/index.js +0 -81
- package/es/earth/index.js.map +0 -1
- package/es/earth/models/atmosphere.d.ts +0 -9
- package/es/earth/models/atmosphere.js +0 -125
- package/es/earth/models/atmosphere.js.map +0 -1
- package/es/earth/models/base.d.ts +0 -16
- package/es/earth/models/base.js +0 -193
- package/es/earth/models/base.js.map +0 -1
- package/es/earth/models/bloomsphere.d.ts +0 -9
- package/es/earth/models/bloomsphere.js +0 -125
- package/es/earth/models/bloomsphere.js.map +0 -1
- package/es/earth/utils.d.ts +0 -26
- package/es/earth/utils.js +0 -81
- package/es/earth/utils.js.map +0 -1
- package/es/glsl.d.js +0 -2
- package/es/glsl.d.js.map +0 -1
- package/es/heatmap/index.d.ts +0 -22
- package/es/heatmap/index.js +0 -123
- package/es/heatmap/index.js.map +0 -1
- package/es/heatmap/models/grid.d.ts +0 -8
- package/es/heatmap/models/grid.js +0 -90
- package/es/heatmap/models/grid.js.map +0 -1
- package/es/heatmap/models/grid3d.d.ts +0 -8
- package/es/heatmap/models/grid3d.js +0 -122
- package/es/heatmap/models/grid3d.js.map +0 -1
- package/es/heatmap/models/heatmap.d.ts +0 -24
- package/es/heatmap/models/heatmap.js +0 -399
- package/es/heatmap/models/heatmap.js.map +0 -1
- package/es/heatmap/models/hexagon.d.ts +0 -8
- package/es/heatmap/models/hexagon.js +0 -90
- package/es/heatmap/models/hexagon.js.map +0 -1
- package/es/heatmap/models/index.d.ts +0 -5
- package/es/heatmap/models/index.js +0 -13
- package/es/heatmap/models/index.js.map +0 -1
- package/es/heatmap/triangulation.d.ts +0 -5
- package/es/heatmap/triangulation.js +0 -38
- package/es/heatmap/triangulation.js.map +0 -1
- package/es/image/index.d.ts +0 -22
- package/es/image/index.js +0 -82
- package/es/image/index.js.map +0 -1
- package/es/image/models/image.d.ts +0 -18
- package/es/image/models/image.js +0 -127
- package/es/image/models/image.js.map +0 -1
- package/es/image/models/index.d.ts +0 -5
- package/es/image/models/index.js +0 -6
- package/es/image/models/index.js.map +0 -1
- package/es/index.d.ts +0 -11
- package/es/index.js +0 -39
- package/es/index.js.map +0 -1
- package/es/line/index.d.ts +0 -25
- package/es/line/index.js +0 -95
- package/es/line/index.js.map +0 -1
- package/es/line/models/arc.d.ts +0 -12
- package/es/line/models/arc.js +0 -281
- package/es/line/models/arc.js.map +0 -1
- package/es/line/models/arc_3d.d.ts +0 -12
- package/es/line/models/arc_3d.js +0 -277
- package/es/line/models/arc_3d.js.map +0 -1
- package/es/line/models/great_circle.d.ts +0 -12
- package/es/line/models/great_circle.js +0 -269
- package/es/line/models/great_circle.js.map +0 -1
- package/es/line/models/index.d.ts +0 -5
- package/es/line/models/index.js +0 -12
- package/es/line/models/index.js.map +0 -1
- package/es/line/models/line.d.ts +0 -13
- package/es/line/models/line.js +0 -342
- package/es/line/models/line.js.map +0 -1
- package/es/plugins/DataMappingPlugin.d.ts +0 -13
- package/es/plugins/DataMappingPlugin.js +0 -199
- package/es/plugins/DataMappingPlugin.js.map +0 -1
- package/es/plugins/DataSourcePlugin.d.ts +0 -7
- package/es/plugins/DataSourcePlugin.js +0 -73
- package/es/plugins/DataSourcePlugin.js.map +0 -1
- package/es/plugins/FeatureScalePlugin.d.ts +0 -26
- package/es/plugins/FeatureScalePlugin.js +0 -270
- package/es/plugins/FeatureScalePlugin.js.map +0 -1
- package/es/plugins/LayerAnimateStylePlugin.d.ts +0 -7
- package/es/plugins/LayerAnimateStylePlugin.js +0 -50
- package/es/plugins/LayerAnimateStylePlugin.js.map +0 -1
- package/es/plugins/LayerModelPlugin.d.ts +0 -8
- package/es/plugins/LayerModelPlugin.js +0 -34
- package/es/plugins/LayerModelPlugin.js.map +0 -1
- package/es/plugins/LayerStylePlugin.d.ts +0 -8
- package/es/plugins/LayerStylePlugin.js +0 -35
- package/es/plugins/LayerStylePlugin.js.map +0 -1
- package/es/plugins/LightingPlugin.d.ts +0 -36
- package/es/plugins/LightingPlugin.js +0 -100
- package/es/plugins/LightingPlugin.js.map +0 -1
- package/es/plugins/MultiPassRendererPlugin.d.ts +0 -37
- package/es/plugins/MultiPassRendererPlugin.js +0 -79
- package/es/plugins/MultiPassRendererPlugin.js.map +0 -1
- package/es/plugins/PixelPickingPlugin.d.ts +0 -8
- package/es/plugins/PixelPickingPlugin.js +0 -112
- package/es/plugins/PixelPickingPlugin.js.map +0 -1
- package/es/plugins/RegisterStyleAttributePlugin.d.ts +0 -11
- package/es/plugins/RegisterStyleAttributePlugin.js +0 -98
- package/es/plugins/RegisterStyleAttributePlugin.js.map +0 -1
- package/es/plugins/ShaderUniformPlugin.d.ts +0 -16
- package/es/plugins/ShaderUniformPlugin.js +0 -78
- package/es/plugins/ShaderUniformPlugin.js.map +0 -1
- package/es/plugins/UpdateModelPlugin.d.ts +0 -8
- package/es/plugins/UpdateModelPlugin.js +0 -27
- package/es/plugins/UpdateModelPlugin.js.map +0 -1
- package/es/plugins/UpdateStyleAttributePlugin.d.ts +0 -12
- package/es/plugins/UpdateStyleAttributePlugin.js +0 -74
- package/es/plugins/UpdateStyleAttributePlugin.js.map +0 -1
- package/es/point/index.d.ts +0 -30
- package/es/point/index.js +0 -130
- package/es/point/index.js.map +0 -1
- package/es/point/models/extrude.d.ts +0 -14
- package/es/point/models/extrude.js +0 -180
- package/es/point/models/extrude.js.map +0 -1
- package/es/point/models/fill.d.ts +0 -17
- package/es/point/models/fill.js +0 -247
- package/es/point/models/fill.js.map +0 -1
- package/es/point/models/icon-font.d.ts +0 -11
- package/es/point/models/icon-font.js +0 -181
- package/es/point/models/icon-font.js.map +0 -1
- package/es/point/models/image.d.ts +0 -11
- package/es/point/models/image.js +0 -207
- package/es/point/models/image.js.map +0 -1
- package/es/point/models/index.d.ts +0 -5
- package/es/point/models/index.js +0 -16
- package/es/point/models/index.js.map +0 -1
- package/es/point/models/normal.d.ts +0 -21
- package/es/point/models/normal.js +0 -155
- package/es/point/models/normal.js.map +0 -1
- package/es/point/models/text.d.ts +0 -56
- package/es/point/models/text.js +0 -522
- package/es/point/models/text.js.map +0 -1
- package/es/point/shape/Path.d.ts +0 -40
- package/es/point/shape/Path.js +0 -57
- package/es/point/shape/Path.js.map +0 -1
- package/es/point/shape/extrude.d.ts +0 -15
- package/es/point/shape/extrude.js +0 -58
- package/es/point/shape/extrude.js.map +0 -1
- package/es/polygon/index.d.ts +0 -22
- package/es/polygon/index.js +0 -124
- package/es/polygon/index.js.map +0 -1
- package/es/polygon/models/extrude.d.ts +0 -13
- package/es/polygon/models/extrude.js +0 -139
- package/es/polygon/models/extrude.js.map +0 -1
- package/es/polygon/models/fill.d.ts +0 -13
- package/es/polygon/models/fill.js +0 -108
- package/es/polygon/models/fill.js.map +0 -1
- package/es/polygon/models/index.d.ts +0 -5
- package/es/polygon/models/index.js +0 -20
- package/es/polygon/models/index.js.map +0 -1
- package/es/raster/buffers/triangulation.d.ts +0 -6
- package/es/raster/buffers/triangulation.js +0 -28
- package/es/raster/buffers/triangulation.js.map +0 -1
- package/es/raster/image.d.ts +0 -0
- package/es/raster/image.js +0 -2
- package/es/raster/image.js.map +0 -1
- package/es/raster/index.d.ts +0 -28
- package/es/raster/index.js +0 -83
- package/es/raster/index.js.map +0 -1
- package/es/raster/models/index.d.ts +0 -5
- package/es/raster/models/index.js +0 -7
- package/es/raster/models/index.js.map +0 -1
- package/es/raster/models/raster.d.ts +0 -19
- package/es/raster/models/raster.js +0 -152
- package/es/raster/models/raster.js.map +0 -1
- package/es/raster/raster.d.ts +0 -30
- package/es/raster/raster.js +0 -178
- package/es/raster/raster.js.map +0 -1
- package/es/raster/raster2d.d.ts +0 -27
- package/es/raster/raster2d.js +0 -158
- package/es/raster/raster2d.js.map +0 -1
- package/es/utils/blend.d.ts +0 -2
- package/es/utils/blend.js +0 -55
- package/es/utils/blend.js.map +0 -1
- package/es/utils/collision-index.d.ts +0 -47
- package/es/utils/collision-index.js +0 -87
- package/es/utils/collision-index.js.map +0 -1
- package/es/utils/dataMappingStyle.d.ts +0 -30
- package/es/utils/dataMappingStyle.js +0 -88
- package/es/utils/dataMappingStyle.js.map +0 -1
- package/es/utils/extrude_polyline.d.ts +0 -48
- package/es/utils/extrude_polyline.js +0 -405
- package/es/utils/extrude_polyline.js.map +0 -1
- package/es/utils/geo.d.ts +0 -3
- package/es/utils/geo.js +0 -24
- package/es/utils/geo.js.map +0 -1
- package/es/utils/grid-index.d.ts +0 -28
- package/es/utils/grid-index.js +0 -193
- package/es/utils/grid-index.js.map +0 -1
- package/es/utils/polylineNormal.d.ts +0 -9
- package/es/utils/polylineNormal.js +0 -171
- package/es/utils/polylineNormal.js.map +0 -1
- package/es/utils/symbol-layout.d.ts +0 -43
- package/es/utils/symbol-layout.js +0 -260
- package/es/utils/symbol-layout.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/line/models/arc_3d.ts"],"names":["AttributeType","gl","rgb2arr","BaseModel","LineArcTriangulation","EARTH_RADIUS","lineStyleObj","solid","dash","Arc3DModel","createTexture2D","rendererService","texture","update","data","iconService","getCanvas","layer","render","mag","NEAREST","min","premultiplyAlpha","width","height","canvasHeight","getLayerConfig","opacity","sourceColor","targetColor","textureBlend","lineType","dashArray","lineTexture","iconStep","segmentNumber","globalArcHeight","length","push","useLinearColor","sourceColorArr","targetColorArr","getDirty","bind","dataTextureTest","dataTextureNeedUpdate","judgeStyleAttributes","encodeData","getEncodedData","calDataFrame","cellLength","cellProperties","rowCount","dataTexture","flipY","format","LUMINANCE","type","FLOAT","u_globel","mapService","version","u_globel_radius","u_global_height","u_dataTexture","u_cellTypeLayout","getCellTypeLayout","u_opacity","u_textureBlend","u_line_type","u_dash_array","u_texture","u_line_texture","u_icon_step","u_textSize","u_linearColor","u_sourceColor","u_targetColor","animateOption","u_aimate","animateOption2Array","u_time","getLayerAnimateTime","updateTexture","on","buildModels","destroy","off","buildLayerModel","moduleName","vertexShader","line_arc_vert","fragmentShader","line_arc_frag","triangulation","blend","getBlend","styleAttributeService","registerStyleAttribute","name","Attribute","descriptor","buffer","usage","DYNAMIC_DRAW","size","feature","featureIdx","vertex","attributeIdx","Array","isArray","STATIC_DRAW","iconMap","getIconMap","x","y"],"mappings":";;;;;;;;;;;;;AAAA,SACEA,aADF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,\n IModelUniform,\n ITexture2D,\n} from '@antv/l7-core';\nimport { rgb2arr } from '@antv/l7-utils';\nimport { isNumber } from 'lodash';\nimport BaseModel from '../../core/BaseModel';\nimport { ILineLayerStyleOptions, lineStyleType } from '../../core/interface';\nimport { LineArcTriangulation } from '../../core/triangulation';\nimport { EARTH_RADIUS } from '../../earth/utils';\nimport line_arc_frag from '../shaders/line_arc_3d_frag.glsl';\nimport line_arc_vert from '../shaders/line_arc_3d_vert.glsl';\nconst lineStyleObj: { [key: string]: number } = {\n solid: 0.0,\n dash: 1.0,\n};\nexport default class Arc3DModel extends BaseModel {\n protected texture: ITexture2D;\n public getUninforms(): IModelUniform {\n const {\n opacity,\n sourceColor,\n targetColor,\n textureBlend = 'normal',\n lineType = 'solid',\n dashArray = [10, 5],\n lineTexture = false,\n iconStep = 100,\n segmentNumber = 30,\n globalArcHeight = 10,\n } = this.layer.getLayerConfig() as ILineLayerStyleOptions;\n\n if (dashArray.length === 2) {\n dashArray.push(0, 0);\n }\n\n // 转化渐变色\n let useLinearColor = 0; // 默认不生效\n let sourceColorArr = [0, 0, 0, 0];\n let targetColorArr = [0, 0, 0, 0];\n if (sourceColor && targetColor) {\n sourceColorArr = rgb2arr(sourceColor);\n targetColorArr = rgb2arr(targetColor);\n useLinearColor = 1;\n }\n\n if (this.rendererService.getDirty()) {\n this.texture.bind();\n }\n\n if (this.dataTextureTest && this.dataTextureNeedUpdate({ opacity })) {\n this.judgeStyleAttributes({ opacity });\n const encodeData = this.layer.getEncodedData();\n const { data, width, height } = this.calDataFrame(\n this.cellLength,\n encodeData,\n this.cellProperties,\n );\n this.rowCount = height; // 当前数据纹理有多少行\n\n this.dataTexture =\n this.cellLength > 0 && data.length > 0\n ? this.createTexture2D({\n flipY: true,\n data,\n format: gl.LUMINANCE,\n type: gl.FLOAT,\n width,\n height,\n })\n : this.createTexture2D({\n flipY: true,\n data: [1],\n format: gl.LUMINANCE,\n type: gl.FLOAT,\n width: 1,\n height: 1,\n });\n }\n\n return {\n u_globel: this.mapService.version === 'GLOBEL' ? 1 : 0,\n u_globel_radius: EARTH_RADIUS, // 地球半径\n u_global_height: globalArcHeight,\n\n u_dataTexture: this.dataTexture, // 数据纹理 - 有数据映射的时候纹理中带数据,若没有任何数据映射时纹理是 [1]\n u_cellTypeLayout: this.getCellTypeLayout(),\n // u_opacity: opacity === undefined ? 1 : opacity,\n u_opacity: isNumber(opacity) ? opacity : 1.0,\n u_textureBlend: textureBlend === 'normal' ? 0.0 : 1.0,\n segmentNumber,\n u_line_type: lineStyleObj[lineType as string] || 0.0,\n u_dash_array: dashArray,\n\n // 纹理支持参数\n u_texture: this.texture, // 贴图\n u_line_texture: lineTexture ? 1.0 : 0.0, // 传入线的标识\n u_icon_step: iconStep,\n u_textSize: [1024, this.iconService.canvasHeight || 128],\n\n // 渐变色支持参数\n u_linearColor: useLinearColor,\n u_sourceColor: sourceColorArr,\n u_targetColor: targetColorArr,\n };\n }\n\n public getAnimateUniforms(): IModelUniform {\n const { animateOption } = this.layer.getLayerConfig() as ILayerConfig;\n return {\n u_aimate: this.animateOption2Array(animateOption as IAnimateOption),\n u_time: this.layer.getLayerAnimateTime(),\n };\n }\n\n public initModels(): IModel[] {\n this.updateTexture();\n this.iconService.on('imageUpdate', this.updateTexture);\n\n return this.buildModels();\n }\n\n public clearModels() {\n this.texture?.destroy();\n this.dataTexture?.destroy();\n this.iconService.off('imageUpdate', this.updateTexture);\n }\n\n public buildModels(): IModel[] {\n const {\n segmentNumber = 30,\n } = this.layer.getLayerConfig() as ILineLayerStyleOptions;\n return [\n this.layer.buildLayerModel({\n moduleName: 'arc3Dline',\n vertexShader: line_arc_vert,\n fragmentShader: line_arc_frag,\n triangulation: LineArcTriangulation,\n blend: this.getBlend(),\n segmentNumber,\n // primitive: gl.POINTS,\n }),\n ];\n }\n protected registerBuiltinAttributes() {\n // point layer size;\n this.styleAttributeService.registerStyleAttribute({\n name: 'size',\n type: AttributeType.Attribute,\n descriptor: {\n name: 'a_Size',\n buffer: {\n // give the WebGL driver a hint that this buffer may change\n usage: gl.DYNAMIC_DRAW,\n data: [],\n type: gl.FLOAT,\n },\n size: 1,\n update: (\n feature: IEncodeFeature,\n featureIdx: number,\n vertex: number[],\n attributeIdx: number,\n ) => {\n const { size = 1 } = feature;\n return Array.isArray(size) ? [size[0]] : [size as number];\n },\n },\n });\n\n this.styleAttributeService.registerStyleAttribute({\n name: 'instance', // 弧线起始点信息\n type: AttributeType.Attribute,\n descriptor: {\n name: 'a_Instance',\n buffer: {\n usage: gl.STATIC_DRAW,\n data: [],\n type: gl.FLOAT,\n },\n size: 4,\n update: (\n feature: IEncodeFeature,\n featureIdx: number,\n vertex: number[],\n attributeIdx: number,\n ) => {\n return [vertex[3], vertex[4], vertex[5], vertex[6]];\n },\n },\n });\n\n this.styleAttributeService.registerStyleAttribute({\n name: 'uv',\n type: AttributeType.Attribute,\n descriptor: {\n name: 'a_iconMapUV',\n buffer: {\n // give the WebGL driver a hint that this buffer may change\n usage: gl.DYNAMIC_DRAW,\n data: [],\n type: gl.FLOAT,\n },\n size: 2,\n update: (\n feature: IEncodeFeature,\n featureIdx: number,\n vertex: number[],\n attributeIdx: number,\n ) => {\n const iconMap = this.iconService.getIconMap();\n const { texture } = feature;\n const { x, y } = iconMap[texture as string] || { x: 0, y: 0 };\n return [x, y];\n },\n },\n });\n }\n\n private updateTexture = () => {\n const { createTexture2D } = this.rendererService;\n if (this.texture) {\n this.texture.update({\n data: this.iconService.getCanvas(),\n });\n this.layer.render();\n return;\n }\n this.texture = createTexture2D({\n data: this.iconService.getCanvas(),\n mag: gl.NEAREST,\n min: gl.NEAREST,\n premultiplyAlpha: false,\n width: 1024,\n height: this.iconService.canvasHeight || 128,\n });\n };\n}\n"],"file":"arc_3d.js"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { IModel, IModelUniform, ITexture2D } from '@antv/l7-core';
|
|
2
|
-
import BaseModel from '../../core/BaseModel';
|
|
3
|
-
export default class GreatCircleModel extends BaseModel {
|
|
4
|
-
protected texture: ITexture2D;
|
|
5
|
-
getUninforms(): IModelUniform;
|
|
6
|
-
getAnimateUniforms(): IModelUniform;
|
|
7
|
-
initModels(): IModel[];
|
|
8
|
-
clearModels(): void;
|
|
9
|
-
buildModels(): IModel[];
|
|
10
|
-
protected registerBuiltinAttributes(): void;
|
|
11
|
-
private updateTexture;
|
|
12
|
-
}
|
|
@@ -1,269 +0,0 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
import _isNumber from "lodash/isNumber";
|
|
9
|
-
|
|
10
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
11
|
-
|
|
12
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
13
|
-
|
|
14
|
-
import { AttributeType, gl } from '@antv/l7-core';
|
|
15
|
-
import { rgb2arr } from '@antv/l7-utils';
|
|
16
|
-
import BaseModel from '../../core/BaseModel';
|
|
17
|
-
import { LineArcTriangulation } from '../../core/triangulation';
|
|
18
|
-
var line_arc_frag = "#define LineTypeSolid 0.0\n#define LineTypeDash 1.0\n#define Animate 0.0\n#define LineTexture 1.0\n\nuniform float u_opacity;\nuniform float u_textureBlend;\nuniform float u_blur : 0.9;\nuniform float u_line_type: 0.0;\n// varying vec2 v_normal;\nvarying vec4 v_dash_array;\nvarying float v_distance_ratio;\nvarying vec4 v_color;\n\nuniform float u_time;\nuniform vec4 u_aimate: [ 0, 2., 1.0, 0.2 ];\n\nuniform float u_line_texture: 0.0;\nuniform sampler2D u_texture;\nuniform vec2 u_textSize;\nuniform float segmentNumber;\n\nvarying vec4 v_dataset; // \u6570\u636E\u96C6\n\nvarying vec2 v_iconMapUV;\n\nuniform float u_linearColor: 0;\nuniform vec4 u_sourceColor;\nuniform vec4 u_targetColor;\n\nvarying mat4 styleMappingMat;\n\n#pragma include \"picking\"\n#pragma include \"project\"\n#pragma include \"projection\"\n\nvoid main() {\n float opacity = styleMappingMat[0][0];\n float animateSpeed = 0.0;\n float d_segmentIndex = v_dataset.g;\n \n // \u8BBE\u7F6E\u5F27\u7EBF\u7684\u5E95\u8272\n if(u_linearColor == 1.0) { // \u4F7F\u7528\u6E10\u53D8\u989C\u8272\n gl_FragColor = mix(u_sourceColor, u_targetColor, d_segmentIndex/segmentNumber);\n } else { // \u4F7F\u7528 color \u65B9\u6CD5\u4F20\u5165\u7684\u989C\u8272\n gl_FragColor = v_color;\n }\n\n // float blur = 1.- smoothstep(u_blur, 1., length(v_normal.xy));\n // float blur = smoothstep(1.0, u_blur, length(v_normal.xy));\n gl_FragColor.a *= opacity;\n if(u_line_type == LineTypeDash) {\n float flag = 0.;\n float dashLength = mod(v_distance_ratio, v_dash_array.x + v_dash_array.y + v_dash_array.z + v_dash_array.w);\n if(dashLength < v_dash_array.x || (dashLength > (v_dash_array.x + v_dash_array.y) && dashLength < v_dash_array.x + v_dash_array.y + v_dash_array.z)) {\n flag = 1.;\n }\n gl_FragColor.a *=flag;\n }\n\n // \u8BBE\u7F6E\u5F27\u7EBF\u7684\u52A8\u753B\u6A21\u5F0F\n if(u_aimate.x == Animate) {\n animateSpeed = u_time / u_aimate.y;\n float alpha =1.0 - fract( mod(1.0- smoothstep(0.0, 1.0, v_distance_ratio), u_aimate.z)* (1.0/ u_aimate.z) + u_time / u_aimate.y);\n alpha = (alpha + u_aimate.w -1.0) / u_aimate.w;\n alpha = smoothstep(0., 1., alpha);\n gl_FragColor.a *= alpha;\n }\n\n // \u8BBE\u7F6E\u5F27\u7EBF\u7684\u8D34\u56FE\n if(LineTexture == u_line_texture && u_line_type != LineTypeDash) { \n float arcRadio = smoothstep( 0.0, 1.0, (d_segmentIndex / (segmentNumber - 1.0)));\n // float arcRadio = d_segmentIndex / (segmentNumber - 1.0);\n float count = v_dataset.b; // \u8D34\u56FE\u5728\u5F27\u7EBF\u4E0A\u91CD\u590D\u7684\u6570\u91CF\n float u = fract(arcRadio * count - animateSpeed * count);\n // float u = fract(arcRadio * count - animateSpeed);\n if(u_aimate.x == Animate) {\n u = gl_FragColor.a/opacity;\n }\n\n float v = v_dataset.a; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C\n\n vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.;\n vec4 pattern = texture2D(u_texture, uv);\n \n // \u8BBE\u7F6E\u8D34\u56FE\u548C\u5E95\u8272\u7684\u53E0\u52A0\u6A21\u5F0F\n if(u_textureBlend == 0.0) { // normal\n pattern.a = 0.0;\n gl_FragColor = filterColor(gl_FragColor + pattern);\n } else { // replace\n pattern.a *= opacity;\n if(gl_FragColor.a <= 0.0) {\n pattern.a = 0.0;\n }\n gl_FragColor = filterColor(pattern);\n }\n } else {\n gl_FragColor = filterColor(gl_FragColor);\n }\n\n // gl_FragColor = filterColor(gl_FragColor);\n}";
|
|
19
|
-
var line_arc2d_vert = "#define LineTypeSolid 0.0\n#define LineTypeDash 1.0\n#define Animate 0.0\n#define LineTexture 1.0\n\nattribute vec4 a_Color;\nattribute vec3 a_Position;\nattribute vec4 a_Instance;\nattribute float a_Size;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nuniform float segmentNumber;\nuniform vec4 u_aimate: [ 0, 2., 1.0, 0.2 ];\nvarying vec4 v_color;\n// varying vec2 v_normal;\n\nvarying float v_distance_ratio;\nuniform float u_line_type: 0.0;\nuniform vec4 u_dash_array: [10.0, 5., 0, 0];\nvarying vec4 v_dash_array;\n\nuniform float u_icon_step: 100;\nuniform float u_line_texture: 0.0;\n\nvarying vec4 v_dataset; // \u6570\u636E\u96C6\n\nattribute vec2 a_iconMapUV;\nvarying vec2 v_iconMapUV;\n\nuniform float u_opacity: 1.0;\nvarying mat4 styleMappingMat; // \u7528\u4E8E\u5C06\u5728\u9876\u70B9\u7740\u8272\u5668\u4E2D\u8BA1\u7B97\u597D\u7684\u6837\u5F0F\u503C\u4F20\u9012\u7ED9\u7247\u5143\n\n#pragma include \"styleMapping\"\n#pragma include \"styleMappingCalOpacity\"\n\n#pragma include \"projection\"\n#pragma include \"project\"\n#pragma include \"picking\"\n\nfloat maps (float value, float start1, float stop1, float start2, float stop2) {\n return start2 + (stop2 - start2) * ((value - start1) / (stop1 - start1));\n}\n\nfloat getSegmentRatio(float index) {\n return smoothstep(0.0, 1.0, index / (segmentNumber - 1.));\n}\n\nfloat paraboloid(vec2 source, vec2 target, float ratio) {\n vec2 x = mix(source, target, ratio);\n vec2 center = mix(source, target, 0.5);\n float dSourceCenter = distance(source, center);\n float dXCenter = distance(x, center);\n return (dSourceCenter + dXCenter) * (dSourceCenter - dXCenter);\n}\n\nvec3 getPos(vec2 source, vec2 target, float segmentRatio) {\n float vertex_height = paraboloid(source, target, segmentRatio);\n\n return vec3(\n mix(source, target, segmentRatio),\n sqrt(max(0.0, vertex_height))\n );\n}\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction) {\n // normalized direction of the line\n vec2 dir_screenspace = normalize(line_clipspace);\n // rotate by 90 degrees\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n vec2 offset = dir_screenspace * offset_direction * setPickingSize(a_Size)/ 2.0;\n return offset;\n}\nvec2 getNormal(vec2 line_clipspace, float offset_direction) {\n // normalized direction of the line\n vec2 dir_screenspace = normalize(line_clipspace);\n // rotate by 90 degrees\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n return reverse_offset_normal(vec3(dir_screenspace,1.0)).xy * sign(offset_direction);\n}\nfloat getAngularDist (vec2 source, vec2 target) {\n vec2 delta = source - target;\n vec2 sin_half_delta = sin(delta / 2.0);\n float a =\n sin_half_delta.y * sin_half_delta.y +\n cos(source.y) * cos(target.y) *\n sin_half_delta.x * sin_half_delta.x;\n return 2.0 * atan(sqrt(a), sqrt(1.0 - a));\n}\n\nvec2 midPoint(vec2 source, vec2 target) {\n vec2 center = target - source;\n float r = length(center);\n float theta = atan(center.y, center.x);\n float thetaOffset = 0.314;\n float r2 = r / 2.0 / cos(thetaOffset);\n float theta2 = theta + thetaOffset;\n vec2 mid = vec2(r2*cos(theta2) + source.x, r2*sin(theta2) + source.y);\n return mid;\n}\nfloat bezier3(vec3 arr, float t) {\n float ut = 1. - t;\n return (arr.x * ut + arr.y * t) * ut + (arr.y * ut + arr.z * t) * t;\n}\n\nvec2 interpolate (vec2 source, vec2 target, float angularDist, float t) {\n // if the angularDist is PI, linear interpolation is applied. otherwise, use spherical interpolation\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n vec2 mid = midPoint(source, target);\n vec3 x = vec3(source.x, mid.x, target.x);\n vec3 y = vec3(source.y, mid.y, target.y);\n return vec2(bezier3(x ,t), bezier3(y,t));\n }else {\n if(abs(angularDist - PI) < 0.001) {\n return (1.0 - t) * source + t * target;\n }\n float a = sin((1.0 - t) * angularDist) / sin(angularDist);\n float b = sin(t * angularDist) / sin(angularDist);\n vec2 sin_source = sin(source);\n vec2 cos_source = cos(source);\n vec2 sin_target = sin(target);\n vec2 cos_target = cos(target);\n float x = a * cos_source.y * cos_source.x + b * cos_target.y * cos_target.x;\n float y = a * cos_source.y * sin_source.x + b * cos_target.y * sin_target.x;\n float z = a * sin_source.y + b * sin_target.y;\n return vec2(atan(y, x), atan(z, sqrt(x * x + y * y)));\n }\n}\n\nvoid main() {\n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\n styleMappingMat = mat4(\n 0.0, 0.0, 0.0, 0.0, // opacity - strokeOpacity - strokeWidth - empty\n 0.0, 0.0, 0.0, 0.0, // strokeR - strokeG - strokeB - strokeA\n 0.0, 0.0, 0.0, 0.0, // offsets[0] - offsets[1]\n 0.0, 0.0, 0.0, 0.0\n );\n\n float rowCount = u_cellTypeLayout[0][0]; // \u5F53\u524D\u7684\u6570\u636E\u7EB9\u7406\u6709\u51E0\u884C\n float columnCount = u_cellTypeLayout[0][1]; // \u5F53\u770B\u5230\u6570\u636E\u7EB9\u7406\u6709\u51E0\u5217\n float columnWidth = 1.0/columnCount; // \u5217\u5BBD\n float rowHeight = 1.0/rowCount; // \u884C\u9AD8\n float cellCount = calCellCount(); // opacity - strokeOpacity - strokeWidth - stroke - offsets\n float id = a_vertexId; // \u7B2Cn\u4E2A\u9876\u70B9\n float cellCurrentRow = floor(id * cellCount / columnCount) + 1.0; // \u8D77\u59CB\u70B9\u5728\u7B2C\u51E0\u884C\n float cellCurrentColumn = mod(id * cellCount, columnCount) + 1.0; // \u8D77\u59CB\u70B9\u5728\u7B2C\u51E0\u5217\n \n // cell \u56FA\u5B9A\u987A\u5E8F opacity -> strokeOpacity -> strokeWidth -> stroke ... \n // \u6309\u987A\u5E8F\u4ECE cell \u4E2D\u53D6\u503C\u3001\u82E5\u6CA1\u6709\u5219\u81EA\u52A8\u5F80\u4E0B\u53D6\u503C\n float textureOffset = 0.0; // \u5728 cell \u4E2D\u53D6\u503C\u7684\u504F\u79FB\u91CF\n\n vec2 opacityAndOffset = calOpacityAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);\n styleMappingMat[0][0] = opacityAndOffset.r;\n textureOffset = opacityAndOffset.g;\n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\n\n v_color = a_Color;\n vec2 source = radians(a_Instance.rg);\n vec2 target = radians(a_Instance.ba);\n float angularDist = getAngularDist(source, target);\n float segmentIndex = a_Position.x;\n float segmentRatio = getSegmentRatio(segmentIndex);\n float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\n if(u_line_type == LineTypeDash) {\n v_distance_ratio = segmentIndex / segmentNumber;\n vec2 s = source;\n vec2 t = target;\n \n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n s = unProjCustomCoord(source);\n t = unProjCustomCoord(target);\n }\n float total_Distance = pixelDistance(s, t) / 2.0 * PI;\n total_Distance = total_Distance*8.0;\n // float total_Distance = pixelDistance(a_Instance.rg, a_Instance.ba);\n v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / (total_Distance / segmentNumber * segmentIndex);\n }\n if(u_aimate.x == Animate) {\n v_distance_ratio = segmentIndex / segmentNumber;\n }\n float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);\n v_distance_ratio = segmentIndex / segmentNumber;\n vec4 curr = project_position(vec4(degrees(interpolate(source, target, angularDist, segmentRatio)), 0.0, 1.0));\n vec4 next = project_position(vec4(degrees(interpolate(source, target, angularDist, nextSegmentRatio)), 0.0, 1.0));\n // v_normal = getNormal((next.xy - curr.xy) * indexDir, a_Position.y);\n vec2 offset = project_pixel(getExtrusionOffset((next.xy - curr.xy) * indexDir, a_Position.y));\n // vec4 project_pos = project_position(vec4(curr.xy, 0, 1.0));\n // gl_Position = project_common_position_to_clipspace(vec4(curr.xy + offset, curr.z, 1.0));\n\n v_dataset.g = a_Position.x; // \u8BE5\u9876\u70B9\u5728\u5F27\u7EBF\u4E0A\u7684\u5206\u6BB5\u6392\u5E8F\n if(LineTexture == u_line_texture) { // \u5F00\u542F\u8D34\u56FE\u6A21\u5F0F \n // float mapZoomScale = u_CoordinateSystem !== COORDINATE_SYSTEM_P20_2?10000000.0:1.0;\n float d_arcDistrance = length(source - target);\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20) { // amap\n d_arcDistrance = d_arcDistrance * 1000000.0;\n }\n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) { // mapbox\n d_arcDistrance = project_pixel_allmap(d_arcDistrance);\n }\n float d_pixelLen = project_pixel(u_icon_step)/8.0;\n v_dataset.b = floor(d_arcDistrance/d_pixelLen); // \u8D34\u56FE\u5728\u5F27\u7EBF\u4E0A\u91CD\u590D\u7684\u6570\u91CF\n\n float lineOffsetWidth = length(offset + offset * sign(a_Position.y)); // \u7EBF\u6A2A\u5411\u504F\u79FB\u7684\u8DDD\u79BB\n float linePixelSize = project_pixel(a_Size); // \u5B9A\u70B9\u4F4D\u7F6E\u504F\u79FB\uFF0C\u6309\u5730\u56FE\u7B49\u7EA7\u7F29\u653E\u540E\u7684\u8DDD\u79BB\n v_dataset.a = lineOffsetWidth/linePixelSize; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C\n\n v_iconMapUV = a_iconMapUV;\n }\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(curr.xy + offset, curr.z, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(curr.xy + offset, curr.z, 1.0));\n }\n setPickingColor(a_PickingColor);\n}\n\n";
|
|
20
|
-
var lineStyleObj = {
|
|
21
|
-
solid: 0.0,
|
|
22
|
-
dash: 1.0
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
var GreatCircleModel = function (_BaseModel) {
|
|
26
|
-
_inherits(GreatCircleModel, _BaseModel);
|
|
27
|
-
|
|
28
|
-
var _super = _createSuper(GreatCircleModel);
|
|
29
|
-
|
|
30
|
-
function GreatCircleModel() {
|
|
31
|
-
var _this;
|
|
32
|
-
|
|
33
|
-
_classCallCheck(this, GreatCircleModel);
|
|
34
|
-
|
|
35
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
36
|
-
args[_key] = arguments[_key];
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
40
|
-
|
|
41
|
-
_defineProperty(_assertThisInitialized(_this), "texture", void 0);
|
|
42
|
-
|
|
43
|
-
_defineProperty(_assertThisInitialized(_this), "updateTexture", function () {
|
|
44
|
-
var createTexture2D = _this.rendererService.createTexture2D;
|
|
45
|
-
|
|
46
|
-
if (_this.texture) {
|
|
47
|
-
_this.texture.update({
|
|
48
|
-
data: _this.iconService.getCanvas()
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
_this.layer.render();
|
|
52
|
-
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
_this.texture = createTexture2D({
|
|
57
|
-
data: _this.iconService.getCanvas(),
|
|
58
|
-
mag: gl.NEAREST,
|
|
59
|
-
min: gl.NEAREST,
|
|
60
|
-
premultiplyAlpha: false,
|
|
61
|
-
width: 1024,
|
|
62
|
-
height: _this.iconService.canvasHeight || 128
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
return _this;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
_createClass(GreatCircleModel, [{
|
|
70
|
-
key: "getUninforms",
|
|
71
|
-
value: function getUninforms() {
|
|
72
|
-
var _ref = this.layer.getLayerConfig(),
|
|
73
|
-
opacity = _ref.opacity,
|
|
74
|
-
sourceColor = _ref.sourceColor,
|
|
75
|
-
targetColor = _ref.targetColor,
|
|
76
|
-
_ref$textureBlend = _ref.textureBlend,
|
|
77
|
-
textureBlend = _ref$textureBlend === void 0 ? 'normal' : _ref$textureBlend,
|
|
78
|
-
_ref$lineType = _ref.lineType,
|
|
79
|
-
lineType = _ref$lineType === void 0 ? 'solid' : _ref$lineType,
|
|
80
|
-
_ref$dashArray = _ref.dashArray,
|
|
81
|
-
dashArray = _ref$dashArray === void 0 ? [10, 5] : _ref$dashArray,
|
|
82
|
-
_ref$lineTexture = _ref.lineTexture,
|
|
83
|
-
lineTexture = _ref$lineTexture === void 0 ? false : _ref$lineTexture,
|
|
84
|
-
_ref$iconStep = _ref.iconStep,
|
|
85
|
-
iconStep = _ref$iconStep === void 0 ? 100 : _ref$iconStep,
|
|
86
|
-
_ref$segmentNumber = _ref.segmentNumber,
|
|
87
|
-
segmentNumber = _ref$segmentNumber === void 0 ? 30 : _ref$segmentNumber;
|
|
88
|
-
|
|
89
|
-
if (dashArray.length === 2) {
|
|
90
|
-
dashArray.push(0, 0);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
if (this.rendererService.getDirty()) {
|
|
94
|
-
this.texture.bind();
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
var useLinearColor = 0;
|
|
98
|
-
var sourceColorArr = [0, 0, 0, 0];
|
|
99
|
-
var targetColorArr = [0, 0, 0, 0];
|
|
100
|
-
|
|
101
|
-
if (sourceColor && targetColor) {
|
|
102
|
-
sourceColorArr = rgb2arr(sourceColor);
|
|
103
|
-
targetColorArr = rgb2arr(targetColor);
|
|
104
|
-
useLinearColor = 1;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
if (this.dataTextureTest && this.dataTextureNeedUpdate({
|
|
108
|
-
opacity: opacity
|
|
109
|
-
})) {
|
|
110
|
-
this.judgeStyleAttributes({
|
|
111
|
-
opacity: opacity
|
|
112
|
-
});
|
|
113
|
-
var encodeData = this.layer.getEncodedData();
|
|
114
|
-
|
|
115
|
-
var _this$calDataFrame = this.calDataFrame(this.cellLength, encodeData, this.cellProperties),
|
|
116
|
-
data = _this$calDataFrame.data,
|
|
117
|
-
width = _this$calDataFrame.width,
|
|
118
|
-
height = _this$calDataFrame.height;
|
|
119
|
-
|
|
120
|
-
this.rowCount = height;
|
|
121
|
-
this.dataTexture = this.cellLength > 0 && data.length > 0 ? this.createTexture2D({
|
|
122
|
-
flipY: true,
|
|
123
|
-
data: data,
|
|
124
|
-
format: gl.LUMINANCE,
|
|
125
|
-
type: gl.FLOAT,
|
|
126
|
-
width: width,
|
|
127
|
-
height: height
|
|
128
|
-
}) : this.createTexture2D({
|
|
129
|
-
flipY: true,
|
|
130
|
-
data: [1],
|
|
131
|
-
format: gl.LUMINANCE,
|
|
132
|
-
type: gl.FLOAT,
|
|
133
|
-
width: 1,
|
|
134
|
-
height: 1
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
return {
|
|
139
|
-
u_dataTexture: this.dataTexture,
|
|
140
|
-
u_cellTypeLayout: this.getCellTypeLayout(),
|
|
141
|
-
u_opacity: _isNumber(opacity) ? opacity : 1.0,
|
|
142
|
-
u_textureBlend: textureBlend === 'normal' ? 0.0 : 1.0,
|
|
143
|
-
segmentNumber: segmentNumber,
|
|
144
|
-
u_line_type: lineStyleObj[lineType] || 0.0,
|
|
145
|
-
u_dash_array: dashArray,
|
|
146
|
-
u_texture: this.texture,
|
|
147
|
-
u_line_texture: lineTexture ? 1.0 : 0.0,
|
|
148
|
-
u_icon_step: iconStep,
|
|
149
|
-
u_textSize: [1024, this.iconService.canvasHeight || 128],
|
|
150
|
-
u_linearColor: useLinearColor,
|
|
151
|
-
u_sourceColor: sourceColorArr,
|
|
152
|
-
u_targetColor: targetColorArr
|
|
153
|
-
};
|
|
154
|
-
}
|
|
155
|
-
}, {
|
|
156
|
-
key: "getAnimateUniforms",
|
|
157
|
-
value: function getAnimateUniforms() {
|
|
158
|
-
var _ref2 = this.layer.getLayerConfig(),
|
|
159
|
-
animateOption = _ref2.animateOption;
|
|
160
|
-
|
|
161
|
-
return {
|
|
162
|
-
u_aimate: this.animateOption2Array(animateOption),
|
|
163
|
-
u_time: this.layer.getLayerAnimateTime()
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
|
-
}, {
|
|
167
|
-
key: "initModels",
|
|
168
|
-
value: function initModels() {
|
|
169
|
-
this.updateTexture();
|
|
170
|
-
this.iconService.on('imageUpdate', this.updateTexture);
|
|
171
|
-
return this.buildModels();
|
|
172
|
-
}
|
|
173
|
-
}, {
|
|
174
|
-
key: "clearModels",
|
|
175
|
-
value: function clearModels() {
|
|
176
|
-
var _this$texture, _this$dataTexture;
|
|
177
|
-
|
|
178
|
-
(_this$texture = this.texture) === null || _this$texture === void 0 ? void 0 : _this$texture.destroy();
|
|
179
|
-
(_this$dataTexture = this.dataTexture) === null || _this$dataTexture === void 0 ? void 0 : _this$dataTexture.destroy();
|
|
180
|
-
this.iconService.off('imageUpdate', this.updateTexture);
|
|
181
|
-
}
|
|
182
|
-
}, {
|
|
183
|
-
key: "buildModels",
|
|
184
|
-
value: function buildModels() {
|
|
185
|
-
return [this.layer.buildLayerModel({
|
|
186
|
-
moduleName: 'arc2dline',
|
|
187
|
-
vertexShader: line_arc2d_vert,
|
|
188
|
-
fragmentShader: line_arc_frag,
|
|
189
|
-
triangulation: LineArcTriangulation,
|
|
190
|
-
depth: {
|
|
191
|
-
enable: false
|
|
192
|
-
},
|
|
193
|
-
blend: this.getBlend()
|
|
194
|
-
})];
|
|
195
|
-
}
|
|
196
|
-
}, {
|
|
197
|
-
key: "registerBuiltinAttributes",
|
|
198
|
-
value: function registerBuiltinAttributes() {
|
|
199
|
-
var _this2 = this;
|
|
200
|
-
|
|
201
|
-
this.styleAttributeService.registerStyleAttribute({
|
|
202
|
-
name: 'size',
|
|
203
|
-
type: AttributeType.Attribute,
|
|
204
|
-
descriptor: {
|
|
205
|
-
name: 'a_Size',
|
|
206
|
-
buffer: {
|
|
207
|
-
usage: gl.DYNAMIC_DRAW,
|
|
208
|
-
data: [],
|
|
209
|
-
type: gl.FLOAT
|
|
210
|
-
},
|
|
211
|
-
size: 1,
|
|
212
|
-
update: function update(feature, featureIdx, vertex, attributeIdx) {
|
|
213
|
-
var _feature$size = feature.size,
|
|
214
|
-
size = _feature$size === void 0 ? 1 : _feature$size;
|
|
215
|
-
return Array.isArray(size) ? [size[0]] : [size];
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
});
|
|
219
|
-
this.styleAttributeService.registerStyleAttribute({
|
|
220
|
-
name: 'instance',
|
|
221
|
-
type: AttributeType.Attribute,
|
|
222
|
-
descriptor: {
|
|
223
|
-
name: 'a_Instance',
|
|
224
|
-
buffer: {
|
|
225
|
-
usage: gl.STATIC_DRAW,
|
|
226
|
-
data: [],
|
|
227
|
-
type: gl.FLOAT
|
|
228
|
-
},
|
|
229
|
-
size: 4,
|
|
230
|
-
update: function update(feature, featureIdx, vertex, attributeIdx) {
|
|
231
|
-
return [vertex[3], vertex[4], vertex[5], vertex[6]];
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
});
|
|
235
|
-
this.styleAttributeService.registerStyleAttribute({
|
|
236
|
-
name: 'uv',
|
|
237
|
-
type: AttributeType.Attribute,
|
|
238
|
-
descriptor: {
|
|
239
|
-
name: 'a_iconMapUV',
|
|
240
|
-
buffer: {
|
|
241
|
-
usage: gl.DYNAMIC_DRAW,
|
|
242
|
-
data: [],
|
|
243
|
-
type: gl.FLOAT
|
|
244
|
-
},
|
|
245
|
-
size: 2,
|
|
246
|
-
update: function update(feature, featureIdx, vertex, attributeIdx) {
|
|
247
|
-
var iconMap = _this2.iconService.getIconMap();
|
|
248
|
-
|
|
249
|
-
var texture = feature.texture;
|
|
250
|
-
|
|
251
|
-
var _ref3 = iconMap[texture] || {
|
|
252
|
-
x: 0,
|
|
253
|
-
y: 0
|
|
254
|
-
},
|
|
255
|
-
x = _ref3.x,
|
|
256
|
-
y = _ref3.y;
|
|
257
|
-
|
|
258
|
-
return [x, y];
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
});
|
|
262
|
-
}
|
|
263
|
-
}]);
|
|
264
|
-
|
|
265
|
-
return GreatCircleModel;
|
|
266
|
-
}(BaseModel);
|
|
267
|
-
|
|
268
|
-
export { GreatCircleModel as default };
|
|
269
|
-
//# sourceMappingURL=great_circle.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/line/models/great_circle.ts"],"names":["AttributeType","gl","rgb2arr","BaseModel","LineArcTriangulation","lineStyleObj","solid","dash","GreatCircleModel","createTexture2D","rendererService","texture","update","data","iconService","getCanvas","layer","render","mag","NEAREST","min","premultiplyAlpha","width","height","canvasHeight","getLayerConfig","opacity","sourceColor","targetColor","textureBlend","lineType","dashArray","lineTexture","iconStep","segmentNumber","length","push","getDirty","bind","useLinearColor","sourceColorArr","targetColorArr","dataTextureTest","dataTextureNeedUpdate","judgeStyleAttributes","encodeData","getEncodedData","calDataFrame","cellLength","cellProperties","rowCount","dataTexture","flipY","format","LUMINANCE","type","FLOAT","u_dataTexture","u_cellTypeLayout","getCellTypeLayout","u_opacity","u_textureBlend","u_line_type","u_dash_array","u_texture","u_line_texture","u_icon_step","u_textSize","u_linearColor","u_sourceColor","u_targetColor","animateOption","u_aimate","animateOption2Array","u_time","getLayerAnimateTime","updateTexture","on","buildModels","destroy","off","buildLayerModel","moduleName","vertexShader","line_arc2d_vert","fragmentShader","line_arc_frag","triangulation","depth","enable","blend","getBlend","styleAttributeService","registerStyleAttribute","name","Attribute","descriptor","buffer","usage","DYNAMIC_DRAW","size","feature","featureIdx","vertex","attributeIdx","Array","isArray","STATIC_DRAW","iconMap","getIconMap","x","y"],"mappings":";;;;;;;;;;;;;AAAA,SACEA,aADF,EAEEC,EAFF,QASO,eATP;AAWA,SAASC,OAAT,QAAwB,gBAAxB;AAEA,OAAOC,SAAP,MAAsB,sBAAtB;AAEA,SAASC,oBAAT,QAAqC,0BAArC;;;AAIA,IAAMC,YAAuC,GAAG;AAC9CC,EAAAA,KAAK,EAAE,GADuC;AAE9CC,EAAAA,IAAI,EAAE;AAFwC,CAA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AA,IAAI,EAAE,EAHA;AAIN0C,YAAAA,IAAI,EAAEtD,EAAE,CAACuD;AAJH,WAFE;AAQV4C,UAAAA,IAAI,EAAE,CARI;AASVxF,UAAAA,MAAM,EAAE,gBACNyF,OADM,EAENC,UAFM,EAGNC,MAHM,EAINC,YAJM,EAKH;AACH,gBAAMI,OAAO,GAAG,MAAI,CAAC9F,WAAL,CAAiB+F,UAAjB,EAAhB;;AACA,gBAAQlG,OAAR,GAAoB0F,OAApB,CAAQ1F,OAAR;;AAEA,wBAAiBiG,OAAO,CAACjG,OAAD,CAAP,IAA8B;AAAEmG,cAAAA,CAAC,EAAE,CAAL;AAAQC,cAAAA,CAAC,EAAE;AAAX,aAA/C;AAAA,gBAAQD,CAAR,SAAQA,CAAR;AAAA,gBAAWC,CAAX,SAAWA,CAAX;;AACA,mBAAO,CAACD,CAAD,EAAIC,CAAJ,CAAP;AACD;AApBS;AAHoC,OAAlD;AA0BD;;;;EA/L2C5G,S;;SAAzBK,gB","sourcesContent":["import {\n AttributeType,\n gl,\n IAnimateOption,\n IEncodeFeature,\n ILayerConfig,\n IModel,\n IModelUniform,\n ITexture2D,\n} from '@antv/l7-core';\n\nimport { rgb2arr } from '@antv/l7-utils';\nimport { isNumber } from 'lodash';\nimport BaseModel from '../../core/BaseModel';\nimport { ILineLayerStyleOptions, lineStyleType } from '../../core/interface';\nimport { LineArcTriangulation } from '../../core/triangulation';\n// import line_arc_frag from '../shaders/line_arc_frag.glsl';\nimport line_arc_frag from '../shaders/line_arc_great_circle_frag.glsl';\nimport line_arc2d_vert from '../shaders/line_arc_great_circle_vert.glsl';\nconst lineStyleObj: { [key: string]: number } = {\n solid: 0.0,\n dash: 1.0,\n};\n\nexport default class GreatCircleModel extends BaseModel {\n protected texture: ITexture2D;\n public getUninforms(): IModelUniform {\n const {\n opacity,\n sourceColor,\n targetColor,\n textureBlend = 'normal',\n lineType = 'solid',\n dashArray = [10, 5],\n lineTexture = false,\n iconStep = 100,\n segmentNumber = 30,\n } = this.layer.getLayerConfig() as Partial<ILineLayerStyleOptions>;\n // console.log('opacity', opacity)\n if (dashArray.length === 2) {\n dashArray.push(0, 0);\n }\n\n if (this.rendererService.getDirty()) {\n this.texture.bind();\n }\n\n // 转化渐变色\n let useLinearColor = 0; // 默认不生效\n let sourceColorArr = [0, 0, 0, 0];\n let targetColorArr = [0, 0, 0, 0];\n if (sourceColor && targetColor) {\n sourceColorArr = rgb2arr(sourceColor);\n targetColorArr = rgb2arr(targetColor);\n useLinearColor = 1;\n }\n\n if (this.dataTextureTest && this.dataTextureNeedUpdate({ opacity })) {\n this.judgeStyleAttributes({ opacity });\n const encodeData = this.layer.getEncodedData();\n const { data, width, height } = this.calDataFrame(\n this.cellLength,\n encodeData,\n this.cellProperties,\n );\n this.rowCount = height; // 当前数据纹理有多少行\n\n this.dataTexture =\n this.cellLength > 0 && data.length > 0\n ? this.createTexture2D({\n flipY: true,\n data,\n format: gl.LUMINANCE,\n type: gl.FLOAT,\n width,\n height,\n })\n : this.createTexture2D({\n flipY: true,\n data: [1],\n format: gl.LUMINANCE,\n type: gl.FLOAT,\n width: 1,\n height: 1,\n });\n }\n\n return {\n u_dataTexture: this.dataTexture, // 数据纹理 - 有数据映射的时候纹理中带数据,若没有任何数据映射时纹理是 [1]\n u_cellTypeLayout: this.getCellTypeLayout(),\n // u_opacity: opacity === undefined ? 1 : opacity,\n u_opacity: isNumber(opacity) ? opacity : 1.0,\n u_textureBlend: textureBlend === 'normal' ? 0.0 : 1.0,\n segmentNumber,\n u_line_type: lineStyleObj[lineType as string] || 0.0,\n u_dash_array: dashArray,\n\n // 纹理支持参数\n u_texture: this.texture, // 贴图\n u_line_texture: lineTexture ? 1.0 : 0.0, // 传入线的标识\n u_icon_step: iconStep,\n u_textSize: [1024, this.iconService.canvasHeight || 128],\n\n // 渐变色支持参数\n u_linearColor: useLinearColor,\n u_sourceColor: sourceColorArr,\n u_targetColor: targetColorArr,\n };\n }\n public getAnimateUniforms(): IModelUniform {\n const { animateOption } = this.layer.getLayerConfig() as ILayerConfig;\n return {\n u_aimate: this.animateOption2Array(animateOption as IAnimateOption),\n u_time: this.layer.getLayerAnimateTime(),\n };\n }\n\n public initModels(): IModel[] {\n this.updateTexture();\n this.iconService.on('imageUpdate', this.updateTexture);\n\n return this.buildModels();\n }\n\n public clearModels() {\n this.texture?.destroy();\n this.dataTexture?.destroy();\n this.iconService.off('imageUpdate', this.updateTexture);\n }\n\n public buildModels(): IModel[] {\n return [\n this.layer.buildLayerModel({\n moduleName: 'arc2dline',\n vertexShader: line_arc2d_vert,\n fragmentShader: line_arc_frag,\n triangulation: LineArcTriangulation,\n depth: { enable: false },\n blend: this.getBlend(),\n }),\n ];\n }\n protected registerBuiltinAttributes() {\n this.styleAttributeService.registerStyleAttribute({\n name: 'size',\n type: AttributeType.Attribute,\n descriptor: {\n name: 'a_Size',\n buffer: {\n // give the WebGL driver a hint that this buffer may change\n usage: gl.DYNAMIC_DRAW,\n data: [],\n type: gl.FLOAT,\n },\n size: 1,\n update: (\n feature: IEncodeFeature,\n featureIdx: number,\n vertex: number[],\n attributeIdx: number,\n ) => {\n const { size = 1 } = feature;\n return Array.isArray(size) ? [size[0]] : [size as number];\n },\n },\n });\n\n this.styleAttributeService.registerStyleAttribute({\n name: 'instance', // 弧线起始点信息\n type: AttributeType.Attribute,\n descriptor: {\n name: 'a_Instance',\n buffer: {\n usage: gl.STATIC_DRAW,\n data: [],\n type: gl.FLOAT,\n },\n size: 4,\n update: (\n feature: IEncodeFeature,\n featureIdx: number,\n vertex: number[],\n attributeIdx: number,\n ) => {\n return [vertex[3], vertex[4], vertex[5], vertex[6]];\n },\n },\n });\n\n this.styleAttributeService.registerStyleAttribute({\n name: 'uv',\n type: AttributeType.Attribute,\n descriptor: {\n name: 'a_iconMapUV',\n buffer: {\n // give the WebGL driver a hint that this buffer may change\n usage: gl.DYNAMIC_DRAW,\n data: [],\n type: gl.FLOAT,\n },\n size: 2,\n update: (\n feature: IEncodeFeature,\n featureIdx: number,\n vertex: number[],\n attributeIdx: number,\n ) => {\n const iconMap = this.iconService.getIconMap();\n const { texture } = feature;\n // console.log('icon feature', feature)\n const { x, y } = iconMap[texture as string] || { x: 0, y: 0 };\n return [x, y];\n },\n },\n });\n }\n\n private updateTexture = () => {\n const { createTexture2D } = this.rendererService;\n if (this.texture) {\n this.texture.update({\n data: this.iconService.getCanvas(),\n });\n this.layer.render();\n return;\n }\n this.texture = createTexture2D({\n data: this.iconService.getCanvas(),\n mag: gl.NEAREST,\n min: gl.NEAREST,\n premultiplyAlpha: false,\n width: 1024,\n height: this.iconService.canvasHeight || 128,\n });\n };\n}\n"],"file":"great_circle.js"}
|
package/es/line/models/index.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import ArcModel from './arc';
|
|
2
|
-
import Arc3DModel from './arc_3d';
|
|
3
|
-
import GreatCircleModel from './great_circle';
|
|
4
|
-
import LineModel from './line';
|
|
5
|
-
var LineModels = {
|
|
6
|
-
arc: ArcModel,
|
|
7
|
-
arc3d: Arc3DModel,
|
|
8
|
-
greatcircle: GreatCircleModel,
|
|
9
|
-
line: LineModel
|
|
10
|
-
};
|
|
11
|
-
export default LineModels;
|
|
12
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/line/models/index.ts"],"names":["ArcModel","Arc3DModel","GreatCircleModel","LineModel","LineModels","arc","arc3d","greatcircle","line"],"mappings":"AAAA,OAAOA,QAAP,MAAqB,OAArB;AACA,OAAOC,UAAP,MAAuB,UAAvB;AACA,OAAOC,gBAAP,MAA6B,gBAA7B;AACA,OAAOC,SAAP,MAAsB,QAAtB;AAIA,IAAMC,UAA2C,GAAG;AAClDC,EAAAA,GAAG,EAAEL,QAD6C;AAElDM,EAAAA,KAAK,EAAEL,UAF2C;AAGlDM,EAAAA,WAAW,EAAEL,gBAHqC;AAIlDM,EAAAA,IAAI,EAAEL;AAJ4C,CAApD;AAOA,eAAeC,UAAf","sourcesContent":["import ArcModel from './arc';\nimport Arc3DModel from './arc_3d';\nimport GreatCircleModel from './great_circle';\nimport LineModel from './line';\n\nexport type LineModelType = 'arc' | 'arc3d' | 'greatcircle' | 'line';\n\nconst LineModels: { [key in LineModelType]: any } = {\n arc: ArcModel,\n arc3d: Arc3DModel,\n greatcircle: GreatCircleModel,\n line: LineModel,\n};\n\nexport default LineModels;\n"],"file":"index.js"}
|
package/es/line/models/line.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { IModel, IModelUniform, ITexture2D } from '@antv/l7-core';
|
|
2
|
-
import BaseModel from '../../core/BaseModel';
|
|
3
|
-
export default class LineModel extends BaseModel {
|
|
4
|
-
protected texture: ITexture2D;
|
|
5
|
-
getUninforms(): IModelUniform;
|
|
6
|
-
getAnimateUniforms(): IModelUniform;
|
|
7
|
-
initModels(): IModel[];
|
|
8
|
-
clearModels(): void;
|
|
9
|
-
buildModels(): IModel[];
|
|
10
|
-
protected registerBuiltinAttributes(): void;
|
|
11
|
-
private loadImage;
|
|
12
|
-
private updateTexture;
|
|
13
|
-
}
|