@antv/l7-layers 2.21.9 → 2.21.11-beta.0
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/citybuliding/models/build.d.ts +16 -0
- package/es/citybuliding/models/build.js +18 -20
- package/es/citybuliding/shaders/build_frag.glsl +6 -6
- package/es/citybuliding/shaders/build_vert.glsl +8 -14
- package/es/core/BaseLayer.d.ts +0 -1
- package/es/core/BaseLayer.js +9 -19
- package/es/core/BaseModel.d.ts +15 -2
- package/es/core/BaseModel.js +98 -64
- package/es/core/CommonStyleAttribute.d.ts +14 -18
- package/es/core/CommonStyleAttribute.js +23 -67
- package/es/core/shape/extrude.js +6 -3
- package/es/core/triangulation.js +22 -50
- package/es/core/utils.d.ts +4 -0
- package/es/core/utils.js +33 -0
- package/es/earth/models/atmosphere.d.ts +15 -0
- package/es/earth/models/atmosphere.js +30 -24
- package/es/earth/models/base.d.ts +15 -0
- package/es/earth/models/base.js +30 -24
- package/es/earth/models/bloomsphere.d.ts +15 -0
- package/es/earth/models/bloomsphere.js +30 -24
- package/es/earth/shaders/atmosphere/atmosphere_vert.glsl +7 -5
- package/es/earth/shaders/base/base_vert.glsl +3 -3
- package/es/earth/shaders/bloomshpere/bloomsphere_vert.glsl +5 -4
- package/es/geometry/models/billboard.d.ts +15 -0
- package/es/geometry/models/billboard.js +14 -8
- package/es/geometry/models/plane.d.ts +14 -0
- package/es/geometry/models/plane.js +10 -10
- package/es/geometry/models/sprite.js +3 -9
- package/es/geometry/shaders/billboard_vert.glsl +28 -25
- package/es/geometry/shaders/plane_vert.glsl +6 -6
- package/es/geometry/shaders/sprite_vert.glsl +7 -9
- package/es/heatmap/models/grid.d.ts +14 -0
- package/es/heatmap/models/grid.js +10 -3
- package/es/heatmap/models/grid3d.d.ts +16 -0
- package/es/heatmap/models/grid3d.js +14 -6
- package/es/heatmap/models/heatmap.d.ts +20 -1
- package/es/heatmap/models/heatmap.js +96 -83
- package/es/heatmap/models/hexagon.d.ts +14 -0
- package/es/heatmap/models/hexagon.js +9 -3
- package/es/heatmap/shaders/grid/grid_vert.glsl +30 -42
- package/es/heatmap/shaders/grid3d/grid_3d_vert.glsl +14 -26
- package/es/heatmap/shaders/heatmap/heatmap_3d_vert.glsl +19 -16
- package/es/heatmap/shaders/heatmap/heatmap_framebuffer_vert.glsl +16 -22
- package/es/heatmap/shaders/heatmap/heatmap_vert.glsl +3 -4
- package/es/heatmap/shaders/hexagon/hexagon_vert.glsl +13 -23
- package/es/image/models/image.d.ts +14 -0
- package/es/image/models/image.js +11 -7
- package/es/image/shaders/image_vert.glsl +7 -6
- package/es/line/models/arc.d.ts +18 -0
- package/es/line/models/arc.js +57 -8
- package/es/line/models/arc_3d.d.ts +18 -0
- package/es/line/models/arc_3d.js +55 -7
- package/es/line/models/flow.d.ts +17 -0
- package/es/line/models/flow.js +35 -7
- package/es/line/models/great_circle.d.ts +17 -0
- package/es/line/models/great_circle.js +34 -6
- package/es/line/models/line.d.ts +17 -0
- package/es/line/models/line.js +17 -8
- package/es/line/models/simple_line.d.ts +14 -0
- package/es/line/models/simple_line.js +12 -47
- package/es/line/models/wall.d.ts +17 -0
- package/es/line/models/wall.js +22 -48
- package/es/line/shaders/arc/line_arc_vert.glsl +44 -52
- package/es/line/shaders/arc3d/line_arc_3d_vert.glsl +15 -20
- package/es/line/shaders/flow/flow_line_vert.glsl +30 -48
- package/es/line/shaders/greatCircle/line_arc_great_circle_vert.glsl +53 -74
- package/es/line/shaders/line/line_vert.glsl +31 -48
- package/es/line/shaders/simple/simpleline_vert.glsl +18 -23
- package/es/line/shaders/wall/wall_vert.glsl +36 -45
- package/es/mask/models/fill.js +2 -1
- package/es/mask/shaders/mask_vert.glsl +2 -7
- package/es/plugins/DataMappingPlugin.d.ts +0 -1
- package/es/plugins/DataMappingPlugin.js +1 -24
- package/es/plugins/PixelPickingPlugin.js +2 -2
- package/es/plugins/RegisterStyleAttributePlugin.d.ts +0 -1
- package/es/plugins/RegisterStyleAttributePlugin.js +3 -25
- package/es/plugins/ShaderUniformPlugin.d.ts +0 -5
- package/es/plugins/ShaderUniformPlugin.js +4 -35
- package/es/point/models/billboard_point.d.ts +14 -0
- package/es/point/models/billboard_point.js +11 -3
- package/es/point/models/earthExtrude.d.ts +16 -0
- package/es/point/models/earthExtrude.js +15 -8
- package/es/point/models/earthFill.d.ts +16 -0
- package/es/point/models/earthFill.js +13 -5
- package/es/point/models/extrude.d.ts +16 -0
- package/es/point/models/extrude.js +19 -12
- package/es/point/models/fill.d.ts +16 -0
- package/es/point/models/fill.js +16 -5
- package/es/point/models/fillImage.d.ts +16 -0
- package/es/point/models/fillImage.js +16 -16
- package/es/point/models/image.d.ts +15 -0
- package/es/point/models/image.js +14 -4
- package/es/point/models/normal.d.ts +14 -0
- package/es/point/models/normal.js +11 -3
- package/es/point/models/radar.d.ts +15 -0
- package/es/point/models/radar.js +13 -4
- package/es/point/models/text.d.ts +16 -0
- package/es/point/models/text.js +18 -11
- package/es/point/shaders/billboard/billboard_point_vert.glsl +10 -13
- package/es/point/shaders/earthExtrude/earthExtrude_vert.glsl +15 -25
- package/es/point/shaders/earthFill/earthFill_vert.glsl +6 -6
- package/es/point/shaders/extrude/extrude_vert.glsl +35 -39
- package/es/point/shaders/fill/fill_vert.glsl +12 -14
- package/es/point/shaders/fillImage/fillImage_vert.glsl +16 -28
- package/es/point/shaders/image/image_vert.glsl +15 -12
- package/es/point/shaders/normal/normal_vert.glsl +7 -10
- package/es/point/shaders/radar/radar_vert.glsl +11 -11
- package/es/point/shaders/text/text_vert.glsl +10 -9
- package/es/polygon/models/extrude.d.ts +16 -0
- package/es/polygon/models/extrude.js +26 -26
- package/es/polygon/models/extrusion.d.ts +16 -0
- package/es/polygon/models/extrusion.js +34 -4
- package/es/polygon/models/fill.d.ts +14 -0
- package/es/polygon/models/fill.js +12 -4
- package/es/polygon/models/ocean.d.ts +14 -0
- package/es/polygon/models/ocean.js +11 -6
- package/es/polygon/models/water.d.ts +14 -0
- package/es/polygon/models/water.js +11 -6
- package/es/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +17 -15
- package/es/polygon/shaders/extrude/polygon_extrude_vert.glsl +22 -20
- package/es/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +17 -17
- package/es/polygon/shaders/extrusion/polygon_extrusion_vert.glsl +8 -8
- package/es/polygon/shaders/fill/fill_linear_vert.glsl +7 -6
- package/es/polygon/shaders/fill/fill_vert.glsl +10 -12
- package/es/polygon/shaders/ocean/ocean_vert.glsl +3 -4
- package/es/polygon/shaders/water/polygon_water_vert.glsl +5 -5
- package/es/raster/index.d.ts +1 -1
- package/es/raster/index.js +1 -1
- package/es/raster/models/raster.d.ts +14 -0
- package/es/raster/models/raster.js +13 -3
- package/es/raster/models/rasterRgb.d.ts +14 -0
- package/es/raster/models/rasterRgb.js +12 -3
- package/es/raster/models/rasterTerrainRgb.d.ts +14 -0
- package/es/raster/models/rasterTerrainRgb.js +11 -3
- package/es/raster/shaders/raster/raster_2d_vert.glsl +6 -6
- package/es/raster/shaders/rgb/raster_rgb_vert.glsl +11 -11
- package/es/raster/shaders/terrain/terrain_rgb_vert.glsl +11 -11
- package/es/tile/core/BaseLayer.js +0 -16
- package/es/utils/extrude_polyline.d.ts +0 -15
- package/es/utils/extrude_polyline.js +0 -217
- package/es/wind/models/wind.d.ts +14 -0
- package/es/wind/models/wind.js +9 -1
- package/es/wind/shaders/wind_vert.glsl +6 -5
- package/lib/citybuliding/models/build.d.ts +16 -0
- package/lib/citybuliding/models/build.js +18 -20
- package/lib/citybuliding/shaders/build_frag.glsl +6 -6
- package/lib/citybuliding/shaders/build_vert.glsl +8 -14
- package/lib/core/BaseLayer.d.ts +0 -1
- package/lib/core/BaseLayer.js +9 -19
- package/lib/core/BaseModel.d.ts +15 -2
- package/lib/core/BaseModel.js +96 -62
- package/lib/core/CommonStyleAttribute.d.ts +14 -18
- package/lib/core/CommonStyleAttribute.js +23 -68
- package/lib/core/shape/extrude.js +6 -3
- package/lib/core/triangulation.js +22 -50
- package/lib/core/utils.d.ts +4 -0
- package/lib/core/utils.js +35 -0
- package/lib/earth/models/atmosphere.d.ts +15 -0
- package/lib/earth/models/atmosphere.js +30 -24
- package/lib/earth/models/base.d.ts +15 -0
- package/lib/earth/models/base.js +30 -24
- package/lib/earth/models/bloomsphere.d.ts +15 -0
- package/lib/earth/models/bloomsphere.js +30 -24
- package/lib/earth/shaders/atmosphere/atmosphere_vert.glsl +7 -5
- package/lib/earth/shaders/base/base_vert.glsl +3 -3
- package/lib/earth/shaders/bloomshpere/bloomsphere_vert.glsl +5 -4
- package/lib/geometry/models/billboard.d.ts +15 -0
- package/lib/geometry/models/billboard.js +14 -8
- package/lib/geometry/models/plane.d.ts +14 -0
- package/lib/geometry/models/plane.js +10 -10
- package/lib/geometry/models/sprite.js +3 -9
- package/lib/geometry/shaders/billboard_vert.glsl +28 -25
- package/lib/geometry/shaders/plane_vert.glsl +6 -6
- package/lib/geometry/shaders/sprite_vert.glsl +7 -9
- package/lib/heatmap/models/grid.d.ts +14 -0
- package/lib/heatmap/models/grid.js +10 -3
- package/lib/heatmap/models/grid3d.d.ts +16 -0
- package/lib/heatmap/models/grid3d.js +14 -6
- package/lib/heatmap/models/heatmap.d.ts +20 -1
- package/lib/heatmap/models/heatmap.js +95 -82
- package/lib/heatmap/models/hexagon.d.ts +14 -0
- package/lib/heatmap/models/hexagon.js +9 -3
- package/lib/heatmap/shaders/grid/grid_vert.glsl +30 -42
- package/lib/heatmap/shaders/grid3d/grid_3d_vert.glsl +14 -26
- package/lib/heatmap/shaders/heatmap/heatmap_3d_vert.glsl +19 -16
- package/lib/heatmap/shaders/heatmap/heatmap_framebuffer_vert.glsl +16 -22
- package/lib/heatmap/shaders/heatmap/heatmap_vert.glsl +3 -4
- package/lib/heatmap/shaders/hexagon/hexagon_vert.glsl +13 -23
- package/lib/image/models/image.d.ts +14 -0
- package/lib/image/models/image.js +11 -7
- package/lib/image/shaders/image_vert.glsl +7 -6
- package/lib/line/models/arc.d.ts +18 -0
- package/lib/line/models/arc.js +56 -7
- package/lib/line/models/arc_3d.d.ts +18 -0
- package/lib/line/models/arc_3d.js +55 -7
- package/lib/line/models/flow.d.ts +17 -0
- package/lib/line/models/flow.js +35 -7
- package/lib/line/models/great_circle.d.ts +17 -0
- package/lib/line/models/great_circle.js +33 -5
- package/lib/line/models/line.d.ts +17 -0
- package/lib/line/models/line.js +17 -8
- package/lib/line/models/simple_line.d.ts +14 -0
- package/lib/line/models/simple_line.js +12 -47
- package/lib/line/models/wall.d.ts +17 -0
- package/lib/line/models/wall.js +22 -48
- package/lib/line/shaders/arc/line_arc_vert.glsl +44 -52
- package/lib/line/shaders/arc3d/line_arc_3d_vert.glsl +15 -20
- package/lib/line/shaders/flow/flow_line_vert.glsl +30 -48
- package/lib/line/shaders/greatCircle/line_arc_great_circle_vert.glsl +53 -74
- package/lib/line/shaders/line/line_vert.glsl +31 -48
- package/lib/line/shaders/simple/simpleline_vert.glsl +18 -23
- package/lib/line/shaders/wall/wall_vert.glsl +36 -45
- package/lib/mask/models/fill.js +2 -1
- package/lib/mask/shaders/mask_vert.glsl +2 -7
- package/lib/plugins/DataMappingPlugin.d.ts +0 -1
- package/lib/plugins/DataMappingPlugin.js +0 -23
- package/lib/plugins/PixelPickingPlugin.js +1 -1
- package/lib/plugins/RegisterStyleAttributePlugin.d.ts +0 -1
- package/lib/plugins/RegisterStyleAttributePlugin.js +2 -24
- package/lib/plugins/ShaderUniformPlugin.d.ts +0 -5
- package/lib/plugins/ShaderUniformPlugin.js +4 -35
- package/lib/point/models/billboard_point.d.ts +14 -0
- package/lib/point/models/billboard_point.js +11 -3
- package/lib/point/models/earthExtrude.d.ts +16 -0
- package/lib/point/models/earthExtrude.js +14 -7
- package/lib/point/models/earthFill.d.ts +16 -0
- package/lib/point/models/earthFill.js +13 -5
- package/lib/point/models/extrude.d.ts +16 -0
- package/lib/point/models/extrude.js +18 -11
- package/lib/point/models/fill.d.ts +16 -0
- package/lib/point/models/fill.js +16 -5
- package/lib/point/models/fillImage.d.ts +16 -0
- package/lib/point/models/fillImage.js +16 -16
- package/lib/point/models/image.d.ts +15 -0
- package/lib/point/models/image.js +14 -4
- package/lib/point/models/normal.d.ts +14 -0
- package/lib/point/models/normal.js +11 -3
- package/lib/point/models/radar.d.ts +15 -0
- package/lib/point/models/radar.js +13 -4
- package/lib/point/models/text.d.ts +16 -0
- package/lib/point/models/text.js +18 -11
- package/lib/point/shaders/billboard/billboard_point_vert.glsl +10 -13
- package/lib/point/shaders/earthExtrude/earthExtrude_vert.glsl +15 -25
- package/lib/point/shaders/earthFill/earthFill_vert.glsl +6 -6
- package/lib/point/shaders/extrude/extrude_vert.glsl +35 -39
- package/lib/point/shaders/fill/fill_vert.glsl +12 -14
- package/lib/point/shaders/fillImage/fillImage_vert.glsl +16 -28
- package/lib/point/shaders/image/image_vert.glsl +15 -12
- package/lib/point/shaders/normal/normal_vert.glsl +7 -10
- package/lib/point/shaders/radar/radar_vert.glsl +11 -11
- package/lib/point/shaders/text/text_vert.glsl +10 -9
- package/lib/polygon/models/extrude.d.ts +16 -0
- package/lib/polygon/models/extrude.js +25 -25
- package/lib/polygon/models/extrusion.d.ts +16 -0
- package/lib/polygon/models/extrusion.js +34 -4
- package/lib/polygon/models/fill.d.ts +14 -0
- package/lib/polygon/models/fill.js +12 -4
- package/lib/polygon/models/ocean.d.ts +14 -0
- package/lib/polygon/models/ocean.js +11 -6
- package/lib/polygon/models/water.d.ts +14 -0
- package/lib/polygon/models/water.js +11 -6
- package/lib/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +17 -15
- package/lib/polygon/shaders/extrude/polygon_extrude_vert.glsl +22 -20
- package/lib/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +17 -17
- package/lib/polygon/shaders/extrusion/polygon_extrusion_vert.glsl +8 -8
- package/lib/polygon/shaders/fill/fill_linear_vert.glsl +7 -6
- package/lib/polygon/shaders/fill/fill_vert.glsl +10 -12
- package/lib/polygon/shaders/ocean/ocean_vert.glsl +3 -4
- package/lib/polygon/shaders/water/polygon_water_vert.glsl +5 -5
- package/lib/raster/index.d.ts +1 -1
- package/lib/raster/index.js +2 -2
- package/lib/raster/models/raster.d.ts +14 -0
- package/lib/raster/models/raster.js +13 -3
- package/lib/raster/models/rasterRgb.d.ts +14 -0
- package/lib/raster/models/rasterRgb.js +12 -3
- package/lib/raster/models/rasterTerrainRgb.d.ts +14 -0
- package/lib/raster/models/rasterTerrainRgb.js +11 -3
- package/lib/raster/shaders/raster/raster_2d_vert.glsl +6 -6
- package/lib/raster/shaders/rgb/raster_rgb_vert.glsl +11 -11
- package/lib/raster/shaders/terrain/terrain_rgb_vert.glsl +11 -11
- package/lib/tile/core/BaseLayer.js +0 -16
- package/lib/utils/extrude_polyline.d.ts +0 -15
- package/lib/utils/extrude_polyline.js +0 -217
- package/lib/wind/models/wind.d.ts +14 -0
- package/lib/wind/models/wind.js +9 -1
- package/lib/wind/shaders/wind_vert.glsl +6 -5
- package/package.json +9 -9
|
@@ -102,98 +102,6 @@ class ExtrudePolyline {
|
|
|
102
102
|
complex.startIndex = complex.positions.length / 6;
|
|
103
103
|
return complex;
|
|
104
104
|
}
|
|
105
|
-
simpleExtrude_gaode2(points, originPoints) {
|
|
106
|
-
const complex = this.complex;
|
|
107
|
-
if (points.length <= 1) {
|
|
108
|
-
return complex;
|
|
109
|
-
}
|
|
110
|
-
this.lastFlip = -1;
|
|
111
|
-
this.started = false;
|
|
112
|
-
this.normal = null;
|
|
113
|
-
this.totalDistance = 0;
|
|
114
|
-
// 去除数组里重复的点
|
|
115
|
-
// points = getArrayUnique(points);
|
|
116
|
-
const total = points.length;
|
|
117
|
-
let count = complex.startIndex;
|
|
118
|
-
for (let i = 1; i < total; i++) {
|
|
119
|
-
var _originPoints$, _originPoints$i$, _originPoints$2;
|
|
120
|
-
const last = points[i - 1];
|
|
121
|
-
last.push((_originPoints$ = originPoints[i - 1][2]) !== null && _originPoints$ !== void 0 ? _originPoints$ : 0);
|
|
122
|
-
// @ts-ignore
|
|
123
|
-
const originLast = originPoints[i - 1];
|
|
124
|
-
const cur = points[i];
|
|
125
|
-
cur.push((_originPoints$i$ = originPoints[i][2]) !== null && _originPoints$i$ !== void 0 ? _originPoints$i$ : 0);
|
|
126
|
-
// @ts-ignore
|
|
127
|
-
const originCur = originPoints[i];
|
|
128
|
-
const next = i < points.length - 1 ? [...points[i + 1], (_originPoints$2 = originPoints[i + 1][2]) !== null && _originPoints$2 !== void 0 ? _originPoints$2 : 0] : null;
|
|
129
|
-
const originNext = i < originPoints.length - 1 ? originPoints[i + 1] : null;
|
|
130
|
-
const amt = this.simpleSegment(complex, count,
|
|
131
|
-
// @ts-ignore
|
|
132
|
-
last,
|
|
133
|
-
// @ts-ignore
|
|
134
|
-
cur,
|
|
135
|
-
// @ts-ignore
|
|
136
|
-
next,
|
|
137
|
-
// @ts-ignore
|
|
138
|
-
originLast, originCur,
|
|
139
|
-
// @ts-ignore
|
|
140
|
-
originNext);
|
|
141
|
-
count += amt;
|
|
142
|
-
}
|
|
143
|
-
if (this.dash) {
|
|
144
|
-
for (let i = 0; i < complex.positions.length / 6; i++) {
|
|
145
|
-
complex.positions[i * 6 + 5] = this.totalDistance;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
complex.startIndex = complex.positions.length / 6;
|
|
149
|
-
return complex;
|
|
150
|
-
}
|
|
151
|
-
extrude_gaode2(points, originPoints) {
|
|
152
|
-
const complex = this.complex;
|
|
153
|
-
if (points.length <= 1) {
|
|
154
|
-
return complex;
|
|
155
|
-
}
|
|
156
|
-
this.lastFlip = -1;
|
|
157
|
-
this.started = false;
|
|
158
|
-
this.normal = null;
|
|
159
|
-
this.totalDistance = 0;
|
|
160
|
-
// 去除数组里重复的点
|
|
161
|
-
// points = getArrayUnique(points);
|
|
162
|
-
const total = points.length;
|
|
163
|
-
let count = complex.startIndex;
|
|
164
|
-
for (let i = 1; i < total; i++) {
|
|
165
|
-
var _originPoints$3, _originPoints$i$2, _originPoints$4;
|
|
166
|
-
const last = points[i - 1];
|
|
167
|
-
last.push((_originPoints$3 = originPoints[i - 1][2]) !== null && _originPoints$3 !== void 0 ? _originPoints$3 : 0);
|
|
168
|
-
// @ts-ignore
|
|
169
|
-
const originLast = originPoints[i - 1];
|
|
170
|
-
const cur = points[i];
|
|
171
|
-
cur.push((_originPoints$i$2 = originPoints[i][2]) !== null && _originPoints$i$2 !== void 0 ? _originPoints$i$2 : 0);
|
|
172
|
-
// @ts-ignore
|
|
173
|
-
const originCur = originPoints[i];
|
|
174
|
-
const next = i < points.length - 1 ? [...points[i + 1], (_originPoints$4 = originPoints[i + 1][2]) !== null && _originPoints$4 !== void 0 ? _originPoints$4 : 0] : null;
|
|
175
|
-
const originNext = i < originPoints.length - 1 ? originPoints[i + 1] : null;
|
|
176
|
-
const amt = this.segment_gaode2(complex, count,
|
|
177
|
-
// @ts-ignore
|
|
178
|
-
last,
|
|
179
|
-
// @ts-ignore
|
|
180
|
-
cur,
|
|
181
|
-
// @ts-ignore
|
|
182
|
-
next,
|
|
183
|
-
// @ts-ignore
|
|
184
|
-
originLast, originCur,
|
|
185
|
-
// @ts-ignore
|
|
186
|
-
originNext);
|
|
187
|
-
count += amt;
|
|
188
|
-
}
|
|
189
|
-
if (this.dash) {
|
|
190
|
-
for (let i = 0; i < complex.positions.length / 6; i++) {
|
|
191
|
-
complex.positions[i * 6 + 5] = this.totalDistance;
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
complex.startIndex = complex.positions.length / 6;
|
|
195
|
-
return complex;
|
|
196
|
-
}
|
|
197
105
|
extrude(points) {
|
|
198
106
|
const complex = this.complex;
|
|
199
107
|
if (points.length <= 1) {
|
|
@@ -276,131 +184,6 @@ class ExtrudePolyline {
|
|
|
276
184
|
}
|
|
277
185
|
return count;
|
|
278
186
|
}
|
|
279
|
-
segment_gaode2(complex, index, last, cur, next, originLast, originCur,
|
|
280
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
281
|
-
originNext) {
|
|
282
|
-
let count = 0;
|
|
283
|
-
const indices = complex.indices;
|
|
284
|
-
const positions = complex.positions;
|
|
285
|
-
const normals = complex.normals;
|
|
286
|
-
const capSquare = this.cap === 'square';
|
|
287
|
-
const joinBevel = this.join === 'bevel';
|
|
288
|
-
const flatCur = (0, _l7Utils.aProjectFlat)([originCur[0], originCur[1]]);
|
|
289
|
-
const flatLast = (0, _l7Utils.aProjectFlat)([originLast[0], originLast[1]]);
|
|
290
|
-
// @ts-ignore
|
|
291
|
-
direction(lineA, cur, last);
|
|
292
|
-
let segmentDistance = 0;
|
|
293
|
-
if (this.dash) {
|
|
294
|
-
// @ts-ignore
|
|
295
|
-
segmentDistance = this.lineSegmentDistance(flatCur, flatLast);
|
|
296
|
-
this.totalDistance += segmentDistance;
|
|
297
|
-
}
|
|
298
|
-
if (!this.normal) {
|
|
299
|
-
this.normal = _glMatrix.vec2.create();
|
|
300
|
-
computeNormal(this.normal, lineA);
|
|
301
|
-
}
|
|
302
|
-
if (!this.started) {
|
|
303
|
-
this.started = true;
|
|
304
|
-
|
|
305
|
-
// if the end cap is type square, we can just push the verts out a bit
|
|
306
|
-
if (capSquare) {
|
|
307
|
-
// vec2.scaleAndAdd(capEnd, last, lineA, -this.thickness);
|
|
308
|
-
const out1 = _glMatrix.vec2.create();
|
|
309
|
-
const out2 = _glMatrix.vec2.create();
|
|
310
|
-
_glMatrix.vec2.add(out1, this.normal, lineA);
|
|
311
|
-
_glMatrix.vec2.add(out2, this.normal, lineA);
|
|
312
|
-
normals.push(out2[0], out2[1], 0);
|
|
313
|
-
normals.push(out1[0], out1[1], 0);
|
|
314
|
-
positions.push(last[0], last[1], last[2] | 0, this.totalDistance - segmentDistance, -this.thickness, last[2] | 0);
|
|
315
|
-
this.complex.indexes.push(this.currentIndex);
|
|
316
|
-
positions.push(last[0], last[1], last[2] | 0, this.totalDistance - segmentDistance, this.thickness, last[2] | 0);
|
|
317
|
-
this.complex.indexes.push(this.currentIndex);
|
|
318
|
-
this.currentIndex++;
|
|
319
|
-
} else {
|
|
320
|
-
this.extrusions(positions, normals, last, this.normal, this.thickness, this.totalDistance - segmentDistance);
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
indices.push(index + 0, index + 1, index + 2);
|
|
324
|
-
if (!next) {
|
|
325
|
-
computeNormal(this.normal, lineA);
|
|
326
|
-
if (capSquare) {
|
|
327
|
-
const out1 = _glMatrix.vec2.create();
|
|
328
|
-
const out2 = _glMatrix.vec2.create();
|
|
329
|
-
_glMatrix.vec2.sub(out2, lineA, this.normal);
|
|
330
|
-
_glMatrix.vec2.add(out1, lineA, this.normal);
|
|
331
|
-
normals.push(out2[0], out2[1], 0);
|
|
332
|
-
normals.push(out1[0], out1[1], 0);
|
|
333
|
-
positions.push(cur[0], cur[1], cur[2] | 0, this.totalDistance, this.thickness, cur[2] | 0);
|
|
334
|
-
this.complex.indexes.push(this.currentIndex);
|
|
335
|
-
positions.push(cur[0], cur[1], cur[2] | 0, this.totalDistance, this.thickness, cur[2] | 0);
|
|
336
|
-
this.complex.indexes.push(this.currentIndex);
|
|
337
|
-
this.currentIndex++;
|
|
338
|
-
} else {
|
|
339
|
-
this.extrusions(positions, normals, cur, this.normal, this.thickness, this.totalDistance);
|
|
340
|
-
}
|
|
341
|
-
indices.push(...(this.lastFlip === 1 ? [index, index + 2, index + 3] : [index + 2, index + 1, index + 3]));
|
|
342
|
-
count += 2;
|
|
343
|
-
} else {
|
|
344
|
-
// @ts-ignore
|
|
345
|
-
if (isPointEqual(cur, next)) {
|
|
346
|
-
_glMatrix.vec2.add(
|
|
347
|
-
// @ts-ignore
|
|
348
|
-
next,
|
|
349
|
-
// @ts-ignore
|
|
350
|
-
cur, _glMatrix.vec2.normalize(
|
|
351
|
-
// @ts-ignore
|
|
352
|
-
next,
|
|
353
|
-
// @ts-ignore
|
|
354
|
-
_glMatrix.vec2.subtract(next, cur, last)));
|
|
355
|
-
}
|
|
356
|
-
// @ts-ignore
|
|
357
|
-
direction(lineB, next, cur);
|
|
358
|
-
// stores tangent & miter
|
|
359
|
-
|
|
360
|
-
const [miterLen, miter] = computeMiter(tangent, _glMatrix.vec2.create(), lineA, lineB, this.thickness);
|
|
361
|
-
// normal(tmp, lineA)
|
|
362
|
-
|
|
363
|
-
// get orientation
|
|
364
|
-
let flip = _glMatrix.vec2.dot(tangent, this.normal) < 0 ? -1 : 1;
|
|
365
|
-
let bevel = joinBevel;
|
|
366
|
-
if (!bevel && this.join === 'miter') {
|
|
367
|
-
const limit = miterLen;
|
|
368
|
-
if (limit > this.miterLimit) {
|
|
369
|
-
bevel = true;
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
if (bevel) {
|
|
373
|
-
normals.push(this.normal[0], this.normal[1], 0);
|
|
374
|
-
normals.push(miter[0], miter[1], 0);
|
|
375
|
-
positions.push(cur[0], cur[1], cur[2] | 0, this.totalDistance, -this.thickness * flip, cur[2] | 0);
|
|
376
|
-
this.complex.indexes.push(this.currentIndex);
|
|
377
|
-
positions.push(cur[0], cur[1], cur[2] | 0, this.totalDistance, this.thickness * flip, cur[2] | 0);
|
|
378
|
-
this.complex.indexes.push(this.currentIndex);
|
|
379
|
-
this.currentIndex++;
|
|
380
|
-
indices.push(...(this.lastFlip !== -flip ? [index, index + 2, index + 3] : [index + 2, index + 1, index + 3]));
|
|
381
|
-
|
|
382
|
-
// now add the bevel triangle
|
|
383
|
-
indices.push(index + 2, index + 3, index + 4);
|
|
384
|
-
computeNormal(tmp, lineB);
|
|
385
|
-
_glMatrix.vec2.copy(this.normal, tmp); // store normal for next round
|
|
386
|
-
normals.push(this.normal[0], this.normal[1], 0);
|
|
387
|
-
positions.push(cur[0], cur[1], cur[2] | 0, this.totalDistance, -this.thickness * flip, cur[2] | 0);
|
|
388
|
-
this.complex.indexes.push(this.currentIndex);
|
|
389
|
-
this.currentIndex++;
|
|
390
|
-
count += 3;
|
|
391
|
-
} else {
|
|
392
|
-
this.extrusions(positions, normals, cur, miter, miterLen, this.totalDistance);
|
|
393
|
-
indices.push(...(this.lastFlip === 1 ? [index, index + 2, index + 3] : [index + 2, index + 1, index + 3]));
|
|
394
|
-
flip = -1;
|
|
395
|
-
|
|
396
|
-
// the miter is now the normal for our next join
|
|
397
|
-
_glMatrix.vec2.copy(this.normal, miter);
|
|
398
|
-
count += 2;
|
|
399
|
-
}
|
|
400
|
-
this.lastFlip = flip;
|
|
401
|
-
}
|
|
402
|
-
return count;
|
|
403
|
-
}
|
|
404
187
|
segment(complex, index, last, cur, next) {
|
|
405
188
|
let count = 0;
|
|
406
189
|
const indices = complex.indices;
|
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
import type { IModel, IModelUniform, IRenderOptions, ITexture2D } from '@antv/l7-core';
|
|
2
2
|
import BaseModel from '../../core/BaseModel';
|
|
3
3
|
export default class WindModel extends BaseModel {
|
|
4
|
+
protected get attributeLocation(): {
|
|
5
|
+
readonly POSITION: 0;
|
|
6
|
+
readonly POSITION_64LOW: 1;
|
|
7
|
+
readonly COLOR: 2;
|
|
8
|
+
readonly PICKING_COLOR: 3;
|
|
9
|
+
readonly STROKE: 4;
|
|
10
|
+
readonly OPACITY: 5;
|
|
11
|
+
readonly OFFSETS: 6;
|
|
12
|
+
readonly ROTATION: 7;
|
|
13
|
+
readonly MAX: 8;
|
|
14
|
+
} & Record<string, number> & {
|
|
15
|
+
MAX: 8;
|
|
16
|
+
UV: number;
|
|
17
|
+
};
|
|
4
18
|
protected texture: ITexture2D;
|
|
5
19
|
private colorModel;
|
|
6
20
|
private wind;
|
package/lib/wind/models/wind.js
CHANGED
|
@@ -15,7 +15,7 @@ var _windRender = require("./windRender");
|
|
|
15
15
|
/* babel-plugin-inline-import '../shaders/wind_frag.glsl' */
|
|
16
16
|
const WindFrag = "precision mediump float;\nuniform float u_opacity: 1.0;\nuniform sampler2D u_texture;\nvarying vec2 v_texCoord;\nvoid main() {\n vec4 color = texture2D(u_texture,vec2(v_texCoord.x,v_texCoord.y));\n gl_FragColor = color;\n gl_FragColor.a *= u_opacity;\n}\n";
|
|
17
17
|
/* babel-plugin-inline-import '../shaders/wind_vert.glsl' */
|
|
18
|
-
const WindVert = "precision highp float;\nuniform mat4 u_ModelMatrix;\n\
|
|
18
|
+
const WindVert = "precision highp float;\nuniform mat4 u_ModelMatrix;\n\nlayout(location = ATTRIBUTE_LOCATION_POSITION) in vec3 a_Position;\nlayout(location = ATTRIBUTE_LOCATION_UV) in vec2 a_Uv;\n\nvarying vec2 v_texCoord;\n#pragma include \"projection\"\nvoid main() {\n v_texCoord = a_Uv;\n vec4 project_pos = project_position(vec4(a_Position, 1.0));\n\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy, 0.0, 1.0));\n}\n";
|
|
19
19
|
const defaultRampColors = {
|
|
20
20
|
0.0: '#3288bd',
|
|
21
21
|
0.1: '#66c2a5',
|
|
@@ -39,6 +39,12 @@ class WindModel extends _BaseModel.default {
|
|
|
39
39
|
(0, _defineProperty2.default)(this, "frequency", new _l7Utils.FrequencyController(7.2));
|
|
40
40
|
(0, _defineProperty2.default)(this, "cacheZoom", void 0);
|
|
41
41
|
}
|
|
42
|
+
get attributeLocation() {
|
|
43
|
+
return Object.assign(super.attributeLocation, {
|
|
44
|
+
MAX: super.attributeLocation.MAX,
|
|
45
|
+
UV: 9
|
|
46
|
+
});
|
|
47
|
+
}
|
|
42
48
|
render(options) {
|
|
43
49
|
this.drawColorMode(options);
|
|
44
50
|
// Tip: 控制风场的平均更新频率
|
|
@@ -115,6 +121,7 @@ class WindModel extends _BaseModel.default {
|
|
|
115
121
|
moduleName: 'wind',
|
|
116
122
|
vertexShader: WindVert,
|
|
117
123
|
fragmentShader: WindFrag,
|
|
124
|
+
defines: _this.getDefines(),
|
|
118
125
|
triangulation: _triangulation.RasterImageTriangulation,
|
|
119
126
|
primitive: _l7Core.gl.TRIANGLES,
|
|
120
127
|
depth: {
|
|
@@ -153,6 +160,7 @@ class WindModel extends _BaseModel.default {
|
|
|
153
160
|
type: _l7Core.AttributeType.Attribute,
|
|
154
161
|
descriptor: {
|
|
155
162
|
name: 'a_Uv',
|
|
163
|
+
shaderLocation: this.attributeLocation.UV,
|
|
156
164
|
buffer: {
|
|
157
165
|
// give the WebGL driver a hint that this buffer may change
|
|
158
166
|
usage: _l7Core.gl.DYNAMIC_DRAW,
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
precision highp float;
|
|
2
2
|
uniform mat4 u_ModelMatrix;
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
layout(location = ATTRIBUTE_LOCATION_POSITION) in vec3 a_Position;
|
|
5
|
+
layout(location = ATTRIBUTE_LOCATION_UV) in vec2 a_Uv;
|
|
6
|
+
|
|
6
7
|
varying vec2 v_texCoord;
|
|
7
8
|
#pragma include "projection"
|
|
8
9
|
void main() {
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
v_texCoord = a_Uv;
|
|
11
|
+
vec4 project_pos = project_position(vec4(a_Position, 1.0));
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy, 0.0, 1.0));
|
|
13
14
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antv/l7-layers",
|
|
3
|
-
"version": "2.21.
|
|
3
|
+
"version": "2.21.11-beta.0",
|
|
4
4
|
"description": "L7's collection of built-in layers",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "https://github.com/orgs/antvis/people",
|
|
@@ -23,29 +23,29 @@
|
|
|
23
23
|
"@turf/meta": "^6.0.2",
|
|
24
24
|
"@turf/polygon-to-line": "^6.5.0",
|
|
25
25
|
"@turf/union": "^6.5.0",
|
|
26
|
-
"d3-array": "
|
|
26
|
+
"d3-array": "^2",
|
|
27
27
|
"d3-color": "^1.4.0",
|
|
28
28
|
"d3-interpolate": "1.4.0",
|
|
29
|
-
"d3-scale": "2",
|
|
29
|
+
"d3-scale": "^2",
|
|
30
30
|
"earcut": "^2.2.1",
|
|
31
31
|
"eventemitter3": "^4.0.0",
|
|
32
32
|
"extrude-polyline": "^1.0.6",
|
|
33
33
|
"gl-matrix": "^3.1.0",
|
|
34
34
|
"gl-vec2": "^1.3.0",
|
|
35
35
|
"polyline-miter-util": "^1.0.1",
|
|
36
|
-
"@antv/l7-core": "2.21.
|
|
37
|
-
"@antv/l7-maps": "2.21.
|
|
38
|
-
"@antv/l7-source": "2.21.
|
|
39
|
-
"@antv/l7-utils": "2.21.
|
|
36
|
+
"@antv/l7-core": "2.21.11-beta.0",
|
|
37
|
+
"@antv/l7-maps": "2.21.11-beta.0",
|
|
38
|
+
"@antv/l7-source": "2.21.11-beta.0",
|
|
39
|
+
"@antv/l7-utils": "2.21.11-beta.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@types/d3-array": "^2
|
|
42
|
+
"@types/d3-array": "^2",
|
|
43
43
|
"@types/d3-color": "^1.2.2",
|
|
44
44
|
"@types/d3-interpolate": "1.1.6",
|
|
45
45
|
"@types/d3-scale": "^2.1.1",
|
|
46
46
|
"@types/earcut": "^2.1.0",
|
|
47
47
|
"@types/gl-matrix": "^2.4.5",
|
|
48
|
-
"@antv/l7-test-utils": "^2.21.
|
|
48
|
+
"@antv/l7-test-utils": "^2.21.11-beta.0"
|
|
49
49
|
},
|
|
50
50
|
"publishConfig": {
|
|
51
51
|
"access": "public",
|