@antv/l7-layers 2.15.2 → 2.15.3

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.
Files changed (242) hide show
  1. package/es/Geometry/index.js +9 -31
  2. package/es/Geometry/models/billboard.js +51 -89
  3. package/es/Geometry/models/plane.js +81 -143
  4. package/es/Geometry/models/sprite.js +60 -118
  5. package/es/canvas/index.js +10 -33
  6. package/es/canvas/models/canvas.js +41 -97
  7. package/es/citybuliding/building.js +8 -27
  8. package/es/citybuliding/models/build.js +57 -82
  9. package/es/core/BaseLayer.js +320 -484
  10. package/es/core/BaseModel.js +97 -126
  11. package/es/core/LayerPickService.js +21 -32
  12. package/es/core/TextureService.js +0 -13
  13. package/es/core/interface.js +17 -24
  14. package/es/core/shape/Path.js +13 -20
  15. package/es/core/shape/extrude.js +10 -31
  16. package/es/core/triangulation.js +54 -114
  17. package/es/earth/index.js +9 -33
  18. package/es/earth/models/atmosphere.js +30 -54
  19. package/es/earth/models/base.js +47 -85
  20. package/es/earth/models/bloomsphere.js +30 -54
  21. package/es/earth/utils.js +9 -13
  22. package/es/heatmap/index.js +10 -40
  23. package/es/heatmap/models/grid.js +28 -52
  24. package/es/heatmap/models/grid3d.js +28 -52
  25. package/es/heatmap/models/heatmap.js +91 -146
  26. package/es/heatmap/models/hexagon.js +28 -52
  27. package/es/heatmap/triangulation.js +0 -4
  28. package/es/image/index.js +9 -28
  29. package/es/image/models/image.js +66 -100
  30. package/es/index.js +9 -17
  31. package/es/line/index.js +9 -34
  32. package/es/line/models/arc.js +66 -118
  33. package/es/line/models/arc_3d.js +60 -108
  34. package/es/line/models/earthArc_3d.js +63 -111
  35. package/es/line/models/great_circle.js +56 -100
  36. package/es/line/models/half.js +46 -77
  37. package/es/line/models/line.js +94 -148
  38. package/es/line/models/linearline.js +45 -80
  39. package/es/line/models/simpleLine.js +41 -74
  40. package/es/line/models/wall.js +52 -92
  41. package/es/mask/index.js +9 -28
  42. package/es/mask/models/fill.js +29 -54
  43. package/es/plugins/DataMappingPlugin.js +80 -117
  44. package/es/plugins/DataSourcePlugin.js +45 -68
  45. package/es/plugins/FeatureScalePlugin.js +67 -122
  46. package/es/plugins/LayerAnimateStylePlugin.js +0 -5
  47. package/es/plugins/LayerMaskPlugin.js +3 -11
  48. package/es/plugins/LayerModelPlugin.js +67 -104
  49. package/es/plugins/LayerStylePlugin.js +3 -9
  50. package/es/plugins/LightingPlugin.js +12 -18
  51. package/es/plugins/MultiPassRendererPlugin.js +11 -16
  52. package/es/plugins/PixelPickingPlugin.js +12 -21
  53. package/es/plugins/RegisterStyleAttributePlugin.js +5 -12
  54. package/es/plugins/ShaderUniformPlugin.js +13 -27
  55. package/es/plugins/UpdateModelPlugin.js +0 -5
  56. package/es/plugins/UpdateStyleAttributePlugin.js +5 -11
  57. package/es/point/index.js +26 -77
  58. package/es/point/models/earthExtrude.js +61 -102
  59. package/es/point/models/earthFill.js +57 -87
  60. package/es/point/models/extrude.js +60 -101
  61. package/es/point/models/fill.js +70 -100
  62. package/es/point/models/fillmage.js +63 -107
  63. package/es/point/models/image.js +48 -88
  64. package/es/point/models/index.js +2 -2
  65. package/es/point/models/normal.js +30 -54
  66. package/es/point/models/radar.js +40 -64
  67. package/es/point/models/simplePoint.js +41 -69
  68. package/es/point/models/text.js +197 -299
  69. package/es/point/shape/extrude.js +4 -13
  70. package/es/polygon/index.js +11 -40
  71. package/es/polygon/models/extrude.js +48 -92
  72. package/es/polygon/models/fill.js +54 -88
  73. package/es/polygon/models/index.js +3 -2
  74. package/es/polygon/models/ocean.js +42 -76
  75. package/es/polygon/models/water.js +37 -71
  76. package/es/raster/buffers/triangulation.js +2 -4
  77. package/es/raster/index.js +9 -32
  78. package/es/raster/models/raster.js +80 -116
  79. package/es/raster/models/rasterRgb.js +84 -127
  80. package/es/raster/models/rasterTerrainRgb.js +56 -84
  81. package/es/tile/interaction/getRasterData.js +14 -20
  82. package/es/tile/interaction/utils.js +7 -9
  83. package/es/tile/manager/base.js +63 -96
  84. package/es/tile/service/TileLayerService.js +30 -52
  85. package/es/tile/service/TilePickService.js +26 -40
  86. package/es/tile/service/TileSourceService.js +3 -7
  87. package/es/tile/tileFactory/DebugTile.js +28 -45
  88. package/es/tile/tileFactory/ImageTile.js +20 -38
  89. package/es/tile/tileFactory/MaskTile.js +22 -43
  90. package/es/tile/tileFactory/RasterRGBTile.js +22 -42
  91. package/es/tile/tileFactory/RasterTerrainRGBTile.js +20 -38
  92. package/es/tile/tileFactory/RasterTile.js +30 -53
  93. package/es/tile/tileFactory/Tile.js +63 -97
  94. package/es/tile/tileFactory/VectorTile.js +41 -68
  95. package/es/tile/tileFactory/index.js +0 -11
  96. package/es/tile/tileFactory/layers/TileDebugLayer.js +6 -27
  97. package/es/tile/tileFactory/util.js +0 -3
  98. package/es/tile/tileLayer/BaseLayer.js +105 -146
  99. package/es/tile/utils.js +1 -1
  100. package/es/utils/blend.js +0 -2
  101. package/es/utils/collision-index.js +9 -16
  102. package/es/utils/dataMappingStyle.js +8 -18
  103. package/es/utils/extrude_polyline.js +101 -149
  104. package/es/utils/grid-index.js +2 -27
  105. package/es/utils/identityScale.js +0 -8
  106. package/es/utils/layerData.js +30 -44
  107. package/es/utils/multiPassRender.js +11 -13
  108. package/es/utils/polylineNormal.js +31 -37
  109. package/es/utils/simpleLine.js +2 -16
  110. package/es/utils/stencil.js +2 -3
  111. package/es/utils/symbol-layout.js +27 -53
  112. package/es/wind/index.js +9 -29
  113. package/es/wind/models/utils.js +26 -51
  114. package/es/wind/models/wind.js +101 -147
  115. package/es/wind/models/windRender.js +53 -66
  116. package/lib/Geometry/index.js +9 -38
  117. package/lib/Geometry/models/billboard.js +51 -97
  118. package/lib/Geometry/models/index.js +0 -5
  119. package/lib/Geometry/models/plane.js +79 -151
  120. package/lib/Geometry/models/sprite.js +60 -127
  121. package/lib/canvas/index.js +10 -40
  122. package/lib/canvas/models/canvas.js +41 -101
  123. package/lib/canvas/models/index.js +0 -3
  124. package/lib/citybuliding/building.js +8 -35
  125. package/lib/citybuliding/models/build.js +57 -92
  126. package/lib/core/BaseLayer.js +320 -478
  127. package/lib/core/BaseModel.js +97 -139
  128. package/lib/core/LayerPickService.js +21 -37
  129. package/lib/core/TextureService.js +0 -16
  130. package/lib/core/interface.js +21 -31
  131. package/lib/core/schema.js +0 -1
  132. package/lib/core/shape/Path.js +14 -31
  133. package/lib/core/shape/extrude.js +10 -54
  134. package/lib/core/triangulation.js +53 -153
  135. package/lib/earth/index.js +9 -43
  136. package/lib/earth/models/atmosphere.js +30 -63
  137. package/lib/earth/models/base.js +47 -90
  138. package/lib/earth/models/bloomsphere.js +30 -63
  139. package/lib/earth/utils.js +7 -31
  140. package/lib/heatmap/index.js +10 -48
  141. package/lib/heatmap/models/grid.js +28 -60
  142. package/lib/heatmap/models/grid3d.js +28 -60
  143. package/lib/heatmap/models/heatmap.js +91 -162
  144. package/lib/heatmap/models/hexagon.js +28 -60
  145. package/lib/heatmap/models/index.js +0 -6
  146. package/lib/heatmap/triangulation.js +0 -5
  147. package/lib/image/index.js +9 -36
  148. package/lib/image/models/image.js +66 -109
  149. package/lib/image/models/index.js +0 -3
  150. package/lib/index.js +7 -61
  151. package/lib/line/index.js +9 -40
  152. package/lib/line/models/arc.js +64 -128
  153. package/lib/line/models/arc_3d.js +58 -119
  154. package/lib/line/models/earthArc_3d.js +61 -122
  155. package/lib/line/models/great_circle.js +56 -111
  156. package/lib/line/models/half.js +46 -87
  157. package/lib/line/models/index.js +0 -11
  158. package/lib/line/models/line.js +92 -156
  159. package/lib/line/models/linearline.js +45 -92
  160. package/lib/line/models/simpleLine.js +41 -84
  161. package/lib/line/models/wall.js +52 -103
  162. package/lib/mask/index.js +9 -36
  163. package/lib/mask/models/fill.js +29 -63
  164. package/lib/mask/models/index.js +0 -3
  165. package/lib/plugins/DataMappingPlugin.js +80 -128
  166. package/lib/plugins/DataSourcePlugin.js +45 -76
  167. package/lib/plugins/FeatureScalePlugin.js +67 -138
  168. package/lib/plugins/LayerAnimateStylePlugin.js +0 -10
  169. package/lib/plugins/LayerMaskPlugin.js +4 -17
  170. package/lib/plugins/LayerModelPlugin.js +68 -113
  171. package/lib/plugins/LayerStylePlugin.js +4 -14
  172. package/lib/plugins/LightingPlugin.js +12 -25
  173. package/lib/plugins/MultiPassRendererPlugin.js +11 -22
  174. package/lib/plugins/PixelPickingPlugin.js +12 -27
  175. package/lib/plugins/RegisterStyleAttributePlugin.js +5 -19
  176. package/lib/plugins/ShaderUniformPlugin.js +13 -34
  177. package/lib/plugins/UpdateModelPlugin.js +1 -10
  178. package/lib/plugins/UpdateStyleAttributePlugin.js +5 -16
  179. package/lib/point/index.js +26 -83
  180. package/lib/point/models/earthExtrude.js +61 -113
  181. package/lib/point/models/earthFill.js +57 -117
  182. package/lib/point/models/extrude.js +60 -111
  183. package/lib/point/models/fill.js +68 -109
  184. package/lib/point/models/fillmage.js +61 -115
  185. package/lib/point/models/image.js +48 -98
  186. package/lib/point/models/index.js +1 -12
  187. package/lib/point/models/normal.js +30 -64
  188. package/lib/point/models/radar.js +40 -74
  189. package/lib/point/models/simplePoint.js +41 -79
  190. package/lib/point/models/text.js +197 -307
  191. package/lib/point/shape/extrude.js +4 -20
  192. package/lib/polygon/index.js +11 -48
  193. package/lib/polygon/models/extrude.js +48 -103
  194. package/lib/polygon/models/fill.js +54 -98
  195. package/lib/polygon/models/index.js +2 -14
  196. package/lib/polygon/models/ocean.js +42 -88
  197. package/lib/polygon/models/water.js +37 -82
  198. package/lib/raster/buffers/triangulation.js +3 -7
  199. package/lib/raster/index.js +9 -40
  200. package/lib/raster/models/index.js +0 -5
  201. package/lib/raster/models/raster.js +80 -125
  202. package/lib/raster/models/rasterRgb.js +84 -139
  203. package/lib/raster/models/rasterTerrainRgb.js +56 -93
  204. package/lib/tile/interaction/getRasterData.js +14 -25
  205. package/lib/tile/interaction/utils.js +7 -19
  206. package/lib/tile/manager/base.js +63 -104
  207. package/lib/tile/service/TileLayerService.js +30 -57
  208. package/lib/tile/service/TilePickService.js +26 -48
  209. package/lib/tile/service/TileSourceService.js +2 -16
  210. package/lib/tile/style/utils.js +0 -3
  211. package/lib/tile/tileFactory/DebugTile.js +28 -53
  212. package/lib/tile/tileFactory/ImageTile.js +20 -46
  213. package/lib/tile/tileFactory/MaskTile.js +22 -51
  214. package/lib/tile/tileFactory/RasterRGBTile.js +22 -50
  215. package/lib/tile/tileFactory/RasterTerrainRGBTile.js +20 -46
  216. package/lib/tile/tileFactory/RasterTile.js +30 -63
  217. package/lib/tile/tileFactory/Tile.js +63 -102
  218. package/lib/tile/tileFactory/VectorTile.js +41 -76
  219. package/lib/tile/tileFactory/index.js +0 -25
  220. package/lib/tile/tileFactory/layers/TileDebugLayer.js +6 -32
  221. package/lib/tile/tileFactory/util.js +0 -9
  222. package/lib/tile/tileLayer/BaseLayer.js +105 -153
  223. package/lib/tile/utils.js +1 -5
  224. package/lib/utils/blend.js +0 -5
  225. package/lib/utils/collision-index.js +9 -25
  226. package/lib/utils/dataMappingStyle.js +8 -19
  227. package/lib/utils/extrude_polyline.js +101 -181
  228. package/lib/utils/grid-index.js +2 -28
  229. package/lib/utils/identityScale.js +0 -9
  230. package/lib/utils/layerData.js +30 -49
  231. package/lib/utils/multiPassRender.js +11 -16
  232. package/lib/utils/polylineNormal.js +31 -66
  233. package/lib/utils/simpleLine.js +2 -21
  234. package/lib/utils/stencil.js +0 -4
  235. package/lib/utils/symbol-layout.js +27 -55
  236. package/lib/wind/index.js +9 -37
  237. package/lib/wind/models/index.js +0 -3
  238. package/lib/wind/models/utils.js +26 -62
  239. package/lib/wind/models/wind.js +101 -157
  240. package/lib/wind/models/windRender.js +53 -71
  241. package/lib/wind/models/windShader.js +0 -1
  242. package/package.json +7 -7
@@ -7,63 +7,46 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConst
7
7
  import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
8
8
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
9
9
  import _regeneratorRuntime from "@babel/runtime/regenerator";
10
-
11
10
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
12
-
13
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; } }
14
-
15
12
  import { AttributeType, gl } from '@antv/l7-core';
16
13
  import { rgb2arr } from '@antv/l7-utils';
17
14
  import { isNumber } from 'lodash';
18
15
  import BaseModel from "../../core/BaseModel";
19
16
  import { LineArcTriangulation } from "../../core/triangulation";
20
- import { EARTH_RADIUS } from "../../earth/utils"; // arc3d line layer
21
-
17
+ import { EARTH_RADIUS } from "../../earth/utils";
18
+ // arc3d line layer
22
19
  /* babel-plugin-inline-import '../shaders/line_arc_3d_frag.glsl' */
23
20
  var arc3d_line_frag = "#define LineTypeSolid 0.0\n#define LineTypeDash 1.0\n#define Animate 0.0\n#define LineTexture 1.0\n\nuniform float u_opacity;\nuniform float u_textureBlend;\nuniform float u_blur : 0.9;\nuniform float u_line_type: 0.0;\n// varying vec2 v_normal;\nvarying vec4 v_dash_array;\nvarying vec4 v_color;\n\nuniform float u_line_texture: 0.0;\nuniform sampler2D u_texture;\nuniform vec2 u_textSize;\nvarying float v_segmentIndex;\nuniform float segmentNumber;\n\nvarying vec2 v_iconMapUV;\n\nuniform float u_time;\nuniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];\n\nvarying mat4 styleMappingMat;\n\n#pragma include \"picking\"\n\nvoid main() {\n float opacity = styleMappingMat[0][0];\n float animateSpeed = 0.0; // \u8FD0\u52A8\u901F\u5EA6\n float d_distance_ratio = styleMappingMat[3].g; // \u5F53\u524D\u70B9\u4F4D\u8DDD\u79BB\u5360\u7EBF\u603B\u957F\u7684\u6BD4\u4F8B\n gl_FragColor = v_color;\n\n gl_FragColor.a *= opacity;\n if(u_line_type == LineTypeDash) {\n float flag = 0.;\n float dashLength = mod(d_distance_ratio, v_dash_array.x + v_dash_array.y + v_dash_array.z + v_dash_array.w);\n if(dashLength < v_dash_array.x || (dashLength > (v_dash_array.x + v_dash_array.y) && dashLength < v_dash_array.x + v_dash_array.y + v_dash_array.z)) {\n flag = 1.;\n }\n gl_FragColor.a *=flag;\n }\n\n if(u_animate.x == Animate && u_line_texture != LineTexture) {\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) + u_time / u_animate.y);\n\n alpha = (alpha + u_animate.w -1.0) / u_animate.w;\n // alpha = smoothstep(0., 1., alpha);\n alpha = clamp(alpha, 0.0, 1.0);\n gl_FragColor.a *= alpha;\n\n // u_animate \n // x enable\n // y duration\n // z interval\n // w trailLength\n }\n\n if(u_line_texture == LineTexture && u_line_type != LineTypeDash) { // while load texture\n // float arcRadio = smoothstep( 0.0, 1.0, (v_segmentIndex / segmentNumber));\n float arcRadio = v_segmentIndex / (segmentNumber - 1.0);\n float count = styleMappingMat[3].b; // // \u8D34\u56FE\u5728\u5F27\u7EBF\u4E0A\u91CD\u590D\u7684\u6570\u91CF\n\n float time = 0.0;\n if(u_animate.x == Animate) {\n time = u_time / u_animate.y;\n }\n float redioCount = arcRadio * count;\n\n float u = fract(redioCount - time);\n\n float v = styleMappingMat[3].a; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C\n vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.;\n vec4 pattern = texture2D(u_texture, uv);\n\n if(u_animate.x == Animate) {\n float currentPlane = floor(redioCount - time);\n float textureStep = floor(count * u_animate.z);\n float a = mod(currentPlane, textureStep);\n if(a < textureStep - 1.0) {\n pattern = vec4(0.0);\n }\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 discard;\n } else {\n gl_FragColor = filterColor(pattern);\n }\n }\n\n } else {\n gl_FragColor = filterColor(gl_FragColor);\n }\n}\n";
24
-
25
21
  /* babel-plugin-inline-import '../shaders/line_arc_3d_vert.glsl' */
26
22
  var arc3d_line_vert = "#define LineTypeSolid 0.0\n#define LineTypeDash 1.0\n#define Animate 0.0\n#define LineTexture 1.0\nattribute vec3 a_Position;\nattribute vec4 a_Instance;\nattribute vec4 a_Color;\nattribute float a_Size;\n\nuniform float u_globel;\nuniform float u_globel_radius;\nuniform float u_global_height: 10;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nuniform float segmentNumber;\nuniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];\nvarying vec4 v_color;\n\nuniform float u_line_type: 0.0;\nuniform vec4 u_dash_array: [10.0, 5., 0, 0];\nvarying vec4 v_dash_array;\n\nuniform float u_icon_step: 100;\nuniform float u_line_texture: 0.0;\nvarying float v_segmentIndex;\n\nattribute vec2 a_iconMapUV;\nvarying vec2 v_iconMapUV;\n\nuniform float u_opacity: 1.0;\nvarying mat4 styleMappingMat; // \u7528\u4E8E\u5C06\u5728\u9876\u70B9\u7740\u8272\u5668\u4E2D\u8BA1\u7B97\u597D\u7684\u6837\u5F0F\u503C\u4F20\u9012\u7ED9\u7247\u5143\n\n#pragma include \"styleMapping\"\n#pragma include \"styleMappingCalOpacity\"\n\n#pragma include \"projection\"\n#pragma include \"project\"\n#pragma include \"picking\"\n\nfloat maps (float value, float start1, float stop1, float start2, float stop2) {\n return start2 + (stop2 - start2) * ((value - start1) / (stop1 - start1));\n}\n\nfloat getSegmentRatio(float index) {\n return smoothstep(0.0, 1.0, index / (segmentNumber - 1.0));\n}\n\nfloat paraboloid(vec2 source, vec2 target, float ratio) {\n vec2 x = mix(source, target, ratio);\n vec2 center = mix(source, target, 0.5);\n float dSourceCenter = distance(source, center);\n float dXCenter = distance(x, center);\n return (dSourceCenter + dXCenter) * (dSourceCenter - dXCenter);\n}\n\nvec3 getPos(vec2 source, vec2 target, float segmentRatio) {\n float vertex_height = paraboloid(source, target, segmentRatio);\n\n return vec3(\n mix(source, target, segmentRatio),\n sqrt(max(0.0, vertex_height))\n );\n}\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction) {\n // normalized direction of the line\n vec2 dir_screenspace = normalize(line_clipspace);\n // rotate by 90 degrees\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n vec2 offset = dir_screenspace * offset_direction * setPickingSize(a_Size) / 2.0;\n\n return offset;\n}\nvec2 getNormal(vec2 line_clipspace, float offset_direction) {\n // normalized direction of the line\n vec2 dir_screenspace = normalize(line_clipspace);\n // rotate by 90 degrees\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n return reverse_offset_normal(vec3(dir_screenspace,1.0)).xy * sign(offset_direction);\n}\n\nfloat torad(float deg) {\n return (deg / 180.0) * acos(-1.0);\n}\n\nvec3 lglt2xyz(vec2 lnglat) {\n float pi = 3.1415926;\n // + Math.PI/2 \u662F\u4E3A\u4E86\u5BF9\u9F50\u5750\u6807\n float lng = torad(lnglat.x) + pi / 2.0;\n float lat = torad(lnglat.y);\n\n // \u624B\u52A8\u589E\u52A0\u4E00\u4E9B\u504F\u79FB\uFF0C\u51CF\u8F7B\u9762\u7684\u51B2\u7A81\n float radius = u_globel_radius;\n\n float z = radius * cos(lat) * cos(lng);\n float x = radius * cos(lat) * sin(lng);\n float y = radius * sin(lat);\n return vec3(x, y, z);\n}\n\nvoid main() {\n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\n styleMappingMat = mat4(\n 0.0, 0.0, 0.0, 0.0, // opacity - strokeOpacity - strokeWidth - empty\n 0.0, 0.0, 0.0, 0.0, // strokeR - strokeG - strokeB - strokeA\n 0.0, 0.0, 0.0, 0.0, // offsets[0] - offsets[1]\n 0.0, 0.0, 0.0, 0.0 // dataset \u6570\u636E\u96C6\n );\n\n float rowCount = u_cellTypeLayout[0][0]; // \u5F53\u524D\u7684\u6570\u636E\u7EB9\u7406\u6709\u51E0\u884C\n float columnCount = u_cellTypeLayout[0][1]; // \u5F53\u770B\u5230\u6570\u636E\u7EB9\u7406\u6709\u51E0\u5217\n float columnWidth = 1.0/columnCount; // \u5217\u5BBD\n float rowHeight = 1.0/rowCount; // \u884C\u9AD8\n float cellCount = calCellCount(); // opacity - strokeOpacity - strokeWidth - stroke - offsets\n float id = a_vertexId; // \u7B2Cn\u4E2A\u9876\u70B9\n float cellCurrentRow = floor(id * cellCount / columnCount) + 1.0; // \u8D77\u59CB\u70B9\u5728\u7B2C\u51E0\u884C\n float cellCurrentColumn = mod(id * cellCount, columnCount) + 1.0; // \u8D77\u59CB\u70B9\u5728\u7B2C\u51E0\u5217\n \n // cell \u56FA\u5B9A\u987A\u5E8F opacity -> strokeOpacity -> strokeWidth -> stroke ... \n // \u6309\u987A\u5E8F\u4ECE cell \u4E2D\u53D6\u503C\u3001\u82E5\u6CA1\u6709\u5219\u81EA\u52A8\u5F80\u4E0B\u53D6\u503C\n float textureOffset = 0.0; // \u5728 cell \u4E2D\u53D6\u503C\u7684\u504F\u79FB\u91CF\n\n vec2 opacityAndOffset = calOpacityAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);\n styleMappingMat[0][0] = opacityAndOffset.r;\n textureOffset = opacityAndOffset.g;\n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\n\n v_color = a_Color;\n vec2 source = project_position(vec4(a_Instance.rg, 0, 0)).xy;\n vec2 target = project_position(vec4(a_Instance.ba, 0, 0)).xy;\n float segmentIndex = a_Position.x;\n float segmentRatio = getSegmentRatio(segmentIndex);\n float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\n\n float d_distance_ratio;\n if(u_line_type == LineTypeDash) {\n d_distance_ratio = segmentIndex / segmentNumber;\n vec2 s = source;\n vec2 t = target;\n \n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n s = unProjCustomCoord(source);\n t = unProjCustomCoord(target);\n }\n float total_Distance = pixelDistance(s, t) / 2.0 * PI;\n v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / (total_Distance / segmentNumber * segmentIndex);\n }\n if(u_animate.x == Animate) {\n d_distance_ratio = segmentIndex / segmentNumber;\n }\n styleMappingMat[3].g = d_distance_ratio; // \u5F53\u524D\u70B9\u4F4D\u8DDD\u79BB\u5360\u7EBF\u603B\u957F\u7684\u6BD4\u4F8B\n\n float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);\n vec3 curr = getPos(source, target, segmentRatio);\n vec3 next = getPos(source, target, nextSegmentRatio);\n vec2 offset = getExtrusionOffset((next.xy - curr.xy) * indexDir, a_Position.y);\n // v_normal = getNormal((next.xy - curr.xy) * indexDir, a_Position.y);\n\n\n v_segmentIndex = a_Position.x;\n if(LineTexture == u_line_texture && u_line_type != LineTypeDash) { // \u5F00\u542F\u8D34\u56FE\u6A21\u5F0F \n\n float arcDistrance = length(source - target);\n float pixelLen = project_pixel_texture(u_icon_step);\n styleMappingMat[3].b = floor(arcDistrance/pixelLen); // \u8D34\u56FE\u5728\u5F27\u7EBF\u4E0A\u91CD\u590D\u7684\u6570\u91CF\n\n vec2 projectOffset = project_pixel(offset);\n float lineOffsetWidth = length(projectOffset + projectOffset * sign(a_Position.y)); // \u7EBF\u6A2A\u5411\u504F\u79FB\u7684\u8DDD\u79BB\n float linePixelSize = project_pixel(a_Size); // \u5B9A\u70B9\u4F4D\u7F6E\u504F\u79FB\uFF0C\u6309\u5730\u56FE\u7B49\u7EA7\u7F29\u653E\u540E\u7684\u8DDD\u79BB\n styleMappingMat[3].a = lineOffsetWidth/linePixelSize; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C\n\n v_iconMapUV = a_iconMapUV;\n }\n \n\n // gl_Position = project_common_position_to_clipspace(vec4(curr.xy + project_pixel(offset), curr.z, 1.0));\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(curr.xy + project_pixel(offset), curr.z, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(curr.xy + project_pixel(offset), curr.z, 1.0));\n }\n\n // \u5730\u7403\u6A21\u5F0F\n if(u_globel > 0.0) {\n vec3 startLngLat = lglt2xyz(a_Instance.rg);\n vec3 endLngLat = lglt2xyz(a_Instance.ba);\n float globalRadius = length(startLngLat);\n\n vec3 lineDir = normalize(endLngLat - startLngLat);\n vec3 midPointDir = normalize((startLngLat + endLngLat)/2.0);\n\n // \u7EBF\u7684\u504F\u79FB\n vec3 lnglatOffset = cross(lineDir, midPointDir) * a_Position.y;\n // \u8BA1\u7B97\u8D77\u59CB\u70B9\u548C\u7EC8\u6B62\u70B9\u7684\u8DDD\u79BB\n float lnglatLength = length(a_Instance.rg - a_Instance.ba)/50.0;\n // \u8BA1\u7B97\u98DE\u7EBF\u5404\u4E2A\u8282\u70B9\u76F8\u5E94\u7684\u9AD8\u5EA6\n float lineHeight = u_global_height * (-4.0*segmentRatio*segmentRatio + 4.0 * segmentRatio) * lnglatLength;\n // \u5730\u7403\u70B9\u4F4D\n vec3 globalPoint = normalize(mix(startLngLat, endLngLat, segmentRatio)) * (globalRadius + lineHeight) + lnglatOffset * a_Size;\n \n gl_Position = u_ViewProjectionMatrix * vec4(globalPoint, 1.0);\n }\n \n\n setPickingColor(a_PickingColor);\n}\n"; // arc3d linear layer
27
-
28
23
  /* babel-plugin-inline-import '../shaders/linear/arc3d_linear_frag.glsl' */
29
24
  var arc3d_linear_frag = "\n#define Animate 0.0\n\nuniform float u_opacity;\nuniform float u_blur : 0.9;\nvarying float v_segmentIndex;\nuniform float segmentNumber;\n\nuniform float u_time;\nuniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];\n\nuniform float u_linearColor: 0;\nuniform vec4 u_sourceColor;\nuniform vec4 u_targetColor;\n\nvarying mat4 styleMappingMat;\n\n#pragma include \"picking\"\n\nvoid main() {\n float opacity = styleMappingMat[0][0];\n float animateSpeed = 0.0; // \u8FD0\u52A8\u901F\u5EA6\n float d_distance_ratio = styleMappingMat[3].g; // \u5F53\u524D\u70B9\u4F4D\u8DDD\u79BB\u5360\u7EBF\u603B\u957F\u7684\u6BD4\u4F8B\n\n gl_FragColor = mix(u_sourceColor, u_targetColor, v_segmentIndex/segmentNumber);\n\n gl_FragColor.a *= opacity;\n\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) + u_time / u_animate.y);\n\n alpha = (alpha + u_animate.w -1.0) / u_animate.w;\n // alpha = smoothstep(0., 1., alpha);\n alpha = clamp(alpha, 0.0, 1.0);\n gl_FragColor.a *= alpha;\n\n // u_animate \n // x enable\n // y duration\n // z interval\n // w trailLength\n }\n\n gl_FragColor = filterColor(gl_FragColor);\n}\n";
30
-
31
25
  /* babel-plugin-inline-import '../shaders/linear/arc3d_linear_vert.glsl' */
32
26
  var arc3d_linear_vert = "#define LineTypeSolid 0.0\n#define LineTypeDash 1.0\n#define Animate 0.0\n#define LineTexture 1.0\nattribute vec3 a_Position;\nattribute vec4 a_Instance;\nattribute vec4 a_Color;\nattribute float a_Size;\nattribute vec2 a_iconMapUV;\n\nuniform float u_globel;\nuniform float u_globel_radius;\nuniform float u_global_height: 10;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nuniform float segmentNumber;\nuniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];\n\nuniform float u_line_type: 0.0;\nuniform vec4 u_dash_array: [10.0, 5., 0, 0];\nuniform float u_icon_step: 100;\nuniform float u_line_texture: 0.0;\nuniform float u_opacity: 1.0;\n\nvarying vec4 v_dash_array;\nvarying vec4 v_color;\nvarying float v_segmentIndex;\nvarying vec2 v_iconMapUV;\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\n#pragma include \"styleMapping\"\n#pragma include \"styleMappingCalOpacity\"\n\n#pragma include \"projection\"\n#pragma include \"project\"\n#pragma include \"picking\"\n\nfloat maps (float value, float start1, float stop1, float start2, float stop2) {\n return start2 + (stop2 - start2) * ((value - start1) / (stop1 - start1));\n}\n\nfloat getSegmentRatio(float index) {\n return smoothstep(0.0, 1.0, index / (segmentNumber - 1.0));\n}\n\nfloat paraboloid(vec2 source, vec2 target, float ratio) {\n vec2 x = mix(source, target, ratio);\n vec2 center = mix(source, target, 0.5);\n float dSourceCenter = distance(source, center);\n float dXCenter = distance(x, center);\n return (dSourceCenter + dXCenter) * (dSourceCenter - dXCenter);\n}\n\nvec3 getPos(vec2 source, vec2 target, float segmentRatio) {\n float vertex_height = paraboloid(source, target, segmentRatio);\n\n return vec3(\n mix(source, target, segmentRatio),\n sqrt(max(0.0, vertex_height))\n );\n}\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction) {\n // normalized direction of the line\n vec2 dir_screenspace = normalize(line_clipspace);\n // rotate by 90 degrees\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n vec2 offset = dir_screenspace * offset_direction * setPickingSize(a_Size) / 2.0;\n\n return offset;\n}\nvec2 getNormal(vec2 line_clipspace, float offset_direction) {\n // normalized direction of the line\n vec2 dir_screenspace = normalize(line_clipspace);\n // rotate by 90 degrees\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n return reverse_offset_normal(vec3(dir_screenspace,1.0)).xy * sign(offset_direction);\n}\n\nfloat torad(float deg) {\n return (deg / 180.0) * acos(-1.0);\n}\n\nvec3 lglt2xyz(vec2 lnglat) {\n float pi = 3.1415926;\n // + Math.PI/2 \u662F\u4E3A\u4E86\u5BF9\u9F50\u5750\u6807\n float lng = torad(lnglat.x) + pi / 2.0;\n float lat = torad(lnglat.y);\n\n // \u624B\u52A8\u589E\u52A0\u4E00\u4E9B\u504F\u79FB\uFF0C\u51CF\u8F7B\u9762\u7684\u51B2\u7A81\n float radius = u_globel_radius;\n\n float z = radius * cos(lat) * cos(lng);\n float x = radius * cos(lat) * sin(lng);\n float y = radius * sin(lat);\n return vec3(x, y, z);\n}\n\nvoid main() {\n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\n styleMappingMat = mat4(\n 0.0, 0.0, 0.0, 0.0, // opacity - strokeOpacity - strokeWidth - empty\n 0.0, 0.0, 0.0, 0.0, // strokeR - strokeG - strokeB - strokeA\n 0.0, 0.0, 0.0, 0.0, // offsets[0] - offsets[1]\n 0.0, 0.0, 0.0, 0.0 // dataset \u6570\u636E\u96C6\n );\n\n float rowCount = u_cellTypeLayout[0][0]; // \u5F53\u524D\u7684\u6570\u636E\u7EB9\u7406\u6709\u51E0\u884C\n float columnCount = u_cellTypeLayout[0][1]; // \u5F53\u770B\u5230\u6570\u636E\u7EB9\u7406\u6709\u51E0\u5217\n float columnWidth = 1.0/columnCount; // \u5217\u5BBD\n float rowHeight = 1.0/rowCount; // \u884C\u9AD8\n float cellCount = calCellCount(); // opacity - strokeOpacity - strokeWidth - stroke - offsets\n float id = a_vertexId; // \u7B2Cn\u4E2A\u9876\u70B9\n float cellCurrentRow = floor(id * cellCount / columnCount) + 1.0; // \u8D77\u59CB\u70B9\u5728\u7B2C\u51E0\u884C\n float cellCurrentColumn = mod(id * cellCount, columnCount) + 1.0; // \u8D77\u59CB\u70B9\u5728\u7B2C\u51E0\u5217\n \n // cell \u56FA\u5B9A\u987A\u5E8F opacity -> strokeOpacity -> strokeWidth -> stroke ... \n // \u6309\u987A\u5E8F\u4ECE cell \u4E2D\u53D6\u503C\u3001\u82E5\u6CA1\u6709\u5219\u81EA\u52A8\u5F80\u4E0B\u53D6\u503C\n float textureOffset = 0.0; // \u5728 cell \u4E2D\u53D6\u503C\u7684\u504F\u79FB\u91CF\n\n vec2 opacityAndOffset = calOpacityAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);\n styleMappingMat[0][0] = opacityAndOffset.r;\n textureOffset = opacityAndOffset.g;\n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\n\n v_color = a_Color;\n vec2 source = project_position(vec4(a_Instance.rg, 0, 0)).xy;\n vec2 target = project_position(vec4(a_Instance.ba, 0, 0)).xy;\n float segmentIndex = a_Position.x;\n float segmentRatio = getSegmentRatio(segmentIndex);\n float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\n\n float d_distance_ratio;\n if(u_line_type == LineTypeDash) {\n d_distance_ratio = segmentIndex / segmentNumber;\n // float total_Distance = pixelDistance(a_Instance.rg, a_Instance.ba) / 2.0 * PI;\n vec2 s = source;\n vec2 t = target;\n \n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n s = unProjCustomCoord(source);\n t = unProjCustomCoord(target);\n }\n float total_Distance = pixelDistance(s, t) / 2.0 * PI;\n v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / (total_Distance / segmentNumber * segmentIndex);\n }\n if(u_animate.x == Animate) {\n d_distance_ratio = segmentIndex / segmentNumber;\n }\n styleMappingMat[3].g = d_distance_ratio; // \u5F53\u524D\u70B9\u4F4D\u8DDD\u79BB\u5360\u7EBF\u603B\u957F\u7684\u6BD4\u4F8B\n\n float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);\n vec3 curr = getPos(source, target, segmentRatio);\n vec3 next = getPos(source, target, nextSegmentRatio);\n vec2 offset = getExtrusionOffset((next.xy - curr.xy) * indexDir, a_Position.y);\n // v_normal = getNormal((next.xy - curr.xy) * indexDir, a_Position.y);\n\n\n v_segmentIndex = a_Position.x;\n if(LineTexture == u_line_texture && u_line_type != LineTypeDash) { // \u5F00\u542F\u8D34\u56FE\u6A21\u5F0F \n\n float arcDistrance = length(source - target);\n float pixelLen = project_pixel_texture(u_icon_step);\n styleMappingMat[3].b = floor(arcDistrance/pixelLen); // \u8D34\u56FE\u5728\u5F27\u7EBF\u4E0A\u91CD\u590D\u7684\u6570\u91CF\n\n vec2 projectOffset = project_pixel(offset);\n float lineOffsetWidth = length(projectOffset + projectOffset * sign(a_Position.y)); // \u7EBF\u6A2A\u5411\u504F\u79FB\u7684\u8DDD\u79BB\n float linePixelSize = project_pixel(a_Size); // \u5B9A\u70B9\u4F4D\u7F6E\u504F\u79FB\uFF0C\u6309\u5730\u56FE\u7B49\u7EA7\u7F29\u653E\u540E\u7684\u8DDD\u79BB\n styleMappingMat[3].a = lineOffsetWidth/linePixelSize; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C\n\n v_iconMapUV = a_iconMapUV;\n }\n \n\n // gl_Position = project_common_position_to_clipspace(vec4(curr.xy + project_pixel(offset), curr.z, 1.0));\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(curr.xy + project_pixel(offset), curr.z, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(curr.xy + project_pixel(offset), curr.z, 1.0));\n }\n\n // \u5730\u7403\u6A21\u5F0F\n if(u_globel > 0.0) {\n vec3 startLngLat = lglt2xyz(a_Instance.rg);\n vec3 endLngLat = lglt2xyz(a_Instance.ba);\n float globalRadius = length(startLngLat);\n\n vec3 lineDir = normalize(endLngLat - startLngLat);\n vec3 midPointDir = normalize((startLngLat + endLngLat)/2.0);\n\n // \u7EBF\u7684\u504F\u79FB\n vec3 lnglatOffset = cross(lineDir, midPointDir) * a_Position.y;\n // \u8BA1\u7B97\u8D77\u59CB\u70B9\u548C\u7EC8\u6B62\u70B9\u7684\u8DDD\u79BB\n float lnglatLength = length(a_Instance.rg - a_Instance.ba)/50.0;\n // \u8BA1\u7B97\u98DE\u7EBF\u5404\u4E2A\u8282\u70B9\u76F8\u5E94\u7684\u9AD8\u5EA6\n float lineHeight = u_global_height * (-4.0*segmentRatio*segmentRatio + 4.0 * segmentRatio) * lnglatLength;\n // \u5730\u7403\u70B9\u4F4D\n vec3 globalPoint = normalize(mix(startLngLat, endLngLat, segmentRatio)) * (globalRadius + lineHeight) + lnglatOffset * a_Size;\n \n gl_Position = u_ViewProjectionMatrix * vec4(globalPoint, 1.0);\n }\n \n\n setPickingColor(a_PickingColor);\n}\n";
33
27
  var lineStyleObj = {
34
28
  solid: 0.0,
35
29
  dash: 1.0
36
30
  };
37
-
38
31
  var Arc3DModel = /*#__PURE__*/function (_BaseModel) {
39
32
  _inherits(Arc3DModel, _BaseModel);
40
-
41
33
  var _super = _createSuper(Arc3DModel);
42
-
43
34
  function Arc3DModel() {
44
35
  var _this;
45
-
46
36
  _classCallCheck(this, Arc3DModel);
47
-
48
37
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
49
38
  args[_key] = arguments[_key];
50
39
  }
51
-
52
40
  _this = _super.call.apply(_super, [this].concat(args));
53
-
54
41
  _defineProperty(_assertThisInitialized(_this), "updateTexture", function () {
55
42
  var createTexture2D = _this.rendererService.createTexture2D;
56
-
57
43
  if (_this.texture) {
58
44
  _this.texture.update({
59
45
  data: _this.iconService.getCanvas()
60
46
  });
61
-
62
47
  _this.layer.render();
63
-
64
48
  return;
65
49
  }
66
-
67
50
  _this.texture = createTexture2D({
68
51
  data: _this.iconService.getCanvas(),
69
52
  mag: gl.NEAREST,
@@ -73,53 +56,46 @@ var Arc3DModel = /*#__PURE__*/function (_BaseModel) {
73
56
  height: _this.iconService.canvasHeight || 128
74
57
  });
75
58
  });
76
-
77
59
  return _this;
78
60
  }
79
-
80
61
  _createClass(Arc3DModel, [{
81
62
  key: "getUninforms",
82
63
  value: function getUninforms() {
83
64
  var _ref = this.layer.getLayerConfig(),
84
- _ref$opacity = _ref.opacity,
85
- opacity = _ref$opacity === void 0 ? 1 : _ref$opacity,
86
- sourceColor = _ref.sourceColor,
87
- targetColor = _ref.targetColor,
88
- _ref$textureBlend = _ref.textureBlend,
89
- textureBlend = _ref$textureBlend === void 0 ? 'normal' : _ref$textureBlend,
90
- _ref$lineType = _ref.lineType,
91
- lineType = _ref$lineType === void 0 ? 'solid' : _ref$lineType,
92
- _ref$dashArray = _ref.dashArray,
93
- dashArray = _ref$dashArray === void 0 ? [10, 5] : _ref$dashArray,
94
- _ref$lineTexture = _ref.lineTexture,
95
- lineTexture = _ref$lineTexture === void 0 ? false : _ref$lineTexture,
96
- _ref$iconStep = _ref.iconStep,
97
- iconStep = _ref$iconStep === void 0 ? 100 : _ref$iconStep,
98
- _ref$segmentNumber = _ref.segmentNumber,
99
- segmentNumber = _ref$segmentNumber === void 0 ? 30 : _ref$segmentNumber,
100
- _ref$globalArcHeight = _ref.globalArcHeight,
101
- globalArcHeight = _ref$globalArcHeight === void 0 ? 10 : _ref$globalArcHeight;
102
-
65
+ _ref$opacity = _ref.opacity,
66
+ opacity = _ref$opacity === void 0 ? 1 : _ref$opacity,
67
+ sourceColor = _ref.sourceColor,
68
+ targetColor = _ref.targetColor,
69
+ _ref$textureBlend = _ref.textureBlend,
70
+ textureBlend = _ref$textureBlend === void 0 ? 'normal' : _ref$textureBlend,
71
+ _ref$lineType = _ref.lineType,
72
+ lineType = _ref$lineType === void 0 ? 'solid' : _ref$lineType,
73
+ _ref$dashArray = _ref.dashArray,
74
+ dashArray = _ref$dashArray === void 0 ? [10, 5] : _ref$dashArray,
75
+ _ref$lineTexture = _ref.lineTexture,
76
+ lineTexture = _ref$lineTexture === void 0 ? false : _ref$lineTexture,
77
+ _ref$iconStep = _ref.iconStep,
78
+ iconStep = _ref$iconStep === void 0 ? 100 : _ref$iconStep,
79
+ _ref$segmentNumber = _ref.segmentNumber,
80
+ segmentNumber = _ref$segmentNumber === void 0 ? 30 : _ref$segmentNumber,
81
+ _ref$globalArcHeight = _ref.globalArcHeight,
82
+ globalArcHeight = _ref$globalArcHeight === void 0 ? 10 : _ref$globalArcHeight;
103
83
  if (dashArray.length === 2) {
104
84
  dashArray.push(0, 0);
105
- } // 转化渐变色
106
-
85
+ }
107
86
 
87
+ // 转化渐变色
108
88
  var useLinearColor = 0; // 默认不生效
109
-
110
89
  var sourceColorArr = [0, 0, 0, 0];
111
90
  var targetColorArr = [0, 0, 0, 0];
112
-
113
91
  if (sourceColor && targetColor) {
114
92
  sourceColorArr = rgb2arr(sourceColor);
115
93
  targetColorArr = rgb2arr(targetColor);
116
94
  useLinearColor = 1;
117
95
  }
118
-
119
96
  if (this.rendererService.getDirty()) {
120
97
  this.texture.bind();
121
98
  }
122
-
123
99
  if (this.dataTextureTest && this.dataTextureNeedUpdate({
124
100
  opacity: opacity
125
101
  })) {
@@ -127,12 +103,10 @@ var Arc3DModel = /*#__PURE__*/function (_BaseModel) {
127
103
  opacity: opacity
128
104
  });
129
105
  var encodeData = this.layer.getEncodedData();
130
-
131
106
  var _this$calDataFrame = this.calDataFrame(this.cellLength, encodeData, this.cellProperties),
132
- data = _this$calDataFrame.data,
133
- width = _this$calDataFrame.width,
134
- height = _this$calDataFrame.height;
135
-
107
+ data = _this$calDataFrame.data,
108
+ width = _this$calDataFrame.width,
109
+ height = _this$calDataFrame.height;
136
110
  this.rowCount = height; // 当前数据纹理有多少行
137
111
 
138
112
  this.dataTexture = this.cellLength > 0 && data.length > 0 ? this.createTexture2D({
@@ -151,7 +125,6 @@ var Arc3DModel = /*#__PURE__*/function (_BaseModel) {
151
125
  height: 1
152
126
  });
153
127
  }
154
-
155
128
  return {
156
129
  u_globel: 1,
157
130
  u_globel_radius: EARTH_RADIUS,
@@ -182,8 +155,7 @@ var Arc3DModel = /*#__PURE__*/function (_BaseModel) {
182
155
  key: "getAnimateUniforms",
183
156
  value: function getAnimateUniforms() {
184
157
  var _ref2 = this.layer.getLayerConfig(),
185
- animateOption = _ref2.animateOption;
186
-
158
+ animateOption = _ref2.animateOption;
187
159
  return {
188
160
  u_animate: this.animateOption2Array(animateOption),
189
161
  u_time: this.layer.getLayerAnimateTime()
@@ -194,32 +166,26 @@ var Arc3DModel = /*#__PURE__*/function (_BaseModel) {
194
166
  value: function () {
195
167
  var _initModels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
196
168
  return _regeneratorRuntime.wrap(function _callee$(_context) {
197
- while (1) {
198
- switch (_context.prev = _context.next) {
199
- case 0:
200
- this.updateTexture();
201
- this.iconService.on('imageUpdate', this.updateTexture);
202
- return _context.abrupt("return", this.buildModels());
203
-
204
- case 3:
205
- case "end":
206
- return _context.stop();
207
- }
169
+ while (1) switch (_context.prev = _context.next) {
170
+ case 0:
171
+ this.updateTexture();
172
+ this.iconService.on('imageUpdate', this.updateTexture);
173
+ return _context.abrupt("return", this.buildModels());
174
+ case 3:
175
+ case "end":
176
+ return _context.stop();
208
177
  }
209
178
  }, _callee, this);
210
179
  }));
211
-
212
180
  function initModels() {
213
181
  return _initModels.apply(this, arguments);
214
182
  }
215
-
216
183
  return initModels;
217
184
  }()
218
185
  }, {
219
186
  key: "clearModels",
220
187
  value: function clearModels() {
221
188
  var _this$texture, _this$dataTexture;
222
-
223
189
  (_this$texture = this.texture) === null || _this$texture === void 0 ? void 0 : _this$texture.destroy();
224
190
  (_this$dataTexture = this.dataTexture) === null || _this$dataTexture === void 0 ? void 0 : _this$dataTexture.destroy();
225
191
  this.iconService.off('imageUpdate', this.updateTexture);
@@ -228,9 +194,8 @@ var Arc3DModel = /*#__PURE__*/function (_BaseModel) {
228
194
  key: "getShaders",
229
195
  value: function getShaders() {
230
196
  var _ref3 = this.layer.getLayerConfig(),
231
- sourceColor = _ref3.sourceColor,
232
- targetColor = _ref3.targetColor;
233
-
197
+ sourceColor = _ref3.sourceColor,
198
+ targetColor = _ref3.targetColor;
234
199
  if (sourceColor && targetColor) {
235
200
  // 分离 linear 功能
236
201
  return {
@@ -251,48 +216,40 @@ var Arc3DModel = /*#__PURE__*/function (_BaseModel) {
251
216
  value: function () {
252
217
  var _buildModels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
253
218
  var _ref4, _ref4$segmentNumber, segmentNumber, _this$getShaders, frag, vert, type, model;
254
-
255
219
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
256
- while (1) {
257
- switch (_context2.prev = _context2.next) {
258
- case 0:
259
- _ref4 = this.layer.getLayerConfig(), _ref4$segmentNumber = _ref4.segmentNumber, segmentNumber = _ref4$segmentNumber === void 0 ? 30 : _ref4$segmentNumber;
260
- _this$getShaders = this.getShaders(), frag = _this$getShaders.frag, vert = _this$getShaders.vert, type = _this$getShaders.type;
261
- _context2.next = 4;
262
- return this.layer.buildLayerModel({
263
- moduleName: 'lineEarthArc3d' + type,
264
- vertexShader: vert,
265
- fragmentShader: frag,
266
- triangulation: LineArcTriangulation,
267
- depth: {
268
- enable: true
269
- },
270
- segmentNumber: segmentNumber
271
- });
272
-
273
- case 4:
274
- model = _context2.sent;
275
- return _context2.abrupt("return", [model]);
276
-
277
- case 6:
278
- case "end":
279
- return _context2.stop();
280
- }
220
+ while (1) switch (_context2.prev = _context2.next) {
221
+ case 0:
222
+ _ref4 = this.layer.getLayerConfig(), _ref4$segmentNumber = _ref4.segmentNumber, segmentNumber = _ref4$segmentNumber === void 0 ? 30 : _ref4$segmentNumber;
223
+ _this$getShaders = this.getShaders(), frag = _this$getShaders.frag, vert = _this$getShaders.vert, type = _this$getShaders.type;
224
+ _context2.next = 4;
225
+ return this.layer.buildLayerModel({
226
+ moduleName: 'lineEarthArc3d' + type,
227
+ vertexShader: vert,
228
+ fragmentShader: frag,
229
+ triangulation: LineArcTriangulation,
230
+ depth: {
231
+ enable: true
232
+ },
233
+ segmentNumber: segmentNumber
234
+ });
235
+ case 4:
236
+ model = _context2.sent;
237
+ return _context2.abrupt("return", [model]);
238
+ case 6:
239
+ case "end":
240
+ return _context2.stop();
281
241
  }
282
242
  }, _callee2, this);
283
243
  }));
284
-
285
244
  function buildModels() {
286
245
  return _buildModels.apply(this, arguments);
287
246
  }
288
-
289
247
  return buildModels;
290
248
  }()
291
249
  }, {
292
250
  key: "registerBuiltinAttributes",
293
251
  value: function registerBuiltinAttributes() {
294
252
  var _this2 = this;
295
-
296
253
  this.styleAttributeService.registerStyleAttribute({
297
254
  name: 'size',
298
255
  type: AttributeType.Attribute,
@@ -307,7 +264,7 @@ var Arc3DModel = /*#__PURE__*/function (_BaseModel) {
307
264
  size: 1,
308
265
  update: function update(feature) {
309
266
  var _feature$size = feature.size,
310
- size = _feature$size === void 0 ? 1 : _feature$size;
267
+ size = _feature$size === void 0 ? 1 : _feature$size;
311
268
  return Array.isArray(size) ? [size[0]] : [size];
312
269
  }
313
270
  }
@@ -342,24 +299,19 @@ var Arc3DModel = /*#__PURE__*/function (_BaseModel) {
342
299
  size: 2,
343
300
  update: function update(feature) {
344
301
  var iconMap = _this2.iconService.getIconMap();
345
-
346
302
  var texture = feature.texture;
347
-
348
303
  var _ref5 = iconMap[texture] || {
349
- x: 0,
350
- y: 0
351
- },
352
- x = _ref5.x,
353
- y = _ref5.y;
354
-
304
+ x: 0,
305
+ y: 0
306
+ },
307
+ x = _ref5.x,
308
+ y = _ref5.y;
355
309
  return [x, y];
356
310
  }
357
311
  }
358
312
  });
359
313
  }
360
314
  }]);
361
-
362
315
  return Arc3DModel;
363
316
  }(BaseModel);
364
-
365
317
  export { Arc3DModel as default };