@antv/l7-layers 2.6.35 → 2.7.2
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 +1 -0
- package/es/core/BaseLayer.js +4 -0
- package/es/core/BaseLayer.js.map +1 -1
- package/es/core/interface.d.ts +60 -1
- package/es/core/interface.js.map +1 -1
- package/es/heatmap/index.d.ts +1 -4
- package/es/heatmap/index.js.map +1 -1
- package/es/heatmap/models/grid.js +9 -1
- package/es/heatmap/models/grid.js.map +1 -1
- package/es/heatmap/models/grid3d.js +9 -1
- package/es/heatmap/models/grid3d.js.map +1 -1
- package/es/heatmap/models/heatmap.js +29 -15
- package/es/heatmap/models/heatmap.js.map +1 -1
- package/es/heatmap/models/hexagon.js +9 -1
- package/es/heatmap/models/hexagon.js.map +1 -1
- package/es/image/index.d.ts +1 -4
- package/es/image/index.js.map +1 -1
- package/es/image/models/image.d.ts +3 -3
- package/es/image/models/image.js +9 -2
- package/es/image/models/image.js.map +1 -1
- package/es/index.d.ts +2 -1
- package/es/index.js +2 -1
- package/es/index.js.map +1 -1
- package/es/line/index.js +1 -1
- package/es/line/index.js.map +1 -1
- package/es/line/models/arc.js +8 -3
- package/es/line/models/arc.js.map +1 -1
- package/es/line/models/arc_3d.js +8 -3
- package/es/line/models/arc_3d.js.map +1 -1
- package/es/line/models/great_circle.js +13 -6
- package/es/line/models/great_circle.js.map +1 -1
- package/es/line/models/index.d.ts +1 -1
- package/es/line/models/index.js +1 -1
- package/es/line/models/index.js.map +1 -1
- package/es/line/models/line.js +12 -5
- package/es/line/models/line.js.map +1 -1
- package/es/line/models/simpleLine.js +10 -3
- package/es/line/models/simpleLine.js.map +1 -1
- package/es/mask/index.d.ts +21 -0
- package/es/mask/index.js +73 -0
- package/es/mask/index.js.map +1 -0
- package/es/mask/models/fill.d.ts +11 -0
- package/es/mask/models/fill.js +92 -0
- package/es/mask/models/fill.js.map +1 -0
- package/es/mask/models/index.d.ts +5 -0
- package/es/mask/models/index.js +6 -0
- package/es/mask/models/index.js.map +1 -0
- package/es/plugins/DataSourcePlugin.js +6 -2
- package/es/plugins/DataSourcePlugin.js.map +1 -1
- package/es/point/index.d.ts +1 -6
- package/es/point/index.js.map +1 -1
- package/es/point/models/fill.js +9 -1
- package/es/point/models/fill.js.map +1 -1
- package/es/point/models/image.js +12 -4
- package/es/point/models/image.js.map +1 -1
- package/es/point/models/index.js.map +1 -1
- package/es/point/models/normal.d.ts +2 -6
- package/es/point/models/normal.js +9 -1
- package/es/point/models/normal.js.map +1 -1
- package/es/point/models/simplePoint.d.ts +2 -10
- package/es/point/models/simplePoint.js +9 -1
- package/es/point/models/simplePoint.js.map +1 -1
- package/es/point/models/text.js +60 -46
- package/es/point/models/text.js.map +1 -1
- package/es/polygon/index.d.ts +1 -4
- package/es/polygon/index.js.map +1 -1
- package/es/polygon/models/extrude.js +8 -2
- package/es/polygon/models/extrude.js.map +1 -1
- package/es/polygon/models/fill.js +8 -2
- package/es/polygon/models/fill.js.map +1 -1
- package/es/raster/index.d.ts +1 -10
- package/es/raster/index.js.map +1 -1
- package/es/raster/models/raster.d.ts +3 -3
- package/es/raster/models/raster.js +13 -6
- package/es/raster/models/raster.js.map +1 -1
- package/lib/core/BaseLayer.js +3 -0
- package/lib/core/BaseLayer.js.map +1 -1
- package/lib/core/interface.js.map +1 -1
- package/lib/heatmap/index.js.map +1 -1
- package/lib/heatmap/models/grid.js +10 -1
- package/lib/heatmap/models/grid.js.map +1 -1
- package/lib/heatmap/models/grid3d.js +10 -1
- package/lib/heatmap/models/grid3d.js.map +1 -1
- package/lib/heatmap/models/heatmap.js +28 -14
- package/lib/heatmap/models/heatmap.js.map +1 -1
- package/lib/heatmap/models/hexagon.js +10 -1
- package/lib/heatmap/models/hexagon.js.map +1 -1
- package/lib/image/index.js.map +1 -1
- package/lib/image/models/image.js +8 -1
- package/lib/image/models/image.js.map +1 -1
- package/lib/index.js +8 -0
- package/lib/index.js.map +1 -1
- package/lib/line/index.js +1 -1
- package/lib/line/index.js.map +1 -1
- package/lib/line/models/arc.js +7 -2
- package/lib/line/models/arc.js.map +1 -1
- package/lib/line/models/arc_3d.js +7 -2
- package/lib/line/models/arc_3d.js.map +1 -1
- package/lib/line/models/great_circle.js +12 -5
- package/lib/line/models/great_circle.js.map +1 -1
- package/lib/line/models/index.js +1 -1
- package/lib/line/models/index.js.map +1 -1
- package/lib/line/models/line.js +11 -4
- package/lib/line/models/line.js.map +1 -1
- package/lib/line/models/simpleLine.js +9 -2
- package/lib/line/models/simpleLine.js.map +1 -1
- package/lib/mask/index.js +86 -0
- package/lib/mask/index.js.map +1 -0
- package/lib/mask/models/fill.js +107 -0
- package/lib/mask/models/fill.js.map +1 -0
- package/lib/mask/models/index.js +17 -0
- package/lib/mask/models/index.js.map +1 -0
- package/lib/plugins/DataSourcePlugin.js +6 -2
- package/lib/plugins/DataSourcePlugin.js.map +1 -1
- package/lib/point/index.js.map +1 -1
- package/lib/point/models/fill.js +10 -1
- package/lib/point/models/fill.js.map +1 -1
- package/lib/point/models/image.js +13 -4
- package/lib/point/models/image.js.map +1 -1
- package/lib/point/models/index.js.map +1 -1
- package/lib/point/models/normal.js +10 -1
- package/lib/point/models/normal.js.map +1 -1
- package/lib/point/models/simplePoint.js +10 -1
- package/lib/point/models/simplePoint.js.map +1 -1
- package/lib/point/models/text.js +59 -45
- package/lib/point/models/text.js.map +1 -1
- package/lib/polygon/index.js.map +1 -1
- package/lib/polygon/models/extrude.js +9 -2
- package/lib/polygon/models/extrude.js.map +1 -1
- package/lib/polygon/models/fill.js +9 -2
- package/lib/polygon/models/fill.js.map +1 -1
- package/lib/raster/index.js.map +1 -1
- package/lib/raster/models/raster.js +12 -5
- package/lib/raster/models/raster.js.map +1 -1
- package/package.json +5 -5
|
@@ -11,6 +11,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
11
11
|
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; } }
|
|
12
12
|
|
|
13
13
|
import { AttributeType, BlendType, gl } from '@antv/l7-core';
|
|
14
|
+
import { getMask } from '@antv/l7-utils';
|
|
14
15
|
import BaseModel from '../../core/BaseModel';
|
|
15
16
|
var normalFrag = "\nuniform float u_opacity : 1;\nuniform vec2 u_offsets;\nvarying vec4 v_color;\nvarying mat4 styleMappingMat; // \u4F20\u9012\u4ECE\u7247\u5143\u4E2D\u4F20\u9012\u7684\u6620\u5C04\u6570\u636E\n\n#pragma include \"picking\"\nvoid main() {\n float opacity = styleMappingMat[0][0];\n\n gl_FragColor = v_color;\n // gl_FragColor.a =gl_FragColor.a * u_opacity;\n gl_FragColor.a =gl_FragColor.a * opacity;\n gl_FragColor = filterColor(gl_FragColor);\n}\n";
|
|
16
17
|
var normalVert = "\nattribute vec3 a_Position;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nattribute float a_Size;\nattribute vec4 a_Color;\nvarying vec4 v_color;\n\nuniform float u_opacity : 1;\nuniform vec2 u_offsets;\n\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 \"picking\"\n#pragma include \"project\"\nvoid main() {\n v_color = a_Color;\n\n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\nstyleMappingMat = 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\n vec2 textrueOffsets = vec2(0.0, 0.0);\n if(hasOffsets()) {\n vec2 valueXPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n textrueOffsets.r = pos2value(valueXPos, columnWidth, rowHeight); // x\n textureOffset += 1.0;\n\n vec2 valueYPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n textrueOffsets.g = pos2value(valueYPos, columnWidth, rowHeight); // x\n textureOffset += 1.0;\n } else {\n textrueOffsets = u_offsets;\n }\n\n // cal style mapping\n \n // vec2 offset = project_pixel(u_offsets);\n vec2 offset = project_pixel(textrueOffsets);\n // vec4 project_pos = project_position(vec4(a_Position, 1.0)) + vec4(a_Size / 2.,-a_Size /2.,0.,0.);\n // gl_Position = project_common_position_to_clipspace(vec4(vec2(project_pos.xy+offset),project_pos.z,project_pos.w));\\\n // \n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n // vec2 offset = project_pixel((u_offsets));\n gl_Position = u_Mvp * vec4(a_Position.xy + offset, a_Position.z, 1.0);\n } else { // else\n // vec2 offset = project_pixel(u_offsets);\n vec4 project_pos = project_position(vec4(a_Position, 1.0)) + vec4(a_Size / 2.,-a_Size /2.,0.,0.);\n gl_Position = project_common_position_to_clipspace(vec4(vec2(project_pos.xy+offset),project_pos.z,project_pos.w));\n }\n\n gl_PointSize = a_Size * 2.0 * u_DevicePixelRatio;\n setPickingColor(a_PickingColor);\n}\n";
|
|
@@ -98,6 +99,12 @@ var NormalModel = function (_BaseModel) {
|
|
|
98
99
|
}, {
|
|
99
100
|
key: "buildModels",
|
|
100
101
|
value: function buildModels() {
|
|
102
|
+
var _ref2 = this.layer.getLayerConfig(),
|
|
103
|
+
_ref2$mask = _ref2.mask,
|
|
104
|
+
mask = _ref2$mask === void 0 ? false : _ref2$mask,
|
|
105
|
+
_ref2$maskInside = _ref2.maskInside,
|
|
106
|
+
maskInside = _ref2$maskInside === void 0 ? true : _ref2$maskInside;
|
|
107
|
+
|
|
101
108
|
return [this.layer.buildLayerModel({
|
|
102
109
|
moduleName: 'normalpoint',
|
|
103
110
|
vertexShader: normalVert,
|
|
@@ -107,7 +114,8 @@ var NormalModel = function (_BaseModel) {
|
|
|
107
114
|
enable: false
|
|
108
115
|
},
|
|
109
116
|
primitive: gl.POINTS,
|
|
110
|
-
blend: this.getBlend()
|
|
117
|
+
blend: this.getBlend(),
|
|
118
|
+
stencil: getMask(mask, maskInside)
|
|
111
119
|
})];
|
|
112
120
|
}
|
|
113
121
|
}, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/point/models/normal.ts"],"names":["AttributeType","BlendType","gl","BaseModel","PointTriangulation","feature","coordinates","vertices","indices","size","length","NormalModel","blend","layer","getLayerConfig","opacity","offsets","dataTextureTest","dataTextureNeedUpdate","judgeStyleAttributes","encodeData","getEncodedData","calDataFrame","cellLength","cellProperties","data","width","height","rowCount","dataTexture","createTexture2D","flipY","format","LUMINANCE","type","FLOAT","u_dataTexture","u_cellTypeLayout","getCellTypeLayout","u_opacity","u_offsets","isOffsetStatic","buildModels","buildLayerModel","moduleName","vertexShader","normalVert","fragmentShader","normalFrag","triangulation","depth","enable","primitive","POINTS","getBlend","destroy","styleAttributeService","registerStyleAttribute","name","Attribute","descriptor","buffer","usage","DYNAMIC_DRAW","update","featureIdx","vertex","attributeIdx","Array","isArray","additive"],"mappings":";;;;;;;;;;;;AAAA,SACEA,aADF,EAEEC,SAFF,EAGEC,EAHF,QAQO,eARP;
|
|
1
|
+
{"version":3,"sources":["../../../src/point/models/normal.ts"],"names":["AttributeType","BlendType","gl","getMask","BaseModel","PointTriangulation","feature","coordinates","vertices","indices","size","length","NormalModel","blend","layer","getLayerConfig","opacity","offsets","dataTextureTest","dataTextureNeedUpdate","judgeStyleAttributes","encodeData","getEncodedData","calDataFrame","cellLength","cellProperties","data","width","height","rowCount","dataTexture","createTexture2D","flipY","format","LUMINANCE","type","FLOAT","u_dataTexture","u_cellTypeLayout","getCellTypeLayout","u_opacity","u_offsets","isOffsetStatic","buildModels","mask","maskInside","buildLayerModel","moduleName","vertexShader","normalVert","fragmentShader","normalFrag","triangulation","depth","enable","primitive","POINTS","getBlend","stencil","destroy","styleAttributeService","registerStyleAttribute","name","Attribute","descriptor","buffer","usage","DYNAMIC_DRAW","update","featureIdx","vertex","attributeIdx","Array","isArray","additive"],"mappings":";;;;;;;;;;;;AAAA,SACEA,aADF,EAEEC,SAFF,EAGEC,EAHF,QAQO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IModelUniform,\n} from '@antv/l7-core';\nimport { getMask } from '@antv/l7-utils';\nimport { isNumber } from 'lodash';\nimport BaseModel from '../../core/BaseModel';\nimport { IPointLayerStyleOptions } from '../../core/interface';\nimport normalFrag from '../shaders/normal_frag.glsl';\nimport normalVert from '../shaders/normal_vert.glsl';\n\nexport function PointTriangulation(feature: IEncodeFeature) {\n const coordinates = feature.coordinates as number[];\n return {\n vertices: [...coordinates],\n indices: [0],\n size: coordinates.length,\n };\n}\n\nexport default class NormalModel extends BaseModel {\n public getDefaultStyle(): Partial<IPointLayerStyleOptions & ILayerConfig> {\n return {\n blend: 'additive',\n };\n }\n public getUninforms(): IModelUniform {\n const {\n opacity = 1,\n offsets = [0, 0],\n } = this.layer.getLayerConfig() as IPointLayerStyleOptions;\n\n if (\n this.dataTextureTest &&\n this.dataTextureNeedUpdate({\n opacity,\n offsets,\n })\n ) {\n // 判断当前的样式中哪些是需要进行数据映射的,哪些是常量,同时计算用于构建数据纹理的一些中间变量\n this.judgeStyleAttributes({\n opacity,\n offsets,\n });\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 return {\n u_dataTexture: this.dataTexture, // 数据纹理 - 有数据映射的时候纹理中带数据,若没有任何数据映射时纹理是 [1]\n u_cellTypeLayout: this.getCellTypeLayout(),\n u_opacity: isNumber(opacity) ? opacity : 1.0,\n u_offsets: this.isOffsetStatic(offsets)\n ? (offsets as [number, number])\n : [0, 0],\n };\n }\n\n public initModels(): IModel[] {\n return this.buildModels();\n }\n\n public buildModels(): IModel[] {\n const {\n mask = false,\n maskInside = true,\n } = this.layer.getLayerConfig() as IPointLayerStyleOptions;\n return [\n this.layer.buildLayerModel({\n moduleName: 'normalpoint',\n vertexShader: normalVert,\n fragmentShader: normalFrag,\n triangulation: PointTriangulation,\n depth: { enable: false },\n primitive: gl.POINTS,\n blend: this.getBlend(),\n stencil: getMask(mask, maskInside),\n }),\n ];\n }\n\n public clearModels() {\n this.dataTexture?.destroy();\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\n private defaultStyleOptions(): Partial<\n IPointLayerStyleOptions & ILayerConfig\n > {\n return {\n blend: BlendType.additive,\n };\n }\n}\n"],"file":"normal.js"}
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
import { IEncodeFeature, ILayerConfig, IModel, IModelUniform } from '@antv/l7-core';
|
|
2
|
-
import BaseModel
|
|
3
|
-
|
|
4
|
-
opacity: styleSingle;
|
|
5
|
-
offsets: styleOffset;
|
|
6
|
-
blend: string;
|
|
7
|
-
strokeOpacity: styleSingle;
|
|
8
|
-
strokeWidth: styleSingle;
|
|
9
|
-
stroke: styleColor;
|
|
10
|
-
}
|
|
2
|
+
import BaseModel from '../../core/BaseModel';
|
|
3
|
+
import { IPointLayerStyleOptions } from '../../core/interface';
|
|
11
4
|
export declare function PointTriangulation(feature: IEncodeFeature): {
|
|
12
5
|
vertices: number[];
|
|
13
6
|
indices: number[];
|
|
@@ -22,4 +15,3 @@ export default class SimplePointModel extends BaseModel {
|
|
|
22
15
|
protected registerBuiltinAttributes(): void;
|
|
23
16
|
private defaultStyleOptions;
|
|
24
17
|
}
|
|
25
|
-
export {};
|
|
@@ -11,6 +11,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
11
11
|
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; } }
|
|
12
12
|
|
|
13
13
|
import { AttributeType, BlendType, gl } from '@antv/l7-core';
|
|
14
|
+
import { getMask } from '@antv/l7-utils';
|
|
14
15
|
import BaseModel from '../../core/BaseModel';
|
|
15
16
|
var simplePointFrag = "\nuniform float u_opacity : 1;\nuniform vec2 u_offsets;\nuniform float u_additive;\n\nuniform float u_stroke_opacity : 1;\n\nuniform vec4 u_stroke_color : [0.0, 0.0, 0.0, 0.0];\n\nvarying vec4 v_color;\nvarying mat4 styleMappingMat; // \u4F20\u9012\u4ECE\u7247\u5143\u4E2D\u4F20\u9012\u7684\u6620\u5C04\u6570\u636E\nvarying float v_blur;\nvarying float v_innerRadius;\n\n#pragma include \"picking\"\nvoid main() {\n vec2 center = vec2(0.5);\n\n float opacity = styleMappingMat[0][0];\n // Tip: \u7247\u5143\u5230\u4E2D\u5FC3\u70B9\u7684\u8DDD\u79BB 0 - 1\n float fragmengTocenter = distance(center, gl_PointCoord) * 2.0;\n // Tip: \u7247\u5143\u7684\u526A\u5207\u6210\u5706\u5F62\n float circleClipOpacity = 1.0 - smoothstep(v_blur, 1.0, fragmengTocenter);\n\n\n if(v_innerRadius < 0.99) {\n // \u5F53\u5B58\u5728 stroke \u4E14 stroke > 0.01\n float blurWidth = (1.0 - v_blur)/2.0;\n vec4 stroke = vec4(u_stroke_color.rgb, u_stroke_opacity);\n if(fragmengTocenter > v_innerRadius + blurWidth) {\n gl_FragColor = stroke;\n } else if(fragmengTocenter > v_innerRadius - blurWidth){\n float mixR = (fragmengTocenter - (v_innerRadius - blurWidth)) / (blurWidth * 2.0);\n gl_FragColor = mix(v_color, stroke, mixR);\n } else {\n gl_FragColor = v_color;\n }\n } else {\n // \u5F53\u4E0D\u5B58\u5728 stroke \u6216 stroke <= 0.01\n gl_FragColor = v_color;\n }\n\n gl_FragColor.a *= opacity;\n\n gl_FragColor = filterColor(gl_FragColor);\n\n \n\n \n \n if(u_additive > 0.0) {\n gl_FragColor *= circleClipOpacity;\n } else {\n gl_FragColor.a *= circleClipOpacity;\n }\n\n}\n";
|
|
16
17
|
var simplePointVert = "\nattribute vec3 a_Position;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nattribute float a_Size;\nattribute vec4 a_Color;\nvarying vec4 v_color;\n\nuniform float u_opacity : 1;\nuniform vec2 u_offsets;\nuniform float u_stroke_width;\n\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\nvarying float v_blur;\nvarying float v_innerRadius;\n\n#pragma include \"styleMapping\"\n#pragma include \"styleMappingCalOpacity\"\n\n#pragma include \"projection\"\n#pragma include \"picking\"\n#pragma include \"project\"\nvoid main() {\n v_color = a_Color;\n v_blur = 1.0 - max(2.0/a_Size, 0.05);\n v_innerRadius = max((a_Size - u_stroke_width) / a_Size, 0.0);\n\n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\nstyleMappingMat = 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\n vec2 textrueOffsets = vec2(0.0, 0.0);\n if(hasOffsets()) {\n vec2 valueXPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n textrueOffsets.r = pos2value(valueXPos, columnWidth, rowHeight); // x\n textureOffset += 1.0;\n\n vec2 valueYPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n textrueOffsets.g = pos2value(valueYPos, columnWidth, rowHeight); // x\n textureOffset += 1.0;\n } else {\n textrueOffsets = u_offsets;\n }\n\n // cal style mapping\n \n // vec2 offset = project_pixel(u_offsets);\n vec2 offset = project_pixel(textrueOffsets);\n // vec4 project_pos = project_position(vec4(a_Position, 1.0)) + vec4(a_Size / 2.,-a_Size /2.,0.,0.);\n // gl_Position = project_common_position_to_clipspace(vec4(vec2(project_pos.xy+offset),project_pos.z,project_pos.w));\\\n // \n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n // vec2 offset = project_pixel((u_offsets));\n gl_Position = u_Mvp * vec4(a_Position.xy + offset, a_Position.z, 1.0);\n } else { // else\n // vec2 offset = project_pixel(u_offsets);\n vec4 project_pos = project_position(vec4(a_Position, 1.0)) + vec4(a_Size / 2.,-a_Size /2.,0.,0.);\n gl_Position = project_common_position_to_clipspace(vec4(vec2(project_pos.xy+offset),project_pos.z,project_pos.w));\n }\n\n gl_PointSize = a_Size * 2.0 * u_DevicePixelRatio;\n setPickingColor(a_PickingColor);\n}\n";
|
|
@@ -109,6 +110,12 @@ var SimplePointModel = function (_BaseModel) {
|
|
|
109
110
|
}, {
|
|
110
111
|
key: "buildModels",
|
|
111
112
|
value: function buildModels() {
|
|
113
|
+
var _ref2 = this.layer.getLayerConfig(),
|
|
114
|
+
_ref2$mask = _ref2.mask,
|
|
115
|
+
mask = _ref2$mask === void 0 ? false : _ref2$mask,
|
|
116
|
+
_ref2$maskInside = _ref2.maskInside,
|
|
117
|
+
maskInside = _ref2$maskInside === void 0 ? true : _ref2$maskInside;
|
|
118
|
+
|
|
112
119
|
return [this.layer.buildLayerModel({
|
|
113
120
|
moduleName: 'simplepoint',
|
|
114
121
|
vertexShader: simplePointVert,
|
|
@@ -118,7 +125,8 @@ var SimplePointModel = function (_BaseModel) {
|
|
|
118
125
|
enable: false
|
|
119
126
|
},
|
|
120
127
|
primitive: gl.POINTS,
|
|
121
|
-
blend: this.getBlend()
|
|
128
|
+
blend: this.getBlend(),
|
|
129
|
+
stencil: getMask(mask, maskInside)
|
|
122
130
|
})];
|
|
123
131
|
}
|
|
124
132
|
}, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/point/models/simplePoint.ts"],"names":["AttributeType","BlendType","gl","BaseModel","PointTriangulation","feature","coordinates","vertices","indices","size","length","SimplePointModel","blend","layer","getLayerConfig","opacity","offsets","strokeOpacity","strokeWidth","stroke","dataTextureTest","dataTextureNeedUpdate","judgeStyleAttributes","encodeData","getEncodedData","calDataFrame","cellLength","cellProperties","data","width","height","rowCount","dataTexture","createTexture2D","flipY","format","LUMINANCE","type","FLOAT","u_additive","u_dataTexture","u_cellTypeLayout","getCellTypeLayout","u_opacity","u_offsets","isOffsetStatic","u_stroke_opacity","u_stroke_width","u_stroke_color","getStrokeColor","buildModels","buildLayerModel","moduleName","vertexShader","simplePointVert","fragmentShader","simplePointFrag","triangulation","depth","enable","primitive","POINTS","getBlend","destroy","styleAttributeService","registerStyleAttribute","name","Attribute","descriptor","buffer","usage","DYNAMIC_DRAW","update","featureIdx","vertex","attributeIdx","Array","isArray","additive"],"mappings":";;;;;;;;;;;;AAAA,SACEA,aADF,EAEEC,SAFF,EAGEC,EAHF,QAQO,eARP;
|
|
1
|
+
{"version":3,"sources":["../../../src/point/models/simplePoint.ts"],"names":["AttributeType","BlendType","gl","getMask","BaseModel","PointTriangulation","feature","coordinates","vertices","indices","size","length","SimplePointModel","blend","layer","getLayerConfig","opacity","offsets","strokeOpacity","strokeWidth","stroke","dataTextureTest","dataTextureNeedUpdate","judgeStyleAttributes","encodeData","getEncodedData","calDataFrame","cellLength","cellProperties","data","width","height","rowCount","dataTexture","createTexture2D","flipY","format","LUMINANCE","type","FLOAT","u_additive","u_dataTexture","u_cellTypeLayout","getCellTypeLayout","u_opacity","u_offsets","isOffsetStatic","u_stroke_opacity","u_stroke_width","u_stroke_color","getStrokeColor","buildModels","mask","maskInside","buildLayerModel","moduleName","vertexShader","simplePointVert","fragmentShader","simplePointFrag","triangulation","depth","enable","primitive","POINTS","getBlend","stencil","destroy","styleAttributeService","registerStyleAttribute","name","Attribute","descriptor","buffer","usage","DYNAMIC_DRAW","update","featureIdx","vertex","attributeIdx","Array","isArray","additive"],"mappings":";;;;;;;;;;;;AAAA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B,UAAAA,IAAI,EAAE,CARI;AASVkE,UAAAA,MAAM,EAAE,gBACNtE,OADM,EAENuE,UAFM,EAGNC,MAHM,EAINC,YAJM,EAKH;AACH,gCAAqBzE,OAArB,CAAQI,IAAR;AAAA,gBAAQA,IAAR,8BAAe,CAAf;AACA,mBAAOsE,KAAK,CAACC,OAAN,CAAcvE,IAAd,IAAsB,CAACA,IAAI,CAAC,CAAD,CAAL,CAAtB,GAAkC,CAACA,IAAD,CAAzC;AACD;AAjBS;AAHoC,OAAlD;AAuBD;;;WAED,+BAEE;AACA,aAAO;AACLG,QAAAA,KAAK,EAAEZ,SAAS,CAACiF;AADZ,OAAP;AAGD;;;;EAlI2C9E,S;;SAAzBQ,gB","sourcesContent":["import {\n AttributeType,\n BlendType,\n gl,\n IEncodeFeature,\n ILayerConfig,\n IModel,\n IModelUniform,\n} from '@antv/l7-core';\n\nimport { getMask } from '@antv/l7-utils';\nimport { isNumber } from 'lodash';\nimport BaseModel from '../../core/BaseModel';\nimport { IPointLayerStyleOptions } from '../../core/interface';\n\nimport simplePointFrag from '../shaders/simplePoint_frag.glsl';\nimport simplePointVert from '../shaders/simplePoint_vert.glsl';\n\nexport function PointTriangulation(feature: IEncodeFeature) {\n const coordinates = feature.coordinates as number[];\n return {\n vertices: [...coordinates],\n indices: [0],\n size: coordinates.length,\n };\n}\n\nexport default class SimplePointModel extends BaseModel {\n public getDefaultStyle(): Partial<IPointLayerStyleOptions & ILayerConfig> {\n return {\n blend: 'additive',\n };\n }\n public getUninforms(): IModelUniform {\n const {\n opacity = 1,\n offsets = [0, 0],\n blend,\n strokeOpacity = 1,\n strokeWidth = 0,\n stroke = '#fff',\n } = this.layer.getLayerConfig() as IPointLayerStyleOptions;\n\n if (\n this.dataTextureTest &&\n this.dataTextureNeedUpdate({\n opacity,\n offsets,\n })\n ) {\n // 判断当前的样式中哪些是需要进行数据映射的,哪些是常量,同时计算用于构建数据纹理的一些中间变量\n this.judgeStyleAttributes({\n opacity,\n offsets,\n });\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 return {\n u_additive: blend === 'additive' ? 1.0 : 0.0,\n u_dataTexture: this.dataTexture, // 数据纹理 - 有数据映射的时候纹理中带数据,若没有任何数据映射时纹理是 [1]\n u_cellTypeLayout: this.getCellTypeLayout(),\n\n u_opacity: isNumber(opacity) ? opacity : 1.0,\n u_offsets: this.isOffsetStatic(offsets)\n ? (offsets as [number, number])\n : [0, 0],\n u_stroke_opacity: isNumber(strokeOpacity) ? strokeOpacity : 1.0,\n u_stroke_width: isNumber(strokeWidth) ? strokeWidth : 0.0,\n u_stroke_color: this.getStrokeColor(stroke),\n };\n }\n\n public initModels(): IModel[] {\n return this.buildModels();\n }\n\n public buildModels(): IModel[] {\n const {\n mask = false,\n maskInside = true,\n } = this.layer.getLayerConfig() as IPointLayerStyleOptions;\n return [\n this.layer.buildLayerModel({\n moduleName: 'simplepoint',\n vertexShader: simplePointVert,\n fragmentShader: simplePointFrag,\n triangulation: PointTriangulation,\n depth: { enable: false },\n primitive: gl.POINTS,\n blend: this.getBlend(),\n stencil: getMask(mask, maskInside),\n }),\n ];\n }\n\n public clearModels() {\n this.dataTexture?.destroy();\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\n private defaultStyleOptions(): Partial<\n IPointLayerStyleOptions & ILayerConfig\n > {\n return {\n blend: BlendType.additive,\n };\n }\n}\n"],"file":"simplePoint.js"}
|
package/es/point/models/text.js
CHANGED
|
@@ -19,7 +19,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
19
19
|
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; } }
|
|
20
20
|
|
|
21
21
|
import { AttributeType, gl } from '@antv/l7-core';
|
|
22
|
-
import { boundsContains, padBounds } from '@antv/l7-utils';
|
|
22
|
+
import { boundsContains, getMask, padBounds } from '@antv/l7-utils';
|
|
23
23
|
import BaseModel from '../../core/BaseModel';
|
|
24
24
|
import CollisionIndex from '../../utils/collision-index';
|
|
25
25
|
import { calculateCentroid } from '../../utils/geo';
|
|
@@ -86,6 +86,12 @@ var TextModel = function (_BaseModel) {
|
|
|
86
86
|
_defineProperty(_assertThisInitialized(_this), "preTextStyle", {});
|
|
87
87
|
|
|
88
88
|
_defineProperty(_assertThisInitialized(_this), "buildModels", function () {
|
|
89
|
+
var _ref = _this.layer.getLayerConfig(),
|
|
90
|
+
_ref$mask = _ref.mask,
|
|
91
|
+
mask = _ref$mask === void 0 ? false : _ref$mask,
|
|
92
|
+
_ref$maskInside = _ref.maskInside,
|
|
93
|
+
maskInside = _ref$maskInside === void 0 ? true : _ref$maskInside;
|
|
94
|
+
|
|
89
95
|
_this.initGlyph();
|
|
90
96
|
|
|
91
97
|
_this.updateTexture();
|
|
@@ -102,7 +108,8 @@ var TextModel = function (_BaseModel) {
|
|
|
102
108
|
depth: {
|
|
103
109
|
enable: false
|
|
104
110
|
},
|
|
105
|
-
blend: _this.getBlend()
|
|
111
|
+
blend: _this.getBlend(),
|
|
112
|
+
stencil: getMask(mask, maskInside)
|
|
106
113
|
})];
|
|
107
114
|
});
|
|
108
115
|
|
|
@@ -112,21 +119,21 @@ var TextModel = function (_BaseModel) {
|
|
|
112
119
|
_createClass(TextModel, [{
|
|
113
120
|
key: "getUninforms",
|
|
114
121
|
value: function getUninforms() {
|
|
115
|
-
var
|
|
116
|
-
|
|
117
|
-
opacity =
|
|
118
|
-
|
|
119
|
-
stroke =
|
|
120
|
-
|
|
121
|
-
strokeWidth =
|
|
122
|
-
|
|
123
|
-
textAnchor =
|
|
124
|
-
|
|
125
|
-
textAllowOverlap =
|
|
126
|
-
|
|
127
|
-
halo =
|
|
128
|
-
|
|
129
|
-
gamma =
|
|
122
|
+
var _ref2 = this.layer.getLayerConfig(),
|
|
123
|
+
_ref2$opacity = _ref2.opacity,
|
|
124
|
+
opacity = _ref2$opacity === void 0 ? 1.0 : _ref2$opacity,
|
|
125
|
+
_ref2$stroke = _ref2.stroke,
|
|
126
|
+
stroke = _ref2$stroke === void 0 ? '#fff' : _ref2$stroke,
|
|
127
|
+
_ref2$strokeWidth = _ref2.strokeWidth,
|
|
128
|
+
strokeWidth = _ref2$strokeWidth === void 0 ? 0 : _ref2$strokeWidth,
|
|
129
|
+
_ref2$textAnchor = _ref2.textAnchor,
|
|
130
|
+
textAnchor = _ref2$textAnchor === void 0 ? 'center' : _ref2$textAnchor,
|
|
131
|
+
_ref2$textAllowOverla = _ref2.textAllowOverlap,
|
|
132
|
+
textAllowOverlap = _ref2$textAllowOverla === void 0 ? false : _ref2$textAllowOverla,
|
|
133
|
+
_ref2$halo = _ref2.halo,
|
|
134
|
+
halo = _ref2$halo === void 0 ? 0.5 : _ref2$halo,
|
|
135
|
+
_ref2$gamma = _ref2.gamma,
|
|
136
|
+
gamma = _ref2$gamma === void 0 ? 2.0 : _ref2$gamma;
|
|
130
137
|
|
|
131
138
|
var _this$fontService = this.fontService,
|
|
132
139
|
canvas = _this$fontService.canvas,
|
|
@@ -195,11 +202,11 @@ var TextModel = function (_BaseModel) {
|
|
|
195
202
|
this.layer.on('remapping', this.buildModels);
|
|
196
203
|
this.extent = this.textExtent();
|
|
197
204
|
|
|
198
|
-
var
|
|
199
|
-
|
|
200
|
-
textAnchor =
|
|
201
|
-
|
|
202
|
-
textAllowOverlap =
|
|
205
|
+
var _ref3 = this.layer.getLayerConfig(),
|
|
206
|
+
_ref3$textAnchor = _ref3.textAnchor,
|
|
207
|
+
textAnchor = _ref3$textAnchor === void 0 ? 'center' : _ref3$textAnchor,
|
|
208
|
+
_ref3$textAllowOverla = _ref3.textAllowOverlap,
|
|
209
|
+
textAllowOverlap = _ref3$textAllowOverla === void 0 ? true : _ref3$textAllowOverla;
|
|
203
210
|
|
|
204
211
|
this.preTextStyle = {
|
|
205
212
|
textAnchor: textAnchor,
|
|
@@ -210,9 +217,9 @@ var TextModel = function (_BaseModel) {
|
|
|
210
217
|
}, {
|
|
211
218
|
key: "needUpdate",
|
|
212
219
|
value: function needUpdate() {
|
|
213
|
-
var
|
|
214
|
-
|
|
215
|
-
textAllowOverlap =
|
|
220
|
+
var _ref4 = this.layer.getLayerConfig(),
|
|
221
|
+
_ref4$textAllowOverla = _ref4.textAllowOverlap,
|
|
222
|
+
textAllowOverlap = _ref4$textAllowOverla === void 0 ? false : _ref4$textAllowOverla;
|
|
216
223
|
|
|
217
224
|
var zoom = this.mapService.getZoom();
|
|
218
225
|
var extent = this.mapService.getBounds();
|
|
@@ -314,11 +321,11 @@ var TextModel = function (_BaseModel) {
|
|
|
314
321
|
}, {
|
|
315
322
|
key: "initTextFont",
|
|
316
323
|
value: function initTextFont() {
|
|
317
|
-
var
|
|
318
|
-
|
|
319
|
-
fontWeight =
|
|
320
|
-
|
|
321
|
-
fontFamily =
|
|
324
|
+
var _ref5 = this.layer.getLayerConfig(),
|
|
325
|
+
_ref5$fontWeight = _ref5.fontWeight,
|
|
326
|
+
fontWeight = _ref5$fontWeight === void 0 ? '400' : _ref5$fontWeight,
|
|
327
|
+
_ref5$fontFamily = _ref5.fontFamily,
|
|
328
|
+
fontFamily = _ref5$fontFamily === void 0 ? 'sans-serif' : _ref5$fontFamily;
|
|
322
329
|
|
|
323
330
|
var data = this.layer.getEncodedData();
|
|
324
331
|
var characterSet = [];
|
|
@@ -354,11 +361,11 @@ var TextModel = function (_BaseModel) {
|
|
|
354
361
|
}, {
|
|
355
362
|
key: "initIconFontTex",
|
|
356
363
|
value: function initIconFontTex() {
|
|
357
|
-
var
|
|
358
|
-
|
|
359
|
-
fontWeight =
|
|
360
|
-
|
|
361
|
-
fontFamily =
|
|
364
|
+
var _ref6 = this.layer.getLayerConfig(),
|
|
365
|
+
_ref6$fontWeight = _ref6.fontWeight,
|
|
366
|
+
fontWeight = _ref6$fontWeight === void 0 ? '400' : _ref6$fontWeight,
|
|
367
|
+
_ref6$fontFamily = _ref6.fontFamily,
|
|
368
|
+
fontFamily = _ref6$fontFamily === void 0 ? 'sans-serif' : _ref6$fontFamily;
|
|
362
369
|
|
|
363
370
|
var data = this.layer.getEncodedData();
|
|
364
371
|
var characterSet = [];
|
|
@@ -385,11 +392,11 @@ var TextModel = function (_BaseModel) {
|
|
|
385
392
|
|
|
386
393
|
var mapping = this.fontService.mapping;
|
|
387
394
|
|
|
388
|
-
var
|
|
389
|
-
|
|
390
|
-
spacing =
|
|
391
|
-
|
|
392
|
-
textAnchor =
|
|
395
|
+
var _ref7 = this.layer.getLayerConfig(),
|
|
396
|
+
_ref7$spacing = _ref7.spacing,
|
|
397
|
+
spacing = _ref7$spacing === void 0 ? 2 : _ref7$spacing,
|
|
398
|
+
_ref7$textAnchor = _ref7.textAnchor,
|
|
399
|
+
textAnchor = _ref7$textAnchor === void 0 ? 'center' : _ref7$textAnchor;
|
|
393
400
|
|
|
394
401
|
var data = this.layer.getEncodedData();
|
|
395
402
|
this.glyphInfo = data.map(function (feature) {
|
|
@@ -419,11 +426,11 @@ var TextModel = function (_BaseModel) {
|
|
|
419
426
|
value: function filterGlyphs() {
|
|
420
427
|
var _this3 = this;
|
|
421
428
|
|
|
422
|
-
var
|
|
423
|
-
|
|
424
|
-
padding =
|
|
425
|
-
|
|
426
|
-
textAllowOverlap =
|
|
429
|
+
var _ref8 = this.layer.getLayerConfig(),
|
|
430
|
+
_ref8$padding = _ref8.padding,
|
|
431
|
+
padding = _ref8$padding === void 0 ? [4, 4] : _ref8$padding,
|
|
432
|
+
_ref8$textAllowOverla = _ref8.textAllowOverlap,
|
|
433
|
+
textAllowOverlap = _ref8$textAllowOverla === void 0 ? false : _ref8$textAllowOverla;
|
|
427
434
|
|
|
428
435
|
if (textAllowOverlap) {
|
|
429
436
|
return;
|
|
@@ -501,6 +508,12 @@ var TextModel = function (_BaseModel) {
|
|
|
501
508
|
}, {
|
|
502
509
|
key: "reBuildModel",
|
|
503
510
|
value: function reBuildModel() {
|
|
511
|
+
var _ref9 = this.layer.getLayerConfig(),
|
|
512
|
+
_ref9$mask = _ref9.mask,
|
|
513
|
+
mask = _ref9$mask === void 0 ? false : _ref9$mask,
|
|
514
|
+
_ref9$maskInside = _ref9.maskInside,
|
|
515
|
+
maskInside = _ref9$maskInside === void 0 ? true : _ref9$maskInside;
|
|
516
|
+
|
|
504
517
|
this.filterGlyphs();
|
|
505
518
|
this.layer.models = [this.layer.buildLayerModel({
|
|
506
519
|
moduleName: 'pointText',
|
|
@@ -510,7 +523,8 @@ var TextModel = function (_BaseModel) {
|
|
|
510
523
|
depth: {
|
|
511
524
|
enable: false
|
|
512
525
|
},
|
|
513
|
-
blend: this.getBlend()
|
|
526
|
+
blend: this.getBlend(),
|
|
527
|
+
stencil: getMask(mask, maskInside)
|
|
514
528
|
})];
|
|
515
529
|
}
|
|
516
530
|
}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/point/models/text.ts"],"names":["AttributeType","gl","boundsContains","padBounds","BaseModel","CollisionIndex","calculateCentroid","getGlyphQuads","shapeText","TextTriangulation","feature","that","id","vertices","indices","glyphInfoMap","size","centroid","coord","length","glyphQuads","forEach","quad","index","push","tex","x","y","height","tl","width","tr","br","bl","TextModel","initGlyph","updateTexture","filterGlyphs","reBuildModel","layer","buildLayerModel","moduleName","vertexShader","textVert","fragmentShader","textFrag","triangulation","bind","depth","enable","blend","getBlend","getLayerConfig","opacity","stroke","strokeWidth","textAnchor","textAllowOverlap","halo","gamma","fontService","canvas","mapping","Object","keys","textCount","preTextStyle","dataTextureTest","dataTextureNeedUpdate","judgeStyleAttributes","encodeData","getEncodedData","calDataFrame","cellLength","cellProperties","data","rowCount","dataTexture","createTexture2D","flipY","format","LUMINANCE","type","FLOAT","u_dataTexture","u_cellTypeLayout","getCellTypeLayout","u_opacity","u_stroke_width","u_stroke_color","getStrokeColor","u_sdf_map","texture","u_halo_blur","u_gamma_scale","u_sdf_map_size","on","buildModels","extent","textExtent","zoom","mapService","getZoom","getBounds","flag","Math","abs","currentZoom","destroy","off","styleAttributeService","registerStyleAttribute","name","Attribute","descriptor","buffer","usage","DYNAMIC_DRAW","update","featureIdx","vertex","attributeIdx","rotate","Array","isArray","STATIC_DRAW","bounds","fontWeight","fontFamily","characterSet","item","shape","toString","char","indexOf","setFontOptions","iconfont","spacing","glyphInfo","map","textOffset","shaping","coordinates","originCentroid","version","originCoordinates","padding","rendererService","getViewportSize","collisionIndex","filterData","filter","fontScale","pixels","lngLatToContainer","placeCollisionBox","x1","left","x2","right","y1","top","y2","bottom","anchorPointX","anchorPointY","box","insertCollisionBox","initIconFontTex","initTextFont","generateGlyphLayout","textureHeight","mag","LINEAR","min","models"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,SACEA,aADF,EAGEC,EAHF,QAUO,eAVP;AAWA,SAASC,cAAT,EAAyBC,SAAzB,QAAmD,gBAAnD;AAEA,OAAOC,SAAP,MAIO,sBAJP;AAKA,OAAOC,cAAP,MAA2B,6BAA3B;AACA,SAASC,iBAAT,QAA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Ae,CAAC;AAC7BH,QAAAA,IAAI,EAAEd,MADuB;AAE7B+G,QAAAA,GAAG,EAAE3K,EAAE,CAAC4K,MAFqB;AAG7BC,QAAAA,GAAG,EAAE7K,EAAE,CAAC4K,MAHqB;AAI7B/I,QAAAA,KAAK,EAAE+B,MAAM,CAAC/B,KAJe;AAK7BF,QAAAA,MAAM,EAAEiC,MAAM,CAACjC;AALc,OAAD,CAA9B;AAOD;;;WAED,wBAAuB;AACrB,WAAKS,YAAL;AACA,WAAKE,KAAL,CAAWwI,MAAX,GAAoB,CAClB,KAAKxI,KAAL,CAAWC,eAAX,CAA2B;AACzBC,QAAAA,UAAU,EAAE,WADa;AAEzBC,QAAAA,YAAY,EAAEC,QAFW;AAGzBC,QAAAA,cAAc,EAAEC,QAHS;AAIzBC,QAAAA,aAAa,EAAErC,iBAAiB,CAACsC,IAAlB,CAAuB,IAAvB,CAJU;AAKzBC,QAAAA,KAAK,EAAE;AAAEC,UAAAA,MAAM,EAAE;AAAV,SALkB;AAMzBC,QAAAA,KAAK,EAAE,KAAKC,QAAL;AANkB,OAA3B,CADkB,CAApB;AAUD;;;;EAxboC/C,S;;SAAlB8B,S","sourcesContent":["import {\n AttributeType,\n BlendType,\n gl,\n IEncodeFeature,\n ILayer,\n ILayerConfig,\n IModel,\n IModelUniform,\n ITexture2D,\n} from '@antv/l7-core';\nimport { boundsContains, padBounds, rgb2arr } from '@antv/l7-utils';\nimport { isNumber, isString } from 'lodash';\nimport BaseModel, {\n styleColor,\n styleOffset,\n styleSingle,\n} from '../../core/BaseModel';\nimport CollisionIndex from '../../utils/collision-index';\nimport { calculateCentroid } from '../../utils/geo';\nimport {\n anchorType,\n getGlyphQuads,\n IGlyphQuad,\n shapeText,\n} from '../../utils/symbol-layout';\nimport textFrag from '../shaders/text_frag.glsl';\nimport textVert from '../shaders/text_vert.glsl';\ninterface IPointTextLayerStyleOptions {\n opacity: styleSingle;\n strokeWidth: styleSingle;\n stroke: styleColor;\n textOffset: [number, number];\n\n textAnchor: anchorType;\n spacing: number;\n padding: [number, number];\n halo: number;\n gamma: number;\n fontWeight: string;\n fontFamily: string;\n textAllowOverlap: boolean;\n}\nexport function TextTriangulation(feature: IEncodeFeature) {\n // @ts-ignore\n const that = this as TextModel;\n const id = feature.id as number;\n const vertices: number[] = [];\n const indices: number[] = [];\n\n if (!that.glyphInfoMap || !that.glyphInfoMap[id]) {\n return {\n vertices: [], // [ x, y, z, tex.x,tex.y, offset.x. offset.y]\n indices: [],\n size: 7,\n };\n }\n const centroid = that.glyphInfoMap[id].centroid as number[]; // 计算中心点\n const coord =\n centroid.length === 2 ? [centroid[0], centroid[1], 0] : centroid;\n that.glyphInfoMap[id].glyphQuads.forEach(\n (quad: IGlyphQuad, index: number) => {\n vertices.push(\n ...coord,\n quad.tex.x,\n quad.tex.y + quad.tex.height,\n quad.tl.x,\n quad.tl.y,\n ...coord,\n quad.tex.x + quad.tex.width,\n quad.tex.y + quad.tex.height,\n quad.tr.x,\n quad.tr.y,\n ...coord,\n quad.tex.x + quad.tex.width,\n quad.tex.y,\n quad.br.x,\n quad.br.y,\n ...coord,\n quad.tex.x,\n quad.tex.y,\n quad.bl.x,\n quad.bl.y,\n );\n indices.push(\n 0 + index * 4,\n 1 + index * 4,\n 2 + index * 4,\n 2 + index * 4,\n 3 + index * 4,\n 0 + index * 4,\n );\n },\n );\n return {\n vertices, // [ x, y, z, tex.x,tex.y, offset.x. offset.y]\n indices,\n size: 7,\n };\n}\n\nexport default class TextModel extends BaseModel {\n public glyphInfo: IEncodeFeature[];\n public glyphInfoMap: {\n [key: string]: {\n shaping: any;\n glyphQuads: IGlyphQuad[];\n centroid: number[];\n };\n } = {};\n private texture: ITexture2D;\n private currentZoom: number = -1;\n private extent: [[number, number], [number, number]];\n private textureHeight: number = 0;\n private textCount: number = 0;\n private preTextStyle: Partial<IPointTextLayerStyleOptions> = {};\n public getUninforms(): IModelUniform {\n const {\n opacity = 1.0,\n stroke = '#fff',\n strokeWidth = 0,\n textAnchor = 'center',\n textAllowOverlap = false,\n halo = 0.5,\n gamma = 2.0,\n } = this.layer.getLayerConfig() as IPointTextLayerStyleOptions;\n const { canvas, mapping } = this.fontService;\n if (Object.keys(mapping).length !== this.textCount) {\n this.updateTexture();\n this.textCount = Object.keys(mapping).length;\n }\n this.preTextStyle = {\n textAnchor,\n textAllowOverlap,\n };\n\n if (\n this.dataTextureTest &&\n this.dataTextureNeedUpdate({\n opacity,\n strokeWidth,\n stroke,\n })\n ) {\n this.judgeStyleAttributes({\n opacity,\n strokeWidth,\n stroke,\n });\n\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\n u_opacity: isNumber(opacity) ? opacity : 1.0,\n u_stroke_width: isNumber(strokeWidth) ? strokeWidth : 0.0,\n u_stroke_color: this.getStrokeColor(stroke),\n\n u_sdf_map: this.texture,\n u_halo_blur: halo,\n u_gamma_scale: gamma,\n u_sdf_map_size: [canvas.width, canvas.height],\n };\n }\n\n public initModels(): IModel[] {\n this.layer.on('remapping', this.buildModels);\n this.extent = this.textExtent();\n const {\n textAnchor = 'center',\n textAllowOverlap = true,\n } = this.layer.getLayerConfig() as IPointTextLayerStyleOptions;\n this.preTextStyle = {\n textAnchor,\n textAllowOverlap,\n };\n return this.buildModels();\n }\n\n public buildModels = () => {\n this.initGlyph();\n this.updateTexture();\n this.filterGlyphs();\n this.reBuildModel();\n return [\n this.layer.buildLayerModel({\n moduleName: 'pointText',\n vertexShader: textVert,\n fragmentShader: textFrag,\n triangulation: TextTriangulation.bind(this),\n depth: { enable: false },\n blend: this.getBlend(),\n }),\n ];\n };\n public needUpdate() {\n const {\n textAllowOverlap = false,\n } = this.layer.getLayerConfig() as IPointTextLayerStyleOptions;\n // textAllowOverlap 发生改变\n const zoom = this.mapService.getZoom();\n const extent = this.mapService.getBounds();\n const flag = boundsContains(this.extent, extent);\n // 文本不能压盖则进行过滤\n if (\n (!textAllowOverlap && (Math.abs(this.currentZoom - zoom) > 1 || !flag)) ||\n textAllowOverlap !== this.preTextStyle.textAllowOverlap\n ) {\n this.reBuildModel();\n return true;\n }\n return false;\n }\n\n public clearModels() {\n this.dataTexture?.destroy();\n this.layer.off('remapping', this.buildModels);\n }\n protected registerBuiltinAttributes() {\n this.styleAttributeService.registerStyleAttribute({\n name: 'rotate',\n type: AttributeType.Attribute,\n descriptor: {\n name: 'a_Rotate',\n buffer: {\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 { rotate = 0 } = feature;\n return Array.isArray(rotate) ? [rotate[0]] : [rotate as number];\n },\n },\n });\n this.styleAttributeService.registerStyleAttribute({\n name: 'textOffsets',\n type: AttributeType.Attribute,\n descriptor: {\n name: 'a_textOffsets',\n buffer: {\n // give the WebGL driver a hint that this buffer may change\n usage: gl.STATIC_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 // console.log([vertex[5], vertex[6]])\n return [vertex[5], vertex[6]];\n },\n },\n });\n\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 = 12 } = feature;\n return Array.isArray(size) ? [size[0]] : [size as number];\n },\n },\n });\n\n // point layer size;\n this.styleAttributeService.registerStyleAttribute({\n name: 'textUv',\n type: AttributeType.Attribute,\n descriptor: {\n name: 'a_tex',\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 return [vertex[3], vertex[4]];\n },\n },\n });\n }\n private textExtent(): [[number, number], [number, number]] {\n const bounds = this.mapService.getBounds();\n return padBounds(bounds, 0.5);\n }\n /**\n * 生成文字纹理(生成文字纹理字典)\n */\n private initTextFont() {\n const {\n fontWeight = '400',\n fontFamily = 'sans-serif',\n } = this.layer.getLayerConfig() as IPointTextLayerStyleOptions;\n const data = this.layer.getEncodedData();\n const characterSet: string[] = [];\n data.forEach((item: IEncodeFeature) => {\n let { shape = '' } = item;\n shape = shape.toString();\n for (const char of shape) {\n // 去重\n if (characterSet.indexOf(char) === -1) {\n characterSet.push(char);\n }\n }\n });\n this.fontService.setFontOptions({\n characterSet,\n fontWeight,\n fontFamily,\n iconfont: false,\n });\n }\n\n /**\n * 生成 iconfont 纹理字典\n */\n private initIconFontTex() {\n const {\n fontWeight = '400',\n fontFamily = 'sans-serif',\n } = this.layer.getLayerConfig() as IPointTextLayerStyleOptions;\n const data = this.layer.getEncodedData();\n const characterSet: string[] = [];\n data.forEach((item: IEncodeFeature) => {\n let { shape = '' } = item;\n shape = `${shape}`;\n if (characterSet.indexOf(shape) === -1) {\n characterSet.push(shape);\n }\n });\n this.fontService.setFontOptions({\n characterSet,\n fontWeight,\n fontFamily,\n iconfont: true,\n });\n }\n\n /**\n * 生成文字布局(对照文字纹理字典提取对应文字的位置很好信息)\n */\n private generateGlyphLayout(iconfont: boolean) {\n // TODO:更新文字布局\n const { mapping } = this.fontService;\n const {\n spacing = 2,\n textAnchor = 'center',\n // textOffset,\n } = this.layer.getLayerConfig() as IPointTextLayerStyleOptions;\n const data = this.layer.getEncodedData();\n\n this.glyphInfo = data.map((feature: IEncodeFeature) => {\n const { shape = '', id, size = 1, textOffset = [0, 0] } = feature;\n\n const shaping = shapeText(\n shape.toString(),\n mapping,\n // @ts-ignore\n size,\n textAnchor,\n 'left',\n spacing,\n textOffset,\n iconfont,\n );\n const glyphQuads = getGlyphQuads(shaping, textOffset, false);\n feature.shaping = shaping;\n feature.glyphQuads = glyphQuads;\n // feature.centroid = calculteCentroid(coordinates);\n\n feature.centroid = calculateCentroid(feature.coordinates);\n\n // 此时地图高德2.0 originCentroid == centroid\n feature.originCentroid =\n feature.version === 'GAODE2.x'\n ? calculateCentroid(feature.originCoordinates)\n : (feature.originCentroid = feature.centroid);\n\n this.glyphInfoMap[id as number] = {\n shaping,\n glyphQuads,\n centroid: calculateCentroid(feature.coordinates),\n };\n return feature;\n });\n }\n /**\n * 文字避让 depend on originCentorid\n */\n private filterGlyphs() {\n const {\n padding = [4, 4],\n textAllowOverlap = false,\n } = this.layer.getLayerConfig() as IPointTextLayerStyleOptions;\n if (textAllowOverlap) {\n // 如果允许文本覆盖\n // this.layer.setEncodedData(this.glyphInfo);\n return;\n }\n this.glyphInfoMap = {};\n this.currentZoom = this.mapService.getZoom();\n this.extent = this.textExtent();\n const { width, height } = this.rendererService.getViewportSize();\n const collisionIndex = new CollisionIndex(width, height);\n const filterData = this.glyphInfo.filter((feature: IEncodeFeature) => {\n const { shaping, id = 0 } = feature;\n // const centroid = feature.centroid as [number, number];\n // const centroid = feature.originCentroid as [number, number];\n const centroid = (feature.version === 'GAODE2.x'\n ? feature.originCentroid\n : feature.centroid) as [number, number];\n const size = feature.size as number;\n const fontScale: number = size / 24;\n const pixels = this.mapService.lngLatToContainer(centroid);\n const { box } = collisionIndex.placeCollisionBox({\n x1: shaping.left * fontScale - padding[0],\n x2: shaping.right * fontScale + padding[0],\n y1: shaping.top * fontScale - padding[1],\n y2: shaping.bottom * fontScale + padding[1],\n anchorPointX: pixels.x,\n anchorPointY: pixels.y,\n });\n if (box && box.length) {\n // TODO:featureIndex\n collisionIndex.insertCollisionBox(box, id);\n return true;\n } else {\n return false;\n }\n });\n filterData.forEach((item) => {\n // @ts-ignore\n this.glyphInfoMap[item.id as number] = item;\n });\n // this.layer.setEncodedData(filterData);\n }\n /**\n * 初始化文字布局\n */\n private initGlyph() {\n const { iconfont = false } = this.layer.getLayerConfig();\n // 1.生成文字纹理(或是生成 iconfont)\n iconfont ? this.initIconFontTex() : this.initTextFont();\n // this.initTextFont();\n\n // 2.生成文字布局\n this.generateGlyphLayout(iconfont);\n }\n /**\n * 更新文字纹理\n */\n private updateTexture() {\n const { createTexture2D } = this.rendererService;\n const { canvas } = this.fontService;\n this.textureHeight = canvas.height;\n if (this.texture) {\n this.texture.destroy();\n }\n\n this.texture = createTexture2D({\n data: canvas,\n mag: gl.LINEAR,\n min: gl.LINEAR,\n width: canvas.width,\n height: canvas.height,\n });\n }\n\n private reBuildModel() {\n this.filterGlyphs();\n this.layer.models = [\n this.layer.buildLayerModel({\n moduleName: 'pointText',\n vertexShader: textVert,\n fragmentShader: textFrag,\n triangulation: TextTriangulation.bind(this),\n depth: { enable: false },\n blend: this.getBlend(),\n }),\n ];\n }\n}\n"],"file":"text.js"}
|
|
1
|
+
{"version":3,"sources":["../../../src/point/models/text.ts"],"names":["AttributeType","gl","boundsContains","getMask","padBounds","BaseModel","CollisionIndex","calculateCentroid","getGlyphQuads","shapeText","TextTriangulation","feature","that","id","vertices","indices","glyphInfoMap","size","centroid","coord","length","glyphQuads","forEach","quad","index","push","tex","x","y","height","tl","width","tr","br","bl","TextModel","layer","getLayerConfig","mask","maskInside","initGlyph","updateTexture","filterGlyphs","reBuildModel","buildLayerModel","moduleName","vertexShader","textVert","fragmentShader","textFrag","triangulation","bind","depth","enable","blend","getBlend","stencil","opacity","stroke","strokeWidth","textAnchor","textAllowOverlap","halo","gamma","fontService","canvas","mapping","Object","keys","textCount","preTextStyle","dataTextureTest","dataTextureNeedUpdate","judgeStyleAttributes","encodeData","getEncodedData","calDataFrame","cellLength","cellProperties","data","rowCount","dataTexture","createTexture2D","flipY","format","LUMINANCE","type","FLOAT","u_dataTexture","u_cellTypeLayout","getCellTypeLayout","u_opacity","u_stroke_width","u_stroke_color","getStrokeColor","u_sdf_map","texture","u_halo_blur","u_gamma_scale","u_sdf_map_size","on","buildModels","extent","textExtent","zoom","mapService","getZoom","getBounds","flag","Math","abs","currentZoom","destroy","off","styleAttributeService","registerStyleAttribute","name","Attribute","descriptor","buffer","usage","DYNAMIC_DRAW","update","featureIdx","vertex","attributeIdx","rotate","Array","isArray","STATIC_DRAW","bounds","fontWeight","fontFamily","characterSet","item","shape","toString","char","indexOf","setFontOptions","iconfont","spacing","glyphInfo","map","textOffset","shaping","coordinates","originCentroid","version","originCoordinates","padding","rendererService","getViewportSize","collisionIndex","filterData","filter","fontScale","pixels","lngLatToContainer","placeCollisionBox","x1","left","x2","right","y1","top","y2","bottom","anchorPointX","anchorPointY","box","insertCollisionBox","initIconFontTex","initTextFont","generateGlyphLayout","textureHeight","mag","LINEAR","min","models"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,SACEA,aADF,EAEEC,EAFF,QAOO,eAPP;AAQA,SAASC,cAAT,EAAyBC,OAAzB,EAAkCC,SAAlC,QAAmD,gBAAnD;AAEA,OAAOC,SAAP,MAAsB,sBAAtB;AAEA,OAAOC,cAAP,MAA2B,6BAA3B;AACA,SAASC,iBAAT,QAAkC,iBAAlC;AACA,SACEC,aADF,EAGEC,SAHF,QAIO,2BAJP;;;AAQA,OAAO,SAASC,iBAAT,CAA2BC,OAA3B,EAAoD;AAEzD,MAAMC,IAAI,GAAG,IAAb;AACA,MAAMC,EAAE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,CAAagB,OAAb;AACD;;AAED,WAAKhB,OAAL,GAAed,eAAe,CAAC;AAC7BH,QAAAA,IAAI,EAAEd,MADuB;AAE7B+G,QAAAA,GAAG,EAAE/K,EAAE,CAACgL,MAFqB;AAG7BC,QAAAA,GAAG,EAAEjL,EAAE,CAACgL,MAHqB;AAI7BlJ,QAAAA,KAAK,EAAEkC,MAAM,CAAClC,KAJe;AAK7BF,QAAAA,MAAM,EAAEoC,MAAM,CAACpC;AALc,OAAD,CAA9B;AAOD;;;WAED,wBAAuB;AACrB,kBAGI,KAAKO,KAAL,CAAWC,cAAX,EAHJ;AAAA,6BACEC,IADF;AAAA,UACEA,IADF,2BACS,KADT;AAAA,mCAEEC,UAFF;AAAA,UAEEA,UAFF,iCAEe,IAFf;;AAIA,WAAKG,YAAL;AACA,WAAKN,KAAL,CAAW+I,MAAX,GAAoB,CAClB,KAAK/I,KAAL,CAAWQ,eAAX,CAA2B;AACzBC,QAAAA,UAAU,EAAE,WADa;AAEzBC,QAAAA,YAAY,EAAEC,QAFW;AAGzBC,QAAAA,cAAc,EAAEC,QAHS;AAIzBC,QAAAA,aAAa,EAAExC,iBAAiB,CAACyC,IAAlB,CAAuB,IAAvB,CAJU;AAKzBC,QAAAA,KAAK,EAAE;AAAEC,UAAAA,MAAM,EAAE;AAAV,SALkB;AAMzBC,QAAAA,KAAK,EAAE,KAAKC,QAAL,EANkB;AAOzBC,QAAAA,OAAO,EAAErD,OAAO,CAACmC,IAAD,EAAOC,UAAP;AAPS,OAA3B,CADkB,CAApB;AAWD;;;;EAjcoClC,S;;SAAlB8B,S","sourcesContent":["import {\n AttributeType,\n gl,\n IEncodeFeature,\n IModel,\n IModelUniform,\n ITexture2D,\n} from '@antv/l7-core';\nimport { boundsContains, getMask, padBounds } from '@antv/l7-utils';\nimport { isNumber } from 'lodash';\nimport BaseModel from '../../core/BaseModel';\nimport { IPointLayerStyleOptions } from '../../core/interface';\nimport CollisionIndex from '../../utils/collision-index';\nimport { calculateCentroid } from '../../utils/geo';\nimport {\n getGlyphQuads,\n IGlyphQuad,\n shapeText,\n} from '../../utils/symbol-layout';\nimport textFrag from '../shaders/text_frag.glsl';\nimport textVert from '../shaders/text_vert.glsl';\n\nexport function TextTriangulation(feature: IEncodeFeature) {\n // @ts-ignore\n const that = this as TextModel;\n const id = feature.id as number;\n const vertices: number[] = [];\n const indices: number[] = [];\n\n if (!that.glyphInfoMap || !that.glyphInfoMap[id]) {\n return {\n vertices: [], // [ x, y, z, tex.x,tex.y, offset.x. offset.y]\n indices: [],\n size: 7,\n };\n }\n const centroid = that.glyphInfoMap[id].centroid as number[]; // 计算中心点\n const coord =\n centroid.length === 2 ? [centroid[0], centroid[1], 0] : centroid;\n that.glyphInfoMap[id].glyphQuads.forEach(\n (quad: IGlyphQuad, index: number) => {\n vertices.push(\n ...coord,\n quad.tex.x,\n quad.tex.y + quad.tex.height,\n quad.tl.x,\n quad.tl.y,\n ...coord,\n quad.tex.x + quad.tex.width,\n quad.tex.y + quad.tex.height,\n quad.tr.x,\n quad.tr.y,\n ...coord,\n quad.tex.x + quad.tex.width,\n quad.tex.y,\n quad.br.x,\n quad.br.y,\n ...coord,\n quad.tex.x,\n quad.tex.y,\n quad.bl.x,\n quad.bl.y,\n );\n indices.push(\n 0 + index * 4,\n 1 + index * 4,\n 2 + index * 4,\n 2 + index * 4,\n 3 + index * 4,\n 0 + index * 4,\n );\n },\n );\n return {\n vertices, // [ x, y, z, tex.x,tex.y, offset.x. offset.y]\n indices,\n size: 7,\n };\n}\n\nexport default class TextModel extends BaseModel {\n public glyphInfo: IEncodeFeature[];\n public glyphInfoMap: {\n [key: string]: {\n shaping: any;\n glyphQuads: IGlyphQuad[];\n centroid: number[];\n };\n } = {};\n private texture: ITexture2D;\n private currentZoom: number = -1;\n private extent: [[number, number], [number, number]];\n private textureHeight: number = 0;\n private textCount: number = 0;\n private preTextStyle: Partial<IPointLayerStyleOptions> = {};\n public getUninforms(): IModelUniform {\n const {\n opacity = 1.0,\n stroke = '#fff',\n strokeWidth = 0,\n textAnchor = 'center',\n textAllowOverlap = false,\n halo = 0.5,\n gamma = 2.0,\n } = this.layer.getLayerConfig() as IPointLayerStyleOptions;\n const { canvas, mapping } = this.fontService;\n if (Object.keys(mapping).length !== this.textCount) {\n this.updateTexture();\n this.textCount = Object.keys(mapping).length;\n }\n this.preTextStyle = {\n textAnchor,\n textAllowOverlap,\n };\n\n if (\n this.dataTextureTest &&\n this.dataTextureNeedUpdate({\n opacity,\n strokeWidth,\n stroke,\n })\n ) {\n this.judgeStyleAttributes({\n opacity,\n strokeWidth,\n stroke,\n });\n\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\n u_opacity: isNumber(opacity) ? opacity : 1.0,\n u_stroke_width: isNumber(strokeWidth) ? strokeWidth : 0.0,\n u_stroke_color: this.getStrokeColor(stroke),\n\n u_sdf_map: this.texture,\n u_halo_blur: halo,\n u_gamma_scale: gamma,\n u_sdf_map_size: [canvas.width, canvas.height],\n };\n }\n\n public initModels(): IModel[] {\n this.layer.on('remapping', this.buildModels);\n this.extent = this.textExtent();\n const {\n textAnchor = 'center',\n textAllowOverlap = true,\n } = this.layer.getLayerConfig() as IPointLayerStyleOptions;\n this.preTextStyle = {\n textAnchor,\n textAllowOverlap,\n };\n return this.buildModels();\n }\n\n public buildModels = () => {\n const {\n mask = false,\n maskInside = true,\n } = this.layer.getLayerConfig() as IPointLayerStyleOptions;\n this.initGlyph();\n this.updateTexture();\n this.filterGlyphs();\n this.reBuildModel();\n return [\n this.layer.buildLayerModel({\n moduleName: 'pointText',\n vertexShader: textVert,\n fragmentShader: textFrag,\n triangulation: TextTriangulation.bind(this),\n depth: { enable: false },\n blend: this.getBlend(),\n stencil: getMask(mask, maskInside),\n }),\n ];\n };\n public needUpdate() {\n const {\n textAllowOverlap = false,\n } = this.layer.getLayerConfig() as IPointLayerStyleOptions;\n // textAllowOverlap 发生改变\n const zoom = this.mapService.getZoom();\n const extent = this.mapService.getBounds();\n const flag = boundsContains(this.extent, extent);\n // 文本不能压盖则进行过滤\n if (\n (!textAllowOverlap && (Math.abs(this.currentZoom - zoom) > 1 || !flag)) ||\n textAllowOverlap !== this.preTextStyle.textAllowOverlap\n ) {\n this.reBuildModel();\n return true;\n }\n return false;\n }\n\n public clearModels() {\n this.dataTexture?.destroy();\n this.layer.off('remapping', this.buildModels);\n }\n protected registerBuiltinAttributes() {\n this.styleAttributeService.registerStyleAttribute({\n name: 'rotate',\n type: AttributeType.Attribute,\n descriptor: {\n name: 'a_Rotate',\n buffer: {\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 { rotate = 0 } = feature;\n return Array.isArray(rotate) ? [rotate[0]] : [rotate as number];\n },\n },\n });\n this.styleAttributeService.registerStyleAttribute({\n name: 'textOffsets',\n type: AttributeType.Attribute,\n descriptor: {\n name: 'a_textOffsets',\n buffer: {\n // give the WebGL driver a hint that this buffer may change\n usage: gl.STATIC_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 return [vertex[5], vertex[6]];\n },\n },\n });\n\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 = 12 } = feature;\n return Array.isArray(size) ? [size[0]] : [size as number];\n },\n },\n });\n\n // point layer size;\n this.styleAttributeService.registerStyleAttribute({\n name: 'textUv',\n type: AttributeType.Attribute,\n descriptor: {\n name: 'a_tex',\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 return [vertex[3], vertex[4]];\n },\n },\n });\n }\n private textExtent(): [[number, number], [number, number]] {\n const bounds = this.mapService.getBounds();\n return padBounds(bounds, 0.5);\n }\n /**\n * 生成文字纹理(生成文字纹理字典)\n */\n private initTextFont() {\n const {\n fontWeight = '400',\n fontFamily = 'sans-serif',\n } = this.layer.getLayerConfig() as IPointLayerStyleOptions;\n const data = this.layer.getEncodedData();\n const characterSet: string[] = [];\n data.forEach((item: IEncodeFeature) => {\n let { shape = '' } = item;\n shape = shape.toString();\n for (const char of shape) {\n // 去重\n if (characterSet.indexOf(char) === -1) {\n characterSet.push(char);\n }\n }\n });\n this.fontService.setFontOptions({\n characterSet,\n fontWeight,\n fontFamily,\n iconfont: false,\n });\n }\n\n /**\n * 生成 iconfont 纹理字典\n */\n private initIconFontTex() {\n const {\n fontWeight = '400',\n fontFamily = 'sans-serif',\n } = this.layer.getLayerConfig() as IPointLayerStyleOptions;\n const data = this.layer.getEncodedData();\n const characterSet: string[] = [];\n data.forEach((item: IEncodeFeature) => {\n let { shape = '' } = item;\n shape = `${shape}`;\n if (characterSet.indexOf(shape) === -1) {\n characterSet.push(shape);\n }\n });\n this.fontService.setFontOptions({\n characterSet,\n fontWeight,\n fontFamily,\n iconfont: true,\n });\n }\n\n /**\n * 生成文字布局(对照文字纹理字典提取对应文字的位置很好信息)\n */\n private generateGlyphLayout(iconfont: boolean) {\n // TODO:更新文字布局\n const { mapping } = this.fontService;\n const {\n spacing = 2,\n textAnchor = 'center',\n // textOffset,\n } = this.layer.getLayerConfig() as IPointLayerStyleOptions;\n const data = this.layer.getEncodedData();\n\n this.glyphInfo = data.map((feature: IEncodeFeature) => {\n const { shape = '', id, size = 1, textOffset = [0, 0] } = feature;\n\n const shaping = shapeText(\n shape.toString(),\n mapping,\n // @ts-ignore\n size,\n textAnchor,\n 'left',\n spacing,\n textOffset,\n iconfont,\n );\n const glyphQuads = getGlyphQuads(shaping, textOffset, false);\n feature.shaping = shaping;\n feature.glyphQuads = glyphQuads;\n // feature.centroid = calculteCentroid(coordinates);\n\n feature.centroid = calculateCentroid(feature.coordinates);\n\n // 此时地图高德2.0 originCentroid == centroid\n feature.originCentroid =\n feature.version === 'GAODE2.x'\n ? calculateCentroid(feature.originCoordinates)\n : (feature.originCentroid = feature.centroid);\n\n this.glyphInfoMap[id as number] = {\n shaping,\n glyphQuads,\n centroid: calculateCentroid(feature.coordinates),\n };\n return feature;\n });\n }\n /**\n * 文字避让 depend on originCentorid\n */\n private filterGlyphs() {\n const {\n padding = [4, 4],\n textAllowOverlap = false,\n } = this.layer.getLayerConfig() as IPointLayerStyleOptions;\n if (textAllowOverlap) {\n // 如果允许文本覆盖\n // this.layer.setEncodedData(this.glyphInfo);\n return;\n }\n this.glyphInfoMap = {};\n this.currentZoom = this.mapService.getZoom();\n this.extent = this.textExtent();\n const { width, height } = this.rendererService.getViewportSize();\n const collisionIndex = new CollisionIndex(width, height);\n const filterData = this.glyphInfo.filter((feature: IEncodeFeature) => {\n const { shaping, id = 0 } = feature;\n // const centroid = feature.centroid as [number, number];\n // const centroid = feature.originCentroid as [number, number];\n const centroid = (feature.version === 'GAODE2.x'\n ? feature.originCentroid\n : feature.centroid) as [number, number];\n const size = feature.size as number;\n const fontScale: number = size / 24;\n const pixels = this.mapService.lngLatToContainer(centroid);\n const { box } = collisionIndex.placeCollisionBox({\n x1: shaping.left * fontScale - padding[0],\n x2: shaping.right * fontScale + padding[0],\n y1: shaping.top * fontScale - padding[1],\n y2: shaping.bottom * fontScale + padding[1],\n anchorPointX: pixels.x,\n anchorPointY: pixels.y,\n });\n if (box && box.length) {\n // TODO:featureIndex\n collisionIndex.insertCollisionBox(box, id);\n return true;\n } else {\n return false;\n }\n });\n filterData.forEach((item) => {\n // @ts-ignore\n this.glyphInfoMap[item.id as number] = item;\n });\n // this.layer.setEncodedData(filterData);\n }\n /**\n * 初始化文字布局\n */\n private initGlyph() {\n const { iconfont = false } = this.layer.getLayerConfig();\n // 1.生成文字纹理(或是生成 iconfont)\n iconfont ? this.initIconFontTex() : this.initTextFont();\n // this.initTextFont();\n\n // 2.生成文字布局\n this.generateGlyphLayout(iconfont);\n }\n /**\n * 更新文字纹理\n */\n private updateTexture() {\n const { createTexture2D } = this.rendererService;\n const { canvas } = this.fontService;\n this.textureHeight = canvas.height;\n if (this.texture) {\n this.texture.destroy();\n }\n\n this.texture = createTexture2D({\n data: canvas,\n mag: gl.LINEAR,\n min: gl.LINEAR,\n width: canvas.width,\n height: canvas.height,\n });\n }\n\n private reBuildModel() {\n const {\n mask = false,\n maskInside = true,\n } = this.layer.getLayerConfig() as IPointLayerStyleOptions;\n this.filterGlyphs();\n this.layer.models = [\n this.layer.buildLayerModel({\n moduleName: 'pointText',\n vertexShader: textVert,\n fragmentShader: textFrag,\n triangulation: TextTriangulation.bind(this),\n depth: { enable: false },\n blend: this.getBlend(),\n stencil: getMask(mask, maskInside),\n }),\n ];\n }\n}\n"],"file":"text.js"}
|
package/es/polygon/index.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import BaseLayer from '../core/BaseLayer';
|
|
2
|
+
import { IPolygonLayerStyleOptions } from '../core/interface';
|
|
2
3
|
import { PolygonModelType } from './models/';
|
|
3
|
-
interface IPolygonLayerStyleOptions {
|
|
4
|
-
opacity: number;
|
|
5
|
-
}
|
|
6
4
|
export default class PolygonLayer extends BaseLayer<IPolygonLayerStyleOptions> {
|
|
7
5
|
type: string;
|
|
8
6
|
buildModels(): void;
|
|
@@ -19,4 +17,3 @@ export default class PolygonLayer extends BaseLayer<IPolygonLayerStyleOptions> {
|
|
|
19
17
|
protected getModelType(): PolygonModelType;
|
|
20
18
|
protected getPointModelType(): PolygonModelType;
|
|
21
19
|
}
|
|
22
|
-
export {};
|
package/es/polygon/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/polygon/index.ts"],"names":["BaseLayer","PolygonModels","PolygonLayer","shape","getModelType","layerModel","models","initModels","buildModels","properties","opacity","type","minimum","maximum","shapeAttribute","styleAttributeService","getLayerStyleAttribute","scale","field","getPointModelType","layerData","getEncodedData","getLayerConfig","shape2d","shape3d","iconMap","iconService","getIconMap","item","find","fe","hasOwnProperty","indexOf"],"mappings":";;;;;;;;;;;;AACA,OAAOA,SAAP,MAAsB,mBAAtB;AAEA,OAAOC,aAAP,MAAgD,WAAhD;;
|
|
1
|
+
{"version":3,"sources":["../../src/polygon/index.ts"],"names":["BaseLayer","PolygonModels","PolygonLayer","shape","getModelType","layerModel","models","initModels","buildModels","properties","opacity","type","minimum","maximum","shapeAttribute","styleAttributeService","getLayerStyleAttribute","scale","field","getPointModelType","layerData","getEncodedData","getLayerConfig","shape2d","shape3d","iconMap","iconService","getIconMap","item","find","fe","hasOwnProperty","indexOf"],"mappings":";;;;;;;;;;;;AACA,OAAOA,SAAP,MAAsB,mBAAtB;AAEA,OAAOC,aAAP,MAAgD,WAAhD;;IAEqBC,Y;;;;;;;;;;;;;;;;2DACG,c;;;;;;;WACtB,uBAAqB;AACnB,UAAMC,KAAK,GAAG,KAAKC,YAAL,EAAd;AACA,WAAKC,UAAL,GAAkB,IAAIJ,aAA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ACT,eAAO,MAAP;AACD,OAFD,MAEO;AACL,YAAMzB,KAAK,GAAGyB,IAAI,CAACzB,KAAnB;;AACA,YAAIA,KAAK,KAAK,KAAd,EAAqB;AACnB,iBAAO,cAAP;AACD;;AACD,YAAI,CAAAoB,OAAO,SAAP,IAAAA,OAAO,WAAP,YAAAA,OAAO,CAAES,OAAT,CAAiB7B,KAAjB,OAAsC,CAAC,CAA3C,EAA8C;AAC5C,iBAAO,YAAP;AACD;;AACD,YAAI,CAAAqB,OAAO,SAAP,IAAAA,OAAO,WAAP,YAAAA,OAAO,CAAEQ,OAAT,CAAiB7B,KAAjB,OAAsC,CAAC,CAA3C,EAA8C;AAC5C,iBAAO,eAAP;AACD;;AACD,YAAIsB,OAAO,CAACM,cAAR,CAAuB5B,KAAvB,CAAJ,EAA6C;AAC3C,iBAAO,aAAP;AACD;;AACD,eAAO,MAAP;AACD;AACF;;;;EAhEuCH,S;;SAArBE,Y","sourcesContent":["import { IEncodeFeature } from '@antv/l7-core';\nimport BaseLayer from '../core/BaseLayer';\nimport { IPolygonLayerStyleOptions } from '../core/interface';\nimport PolygonModels, { PolygonModelType } from './models/';\n\nexport default class PolygonLayer extends BaseLayer<IPolygonLayerStyleOptions> {\n public type: string = 'PolygonLayer';\n public buildModels() {\n const shape = this.getModelType();\n this.layerModel = new PolygonModels[shape](this);\n this.models = this.layerModel.initModels();\n }\n public rebuildModels() {\n this.models = this.layerModel.buildModels();\n }\n protected getConfigSchema() {\n return {\n properties: {\n opacity: {\n type: 'number',\n minimum: 0,\n maximum: 1,\n },\n },\n };\n }\n\n protected getModelType(): PolygonModelType {\n const shapeAttribute = this.styleAttributeService.getLayerStyleAttribute(\n 'shape',\n );\n const shape = shapeAttribute?.scale?.field as PolygonModelType;\n if (shape === 'fill') {\n return 'fill';\n } else if (shape === 'extrude') {\n return 'extrude';\n } else if (shape === 'line') {\n return 'line';\n } else {\n return this.getPointModelType();\n }\n }\n protected getPointModelType(): PolygonModelType {\n // pointlayer\n // 2D、 3d、 shape、image、text、normal、\n const layerData = this.getEncodedData();\n const { shape2d, shape3d } = this.getLayerConfig();\n const iconMap = this.iconService.getIconMap();\n const item = layerData.find((fe: IEncodeFeature) => {\n return fe.hasOwnProperty('shape');\n });\n if (!item) {\n return 'fill';\n } else {\n const shape = item.shape;\n if (shape === 'dot') {\n return 'point_normal';\n }\n if (shape2d?.indexOf(shape as string) !== -1) {\n return 'point_fill';\n }\n if (shape3d?.indexOf(shape as string) !== -1) {\n return 'point_extrude';\n }\n if (iconMap.hasOwnProperty(shape as string)) {\n return 'point_image';\n }\n return 'text';\n }\n }\n}\n"],"file":"index.js"}
|