@antv/l7-layers 2.9.27-alpha.3 → 2.9.27
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/Geometry/models/billboard.js +2 -5
- package/es/Geometry/models/plane.js +3 -3
- package/es/Geometry/models/sprite.js +2 -3
- package/es/core/BaseLayer.d.ts +5 -6
- package/es/core/BaseLayer.js +15 -20
- package/es/core/BaseModel.d.ts +1 -1
- package/es/core/BaseModel.js +15 -16
- package/es/core/interface.d.ts +3 -1
- package/es/earth/models/atmosphere.js +4 -7
- package/es/earth/models/base.js +10 -14
- package/es/earth/models/bloomsphere.js +4 -8
- package/es/heatmap/index.d.ts +2 -2
- package/es/heatmap/index.js +1 -3
- package/es/heatmap/models/grid.js +1 -3
- package/es/heatmap/models/grid3d.js +4 -11
- package/es/heatmap/models/heatmap.js +3 -6
- package/es/heatmap/models/hexagon.js +2 -6
- package/es/heatmap/triangulation.js +0 -1
- package/es/image/index.d.ts +1 -1
- package/es/image/index.js +4 -1
- package/es/image/models/dataImage.d.ts +1 -1
- package/es/image/models/dataImage.js +12 -34
- package/es/image/models/image.js +1 -3
- package/es/image/models/index.d.ts +1 -1
- package/es/image/models/index.js +3 -1
- package/es/image/models/tileDataImage.d.ts +19 -0
- package/es/image/models/tileDataImage.js +174 -0
- package/es/line/models/arc.js +7 -8
- package/es/line/models/arc_3d.js +8 -10
- package/es/line/models/earthArc_3d.js +8 -10
- package/es/line/models/great_circle.js +7 -7
- package/es/line/models/line.js +4 -4
- package/es/line/models/linearline.js +3 -4
- package/es/line/models/simpleLine.js +3 -3
- package/es/line/models/tile.js +1 -1
- package/es/line/models/wall.js +3 -3
- package/es/line/shaders/dash/line_dash_frag.glsl +1 -1
- package/es/line/shaders/line_arc2d_vert.glsl +2 -2
- package/es/line/shaders/line_arc_3d_frag.glsl +10 -10
- package/es/line/shaders/line_arc_3d_vert.glsl +3 -4
- package/es/line/shaders/line_arc_frag.glsl +9 -10
- package/es/line/shaders/line_arc_great_circle_frag.glsl +6 -6
- package/es/line/shaders/line_arc_great_circle_vert.glsl +2 -3
- package/es/line/shaders/line_arc_vert.glsl +2 -2
- package/es/line/shaders/line_bezier_vert.glsl +2 -2
- package/es/line/shaders/line_frag.glsl +5 -5
- package/es/line/shaders/line_vert.glsl +1 -1
- package/es/line/shaders/linear/arc3d_linear_frag.glsl +6 -7
- package/es/line/shaders/linear/arc3d_linear_vert.glsl +9 -10
- package/es/line/shaders/linear/arc_linear_frag.glsl +1 -1
- package/es/line/shaders/wall/wall_frag.glsl +5 -5
- package/es/line/shaders/wall/wall_vert.glsl +2 -2
- package/es/plugins/LayerAnimateStylePlugin.js +2 -2
- package/es/point/index.js +3 -4
- package/es/point/models/earthExtrude.d.ts +1 -1
- package/es/point/models/earthExtrude.js +9 -14
- package/es/point/models/earthFill.js +2 -2
- package/es/point/models/extrude.d.ts +1 -1
- package/es/point/models/extrude.js +9 -12
- package/es/point/models/fill.d.ts +1 -1
- package/es/point/models/fill.js +7 -8
- package/es/point/models/fillmage.js +4 -5
- package/es/point/models/image.js +2 -2
- package/es/point/models/index.d.ts +1 -1
- package/es/point/models/index.js +3 -3
- package/es/point/models/normal.js +0 -2
- package/es/point/models/radar.js +1 -1
- package/es/point/models/text.js +1 -3
- package/es/point/models/tile.js +2 -3
- package/es/point/models/tileText.js +3 -5
- package/es/point/shaders/animate/wave_frag.glsl +2 -2
- package/es/polygon/models/extrude.js +3 -5
- package/es/raster/index.js +1 -2
- package/es/raster/models/raster.d.ts +1 -1
- package/es/raster/models/raster.js +5 -5
- package/es/raster/models/rasterTile.d.ts +18 -0
- package/es/raster/models/rasterTile.js +140 -0
- package/es/raster/shaders/raster_2d_frag.glsl +0 -2
- package/es/raster/shaders/raster_2d_vert.glsl +0 -1
- package/es/tile/manager/baseMapTileLayerManager.d.ts +3 -25
- package/es/tile/manager/baseMapTileLayerManager.js +31 -119
- package/es/tile/manager/baseTileManager.d.ts +27 -0
- package/es/tile/manager/baseTileManager.js +107 -0
- package/es/tile/manager/tileLayerManager.d.ts +4 -26
- package/es/tile/manager/tileLayerManager.js +64 -132
- package/es/tile/manager/tilePickerManager.d.ts +1 -0
- package/es/tile/manager/tilePickerManager.js +5 -0
- package/es/tile/models/tileModel.d.ts +1 -0
- package/es/tile/models/tileModel.js +3 -0
- package/es/tile/tileFactory/rasterData.js +9 -11
- package/es/tile/tileFactory/rasterDataLayer.d.ts +1 -1
- package/es/tile/tileFactory/rasterDataLayer.js +1 -1
- package/es/tile/tileLayer/baseMapTileLayer.d.ts +1 -0
- package/es/tile/tileLayer/baseMapTileLayer.js +7 -0
- package/es/tile/tileLayer/baseTileLayer.d.ts +1 -0
- package/es/tile/tileLayer/baseTileLayer.js +12 -1
- package/es/tile/tmsMapTileLayer.js +2 -2
- package/es/tile/tmsTileLayer.js +2 -2
- package/es/tile/utils.d.ts +1 -0
- package/es/tile/utils.js +13 -0
- package/lib/Geometry/models/billboard.js +2 -5
- package/lib/Geometry/models/plane.js +3 -3
- package/lib/Geometry/models/sprite.js +2 -3
- package/lib/core/BaseLayer.js +15 -20
- package/lib/core/BaseModel.js +15 -16
- package/lib/earth/models/atmosphere.js +4 -7
- package/lib/earth/models/base.js +10 -14
- package/lib/earth/models/bloomsphere.js +4 -8
- package/lib/heatmap/index.js +1 -3
- package/lib/heatmap/models/grid.js +1 -3
- package/lib/heatmap/models/grid3d.js +4 -11
- package/lib/heatmap/models/heatmap.js +3 -6
- package/lib/heatmap/models/hexagon.js +2 -6
- package/lib/heatmap/triangulation.js +0 -1
- package/lib/image/index.js +4 -1
- package/lib/image/models/dataImage.js +11 -33
- package/lib/image/models/image.js +1 -3
- package/lib/image/models/index.js +4 -1
- package/lib/image/models/tileDataImage.js +188 -0
- package/lib/line/models/arc.js +7 -8
- package/lib/line/models/arc_3d.js +8 -10
- package/lib/line/models/earthArc_3d.js +8 -10
- package/lib/line/models/great_circle.js +7 -7
- package/lib/line/models/line.js +4 -4
- package/lib/line/models/linearline.js +3 -4
- package/lib/line/models/simpleLine.js +3 -3
- package/lib/line/models/tile.js +1 -1
- package/lib/line/models/wall.js +3 -3
- package/lib/line/shaders/dash/line_dash_frag.glsl +1 -1
- package/lib/line/shaders/line_arc2d_vert.glsl +2 -2
- package/lib/line/shaders/line_arc_3d_frag.glsl +10 -10
- package/lib/line/shaders/line_arc_3d_vert.glsl +3 -4
- package/lib/line/shaders/line_arc_frag.glsl +9 -10
- package/lib/line/shaders/line_arc_great_circle_frag.glsl +6 -6
- package/lib/line/shaders/line_arc_great_circle_vert.glsl +2 -3
- package/lib/line/shaders/line_arc_vert.glsl +2 -2
- package/lib/line/shaders/line_bezier_vert.glsl +2 -2
- package/lib/line/shaders/line_frag.glsl +5 -5
- package/lib/line/shaders/line_vert.glsl +1 -1
- package/lib/line/shaders/linear/arc3d_linear_frag.glsl +6 -7
- package/lib/line/shaders/linear/arc3d_linear_vert.glsl +9 -10
- package/lib/line/shaders/linear/arc_linear_frag.glsl +1 -1
- package/lib/line/shaders/wall/wall_frag.glsl +5 -5
- package/lib/line/shaders/wall/wall_vert.glsl +2 -2
- package/lib/plugins/LayerAnimateStylePlugin.js +2 -2
- package/lib/point/index.js +3 -4
- package/lib/point/models/earthExtrude.js +9 -14
- package/lib/point/models/earthFill.js +2 -2
- package/lib/point/models/extrude.js +9 -12
- package/lib/point/models/fill.js +7 -8
- package/lib/point/models/fillmage.js +4 -5
- package/lib/point/models/image.js +2 -2
- package/lib/point/models/index.js +1 -1
- package/lib/point/models/normal.js +0 -2
- package/lib/point/models/radar.js +1 -1
- package/lib/point/models/text.js +1 -3
- package/lib/point/models/tile.js +2 -3
- package/lib/point/models/tileText.js +3 -5
- package/lib/point/shaders/animate/wave_frag.glsl +2 -2
- package/lib/polygon/models/extrude.js +3 -5
- package/lib/raster/index.js +1 -2
- package/lib/raster/models/raster.js +5 -5
- package/lib/raster/models/rasterTile.js +154 -0
- package/lib/raster/shaders/raster_2d_frag.glsl +0 -2
- package/lib/raster/shaders/raster_2d_vert.glsl +0 -1
- package/lib/tile/manager/baseMapTileLayerManager.js +33 -121
- package/lib/tile/manager/baseTileManager.js +121 -0
- package/lib/tile/manager/tileLayerManager.js +66 -134
- package/lib/tile/manager/tilePickerManager.js +5 -0
- package/lib/tile/models/tileModel.js +3 -0
- package/lib/tile/tileFactory/rasterData.js +9 -11
- package/lib/tile/tileFactory/rasterDataLayer.js +2 -2
- package/lib/tile/tileLayer/baseMapTileLayer.js +7 -0
- package/lib/tile/tileLayer/baseTileLayer.js +12 -1
- package/lib/tile/tmsMapTileLayer.js +1 -1
- package/lib/tile/tmsTileLayer.js +1 -1
- package/lib/tile/utils.js +16 -0
- package/package.json +6 -6
|
@@ -184,7 +184,7 @@ var SimpleLineModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
184
184
|
type: gl.FLOAT
|
|
185
185
|
},
|
|
186
186
|
size: 1,
|
|
187
|
-
update: function update(feature, featureIdx, vertex
|
|
187
|
+
update: function update(feature, featureIdx, vertex) {
|
|
188
188
|
return [vertex[3]];
|
|
189
189
|
}
|
|
190
190
|
}
|
|
@@ -201,7 +201,7 @@ var SimpleLineModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
201
201
|
type: gl.FLOAT
|
|
202
202
|
},
|
|
203
203
|
size: 1,
|
|
204
|
-
update: function update(feature, featureIdx, vertex
|
|
204
|
+
update: function update(feature, featureIdx, vertex) {
|
|
205
205
|
return [vertex[5]];
|
|
206
206
|
}
|
|
207
207
|
}
|
|
@@ -218,7 +218,7 @@ var SimpleLineModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
218
218
|
type: gl.FLOAT
|
|
219
219
|
},
|
|
220
220
|
size: 2,
|
|
221
|
-
update: function update(feature
|
|
221
|
+
update: function update(feature) {
|
|
222
222
|
var _feature$size = feature.size,
|
|
223
223
|
size = _feature$size === void 0 ? 1 : _feature$size;
|
|
224
224
|
return Array.isArray(size) ? [size[0], size[1]] : [size, 0];
|
package/es/line/models/tile.js
CHANGED
|
@@ -164,7 +164,7 @@ var LineModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
164
164
|
type: gl.FLOAT
|
|
165
165
|
},
|
|
166
166
|
size: 1,
|
|
167
|
-
update: function update(feature, featureIdx, vertex
|
|
167
|
+
update: function update(feature, featureIdx, vertex) {
|
|
168
168
|
return [vertex[4]];
|
|
169
169
|
}
|
|
170
170
|
}
|
package/es/line/models/wall.js
CHANGED
|
@@ -17,10 +17,10 @@ import BaseModel from "../../core/BaseModel";
|
|
|
17
17
|
import { LineTriangulation } from "../../core/triangulation";
|
|
18
18
|
|
|
19
19
|
/* babel-plugin-inline-import '../shaders/wall/wall_frag.glsl' */
|
|
20
|
-
var line_frag = "#define Animate 0.0\n#define LineTexture 1.0\n\n// line texture\nuniform float u_line_texture;\nuniform sampler2D u_texture;\nuniform vec2 u_textSize;\nuniform float u_linearColor: 0;\nuniform vec4 u_sourceColor;\nuniform vec4 u_targetColor;\nuniform float u_opacity : 1.0;\nuniform float u_textureBlend;\nuniform float u_iconStepCount;\nuniform float u_time;\nuniform vec4
|
|
20
|
+
var line_frag = "#define Animate 0.0\n#define LineTexture 1.0\n\n// line texture\nuniform float u_line_texture;\nuniform sampler2D u_texture;\nuniform vec2 u_textSize;\nuniform float u_linearColor: 0;\nuniform vec4 u_sourceColor;\nuniform vec4 u_targetColor;\nuniform float u_opacity : 1.0;\nuniform float u_textureBlend;\nuniform float u_iconStepCount;\nuniform float u_time;\nuniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ]; // \u63A7\u5236\u8FD0\u52A8\n\nvarying vec2 v_iconMapUV;\nvarying float v_blur;\nvarying float v_radio;\nvarying vec4 v_color;\nvarying vec4 v_dataset;\n\n#pragma include \"picking\"\n\nvoid main() {\n float opacity = u_opacity;\n float animateSpeed = 0.0; // \u8FD0\u52A8\u901F\u5EA6\n float d_distance_ratio = v_dataset.r; // \u5F53\u524D\u70B9\u4F4D\u8DDD\u79BB\u5360\u7EBF\u603B\u957F\u7684\u6BD4\u4F8B\n float v = v_dataset.a;\n\n if(u_linearColor == 1.0) { // \u4F7F\u7528\u6E10\u53D8\u989C\u8272\n gl_FragColor = mix(u_sourceColor, u_targetColor, v);\n } else { // \u4F7F\u7528 color \u65B9\u6CD5\u4F20\u5165\u7684\u989C\u8272\n gl_FragColor = v_color;\n }\n\n gl_FragColor.a *= opacity; // \u5168\u5C40\u900F\u660E\u5EA6\n if(u_animate.x == Animate) {\n animateSpeed = u_time / u_animate.y;\n float alpha =1.0 - fract( mod(1.0- d_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + animateSpeed);\n alpha = (alpha + u_animate.w -1.0) / u_animate.w;\n alpha = smoothstep(0., 1., alpha);\n gl_FragColor.a *= alpha;\n }\n\n if(u_line_texture == LineTexture) { // while load texture\n float aDistance = v_dataset.g; // \u5F53\u524D\u9876\u70B9\u7684\u8DDD\u79BB\n float d_texPixelLen = v_dataset.b; // \u8D34\u56FE\u7684\u50CF\u7D20\u957F\u5EA6\uFF0C\u6839\u636E\u5730\u56FE\u5C42\u7EA7\u7F29\u653E\n float u = fract(mod(aDistance, d_texPixelLen)/d_texPixelLen - animateSpeed);\n float v = v_dataset.a; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C\n\n // \u8BA1\u7B97\u7EB9\u7406\u95F4\u9694 start\n float flag = 0.0;\n if(u > 1.0/u_iconStepCount) {\n flag = 1.0;\n }\n u = fract(u*u_iconStepCount);\n // \u8BA1\u7B97\u7EB9\u7406\u95F4\u9694 end\n\n vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.;\n vec4 pattern = texture2D(u_texture, uv);\n\n // Tip: \u5224\u65AD\u7EB9\u7406\u95F4\u9694\n if(flag > 0.0) {\n pattern = vec4(0.0);\n }\n\n if(u_textureBlend == 0.0) { // normal\n pattern.a = 0.0;\n gl_FragColor = filterColor(gl_FragColor + pattern);\n } else { // replace\n pattern.a *= opacity;\n if(gl_FragColor.a <= 0.0) {\n pattern.a = 0.0;\n }\n gl_FragColor = filterColor(pattern);\n }\n }\n \n\n // blur - AA\n if(v < v_blur) {\n gl_FragColor.a = mix(0.0, gl_FragColor.a, v/v_blur);\n } else if(v > 1.0 - v_blur) {\n gl_FragColor.a = mix(gl_FragColor.a, 0.0, (v - (1.0 - v_blur))/v_blur);\n }\n\n gl_FragColor = filterColor(gl_FragColor);\n}\n";
|
|
21
21
|
|
|
22
22
|
/* babel-plugin-inline-import '../shaders/wall/wall_vert.glsl' */
|
|
23
|
-
var line_vert = "#define Animate 0.0\n\nattribute float a_Miter;\nattribute vec4 a_Color;\nattribute vec2 a_Size;\nattribute vec3 a_Normal;\nattribute vec3 a_Position;\nattribute vec2 a_iconMapUV;\nattribute float a_Total_Distance;\nattribute float a_Distance;\n\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nuniform vec4
|
|
23
|
+
var line_vert = "#define Animate 0.0\n\nattribute float a_Miter;\nattribute vec4 a_Color;\nattribute vec2 a_Size;\nattribute vec3 a_Normal;\nattribute vec3 a_Position;\nattribute vec2 a_iconMapUV;\nattribute float a_Total_Distance;\nattribute float a_Distance;\n\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nuniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];\nuniform float u_icon_step: 100;\nuniform float u_heightfixed;\nuniform float u_linearColor: 0;\n\n#pragma include \"projection\"\n#pragma include \"light\"\n#pragma include \"picking\"\n\n// texV \u7EBF\u56FE\u5C42 - \u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\uFF08\u7EBF\u7684\u5BBD\u5EA6\u65B9\u5411\uFF09\nvarying vec2 v_iconMapUV;\nvarying vec4 v_color;\nvarying float v_blur;\nvarying float v_radio;\nvarying vec4 v_dataset;\n\nvoid main() {\n\n\n float d_distance_ratio; // \u5F53\u524D\u70B9\u4F4D\u8DDD\u79BB\u5360\u7EBF\u603B\u957F\u7684\u6BD4\u4F8B\n float d_texPixelLen; // \u8D34\u56FE\u7684\u50CF\u7D20\u957F\u5EA6\uFF0C\u6839\u636E\u5730\u56FE\u5C42\u7EA7\u7F29\u653E\n\n v_iconMapUV = a_iconMapUV;\n if(u_heightfixed < 1.0) { // \u9AD8\u5EA6\u968F zoom \u8C03\u6574\n d_texPixelLen = project_pixel(u_icon_step);\n } else {\n d_texPixelLen = u_icon_step;\n }\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {\n d_texPixelLen *= 10.0;\n }\n\n if(u_animate.x == Animate || u_linearColor == 1.0) {\n d_distance_ratio = a_Distance / a_Total_Distance;\n }\n\n float miter = (a_Miter + 1.0)/2.0;\n // \u8BBE\u7F6E\u6570\u636E\u96C6\u7684\u53C2\u6570\n v_dataset[0] = d_distance_ratio; // \u5F53\u524D\u70B9\u4F4D\u8DDD\u79BB\u5360\u7EBF\u603B\u957F\u7684\u6BD4\u4F8B\n v_dataset[1] = a_Distance; // \u5F53\u524D\u9876\u70B9\u7684\u8DDD\u79BB\n v_dataset[2] = d_texPixelLen; // \u8D34\u56FE\u7684\u50CF\u7D20\u957F\u5EA6\uFF0C\u6839\u636E\u5730\u56FE\u5C42\u7EA7\u7F29\u653E\n v_dataset[3] = miter; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C 0 - 1\n\n vec4 project_pos = project_position(vec4(a_Position.xy, 0, 1.0));\n\n float originSize = a_Size.x; // \u56FA\u5B9A\u9AD8\u5EA6\n if(u_heightfixed < 1.0) { // \u9AD8\u5EA6\u968F zoom \u8C03\u6574\n originSize = project_float_pixel(a_Size.x);\n }\n\n float wallHeight = originSize * miter;\n float lightWeight = calc_lighting(vec4(project_pos.xy, wallHeight, 1.0));\n\n v_blur = min(project_float_pixel(2.0) / originSize, 0.05);\n v_color = vec4(a_Color.rgb * lightWeight, a_Color.w);\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(project_pos.xy, wallHeight, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy, wallHeight, 1.0));\n }\n\n setPickingColor(a_PickingColor);\n}\n";
|
|
24
24
|
|
|
25
25
|
var LineWallModel = /*#__PURE__*/function (_BaseModel) {
|
|
26
26
|
_inherits(LineWallModel, _BaseModel);
|
|
@@ -124,7 +124,7 @@ var LineWallModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
124
124
|
animateOption = _ref2.animateOption;
|
|
125
125
|
|
|
126
126
|
return {
|
|
127
|
-
|
|
127
|
+
u_animate: this.animateOption2Array(animateOption),
|
|
128
128
|
u_time: this.layer.getLayerAnimateTime()
|
|
129
129
|
};
|
|
130
130
|
}
|
|
@@ -9,7 +9,7 @@ varying vec4 v_dash_array;
|
|
|
9
9
|
#pragma include "picking"
|
|
10
10
|
|
|
11
11
|
uniform float u_time;
|
|
12
|
-
uniform vec4
|
|
12
|
+
uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ]; // 控制运动
|
|
13
13
|
|
|
14
14
|
varying mat4 styleMappingMat;
|
|
15
15
|
// [animate, duration, interval, trailLength],
|
|
@@ -7,7 +7,7 @@ attribute vec4 a_Instance;
|
|
|
7
7
|
attribute float a_Size;
|
|
8
8
|
uniform mat4 u_ModelMatrix;
|
|
9
9
|
uniform float segmentNumber;
|
|
10
|
-
uniform vec4
|
|
10
|
+
uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
11
11
|
varying vec4 v_color;
|
|
12
12
|
varying vec2 v_normal;
|
|
13
13
|
|
|
@@ -98,7 +98,7 @@ void main() {
|
|
|
98
98
|
float total_Distance = pixelDistance(a_Instance.rg, a_Instance.ba);
|
|
99
99
|
v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / (total_Distance / segmentNumber * segmentIndex);
|
|
100
100
|
}
|
|
101
|
-
if(
|
|
101
|
+
if(u_animate.x == Animate) {
|
|
102
102
|
v_distance_ratio = segmentIndex / segmentNumber;
|
|
103
103
|
}
|
|
104
104
|
float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);
|
|
@@ -20,7 +20,7 @@ uniform float segmentNumber;
|
|
|
20
20
|
varying vec2 v_iconMapUV;
|
|
21
21
|
|
|
22
22
|
uniform float u_time;
|
|
23
|
-
uniform vec4
|
|
23
|
+
uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
24
24
|
|
|
25
25
|
varying mat4 styleMappingMat;
|
|
26
26
|
|
|
@@ -42,16 +42,16 @@ void main() {
|
|
|
42
42
|
gl_FragColor.a *=flag;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
if(
|
|
46
|
-
animateSpeed = u_time /
|
|
47
|
-
float alpha =1.0 - fract( mod(1.0- d_distance_ratio,
|
|
45
|
+
if(u_animate.x == Animate && u_line_texture != LineTexture) {
|
|
46
|
+
animateSpeed = u_time / u_animate.y;
|
|
47
|
+
float alpha =1.0 - fract( mod(1.0- d_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + u_time / u_animate.y);
|
|
48
48
|
|
|
49
|
-
alpha = (alpha +
|
|
49
|
+
alpha = (alpha + u_animate.w -1.0) / u_animate.w;
|
|
50
50
|
// alpha = smoothstep(0., 1., alpha);
|
|
51
51
|
alpha = clamp(alpha, 0.0, 1.0);
|
|
52
52
|
gl_FragColor.a *= alpha;
|
|
53
53
|
|
|
54
|
-
//
|
|
54
|
+
// u_animate
|
|
55
55
|
// x enable
|
|
56
56
|
// y duration
|
|
57
57
|
// z interval
|
|
@@ -64,8 +64,8 @@ void main() {
|
|
|
64
64
|
float count = styleMappingMat[3].b; // // 贴图在弧线上重复的数量
|
|
65
65
|
|
|
66
66
|
float time = 0.0;
|
|
67
|
-
if(
|
|
68
|
-
time = u_time /
|
|
67
|
+
if(u_animate.x == Animate) {
|
|
68
|
+
time = u_time / u_animate.y;
|
|
69
69
|
}
|
|
70
70
|
float redioCount = arcRadio * count;
|
|
71
71
|
|
|
@@ -75,9 +75,9 @@ void main() {
|
|
|
75
75
|
vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.;
|
|
76
76
|
vec4 pattern = texture2D(u_texture, uv);
|
|
77
77
|
|
|
78
|
-
if(
|
|
78
|
+
if(u_animate.x == Animate) {
|
|
79
79
|
float currentPlane = floor(redioCount - time);
|
|
80
|
-
float textureStep = floor(count *
|
|
80
|
+
float textureStep = floor(count * u_animate.z);
|
|
81
81
|
float a = mod(currentPlane, textureStep);
|
|
82
82
|
if(a < textureStep - 1.0) {
|
|
83
83
|
pattern = vec4(0.0);
|
|
@@ -13,9 +13,9 @@ uniform float u_global_height: 10;
|
|
|
13
13
|
uniform mat4 u_ModelMatrix;
|
|
14
14
|
uniform mat4 u_Mvp;
|
|
15
15
|
uniform float segmentNumber;
|
|
16
|
-
uniform vec4
|
|
16
|
+
uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
17
17
|
varying vec4 v_color;
|
|
18
|
-
|
|
18
|
+
|
|
19
19
|
uniform float u_line_type: 0.0;
|
|
20
20
|
uniform vec4 u_dash_array: [10.0, 5., 0, 0];
|
|
21
21
|
varying vec4 v_dash_array;
|
|
@@ -135,7 +135,6 @@ void main() {
|
|
|
135
135
|
float d_distance_ratio;
|
|
136
136
|
if(u_line_type == LineTypeDash) {
|
|
137
137
|
d_distance_ratio = segmentIndex / segmentNumber;
|
|
138
|
-
// float total_Distance = pixelDistance(a_Instance.rg, a_Instance.ba) / 2.0 * PI;
|
|
139
138
|
vec2 s = source;
|
|
140
139
|
vec2 t = target;
|
|
141
140
|
|
|
@@ -146,7 +145,7 @@ void main() {
|
|
|
146
145
|
float total_Distance = pixelDistance(s, t) / 2.0 * PI;
|
|
147
146
|
v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / (total_Distance / segmentNumber * segmentIndex);
|
|
148
147
|
}
|
|
149
|
-
if(
|
|
148
|
+
if(u_animate.x == Animate) {
|
|
150
149
|
d_distance_ratio = segmentIndex / segmentNumber;
|
|
151
150
|
}
|
|
152
151
|
styleMappingMat[3].g = d_distance_ratio; // 当前点位距离占线总长的比例
|
|
@@ -11,7 +11,7 @@ varying vec4 v_dash_array;
|
|
|
11
11
|
varying vec4 v_color;
|
|
12
12
|
|
|
13
13
|
uniform float u_time;
|
|
14
|
-
uniform vec4
|
|
14
|
+
uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
15
15
|
|
|
16
16
|
uniform float u_line_texture;
|
|
17
17
|
uniform sampler2D u_texture;
|
|
@@ -34,10 +34,10 @@ void main() {
|
|
|
34
34
|
|
|
35
35
|
gl_FragColor.a *= opacity;
|
|
36
36
|
|
|
37
|
-
if(
|
|
38
|
-
animateSpeed = u_time /
|
|
39
|
-
float alpha =1.0 - fract( mod(1.0- d_distance_ratio,
|
|
40
|
-
alpha = (alpha +
|
|
37
|
+
if(u_animate.x == Animate && u_line_texture != LineTexture) {
|
|
38
|
+
animateSpeed = u_time / u_animate.y;
|
|
39
|
+
float alpha =1.0 - fract( mod(1.0- d_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + u_time / u_animate.y);
|
|
40
|
+
alpha = (alpha + u_animate.w -1.0) / u_animate.w;
|
|
41
41
|
// alpha = smoothstep(0., 1., alpha);
|
|
42
42
|
alpha = clamp(alpha, 0.0, 1.0);
|
|
43
43
|
gl_FragColor.a *= alpha;
|
|
@@ -51,8 +51,8 @@ void main() {
|
|
|
51
51
|
float count = styleMappingMat[3].g; // 贴图在弧线上重复的数量
|
|
52
52
|
|
|
53
53
|
float time = 0.0;
|
|
54
|
-
if(
|
|
55
|
-
time = u_time /
|
|
54
|
+
if(u_animate.x == Animate) {
|
|
55
|
+
time = u_time / u_animate.y;
|
|
56
56
|
}
|
|
57
57
|
float redioCount = arcRadio * count;
|
|
58
58
|
|
|
@@ -62,9 +62,9 @@ void main() {
|
|
|
62
62
|
|
|
63
63
|
vec4 pattern = texture2D(u_texture, uv);
|
|
64
64
|
|
|
65
|
-
if(
|
|
65
|
+
if(u_animate.x == Animate) {
|
|
66
66
|
float currentPlane = floor(redioCount - time);
|
|
67
|
-
float textureStep = floor(count *
|
|
67
|
+
float textureStep = floor(count * u_animate.z);
|
|
68
68
|
float a = mod(currentPlane, textureStep);
|
|
69
69
|
if(a < textureStep - 1.0) {
|
|
70
70
|
pattern = vec4(0.0);
|
|
@@ -85,5 +85,4 @@ void main() {
|
|
|
85
85
|
} else {
|
|
86
86
|
gl_FragColor = filterColor(gl_FragColor);
|
|
87
87
|
}
|
|
88
|
-
// gl_FragColor = filterColor(gl_FragColor);
|
|
89
88
|
}
|
|
@@ -13,7 +13,7 @@ varying float v_distance_ratio;
|
|
|
13
13
|
varying vec4 v_color;
|
|
14
14
|
|
|
15
15
|
uniform float u_time;
|
|
16
|
-
uniform vec4
|
|
16
|
+
uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
17
17
|
|
|
18
18
|
uniform float u_line_texture: 0.0;
|
|
19
19
|
uniform sampler2D u_texture;
|
|
@@ -58,10 +58,10 @@ void main() {
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
// 设置弧线的动画模式
|
|
61
|
-
if(
|
|
62
|
-
animateSpeed = u_time /
|
|
63
|
-
float alpha =1.0 - fract( mod(1.0- v_distance_ratio,
|
|
64
|
-
alpha = (alpha +
|
|
61
|
+
if(u_animate.x == Animate) {
|
|
62
|
+
animateSpeed = u_time / u_animate.y;
|
|
63
|
+
float alpha =1.0 - fract( mod(1.0- v_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + u_time / u_animate.y);
|
|
64
|
+
alpha = (alpha + u_animate.w -1.0) / u_animate.w;
|
|
65
65
|
alpha = smoothstep(0., 1., alpha);
|
|
66
66
|
gl_FragColor.a *= alpha;
|
|
67
67
|
}
|
|
@@ -73,7 +73,7 @@ void main() {
|
|
|
73
73
|
float count = styleMappingMat[3].b; // 贴图在弧线上重复的数量
|
|
74
74
|
float u = fract(arcRadio * count - animateSpeed * count);
|
|
75
75
|
// float u = fract(arcRadio * count - animateSpeed);
|
|
76
|
-
if(
|
|
76
|
+
if(u_animate.x == Animate) {
|
|
77
77
|
u = gl_FragColor.a/opacity;
|
|
78
78
|
}
|
|
79
79
|
|
|
@@ -10,9 +10,8 @@ attribute float a_Size;
|
|
|
10
10
|
uniform mat4 u_ModelMatrix;
|
|
11
11
|
uniform mat4 u_Mvp;
|
|
12
12
|
uniform float segmentNumber;
|
|
13
|
-
uniform vec4
|
|
13
|
+
uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
14
14
|
varying vec4 v_color;
|
|
15
|
-
// varying vec2 v_normal;
|
|
16
15
|
|
|
17
16
|
varying float v_distance_ratio;
|
|
18
17
|
uniform float u_line_type: 0.0;
|
|
@@ -172,7 +171,7 @@ void main() {
|
|
|
172
171
|
v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / total_Distance;
|
|
173
172
|
}
|
|
174
173
|
|
|
175
|
-
if(
|
|
174
|
+
if(u_animate.x == Animate) {
|
|
176
175
|
v_distance_ratio = segmentIndex / segmentNumber;
|
|
177
176
|
}
|
|
178
177
|
|
|
@@ -8,7 +8,7 @@ attribute float a_Size;
|
|
|
8
8
|
uniform mat4 u_ModelMatrix;
|
|
9
9
|
uniform mat4 u_Mvp;
|
|
10
10
|
uniform float segmentNumber;
|
|
11
|
-
uniform vec4
|
|
11
|
+
uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
12
12
|
varying vec4 v_color;
|
|
13
13
|
|
|
14
14
|
uniform float u_lineDir: 1.0;
|
|
@@ -123,7 +123,7 @@ void main() {
|
|
|
123
123
|
float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);
|
|
124
124
|
float d_distance_ratio;
|
|
125
125
|
|
|
126
|
-
if(
|
|
126
|
+
if(u_animate.x == Animate) {
|
|
127
127
|
d_distance_ratio = segmentIndex / segmentNumber;
|
|
128
128
|
if(u_lineDir != 1.0) {
|
|
129
129
|
d_distance_ratio = 1.0 - d_distance_ratio;
|
|
@@ -7,7 +7,7 @@ attribute vec4 a_Instance;
|
|
|
7
7
|
attribute float a_Size;
|
|
8
8
|
uniform mat4 u_ModelMatrix;
|
|
9
9
|
uniform float segmentNumber;
|
|
10
|
-
uniform vec4
|
|
10
|
+
uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
11
11
|
varying vec4 v_color;
|
|
12
12
|
varying vec2 v_normal;
|
|
13
13
|
|
|
@@ -72,7 +72,7 @@ void main() {
|
|
|
72
72
|
float total_Distance = pixelDistance(a_Instance.rg, a_Instance.ba) / 2.0 * PI;
|
|
73
73
|
v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / (total_Distance / segmentNumber * segmentIndex);
|
|
74
74
|
}
|
|
75
|
-
if(
|
|
75
|
+
if(u_animate.x == Animate) {
|
|
76
76
|
v_distance_ratio = segmentIndex / segmentNumber;
|
|
77
77
|
}
|
|
78
78
|
vec4 curr = project_position(vec4(interpolate(source, target, segmentRatio), 0.0, 1.0));
|
|
@@ -19,7 +19,7 @@ varying vec2 v_iconMapUV;
|
|
|
19
19
|
#pragma include "picking"
|
|
20
20
|
|
|
21
21
|
uniform float u_time;
|
|
22
|
-
uniform vec4
|
|
22
|
+
uniform vec4 u_animate: [ 1, 2., 1.0, 0.2 ]; // 控制运动
|
|
23
23
|
|
|
24
24
|
varying mat4 styleMappingMat;
|
|
25
25
|
// [animate, duration, interval, trailLength],
|
|
@@ -31,10 +31,10 @@ void main() {
|
|
|
31
31
|
// anti-alias
|
|
32
32
|
// float blur = 1.0 - smoothstep(u_blur, 1., length(v_normal.xy));
|
|
33
33
|
gl_FragColor.a *= opacity; // 全局透明度
|
|
34
|
-
if(
|
|
35
|
-
animateSpeed = u_time /
|
|
36
|
-
float alpha =1.0 - fract( mod(1.0- d_distance_ratio,
|
|
37
|
-
alpha = (alpha +
|
|
34
|
+
if(u_animate.x == Animate) {
|
|
35
|
+
animateSpeed = u_time / u_animate.y;
|
|
36
|
+
float alpha =1.0 - fract( mod(1.0- d_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + animateSpeed);
|
|
37
|
+
alpha = (alpha + u_animate.w -1.0) / u_animate.w;
|
|
38
38
|
alpha = smoothstep(0., 1., alpha);
|
|
39
39
|
gl_FragColor.a *= alpha;
|
|
40
40
|
}
|
|
@@ -15,7 +15,7 @@ attribute vec2 a_DistanceAndIndex;
|
|
|
15
15
|
|
|
16
16
|
uniform mat4 u_ModelMatrix;
|
|
17
17
|
uniform mat4 u_Mvp;
|
|
18
|
-
uniform vec4
|
|
18
|
+
uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
19
19
|
uniform float u_icon_step: 100;
|
|
20
20
|
|
|
21
21
|
uniform float u_heightfixed: 0.0;
|
|
@@ -6,9 +6,8 @@ uniform float u_blur : 0.9;
|
|
|
6
6
|
varying float v_segmentIndex;
|
|
7
7
|
uniform float segmentNumber;
|
|
8
8
|
|
|
9
|
-
|
|
10
9
|
uniform float u_time;
|
|
11
|
-
uniform vec4
|
|
10
|
+
uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
12
11
|
|
|
13
12
|
uniform float u_linearColor: 0;
|
|
14
13
|
uniform vec4 u_sourceColor;
|
|
@@ -27,16 +26,16 @@ void main() {
|
|
|
27
26
|
|
|
28
27
|
gl_FragColor.a *= opacity;
|
|
29
28
|
|
|
30
|
-
if(
|
|
31
|
-
animateSpeed = u_time /
|
|
32
|
-
float alpha =1.0 - fract( mod(1.0- d_distance_ratio,
|
|
29
|
+
if(u_animate.x == Animate) {
|
|
30
|
+
animateSpeed = u_time / u_animate.y;
|
|
31
|
+
float alpha =1.0 - fract( mod(1.0- d_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + u_time / u_animate.y);
|
|
33
32
|
|
|
34
|
-
alpha = (alpha +
|
|
33
|
+
alpha = (alpha + u_animate.w -1.0) / u_animate.w;
|
|
35
34
|
// alpha = smoothstep(0., 1., alpha);
|
|
36
35
|
alpha = clamp(alpha, 0.0, 1.0);
|
|
37
36
|
gl_FragColor.a *= alpha;
|
|
38
37
|
|
|
39
|
-
//
|
|
38
|
+
// u_animate
|
|
40
39
|
// x enable
|
|
41
40
|
// y duration
|
|
42
41
|
// z interval
|
|
@@ -6,6 +6,7 @@ attribute vec3 a_Position;
|
|
|
6
6
|
attribute vec4 a_Instance;
|
|
7
7
|
attribute vec4 a_Color;
|
|
8
8
|
attribute float a_Size;
|
|
9
|
+
attribute vec2 a_iconMapUV;
|
|
9
10
|
|
|
10
11
|
uniform float u_globel;
|
|
11
12
|
uniform float u_globel_radius;
|
|
@@ -13,23 +14,21 @@ uniform float u_global_height: 10;
|
|
|
13
14
|
uniform mat4 u_ModelMatrix;
|
|
14
15
|
uniform mat4 u_Mvp;
|
|
15
16
|
uniform float segmentNumber;
|
|
16
|
-
uniform vec4
|
|
17
|
-
|
|
18
|
-
// varying vec2 v_normal;
|
|
17
|
+
uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
18
|
+
|
|
19
19
|
uniform float u_line_type: 0.0;
|
|
20
20
|
uniform vec4 u_dash_array: [10.0, 5., 0, 0];
|
|
21
|
-
varying vec4 v_dash_array;
|
|
22
|
-
|
|
23
21
|
uniform float u_icon_step: 100;
|
|
24
22
|
uniform float u_line_texture: 0.0;
|
|
25
|
-
|
|
23
|
+
uniform float u_opacity: 1.0;
|
|
26
24
|
|
|
27
|
-
|
|
25
|
+
varying vec4 v_dash_array;
|
|
26
|
+
varying vec4 v_color;
|
|
27
|
+
varying float v_segmentIndex;
|
|
28
28
|
varying vec2 v_iconMapUV;
|
|
29
|
-
|
|
30
|
-
uniform float u_opacity: 1.0;
|
|
31
29
|
varying mat4 styleMappingMat; // 用于将在顶点着色器中计算好的样式值传递给片元
|
|
32
30
|
|
|
31
|
+
|
|
33
32
|
#pragma include "styleMapping"
|
|
34
33
|
#pragma include "styleMappingCalOpacity"
|
|
35
34
|
|
|
@@ -146,7 +145,7 @@ void main() {
|
|
|
146
145
|
float total_Distance = pixelDistance(s, t) / 2.0 * PI;
|
|
147
146
|
v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / (total_Distance / segmentNumber * segmentIndex);
|
|
148
147
|
}
|
|
149
|
-
if(
|
|
148
|
+
if(u_animate.x == Animate) {
|
|
150
149
|
d_distance_ratio = segmentIndex / segmentNumber;
|
|
151
150
|
}
|
|
152
151
|
styleMappingMat[3].g = d_distance_ratio; // 当前点位距离占线总长的比例
|
|
@@ -12,7 +12,7 @@ uniform float u_opacity : 1.0;
|
|
|
12
12
|
uniform float u_textureBlend;
|
|
13
13
|
uniform float u_iconStepCount;
|
|
14
14
|
uniform float u_time;
|
|
15
|
-
uniform vec4
|
|
15
|
+
uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ]; // 控制运动
|
|
16
16
|
|
|
17
17
|
varying vec2 v_iconMapUV;
|
|
18
18
|
varying float v_blur;
|
|
@@ -35,10 +35,10 @@ void main() {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
gl_FragColor.a *= opacity; // 全局透明度
|
|
38
|
-
if(
|
|
39
|
-
animateSpeed = u_time /
|
|
40
|
-
float alpha =1.0 - fract( mod(1.0- d_distance_ratio,
|
|
41
|
-
alpha = (alpha +
|
|
38
|
+
if(u_animate.x == Animate) {
|
|
39
|
+
animateSpeed = u_time / u_animate.y;
|
|
40
|
+
float alpha =1.0 - fract( mod(1.0- d_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + animateSpeed);
|
|
41
|
+
alpha = (alpha + u_animate.w -1.0) / u_animate.w;
|
|
42
42
|
alpha = smoothstep(0., 1., alpha);
|
|
43
43
|
gl_FragColor.a *= alpha;
|
|
44
44
|
}
|
|
@@ -11,7 +11,7 @@ attribute float a_Distance;
|
|
|
11
11
|
|
|
12
12
|
uniform mat4 u_ModelMatrix;
|
|
13
13
|
uniform mat4 u_Mvp;
|
|
14
|
-
uniform vec4
|
|
14
|
+
uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
15
15
|
uniform float u_icon_step: 100;
|
|
16
16
|
uniform float u_heightfixed;
|
|
17
17
|
uniform float u_linearColor: 0;
|
|
@@ -43,7 +43,7 @@ void main() {
|
|
|
43
43
|
d_texPixelLen *= 10.0;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
if(
|
|
46
|
+
if(u_animate.x == Animate || u_linearColor == 1.0) {
|
|
47
47
|
d_distance_ratio = a_Distance / a_Total_Distance;
|
|
48
48
|
}
|
|
49
49
|
|
|
@@ -16,8 +16,8 @@ var LayerAnimateStylePlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/f
|
|
|
16
16
|
value: function apply(layer) {
|
|
17
17
|
layer.hooks.beforeRender.tap('LayerAnimateStylePlugin', function () {
|
|
18
18
|
// @ts-ignore
|
|
19
|
-
var
|
|
20
|
-
|
|
19
|
+
var animateStatus = layer.animateStatus;
|
|
20
|
+
animateStatus && layer.models.forEach(function (model) {
|
|
21
21
|
model.addUniforms(_objectSpread({}, layer.layerModel.getAnimateUniforms()));
|
|
22
22
|
});
|
|
23
23
|
});
|
package/es/point/index.js
CHANGED
|
@@ -156,7 +156,7 @@ var PointLayer = /*#__PURE__*/function (_BaseLayer) {
|
|
|
156
156
|
text: {
|
|
157
157
|
blend: 'normal'
|
|
158
158
|
},
|
|
159
|
-
|
|
159
|
+
vectorPoint: {},
|
|
160
160
|
tile: {},
|
|
161
161
|
tileText: {},
|
|
162
162
|
earthFill: {},
|
|
@@ -170,9 +170,8 @@ var PointLayer = /*#__PURE__*/function (_BaseLayer) {
|
|
|
170
170
|
var parserType = this.layerSource.getParserType();
|
|
171
171
|
|
|
172
172
|
if (isVectorTile(parserType)) {
|
|
173
|
-
return '
|
|
174
|
-
} //
|
|
175
|
-
// 2D、 3d、 shape、image、text、normal、
|
|
173
|
+
return 'vectorPoint';
|
|
174
|
+
} // 2D、 3d、 shape、image、text、normal、
|
|
176
175
|
|
|
177
176
|
|
|
178
177
|
var layerData = this.getEncodedData();
|
|
@@ -2,7 +2,7 @@ import { IModel } from '@antv/l7-core';
|
|
|
2
2
|
import BaseModel from '../../core/BaseModel';
|
|
3
3
|
export default class ExtrudeModel extends BaseModel {
|
|
4
4
|
private raiseCount;
|
|
5
|
-
private
|
|
5
|
+
private raiseRepeat;
|
|
6
6
|
getUninforms(): {
|
|
7
7
|
u_pickLight: number;
|
|
8
8
|
u_heightfixed: number;
|
|
@@ -41,7 +41,7 @@ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
41
41
|
|
|
42
42
|
_defineProperty(_assertThisInitialized(_this), "raiseCount", 0);
|
|
43
43
|
|
|
44
|
-
_defineProperty(_assertThisInitialized(_this), "
|
|
44
|
+
_defineProperty(_assertThisInitialized(_this), "raiseRepeat", 0);
|
|
45
45
|
|
|
46
46
|
return _this;
|
|
47
47
|
}
|
|
@@ -116,18 +116,16 @@ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
116
116
|
useLinearColor = 1;
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
if (this.raiseCount < 1 && this.
|
|
119
|
+
if (this.raiseCount < 1 && this.raiseRepeat > 0) {
|
|
120
120
|
if (animateOption.enable) {
|
|
121
121
|
var _animateOption$speed = animateOption.speed,
|
|
122
|
-
speed = _animateOption$speed === void 0 ? 0.01 : _animateOption$speed
|
|
123
|
-
_animateOption$repeat = animateOption.repeat,
|
|
124
|
-
repeat = _animateOption$repeat === void 0 ? false : _animateOption$repeat;
|
|
122
|
+
speed = _animateOption$speed === void 0 ? 0.01 : _animateOption$speed;
|
|
125
123
|
this.raiseCount += speed;
|
|
126
124
|
|
|
127
125
|
if (this.raiseCount >= 1) {
|
|
128
|
-
if (this.
|
|
126
|
+
if (this.raiseRepeat > 1) {
|
|
129
127
|
this.raiseCount = 0;
|
|
130
|
-
this.
|
|
128
|
+
this.raiseRepeat--;
|
|
131
129
|
} else {
|
|
132
130
|
this.raiseCount = 1;
|
|
133
131
|
}
|
|
@@ -140,7 +138,7 @@ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
140
138
|
u_pickLight: Number(pickLight),
|
|
141
139
|
// 圆柱体是否固定高度
|
|
142
140
|
u_heightfixed: Number(heightfixed),
|
|
143
|
-
u_r: animateOption.enable && this.
|
|
141
|
+
u_r: animateOption.enable && this.raiseRepeat > 0 ? this.raiseCount : 1.0,
|
|
144
142
|
u_dataTexture: this.dataTexture,
|
|
145
143
|
// 数据纹理 - 有数据映射的时候纹理中带数据,若没有任何数据映射时纹理是 [1]
|
|
146
144
|
u_cellTypeLayout: this.getCellTypeLayout(),
|
|
@@ -169,7 +167,7 @@ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
169
167
|
_ref2$animateOption$r = _ref2.animateOption.repeat,
|
|
170
168
|
repeat = _ref2$animateOption$r === void 0 ? 1 : _ref2$animateOption$r;
|
|
171
169
|
|
|
172
|
-
this.
|
|
170
|
+
this.raiseRepeat = repeat;
|
|
173
171
|
this.layer.buildLayerModel({
|
|
174
172
|
moduleName: 'pointEarthExtrude',
|
|
175
173
|
vertexShader: pointExtrudeVert,
|
|
@@ -200,20 +198,18 @@ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
200
198
|
}, {
|
|
201
199
|
key: "registerBuiltinAttributes",
|
|
202
200
|
value: function registerBuiltinAttributes() {
|
|
203
|
-
// point layer size;
|
|
204
201
|
this.styleAttributeService.registerStyleAttribute({
|
|
205
202
|
name: 'size',
|
|
206
203
|
type: AttributeType.Attribute,
|
|
207
204
|
descriptor: {
|
|
208
205
|
name: 'a_Size',
|
|
209
206
|
buffer: {
|
|
210
|
-
// give the WebGL driver a hint that this buffer may change
|
|
211
207
|
usage: gl.DYNAMIC_DRAW,
|
|
212
208
|
data: [],
|
|
213
209
|
type: gl.FLOAT
|
|
214
210
|
},
|
|
215
211
|
size: 3,
|
|
216
|
-
update: function update(feature
|
|
212
|
+
update: function update(feature) {
|
|
217
213
|
var size = feature.size;
|
|
218
214
|
|
|
219
215
|
if (size) {
|
|
@@ -258,13 +254,12 @@ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
258
254
|
descriptor: {
|
|
259
255
|
name: 'a_Pos',
|
|
260
256
|
buffer: {
|
|
261
|
-
// give the WebGL driver a hint that this buffer may change
|
|
262
257
|
usage: gl.DYNAMIC_DRAW,
|
|
263
258
|
data: [],
|
|
264
259
|
type: gl.FLOAT
|
|
265
260
|
},
|
|
266
261
|
size: 3,
|
|
267
|
-
update: function update(feature
|
|
262
|
+
update: function update(feature) {
|
|
268
263
|
var coordinates = calculateCentroid(feature.coordinates);
|
|
269
264
|
return lglt2xyz([coordinates[0], coordinates[1]]);
|
|
270
265
|
}
|