@antv/l7-layers 2.5.36 → 2.5.37-mini12

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 (286) hide show
  1. package/lib/core/BaseLayer.js +10 -4
  2. package/lib/core/BaseLayer.js.map +1 -1
  3. package/lib/core/BaseModel.js +1 -1
  4. package/lib/core/BaseModel.js.map +1 -1
  5. package/lib/core/shape/Path.js +5 -4
  6. package/lib/core/shape/Path.js.map +1 -1
  7. package/lib/core/shape/extrude.js +1 -1
  8. package/lib/core/triangulation.js +13 -9
  9. package/lib/core/triangulation.js.map +1 -1
  10. package/lib/earth/utils.js +1 -1
  11. package/lib/heatmap/models/heatmap.js +13 -18
  12. package/lib/heatmap/models/heatmap.js.map +1 -1
  13. package/lib/image/models/image.js +28 -7
  14. package/lib/image/models/image.js.map +1 -1
  15. package/lib/imagetile/index.js +95 -0
  16. package/lib/imagetile/index.js.map +1 -0
  17. package/lib/imagetile/models/imagetile.js +177 -0
  18. package/lib/imagetile/models/imagetile.js.map +1 -0
  19. package/lib/imagetile/models/index.js +17 -0
  20. package/lib/imagetile/models/index.js.map +1 -0
  21. package/lib/imagetile/utils/ImageTile.js +99 -0
  22. package/lib/imagetile/utils/ImageTile.js.map +1 -0
  23. package/lib/imagetile/utils/Tile.js +324 -0
  24. package/lib/imagetile/utils/Tile.js.map +1 -0
  25. package/lib/imagetile/utils/lruCache.js +109 -0
  26. package/lib/imagetile/utils/lruCache.js.map +1 -0
  27. package/lib/imagetile/utils/tileCache.js +58 -0
  28. package/lib/imagetile/utils/tileCache.js.map +1 -0
  29. package/lib/index.js +16 -8
  30. package/lib/index.js.map +1 -1
  31. package/lib/line/index.js +3 -0
  32. package/lib/line/index.js.map +1 -1
  33. package/lib/line/models/arc.js +2 -2
  34. package/lib/line/models/arc_3d.js +2 -2
  35. package/lib/line/models/arcmini.js +160 -0
  36. package/lib/line/models/arcmini.js.map +1 -0
  37. package/lib/line/models/great_circle.js +2 -2
  38. package/lib/line/models/index.js +3 -0
  39. package/lib/line/models/index.js.map +1 -1
  40. package/lib/line/models/line.js +2 -2
  41. package/lib/plugins/DataMappingPlugin.js +1 -1
  42. package/lib/plugins/DataSourcePlugin.js +5 -1
  43. package/lib/plugins/DataSourcePlugin.js.map +1 -1
  44. package/lib/plugins/FeatureScalePlugin.js +5 -1
  45. package/lib/plugins/FeatureScalePlugin.js.map +1 -1
  46. package/lib/plugins/LayerAnimateStylePlugin.js +1 -1
  47. package/lib/plugins/LayerStylePlugin.js.map +1 -1
  48. package/lib/plugins/LightingPlugin.js +5 -3
  49. package/lib/plugins/LightingPlugin.js.map +1 -1
  50. package/lib/plugins/MultiPassRendererPlugin.js +1 -1
  51. package/lib/plugins/ShaderUniformPlugin.js +3 -1
  52. package/lib/plugins/ShaderUniformPlugin.js.map +1 -1
  53. package/lib/plugins/UpdateStyleAttributePlugin.js +6 -6
  54. package/lib/plugins/UpdateStyleAttributePlugin.js.map +1 -1
  55. package/lib/point/models/image.js.map +1 -1
  56. package/lib/point/shape/Path.js +5 -4
  57. package/lib/point/shape/Path.js.map +1 -1
  58. package/lib/raster/raster.js +1 -1
  59. package/lib/utils/dataMappingStyle.js +1 -1
  60. package/lib/utils/extrude_polyline.js +1 -1
  61. package/lib/utils/polylineNormal.js +1 -1
  62. package/lib/utils/symbol-layout.js +1 -1
  63. package/package.json +7 -6
  64. package/CHANGELOG.md +0 -492
  65. package/LICENSE.md +0 -21
  66. package/es/citybuliding/building.d.ts +0 -17
  67. package/es/citybuliding/building.js +0 -79
  68. package/es/citybuliding/building.js.map +0 -1
  69. package/es/citybuliding/models/build.d.ts +0 -13
  70. package/es/citybuliding/models/build.js +0 -124
  71. package/es/citybuliding/models/build.js.map +0 -1
  72. package/es/core/BaseLayer.d.ts +0 -174
  73. package/es/core/BaseLayer.js +0 -974
  74. package/es/core/BaseLayer.js.map +0 -1
  75. package/es/core/BaseModel.d.ts +0 -135
  76. package/es/core/BaseModel.js +0 -412
  77. package/es/core/BaseModel.js.map +0 -1
  78. package/es/core/interface.d.ts +0 -19
  79. package/es/core/interface.js +0 -7
  80. package/es/core/interface.js.map +0 -1
  81. package/es/core/schema.d.ts +0 -27
  82. package/es/core/schema.js +0 -23
  83. package/es/core/schema.js.map +0 -1
  84. package/es/core/shape/Path.d.ts +0 -39
  85. package/es/core/shape/Path.js +0 -57
  86. package/es/core/shape/Path.js.map +0 -1
  87. package/es/core/shape/extrude.d.ts +0 -17
  88. package/es/core/shape/extrude.js +0 -143
  89. package/es/core/shape/extrude.js.map +0 -1
  90. package/es/core/triangulation.d.ts +0 -109
  91. package/es/core/triangulation.js +0 -328
  92. package/es/core/triangulation.js.map +0 -1
  93. package/es/earth/index.d.ts +0 -17
  94. package/es/earth/index.js +0 -81
  95. package/es/earth/index.js.map +0 -1
  96. package/es/earth/models/atmosphere.d.ts +0 -9
  97. package/es/earth/models/atmosphere.js +0 -125
  98. package/es/earth/models/atmosphere.js.map +0 -1
  99. package/es/earth/models/base.d.ts +0 -16
  100. package/es/earth/models/base.js +0 -193
  101. package/es/earth/models/base.js.map +0 -1
  102. package/es/earth/models/bloomsphere.d.ts +0 -9
  103. package/es/earth/models/bloomsphere.js +0 -125
  104. package/es/earth/models/bloomsphere.js.map +0 -1
  105. package/es/earth/utils.d.ts +0 -26
  106. package/es/earth/utils.js +0 -81
  107. package/es/earth/utils.js.map +0 -1
  108. package/es/glsl.d.js +0 -2
  109. package/es/glsl.d.js.map +0 -1
  110. package/es/heatmap/index.d.ts +0 -22
  111. package/es/heatmap/index.js +0 -123
  112. package/es/heatmap/index.js.map +0 -1
  113. package/es/heatmap/models/grid.d.ts +0 -8
  114. package/es/heatmap/models/grid.js +0 -90
  115. package/es/heatmap/models/grid.js.map +0 -1
  116. package/es/heatmap/models/grid3d.d.ts +0 -8
  117. package/es/heatmap/models/grid3d.js +0 -122
  118. package/es/heatmap/models/grid3d.js.map +0 -1
  119. package/es/heatmap/models/heatmap.d.ts +0 -24
  120. package/es/heatmap/models/heatmap.js +0 -399
  121. package/es/heatmap/models/heatmap.js.map +0 -1
  122. package/es/heatmap/models/hexagon.d.ts +0 -8
  123. package/es/heatmap/models/hexagon.js +0 -90
  124. package/es/heatmap/models/hexagon.js.map +0 -1
  125. package/es/heatmap/models/index.d.ts +0 -5
  126. package/es/heatmap/models/index.js +0 -13
  127. package/es/heatmap/models/index.js.map +0 -1
  128. package/es/heatmap/triangulation.d.ts +0 -5
  129. package/es/heatmap/triangulation.js +0 -38
  130. package/es/heatmap/triangulation.js.map +0 -1
  131. package/es/image/index.d.ts +0 -22
  132. package/es/image/index.js +0 -82
  133. package/es/image/index.js.map +0 -1
  134. package/es/image/models/image.d.ts +0 -18
  135. package/es/image/models/image.js +0 -127
  136. package/es/image/models/image.js.map +0 -1
  137. package/es/image/models/index.d.ts +0 -5
  138. package/es/image/models/index.js +0 -6
  139. package/es/image/models/index.js.map +0 -1
  140. package/es/index.d.ts +0 -11
  141. package/es/index.js +0 -39
  142. package/es/index.js.map +0 -1
  143. package/es/line/index.d.ts +0 -25
  144. package/es/line/index.js +0 -95
  145. package/es/line/index.js.map +0 -1
  146. package/es/line/models/arc.d.ts +0 -12
  147. package/es/line/models/arc.js +0 -281
  148. package/es/line/models/arc.js.map +0 -1
  149. package/es/line/models/arc_3d.d.ts +0 -12
  150. package/es/line/models/arc_3d.js +0 -277
  151. package/es/line/models/arc_3d.js.map +0 -1
  152. package/es/line/models/great_circle.d.ts +0 -12
  153. package/es/line/models/great_circle.js +0 -269
  154. package/es/line/models/great_circle.js.map +0 -1
  155. package/es/line/models/index.d.ts +0 -5
  156. package/es/line/models/index.js +0 -12
  157. package/es/line/models/index.js.map +0 -1
  158. package/es/line/models/line.d.ts +0 -13
  159. package/es/line/models/line.js +0 -342
  160. package/es/line/models/line.js.map +0 -1
  161. package/es/plugins/DataMappingPlugin.d.ts +0 -13
  162. package/es/plugins/DataMappingPlugin.js +0 -199
  163. package/es/plugins/DataMappingPlugin.js.map +0 -1
  164. package/es/plugins/DataSourcePlugin.d.ts +0 -7
  165. package/es/plugins/DataSourcePlugin.js +0 -73
  166. package/es/plugins/DataSourcePlugin.js.map +0 -1
  167. package/es/plugins/FeatureScalePlugin.d.ts +0 -26
  168. package/es/plugins/FeatureScalePlugin.js +0 -270
  169. package/es/plugins/FeatureScalePlugin.js.map +0 -1
  170. package/es/plugins/LayerAnimateStylePlugin.d.ts +0 -7
  171. package/es/plugins/LayerAnimateStylePlugin.js +0 -50
  172. package/es/plugins/LayerAnimateStylePlugin.js.map +0 -1
  173. package/es/plugins/LayerModelPlugin.d.ts +0 -8
  174. package/es/plugins/LayerModelPlugin.js +0 -34
  175. package/es/plugins/LayerModelPlugin.js.map +0 -1
  176. package/es/plugins/LayerStylePlugin.d.ts +0 -8
  177. package/es/plugins/LayerStylePlugin.js +0 -35
  178. package/es/plugins/LayerStylePlugin.js.map +0 -1
  179. package/es/plugins/LightingPlugin.d.ts +0 -36
  180. package/es/plugins/LightingPlugin.js +0 -100
  181. package/es/plugins/LightingPlugin.js.map +0 -1
  182. package/es/plugins/MultiPassRendererPlugin.d.ts +0 -37
  183. package/es/plugins/MultiPassRendererPlugin.js +0 -79
  184. package/es/plugins/MultiPassRendererPlugin.js.map +0 -1
  185. package/es/plugins/PixelPickingPlugin.d.ts +0 -8
  186. package/es/plugins/PixelPickingPlugin.js +0 -112
  187. package/es/plugins/PixelPickingPlugin.js.map +0 -1
  188. package/es/plugins/RegisterStyleAttributePlugin.d.ts +0 -11
  189. package/es/plugins/RegisterStyleAttributePlugin.js +0 -98
  190. package/es/plugins/RegisterStyleAttributePlugin.js.map +0 -1
  191. package/es/plugins/ShaderUniformPlugin.d.ts +0 -16
  192. package/es/plugins/ShaderUniformPlugin.js +0 -78
  193. package/es/plugins/ShaderUniformPlugin.js.map +0 -1
  194. package/es/plugins/UpdateModelPlugin.d.ts +0 -8
  195. package/es/plugins/UpdateModelPlugin.js +0 -27
  196. package/es/plugins/UpdateModelPlugin.js.map +0 -1
  197. package/es/plugins/UpdateStyleAttributePlugin.d.ts +0 -12
  198. package/es/plugins/UpdateStyleAttributePlugin.js +0 -74
  199. package/es/plugins/UpdateStyleAttributePlugin.js.map +0 -1
  200. package/es/point/index.d.ts +0 -30
  201. package/es/point/index.js +0 -130
  202. package/es/point/index.js.map +0 -1
  203. package/es/point/models/extrude.d.ts +0 -14
  204. package/es/point/models/extrude.js +0 -180
  205. package/es/point/models/extrude.js.map +0 -1
  206. package/es/point/models/fill.d.ts +0 -17
  207. package/es/point/models/fill.js +0 -247
  208. package/es/point/models/fill.js.map +0 -1
  209. package/es/point/models/icon-font.d.ts +0 -11
  210. package/es/point/models/icon-font.js +0 -181
  211. package/es/point/models/icon-font.js.map +0 -1
  212. package/es/point/models/image.d.ts +0 -11
  213. package/es/point/models/image.js +0 -207
  214. package/es/point/models/image.js.map +0 -1
  215. package/es/point/models/index.d.ts +0 -5
  216. package/es/point/models/index.js +0 -16
  217. package/es/point/models/index.js.map +0 -1
  218. package/es/point/models/normal.d.ts +0 -21
  219. package/es/point/models/normal.js +0 -155
  220. package/es/point/models/normal.js.map +0 -1
  221. package/es/point/models/text.d.ts +0 -56
  222. package/es/point/models/text.js +0 -522
  223. package/es/point/models/text.js.map +0 -1
  224. package/es/point/shape/Path.d.ts +0 -40
  225. package/es/point/shape/Path.js +0 -57
  226. package/es/point/shape/Path.js.map +0 -1
  227. package/es/point/shape/extrude.d.ts +0 -15
  228. package/es/point/shape/extrude.js +0 -58
  229. package/es/point/shape/extrude.js.map +0 -1
  230. package/es/polygon/index.d.ts +0 -22
  231. package/es/polygon/index.js +0 -124
  232. package/es/polygon/index.js.map +0 -1
  233. package/es/polygon/models/extrude.d.ts +0 -13
  234. package/es/polygon/models/extrude.js +0 -139
  235. package/es/polygon/models/extrude.js.map +0 -1
  236. package/es/polygon/models/fill.d.ts +0 -13
  237. package/es/polygon/models/fill.js +0 -108
  238. package/es/polygon/models/fill.js.map +0 -1
  239. package/es/polygon/models/index.d.ts +0 -5
  240. package/es/polygon/models/index.js +0 -20
  241. package/es/polygon/models/index.js.map +0 -1
  242. package/es/raster/buffers/triangulation.d.ts +0 -6
  243. package/es/raster/buffers/triangulation.js +0 -28
  244. package/es/raster/buffers/triangulation.js.map +0 -1
  245. package/es/raster/image.d.ts +0 -0
  246. package/es/raster/image.js +0 -2
  247. package/es/raster/image.js.map +0 -1
  248. package/es/raster/index.d.ts +0 -28
  249. package/es/raster/index.js +0 -83
  250. package/es/raster/index.js.map +0 -1
  251. package/es/raster/models/index.d.ts +0 -5
  252. package/es/raster/models/index.js +0 -7
  253. package/es/raster/models/index.js.map +0 -1
  254. package/es/raster/models/raster.d.ts +0 -19
  255. package/es/raster/models/raster.js +0 -152
  256. package/es/raster/models/raster.js.map +0 -1
  257. package/es/raster/raster.d.ts +0 -30
  258. package/es/raster/raster.js +0 -178
  259. package/es/raster/raster.js.map +0 -1
  260. package/es/raster/raster2d.d.ts +0 -27
  261. package/es/raster/raster2d.js +0 -158
  262. package/es/raster/raster2d.js.map +0 -1
  263. package/es/utils/blend.d.ts +0 -2
  264. package/es/utils/blend.js +0 -55
  265. package/es/utils/blend.js.map +0 -1
  266. package/es/utils/collision-index.d.ts +0 -47
  267. package/es/utils/collision-index.js +0 -87
  268. package/es/utils/collision-index.js.map +0 -1
  269. package/es/utils/dataMappingStyle.d.ts +0 -30
  270. package/es/utils/dataMappingStyle.js +0 -88
  271. package/es/utils/dataMappingStyle.js.map +0 -1
  272. package/es/utils/extrude_polyline.d.ts +0 -48
  273. package/es/utils/extrude_polyline.js +0 -405
  274. package/es/utils/extrude_polyline.js.map +0 -1
  275. package/es/utils/geo.d.ts +0 -3
  276. package/es/utils/geo.js +0 -24
  277. package/es/utils/geo.js.map +0 -1
  278. package/es/utils/grid-index.d.ts +0 -28
  279. package/es/utils/grid-index.js +0 -193
  280. package/es/utils/grid-index.js.map +0 -1
  281. package/es/utils/polylineNormal.d.ts +0 -9
  282. package/es/utils/polylineNormal.js +0 -171
  283. package/es/utils/polylineNormal.js.map +0 -1
  284. package/es/utils/symbol-layout.d.ts +0 -43
  285. package/es/utils/symbol-layout.js +0 -260
  286. package/es/utils/symbol-layout.js.map +0 -1
@@ -1,124 +0,0 @@
1
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/createClass";
3
- import _inherits from "@babel/runtime/helpers/inherits";
4
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
5
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
-
7
- 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); }; }
8
-
9
- 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; } }
10
-
11
- import { AttributeType, gl } from '@antv/l7-core';
12
- import { rgb2arr } from '@antv/l7-utils';
13
- import BaseModel from '../../core/BaseModel';
14
- import { PolygonExtrudeTriangulation } from '../../core/triangulation';
15
- var buildFrag = "uniform float u_opacity: 1.0;\nuniform vec4 u_baseColor : [ 1.0, 0, 0, 1.0 ];\nuniform vec4 u_brightColor : [ 1.0, 0, 0, 1.0 ];\nuniform vec4 u_windowColor : [ 1.0, 0, 0, 1.0 ];\nuniform float u_near : 0;\nuniform float u_far : 1;\nvarying vec4 v_Color;\nvarying vec2 v_texCoord;\nuniform float u_Zoom : 1;\nuniform float u_time;\n\n#pragma include \"picking\"\n\nvec3 getWindowColor(float n, float hot, vec3 brightColor, vec3 darkColor) {\n float s = step(hot, n);\n vec3 color = mix(brightColor,vec3(0.9,0.9,1.0),n);\n\n return mix(darkColor, color, s);\n}\nfloat random (vec2 st) {\n return fract(sin(dot(st.xy, vec2(12.9898,78.233)))* 43758.5453123);\n}\n\nfloat LinearizeDepth()\n{\n float z = gl_FragCoord.z * 2.0 - 1.0;\n return (2.0 * u_near * u_far) / (u_far + u_near - z * (u_far - u_near));\n}\n\nvec3 fog(vec3 color, vec3 fogColor, float depth){\n float fogFactor=clamp(depth,0.0,1.0);\n vec3 output_color=mix(fogColor,color,fogFactor);\n return output_color;\n}\n\nfloat sdRect(vec2 p, vec2 sz) {\n vec2 d = abs(p) - sz;\n float outside = length(max(d, 0.));\n float inside = min(max(d.x, d.y), 0.);\n return outside + inside;\n}\n\nvoid main() {\n gl_FragColor = v_Color;\n vec3 baseColor = u_baseColor.xyz;\n vec3 brightColor = u_brightColor.xyz;\n vec3 windowColor = u_windowColor.xyz;\n float targetColId = 5.;\n float depth = 1.0 - LinearizeDepth() / u_far * u_Zoom;\n vec3 fogColor = vec3(23.0/255.0,31.0/255.0,51.0/255.0);\n if(v_texCoord.x < 0.) { //\u9876\u90E8\u989C\u8272\n vec3 foggedColor = fog(baseColor.xyz + vec3(0.12*0.9,0.2*0.9,0.3*0.9),fogColor,depth);\n gl_FragColor = vec4( foggedColor, v_Color.w);\n }else { // \u4FA7\u9762\u989C\u8272\n vec2 st = v_texCoord;\n vec2 UvScale = v_texCoord;\n float tStep = min(0.08,max(0.05* (18.0-u_Zoom),0.02));\n float tStart = 0.25 * tStep;\n float tEnd = 0.75 * tStep;\n float u = mod(UvScale.x, tStep);\n float v = mod(UvScale.y, tStep);\n float ux = floor(UvScale.x/tStep);\n float uy = floor(UvScale.y/tStep);\n float n = random(vec2(ux,uy));\n float lightP = u_time;\n float head = 1.0- step(0.005,st.y);\n /*step3*/\n // \u5C06\u7A97\u6237\u989C\u8272\u548C\u5899\u9762\u989C\u8272\u533A\u522B\u5F00\u6765\n float sU = step(tStart, u) - step(tEnd, u);\n float sV = step(tStart, v) - step(tEnd, v);\n vec2 windowSize = vec2(abs(tEnd-tStart),abs(tEnd-tStart));\n float dist = sdRect(vec2(u,v), windowSize);\n float s = sU * sV;\n\n float curColId = floor(UvScale.x / tStep);\n float sCol = step(targetColId - 0.2, curColId) - step(targetColId + 0.2, curColId);\n\n float mLightP = mod(lightP, 2.);\n float sRow = step(mLightP - 0.2, st.y) - step(mLightP, st.y);\n if(ux == targetColId){\n n =0.;\n }\n float timeP = min(0.75, abs ( sin(u_time/3.0) ) );\n float hot = smoothstep(1.0,0.0,timeP);\n vec3 color = mix(baseColor, getWindowColor(n,hot,brightColor,windowColor), s);\n //vec3 color = mix(baseColor, getWindowColor(n,hot,brightColor,windowColor), 1.0);\n float sFinal = s * sCol * sRow;\n color += mix(baseColor, brightColor, sFinal*n);\n if (st.y<0.01){\n color = baseColor;\n }\n if(head ==1.0) { // \u9876\u90E8\u4EAE\u7EBF\n color = brightColor;\n }\n color = color * v_Color.rgb;\n\n vec3 foggedColor = fog(color,fogColor,depth);\n\n gl_FragColor = vec4(foggedColor,1.0);\n }\n gl_FragColor.a *= u_opacity;\n gl_FragColor = filterColor(gl_FragColor);\n}\n";
16
- var buildVert = "precision highp float;\n\n#define ambientRatio 0.5\n#define diffuseRatio 0.3\n#define specularRatio 0.2\n\nattribute vec4 a_Color;\nattribute vec3 a_Position;\nattribute vec3 a_Normal;\nattribute float a_Size;\nuniform mat4 u_ModelMatrix;\n\nattribute vec2 a_Uv;\nvarying vec2 v_texCoord;\n\nvarying vec4 v_Color;\nuniform mat4 u_Mvp;\n\n#pragma include \"projection\"\n#pragma include \"light\"\n#pragma include \"picking\"\n\nvoid main() {\n vec4 pos = vec4(a_Position.xy, a_Position.z * a_Size, 1.0);\n vec4 project_pos = project_position(pos);\n v_texCoord = a_Uv;\n // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(project_pos.xyz, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n }\n\n float lightWeight = calc_lighting(pos);\n // v_Color = a_Color;\n v_Color = vec4(a_Color.rgb * lightWeight, a_Color.w);\n\n setPickingColor(a_PickingColor);\n}\n";
17
-
18
- var CityBuildModel = function (_BaseModel) {
19
- _inherits(CityBuildModel, _BaseModel);
20
-
21
- var _super = _createSuper(CityBuildModel);
22
-
23
- function CityBuildModel() {
24
- _classCallCheck(this, CityBuildModel);
25
-
26
- return _super.apply(this, arguments);
27
- }
28
-
29
- _createClass(CityBuildModel, [{
30
- key: "getUninforms",
31
- value: function getUninforms() {
32
- var _ref = this.layer.getLayerConfig(),
33
- _ref$opacity = _ref.opacity,
34
- opacity = _ref$opacity === void 0 ? 1 : _ref$opacity,
35
- _ref$baseColor = _ref.baseColor,
36
- baseColor = _ref$baseColor === void 0 ? 'rgb(16,16,16)' : _ref$baseColor,
37
- _ref$brightColor = _ref.brightColor,
38
- brightColor = _ref$brightColor === void 0 ? 'rgb(255,176,38)' : _ref$brightColor,
39
- _ref$windowColor = _ref.windowColor,
40
- windowColor = _ref$windowColor === void 0 ? 'rgb(30,60,89)' : _ref$windowColor,
41
- _ref$time = _ref.time,
42
- time = _ref$time === void 0 ? 0 : _ref$time;
43
-
44
- return {
45
- u_opacity: opacity,
46
- u_baseColor: rgb2arr(baseColor),
47
- u_brightColor: rgb2arr(brightColor),
48
- u_windowColor: rgb2arr(windowColor),
49
- u_time: this.layer.getLayerAnimateTime() || time
50
- };
51
- }
52
- }, {
53
- key: "initModels",
54
- value: function initModels() {
55
- this.startModelAnimate();
56
- return [this.layer.buildLayerModel({
57
- moduleName: 'cityBuilding',
58
- vertexShader: buildVert,
59
- fragmentShader: buildFrag,
60
- triangulation: PolygonExtrudeTriangulation
61
- })];
62
- }
63
- }, {
64
- key: "registerBuiltinAttributes",
65
- value: function registerBuiltinAttributes() {
66
- this.styleAttributeService.registerStyleAttribute({
67
- name: 'normal',
68
- type: AttributeType.Attribute,
69
- descriptor: {
70
- name: 'a_Normal',
71
- buffer: {
72
- usage: gl.STATIC_DRAW,
73
- data: [],
74
- type: gl.FLOAT
75
- },
76
- size: 3,
77
- update: function update(feature, featureIdx, vertex, attributeIdx, normal) {
78
- return normal;
79
- }
80
- }
81
- });
82
- this.styleAttributeService.registerStyleAttribute({
83
- name: 'size',
84
- type: AttributeType.Attribute,
85
- descriptor: {
86
- name: 'a_Size',
87
- buffer: {
88
- usage: gl.DYNAMIC_DRAW,
89
- data: [],
90
- type: gl.FLOAT
91
- },
92
- size: 1,
93
- update: function update(feature, featureIdx, vertex, attributeIdx) {
94
- var _feature$size = feature.size,
95
- size = _feature$size === void 0 ? 10 : _feature$size;
96
- return Array.isArray(size) ? [size[0]] : [size];
97
- }
98
- }
99
- });
100
- this.styleAttributeService.registerStyleAttribute({
101
- name: 'uv',
102
- type: AttributeType.Attribute,
103
- descriptor: {
104
- name: 'a_Uv',
105
- buffer: {
106
- usage: gl.DYNAMIC_DRAW,
107
- data: [],
108
- type: gl.FLOAT
109
- },
110
- size: 2,
111
- update: function update(feature, featureIdx, vertex, attributeIdx) {
112
- var size = feature.size;
113
- return [vertex[3], vertex[4]];
114
- }
115
- }
116
- });
117
- }
118
- }]);
119
-
120
- return CityBuildModel;
121
- }(BaseModel);
122
-
123
- export { CityBuildModel as default };
124
- //# sourceMappingURL=build.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/citybuliding/models/build.ts"],"names":["AttributeType","gl","rgb2arr","BaseModel","PolygonExtrudeTriangulation","CityBuildModel","layer","getLayerConfig","opacity","baseColor","brightColor","windowColor","time","u_opacity","u_baseColor","u_brightColor","u_windowColor","u_time","getLayerAnimateTime","startModelAnimate","buildLayerModel","moduleName","vertexShader","buildVert","fragmentShader","buildFrag","triangulation","styleAttributeService","registerStyleAttribute","name","type","Attribute","descriptor","buffer","usage","STATIC_DRAW","data","FLOAT","size","update","feature","featureIdx","vertex","attributeIdx","normal","DYNAMIC_DRAW","Array","isArray"],"mappings":";;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AAENC,YAAAA,KAAK,EAAEjC,EAAE,CAAC4C,YAFJ;AAGNT,YAAAA,IAAI,EAAE,EAHA;AAINN,YAAAA,IAAI,EAAE7B,EAAE,CAACoC;AAJH,WAFE;AAQVC,UAAAA,IAAI,EAAE,CARI;AASVC,UAAAA,MAAM,EAAE,gBACNC,OADM,EAENC,UAFM,EAGNC,MAHM,EAINC,YAJM,EAKH;AACH,gBAAQL,IAAR,GAAiBE,OAAjB,CAAQF,IAAR;AACA,mBAAO,CAACI,MAAM,CAAC,CAAD,CAAP,EAAYA,MAAM,CAAC,CAAD,CAAlB,CAAP;AACD;AAjBS;AAHoC,OAAlD;AAuBD;;;;EAtGyCvC,S;;SAAvBE,c","sourcesContent":["import { AttributeType, gl, IEncodeFeature, IModel } from '@antv/l7-core';\nimport { rgb2arr } from '@antv/l7-utils';\nimport BaseModel from '../../core/BaseModel';\nimport { PolygonExtrudeTriangulation } from '../../core/triangulation';\nimport buildFrag from '../shaders/build_frag.glsl';\nimport buildVert from '../shaders/build_vert.glsl';\ninterface ICityBuildLayerStyleOptions {\n opacity: number;\n baseColor: string;\n brightColor: string;\n windowColor: string;\n time: number;\n}\nexport default class CityBuildModel extends BaseModel {\n public getUninforms() {\n const {\n opacity = 1,\n baseColor = 'rgb(16,16,16)',\n brightColor = 'rgb(255,176,38)',\n windowColor = 'rgb(30,60,89)',\n time = 0,\n } = this.layer.getLayerConfig() as ICityBuildLayerStyleOptions;\n return {\n u_opacity: opacity,\n u_baseColor: rgb2arr(baseColor),\n u_brightColor: rgb2arr(brightColor),\n u_windowColor: rgb2arr(windowColor),\n u_time: this.layer.getLayerAnimateTime() || time,\n };\n }\n\n public initModels(): IModel[] {\n this.startModelAnimate();\n return [\n this.layer.buildLayerModel({\n moduleName: 'cityBuilding',\n vertexShader: buildVert,\n fragmentShader: buildFrag,\n triangulation: PolygonExtrudeTriangulation,\n }),\n ];\n }\n\n protected registerBuiltinAttributes() {\n // point layer size;\n this.styleAttributeService.registerStyleAttribute({\n name: 'normal',\n type: AttributeType.Attribute,\n descriptor: {\n name: 'a_Normal',\n buffer: {\n // give the WebGL driver a hint that this buffer may change\n usage: gl.STATIC_DRAW,\n data: [],\n type: gl.FLOAT,\n },\n size: 3,\n update: (\n feature: IEncodeFeature,\n featureIdx: number,\n vertex: number[],\n attributeIdx: number,\n normal: number[],\n ) => {\n return normal;\n },\n },\n });\n\n this.styleAttributeService.registerStyleAttribute({\n name: 'size',\n type: AttributeType.Attribute,\n descriptor: {\n name: 'a_Size',\n buffer: {\n // give the WebGL driver a hint that this buffer may change\n usage: gl.DYNAMIC_DRAW,\n data: [],\n type: gl.FLOAT,\n },\n size: 1,\n update: (\n feature: IEncodeFeature,\n featureIdx: number,\n vertex: number[],\n attributeIdx: number,\n ) => {\n const { size = 10 } = feature;\n return Array.isArray(size) ? [size[0]] : [size as number];\n },\n },\n });\n this.styleAttributeService.registerStyleAttribute({\n name: 'uv',\n type: AttributeType.Attribute,\n descriptor: {\n name: 'a_Uv',\n buffer: {\n // give the WebGL driver a hint that this buffer may change\n usage: gl.DYNAMIC_DRAW,\n data: [],\n type: gl.FLOAT,\n },\n size: 2,\n update: (\n feature: IEncodeFeature,\n featureIdx: number,\n vertex: number[],\n attributeIdx: number,\n ) => {\n const { size } = feature;\n return [vertex[3], vertex[4]];\n },\n },\n });\n }\n}\n"],"file":"build.js"}
@@ -1,174 +0,0 @@
1
- import { SyncBailHook, SyncHook, SyncWaterfallHook } from '@antv/async-hook';
2
- import { BlendType, IActiveOption, IAnimateOption, ICameraService, ICoordinateSystemService, IDataState, IEncodeFeature, IFontService, IGlobalConfigService, IIconService, IInteractionService, ILayer, ILayerConfig, ILayerModel, ILayerModelInitializationOptions, ILayerPlugin, ILayerService, IMapService, IModel, IModelInitializationOptions, IMultiPassRenderer, IPass, IPickingService, IPostProcessingPass, IRendererService, IScale, IScaleOptions, IShaderModuleService, ISourceCFG, IStyleAttributeService, IStyleAttributeUpdateOptions, StyleAttributeField, StyleAttributeOption } from '@antv/l7-core';
3
- import Source from '@antv/l7-source';
4
- import { EventEmitter } from 'eventemitter3';
5
- import { Container } from 'inversify';
6
- export default class BaseLayer<ChildLayerStyleOptions = {}> extends EventEmitter implements ILayer {
7
- id: string;
8
- name: string;
9
- type: string;
10
- visible: boolean;
11
- zIndex: number;
12
- minZoom: number;
13
- maxZoom: number;
14
- inited: boolean;
15
- layerModelNeedUpdate: boolean;
16
- pickedFeatureID: number | null;
17
- selectedFeatureID: number | null;
18
- styleNeedUpdate: boolean;
19
- rendering: boolean;
20
- dataState: IDataState;
21
- hooks: {
22
- init: SyncBailHook;
23
- afterInit: SyncBailHook;
24
- beforeRender: SyncBailHook;
25
- beforeRenderData: SyncWaterfallHook;
26
- afterRender: SyncHook;
27
- beforePickingEncode: SyncHook;
28
- afterPickingEncode: SyncHook;
29
- beforeHighlight: SyncHook;
30
- afterHighlight: SyncHook;
31
- beforeSelect: SyncHook;
32
- afterSelect: SyncHook;
33
- beforeDestroy: SyncHook;
34
- afterDestroy: SyncHook;
35
- };
36
- models: IModel[];
37
- multiPassRenderer: IMultiPassRenderer;
38
- plugins: ILayerPlugin[];
39
- sourceOption: {
40
- data: any;
41
- options?: ISourceCFG;
42
- };
43
- layerModel: ILayerModel;
44
- protected readonly configService: IGlobalConfigService;
45
- protected readonly shaderModuleService: IShaderModuleService;
46
- protected cameraService: ICameraService;
47
- protected coordinateService: ICoordinateSystemService;
48
- protected iconService: IIconService;
49
- protected fontService: IFontService;
50
- protected pickingService: IPickingService;
51
- protected rendererService: IRendererService;
52
- protected layerService: ILayerService;
53
- protected interactionService: IInteractionService;
54
- protected mapService: IMapService;
55
- protected styleAttributeService: IStyleAttributeService;
56
- protected layerSource: Source;
57
- protected postProcessingPassFactory: (name: string) => IPostProcessingPass<unknown>;
58
- protected normalPassFactory: (name: string) => IPass<unknown>;
59
- protected animateOptions: IAnimateOption;
60
- /**
61
- * 图层容器
62
- */
63
- private container;
64
- private encodedData;
65
- private configSchema;
66
- private currentPickId;
67
- private rawConfig;
68
- private needUpdateConfig;
69
- /**
70
- * 待更新样式属性,在初始化阶段完成注册
71
- */
72
- private pendingStyleAttributes;
73
- private scaleOptions;
74
- private animateStartTime;
75
- private aniamateStatus;
76
- constructor(config?: Partial<ILayerConfig & ChildLayerStyleOptions>);
77
- getLayerConfig(): Partial<ILayerConfig & import("@antv/l7-core").ISceneConfig & ChildLayerStyleOptions>;
78
- updateLayerConfig(configToUpdate: Partial<ILayerConfig | ChildLayerStyleOptions>): void;
79
- /**
80
- * 注入图层容器,父容器为场景容器
81
- * RootContainer 1
82
- * -> SceneContainer 1.*
83
- * -> LayerContainer 1.*
84
- */
85
- setContainer(container: Container): void;
86
- getContainer(): Container;
87
- addPlugin(plugin: ILayerPlugin): ILayer;
88
- init(): this;
89
- /**
90
- * Model初始化前需要更新Model样式
91
- */
92
- prepareBuildModel(): void;
93
- color(field: StyleAttributeField, values?: StyleAttributeOption, updateOptions?: Partial<IStyleAttributeUpdateOptions>): this;
94
- texture(field: StyleAttributeField, values?: StyleAttributeOption, updateOptions?: Partial<IStyleAttributeUpdateOptions>): this;
95
- rotate(field: StyleAttributeField, values?: StyleAttributeOption, updateOptions?: Partial<IStyleAttributeUpdateOptions>): this;
96
- size(field: StyleAttributeField, values?: StyleAttributeOption, updateOptions?: Partial<IStyleAttributeUpdateOptions>): this;
97
- filter(field: StyleAttributeField, values?: StyleAttributeOption, updateOptions?: Partial<IStyleAttributeUpdateOptions>): this;
98
- shape(field: StyleAttributeField, values?: StyleAttributeOption, updateOptions?: Partial<IStyleAttributeUpdateOptions>): this;
99
- label(field: StyleAttributeField, values?: StyleAttributeOption, updateOptions?: Partial<IStyleAttributeUpdateOptions>): this;
100
- animate(options: IAnimateOption | boolean): this;
101
- source(data: any, options?: ISourceCFG): ILayer;
102
- setData(data: any, options?: ISourceCFG): this;
103
- style(options: Partial<ChildLayerStyleOptions> & Partial<ILayerConfig>): ILayer;
104
- scale(field: string | number | IScaleOptions, cfg?: IScale): this;
105
- /**
106
- * 渲染所有的图层
107
- */
108
- renderLayers(): void;
109
- render(): ILayer;
110
- active(options: IActiveOption | boolean): this;
111
- setActive(id: number | {
112
- x: number;
113
- y: number;
114
- }, options?: IActiveOption): void;
115
- select(option: IActiveOption | boolean): ILayer;
116
- setSelect(id: number | {
117
- x: number;
118
- y: number;
119
- }, options?: IActiveOption): void;
120
- setBlend(type: keyof typeof BlendType): void;
121
- show(): ILayer;
122
- hide(): ILayer;
123
- setIndex(index: number): ILayer;
124
- setCurrentPickId(id: number): void;
125
- getCurrentPickId(): number | null;
126
- setCurrentSelectedId(id: number): void;
127
- getCurrentSelectedId(): number | null;
128
- isVisible(): boolean;
129
- setMinZoom(minZoom: number): ILayer;
130
- getMinZoom(): number;
131
- getMaxZoom(): number;
132
- get(name: string): any;
133
- setMaxZoom(maxZoom: number): ILayer;
134
- /**
135
- * zoom to layer Bounds
136
- */
137
- fitBounds(fitBoundsOptions?: unknown): ILayer;
138
- destroy(): void;
139
- clear(): void;
140
- clearModels(): void;
141
- isDirty(): boolean;
142
- setSource(source: Source): void;
143
- getSource(): Source;
144
- getScaleOptions(): IScaleOptions;
145
- setEncodedData(encodedData: IEncodeFeature[]): void;
146
- getEncodedData(): IEncodeFeature[];
147
- getLegendItems(name: string): any;
148
- pick({ x, y }: {
149
- x: number;
150
- y: number;
151
- }): void;
152
- boxSelect(box: [number, number, number, number], cb: (...args: any[]) => void): void;
153
- buildLayerModel(options: ILayerModelInitializationOptions & Partial<IModelInitializationOptions>): IModel;
154
- getTime(): number;
155
- setAnimateStartTime(): void;
156
- stopAnimate(): void;
157
- getLayerAnimateTime(): number;
158
- needPick(type: string): boolean;
159
- buildModels(): void;
160
- rebuildModels(): void;
161
- renderModels(): this;
162
- updateStyleAttribute(type: string, field: StyleAttributeField, values?: StyleAttributeOption, updateOptions?: Partial<IStyleAttributeUpdateOptions>): void;
163
- /**
164
- * 继承空方法
165
- * @param time
166
- */
167
- setEarthTime(time: number): void;
168
- protected getConfigSchema(): void;
169
- protected getModelType(): unknown;
170
- protected getDefaultConfig(): {};
171
- private sourceEvent;
172
- private reRender;
173
- private splitValuesAndCallbackInAttribute;
174
- }