@antv/l7-layers 2.9.27-alpha.1 → 2.9.27-alpha.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 (302) hide show
  1. package/es/Geometry/index.d.ts +13 -0
  2. package/es/Geometry/index.js +20 -2
  3. package/es/Geometry/models/billboard.js +1 -2
  4. package/es/Geometry/models/plane.js +2 -4
  5. package/es/Geometry/models/sprite.js +2 -4
  6. package/es/canvas/index.d.ts +4 -0
  7. package/es/canvas/index.js +38 -2
  8. package/es/citybuliding/building.js +6 -2
  9. package/es/citybuliding/models/build.js +2 -3
  10. package/es/core/BaseLayer.d.ts +17 -6
  11. package/es/core/BaseLayer.js +89 -94
  12. package/es/core/BaseModel.d.ts +1 -1
  13. package/es/core/BaseModel.js +7 -3
  14. package/es/core/interface.d.ts +18 -0
  15. package/es/core/triangulation.d.ts +6 -0
  16. package/es/core/triangulation.js +64 -2
  17. package/es/earth/index.d.ts +5 -0
  18. package/es/earth/index.js +12 -1
  19. package/es/earth/models/base.js +2 -4
  20. package/es/earth/shaders/atmosphere_frag.glsl +1 -1
  21. package/es/earth/shaders/bloomsphere_frag.glsl +1 -1
  22. package/es/heatmap/index.js +6 -2
  23. package/es/heatmap/models/heatmap.js +5 -3
  24. package/es/image/index.js +6 -2
  25. package/es/image/models/dataImage.js +4 -7
  26. package/es/image/models/image.js +4 -7
  27. package/es/line/index.d.ts +1 -0
  28. package/es/line/index.js +8 -2
  29. package/es/line/models/arc.js +6 -5
  30. package/es/line/models/half.js +3 -4
  31. package/es/line/models/line.js +9 -8
  32. package/es/line/models/simpleLine.js +2 -1
  33. package/es/line/models/simpleTileLine.d.ts +9 -0
  34. package/es/line/models/simpleTileLine.js +100 -0
  35. package/es/line/models/tile.d.ts +1 -4
  36. package/es/line/models/tile.js +49 -222
  37. package/es/line/models/wall.js +10 -46
  38. package/es/line/shaders/dash/arc_dash_vert.glsl +2 -0
  39. package/es/line/shaders/dash/line_dash_frag.glsl +1 -1
  40. package/es/line/shaders/line_arc2d_vert.glsl +1 -1
  41. package/es/line/shaders/line_arc_3d_frag.glsl +1 -1
  42. package/es/line/shaders/line_arc_3d_vert.glsl +3 -3
  43. package/es/line/shaders/line_arc_frag.glsl +1 -1
  44. package/es/line/shaders/line_arc_great_circle_frag.glsl +1 -1
  45. package/es/line/shaders/line_arc_great_circle_vert.glsl +1 -1
  46. package/es/line/shaders/line_arc_vert.glsl +5 -3
  47. package/es/line/shaders/line_bezier_vert.glsl +1 -1
  48. package/es/line/shaders/line_frag.glsl +1 -2
  49. package/es/line/shaders/line_vert.glsl +1 -1
  50. package/es/line/shaders/linear/arc3d_linear_frag.glsl +1 -1
  51. package/es/line/shaders/linear/arc3d_linear_vert.glsl +3 -3
  52. package/es/line/shaders/linear/arc_linear_frag.glsl +1 -1
  53. package/es/line/shaders/tile/line_tile_map_vert.glsl +25 -0
  54. package/es/line/shaders/tile/line_tile_vert.glsl +19 -177
  55. package/es/line/shaders/tile/simpleline_map_vert.glsl +15 -0
  56. package/es/line/shaders/tile/simpleline_vert.glsl +21 -0
  57. package/es/line/shaders/{wall_frag.glsl → wall/wall_frag.glsl} +17 -21
  58. package/es/line/shaders/wall/wall_vert.glsl +77 -0
  59. package/es/mask/index.d.ts +1 -0
  60. package/es/mask/index.js +80 -5
  61. package/es/mask/models/fill.d.ts +2 -1
  62. package/es/mask/models/fill.js +13 -10
  63. package/es/mask/shaders/mask_vert.glsl +0 -6
  64. package/es/plugins/DataMappingPlugin.d.ts +4 -3
  65. package/es/plugins/DataMappingPlugin.js +129 -58
  66. package/es/plugins/DataSourcePlugin.js +3 -2
  67. package/es/plugins/FeatureScalePlugin.d.ts +0 -2
  68. package/es/plugins/FeatureScalePlugin.js +8 -51
  69. package/es/plugins/LayerAnimateStylePlugin.d.ts +0 -2
  70. package/es/plugins/LayerAnimateStylePlugin.js +7 -27
  71. package/es/plugins/LayerModelPlugin.js +2 -6
  72. package/es/plugins/LightingPlugin.js +1 -7
  73. package/es/plugins/MultiPassRendererPlugin.d.ts +0 -1
  74. package/es/plugins/MultiPassRendererPlugin.js +4 -16
  75. package/es/plugins/PixelPickingPlugin.d.ts +1 -1
  76. package/es/plugins/PixelPickingPlugin.js +8 -28
  77. package/es/plugins/RegisterStyleAttributePlugin.d.ts +4 -0
  78. package/es/plugins/RegisterStyleAttributePlugin.js +56 -5
  79. package/es/plugins/UpdateStyleAttributePlugin.js +2 -9
  80. package/es/point/index.js +6 -2
  81. package/es/point/models/fill.js +2 -2
  82. package/es/point/models/fillmage.js +1 -1
  83. package/es/point/models/image.js +1 -1
  84. package/es/point/models/normal.d.ts +0 -1
  85. package/es/point/models/normal.js +9 -60
  86. package/es/point/models/radar.js +4 -69
  87. package/es/point/models/simplePoint.d.ts +0 -1
  88. package/es/point/models/simplePoint.js +2 -11
  89. package/es/point/models/text.js +6 -7
  90. package/es/point/models/tile.d.ts +0 -7
  91. package/es/point/models/tile.js +22 -155
  92. package/es/point/models/tileText.d.ts +0 -4
  93. package/es/point/models/tileText.js +98 -185
  94. package/es/point/shaders/animate/wave_frag.glsl +3 -3
  95. package/es/point/shaders/earth/fill_vert.glsl +0 -1
  96. package/es/point/shaders/fill_vert.glsl +0 -1
  97. package/es/point/shaders/normal_frag.glsl +1 -10
  98. package/es/point/shaders/normal_vert.glsl +5 -60
  99. package/es/point/shaders/radar/radar_frag.glsl +4 -15
  100. package/es/point/shaders/radar/radar_vert.glsl +4 -54
  101. package/es/point/shaders/tile/fill_tile_frag.glsl +10 -17
  102. package/es/point/shaders/tile/fill_tile_vert.glsl +20 -123
  103. package/es/point/shaders/tile/text_frag.glsl +33 -0
  104. package/es/point/shaders/tile/text_map_frag.glsl +31 -0
  105. package/es/point/shaders/tile/text_map_vert.glsl +38 -0
  106. package/es/point/shaders/tile/text_vert.glsl +48 -0
  107. package/es/polygon/index.js +6 -2
  108. package/es/polygon/models/extrude.js +1 -3
  109. package/es/polygon/models/fill.js +3 -4
  110. package/es/polygon/models/ocean.d.ts +0 -2
  111. package/es/polygon/models/ocean.js +13 -47
  112. package/es/polygon/models/tile.d.ts +1 -4
  113. package/es/polygon/models/tile.js +25 -57
  114. package/es/polygon/models/water.d.ts +0 -2
  115. package/es/polygon/models/water.js +13 -47
  116. package/es/polygon/shaders/polygon_frag.glsl +2 -2
  117. package/es/polygon/shaders/polygon_vert.glsl +2 -2
  118. package/es/polygon/shaders/tile/polygon_tile_map_vert.glsl +16 -0
  119. package/es/polygon/shaders/tile/polygon_tile_vert.glsl +20 -60
  120. package/es/polygon/shaders/water/polygon_ocean_frag.glsl +1 -2
  121. package/es/polygon/shaders/water/polygon_ocean_vert.glsl +0 -31
  122. package/es/polygon/shaders/water/polygon_water_frag.glsl +1 -3
  123. package/es/polygon/shaders/water/polygon_water_vert.glsl +0 -29
  124. package/es/raster/buffers/triangulation.js +1 -4
  125. package/es/raster/index.js +6 -2
  126. package/es/raster/models/raster.js +3 -2
  127. package/es/shader/minify_frag.glsl +7 -0
  128. package/es/shader/minify_picking_frag.glsl +10 -0
  129. package/es/tile/manager/baseMapTileLayerManager.d.ts +29 -0
  130. package/es/tile/manager/baseMapTileLayerManager.js +207 -0
  131. package/es/tile/manager/tileLayerManager.d.ts +2 -2
  132. package/es/tile/manager/tileLayerManager.js +2 -2
  133. package/es/tile/manager/tilePickerManager.d.ts +2 -3
  134. package/es/tile/manager/tilePickerManager.js +1 -2
  135. package/es/tile/models/tileModel.d.ts +1 -0
  136. package/es/tile/models/tileModel.js +18 -2
  137. package/es/tile/tileFactory/base.d.ts +1 -1
  138. package/es/tile/tileFactory/base.js +58 -33
  139. package/es/tile/tileFactory/line.js +3 -0
  140. package/es/tile/tileFactory/point.js +3 -0
  141. package/es/tile/tileFactory/polygon.js +3 -0
  142. package/es/tile/tileFactory/raster.js +3 -0
  143. package/es/tile/tileFactory/rasterData.js +3 -0
  144. package/es/tile/tileFactory/rasterDataLayer.js +6 -2
  145. package/es/tile/tileFactory/test.js +26 -5
  146. package/es/tile/tileFactory/vectorLayer.d.ts +4 -1
  147. package/es/tile/tileFactory/vectorLayer.js +110 -7
  148. package/es/tile/tileLayer/baseMapTileLayer.d.ts +29 -0
  149. package/es/tile/tileLayer/baseMapTileLayer.js +188 -0
  150. package/es/tile/tileLayer/baseTileLayer.d.ts +4 -4
  151. package/es/tile/tileLayer/baseTileLayer.js +46 -75
  152. package/es/tile/tileTest.d.ts +1 -0
  153. package/es/tile/tileTest.js +3 -2
  154. package/es/tile/tmsMapTileLayer.d.ts +9 -0
  155. package/es/tile/tmsMapTileLayer.js +119 -0
  156. package/es/tile/tmsTileLayer.d.ts +2 -0
  157. package/es/tile/tmsTileLayer.js +24 -2
  158. package/es/tile/utils.d.ts +4 -0
  159. package/es/tile/utils.js +30 -0
  160. package/es/utils/dataMappingStyle.js +3 -0
  161. package/es/utils/layerData.js +2 -2
  162. package/es/utils/updateShape.js +2 -2
  163. package/es/wind/index.js +6 -2
  164. package/es/wind/models/wind.js +8 -8
  165. package/es/wind/shaders/wind_vert.glsl +1 -1
  166. package/lib/Geometry/index.js +19 -2
  167. package/lib/Geometry/models/billboard.js +1 -2
  168. package/lib/Geometry/models/plane.js +2 -4
  169. package/lib/Geometry/models/sprite.js +2 -4
  170. package/lib/canvas/index.js +37 -2
  171. package/lib/citybuliding/building.js +6 -2
  172. package/lib/citybuliding/models/build.js +2 -3
  173. package/lib/core/BaseLayer.js +86 -94
  174. package/lib/core/BaseModel.js +7 -3
  175. package/lib/core/triangulation.js +66 -2
  176. package/lib/earth/index.js +11 -1
  177. package/lib/earth/models/base.js +2 -4
  178. package/lib/earth/shaders/atmosphere_frag.glsl +1 -1
  179. package/lib/earth/shaders/bloomsphere_frag.glsl +1 -1
  180. package/lib/heatmap/index.js +6 -2
  181. package/lib/heatmap/models/heatmap.js +5 -3
  182. package/lib/image/index.js +6 -2
  183. package/lib/image/models/dataImage.js +4 -7
  184. package/lib/image/models/image.js +4 -7
  185. package/lib/line/index.js +7 -2
  186. package/lib/line/models/arc.js +6 -5
  187. package/lib/line/models/half.js +3 -4
  188. package/lib/line/models/line.js +9 -8
  189. package/lib/line/models/simpleLine.js +2 -1
  190. package/lib/line/models/simpleTileLine.js +115 -0
  191. package/lib/line/models/tile.js +49 -223
  192. package/lib/line/models/wall.js +10 -46
  193. package/lib/line/shaders/dash/arc_dash_vert.glsl +2 -0
  194. package/lib/line/shaders/dash/line_dash_frag.glsl +1 -1
  195. package/lib/line/shaders/line_arc2d_vert.glsl +1 -1
  196. package/lib/line/shaders/line_arc_3d_frag.glsl +1 -1
  197. package/lib/line/shaders/line_arc_3d_vert.glsl +3 -3
  198. package/lib/line/shaders/line_arc_frag.glsl +1 -1
  199. package/lib/line/shaders/line_arc_great_circle_frag.glsl +1 -1
  200. package/lib/line/shaders/line_arc_great_circle_vert.glsl +1 -1
  201. package/lib/line/shaders/line_arc_vert.glsl +5 -3
  202. package/lib/line/shaders/line_bezier_vert.glsl +1 -1
  203. package/lib/line/shaders/line_frag.glsl +1 -2
  204. package/lib/line/shaders/line_vert.glsl +1 -1
  205. package/lib/line/shaders/linear/arc3d_linear_frag.glsl +1 -1
  206. package/lib/line/shaders/linear/arc3d_linear_vert.glsl +3 -3
  207. package/lib/line/shaders/linear/arc_linear_frag.glsl +1 -1
  208. package/lib/line/shaders/tile/line_tile_map_vert.glsl +25 -0
  209. package/lib/line/shaders/tile/line_tile_vert.glsl +19 -177
  210. package/lib/line/shaders/tile/simpleline_map_vert.glsl +15 -0
  211. package/lib/line/shaders/tile/simpleline_vert.glsl +21 -0
  212. package/lib/line/shaders/{wall_frag.glsl → wall/wall_frag.glsl} +17 -21
  213. package/lib/line/shaders/wall/wall_vert.glsl +77 -0
  214. package/lib/mask/index.js +82 -5
  215. package/lib/mask/models/fill.js +14 -10
  216. package/lib/mask/shaders/mask_vert.glsl +0 -6
  217. package/lib/plugins/DataMappingPlugin.js +127 -57
  218. package/lib/plugins/DataSourcePlugin.js +3 -2
  219. package/lib/plugins/FeatureScalePlugin.js +6 -50
  220. package/lib/plugins/LayerAnimateStylePlugin.js +6 -29
  221. package/lib/plugins/LayerModelPlugin.js +2 -6
  222. package/lib/plugins/LightingPlugin.js +1 -7
  223. package/lib/plugins/MultiPassRendererPlugin.js +3 -19
  224. package/lib/plugins/PixelPickingPlugin.js +8 -28
  225. package/lib/plugins/RegisterStyleAttributePlugin.js +56 -5
  226. package/lib/plugins/UpdateStyleAttributePlugin.js +2 -9
  227. package/lib/point/index.js +6 -2
  228. package/lib/point/models/fill.js +2 -2
  229. package/lib/point/models/fillmage.js +1 -1
  230. package/lib/point/models/image.js +1 -1
  231. package/lib/point/models/normal.js +8 -59
  232. package/lib/point/models/radar.js +4 -69
  233. package/lib/point/models/simplePoint.js +1 -10
  234. package/lib/point/models/text.js +6 -7
  235. package/lib/point/models/tile.js +21 -156
  236. package/lib/point/models/tileText.js +97 -184
  237. package/lib/point/shaders/animate/wave_frag.glsl +3 -3
  238. package/lib/point/shaders/earth/fill_vert.glsl +0 -1
  239. package/lib/point/shaders/fill_vert.glsl +0 -1
  240. package/lib/point/shaders/normal_frag.glsl +1 -10
  241. package/lib/point/shaders/normal_vert.glsl +5 -60
  242. package/lib/point/shaders/radar/radar_frag.glsl +4 -15
  243. package/lib/point/shaders/radar/radar_vert.glsl +4 -54
  244. package/lib/point/shaders/tile/fill_tile_frag.glsl +10 -17
  245. package/lib/point/shaders/tile/fill_tile_vert.glsl +20 -123
  246. package/lib/point/shaders/tile/text_frag.glsl +33 -0
  247. package/lib/point/shaders/tile/text_map_frag.glsl +31 -0
  248. package/lib/point/shaders/tile/text_map_vert.glsl +38 -0
  249. package/lib/point/shaders/tile/text_vert.glsl +48 -0
  250. package/lib/polygon/index.js +6 -2
  251. package/lib/polygon/models/extrude.js +1 -3
  252. package/lib/polygon/models/fill.js +3 -4
  253. package/lib/polygon/models/ocean.js +14 -47
  254. package/lib/polygon/models/tile.js +24 -57
  255. package/lib/polygon/models/water.js +14 -47
  256. package/lib/polygon/shaders/polygon_frag.glsl +2 -2
  257. package/lib/polygon/shaders/polygon_vert.glsl +2 -2
  258. package/lib/polygon/shaders/tile/polygon_tile_map_vert.glsl +16 -0
  259. package/lib/polygon/shaders/tile/polygon_tile_vert.glsl +20 -60
  260. package/lib/polygon/shaders/water/polygon_ocean_frag.glsl +1 -2
  261. package/lib/polygon/shaders/water/polygon_ocean_vert.glsl +0 -31
  262. package/lib/polygon/shaders/water/polygon_water_frag.glsl +1 -3
  263. package/lib/polygon/shaders/water/polygon_water_vert.glsl +0 -29
  264. package/lib/raster/buffers/triangulation.js +1 -4
  265. package/lib/raster/index.js +6 -2
  266. package/lib/raster/models/raster.js +3 -2
  267. package/lib/shader/minify_frag.glsl +7 -0
  268. package/lib/shader/minify_picking_frag.glsl +10 -0
  269. package/lib/tile/manager/baseMapTileLayerManager.js +222 -0
  270. package/lib/tile/manager/tileLayerManager.js +2 -2
  271. package/lib/tile/manager/tilePickerManager.js +1 -2
  272. package/lib/tile/models/tileModel.js +19 -2
  273. package/lib/tile/tileFactory/base.js +60 -33
  274. package/lib/tile/tileFactory/line.js +3 -0
  275. package/lib/tile/tileFactory/point.js +3 -0
  276. package/lib/tile/tileFactory/polygon.js +3 -0
  277. package/lib/tile/tileFactory/raster.js +3 -0
  278. package/lib/tile/tileFactory/rasterData.js +3 -0
  279. package/lib/tile/tileFactory/rasterDataLayer.js +6 -2
  280. package/lib/tile/tileFactory/test.js +26 -5
  281. package/lib/tile/tileFactory/vectorLayer.js +112 -8
  282. package/lib/tile/tileLayer/baseMapTileLayer.js +195 -0
  283. package/lib/tile/tileLayer/baseTileLayer.js +46 -75
  284. package/lib/tile/tileTest.js +3 -2
  285. package/lib/tile/tmsMapTileLayer.js +136 -0
  286. package/lib/tile/tmsTileLayer.js +25 -2
  287. package/lib/tile/utils.js +38 -0
  288. package/lib/utils/dataMappingStyle.js +3 -0
  289. package/lib/utils/layerData.js +2 -2
  290. package/lib/utils/updateShape.js +2 -2
  291. package/lib/wind/index.js +6 -2
  292. package/lib/wind/models/wind.js +7 -7
  293. package/lib/wind/shaders/wind_vert.glsl +1 -1
  294. package/package.json +8 -7
  295. package/es/line/shaders/tile/line_tile_frag.glsl +0 -79
  296. package/es/line/shaders/wall_vert.glsl +0 -111
  297. package/es/mask/shaders/mask_frag.glsl +0 -7
  298. package/es/polygon/shaders/tile/polygon_tile_frag.glsl +0 -12
  299. package/lib/line/shaders/tile/line_tile_frag.glsl +0 -79
  300. package/lib/line/shaders/wall_vert.glsl +0 -111
  301. package/lib/mask/shaders/mask_frag.glsl +0 -7
  302. package/lib/polygon/shaders/tile/polygon_tile_frag.glsl +0 -12
@@ -20,9 +20,7 @@ var LayerModelPlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/function
20
20
  // 更新Model 配置项
21
21
  layer.prepareBuildModel(); // 初始化 Model
22
22
 
23
- layer.buildModels(); // emit layer model loaded
24
-
25
- layer.emit('modelLoaded', null);
23
+ layer.buildModels();
26
24
  layer.styleNeedUpdate = false;
27
25
  }
28
26
  }, {
@@ -32,9 +30,7 @@ var LayerModelPlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/function
32
30
  layer.prepareBuildModel();
33
31
  layer.clearModels(); // 初始化 Model
34
32
 
35
- layer.buildModels(); // emit layer model loaded
36
-
37
- layer.emit('modelLoaded', null);
33
+ layer.buildModels();
38
34
  layer.layerModelNeedUpdate = false;
39
35
  }
40
36
  }, {
@@ -44,7 +44,6 @@ var DEFAULT_SPOT_LIGHT = {
44
44
  exponent: 40,
45
45
  blur: 5
46
46
  };
47
- var COLOR_ATTRIBUTES = ['ambient', 'diffuse', 'specular'];
48
47
  export function generateLightingUniforms(lights) {
49
48
  var lightsMap = {
50
49
  u_DirectionalLights: new Array(3).fill(_objectSpread({}, DEFAULT_DIRECTIONAL_LIGHT)),
@@ -63,12 +62,7 @@ export function generateLightingUniforms(lights) {
63
62
  rest = _objectWithoutProperties(_ref, _excluded);
64
63
 
65
64
  var lightsUniformName = lightTypeUniformMap[type].lights;
66
- var lightsNumUniformName = lightTypeUniformMap[type].num; // Object.keys(rest).forEach(key => {
67
- // if (Util.isString(rest[key]) && COLOR_ATTRIBUTES.indexOf(key) > -1) {
68
- // rest[key] = ColorUtil.color2RGBA(rest[key]).slice(0, 3);
69
- // }
70
- // });
71
- // @ts-ignore
65
+ var lightsNumUniformName = lightTypeUniformMap[type].num; // @ts-ignore
72
66
 
73
67
  var num = lightsMap[lightsNumUniformName]; // @ts-ignore
74
68
 
@@ -14,7 +14,6 @@ import 'reflect-metadata';
14
14
  * })
15
15
  */
16
16
  export default class MultiPassRendererPlugin implements ILayerPlugin {
17
- private readonly configService;
18
17
  private enabled;
19
18
  apply(layer: ILayer, { rendererService, postProcessingPassFactory, normalPassFactory, }: {
20
19
  rendererService: IRendererService;
@@ -1,14 +1,9 @@
1
- import _initializerDefineProperty from "@babel/runtime/helpers/initializerDefineProperty";
2
1
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
2
  import _createClass from "@babel/runtime/helpers/createClass";
4
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
5
- import _applyDecoratedDescriptor from "@babel/runtime/helpers/applyDecoratedDescriptor";
6
- import _initializerWarningHelper from "@babel/runtime/helpers/initializerWarningHelper";
7
3
 
8
- var _dec, _dec2, _class, _class2, _descriptor;
4
+ var _dec, _class;
9
5
 
10
- import { TYPES } from '@antv/l7-core';
11
- import { inject, injectable } from 'inversify';
6
+ import { injectable } from 'inversify';
12
7
  import 'reflect-metadata';
13
8
  import { createMultiPassRenderer } from "../utils/multiPassRender";
14
9
  /**
@@ -25,11 +20,9 @@ import { createMultiPassRenderer } from "../utils/multiPassRender";
25
20
  * })
26
21
  */
27
22
 
28
- var MultiPassRendererPlugin = (_dec = injectable(), _dec2 = inject(TYPES.IGlobalConfigService), _dec(_class = (_class2 = /*#__PURE__*/function () {
23
+ var MultiPassRendererPlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/function () {
29
24
  function MultiPassRendererPlugin() {
30
25
  _classCallCheck(this, MultiPassRendererPlugin);
31
-
32
- _initializerDefineProperty(this, "configService", _descriptor, this);
33
26
  }
34
27
 
35
28
  _createClass(MultiPassRendererPlugin, [{
@@ -68,10 +61,5 @@ var MultiPassRendererPlugin = (_dec = injectable(), _dec2 = inject(TYPES.IGlobal
68
61
  }]);
69
62
 
70
63
  return MultiPassRendererPlugin;
71
- }(), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "configService", [_dec2], {
72
- configurable: true,
73
- enumerable: true,
74
- writable: true,
75
- initializer: null
76
- })), _class2)) || _class);
64
+ }()) || _class);
77
65
  export { MultiPassRendererPlugin as default };
@@ -1,7 +1,7 @@
1
1
  import { ILayer, ILayerPlugin, IRendererService, IStyleAttributeService } from '@antv/l7-core';
2
2
  import 'reflect-metadata';
3
3
  export default class PixelPickingPlugin implements ILayerPlugin {
4
- apply(layer: ILayer, { rendererService, styleAttributeService, }: {
4
+ apply(layer: ILayer, { styleAttributeService, }: {
5
5
  rendererService: IRendererService;
6
6
  styleAttributeService: IStyleAttributeService;
7
7
  }): void;
@@ -20,14 +20,11 @@ var PixelPickingPlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/functi
20
20
  _createClass(PixelPickingPlugin, [{
21
21
  key: "apply",
22
22
  value: function apply(layer, _ref) {
23
- var rendererService = _ref.rendererService,
24
- styleAttributeService = _ref.styleAttributeService;
23
+ var styleAttributeService = _ref.styleAttributeService;
25
24
  // TODO: 由于 Shader 目前无法根据是否开启拾取进行内容修改,因此即使不开启也需要生成 a_PickingColor
26
25
  layer.hooks.init.tap('PixelPickingPlugin', function () {
27
26
  var _layer$getLayerConfig = layer.getLayerConfig(),
28
- enablePicking = _layer$getLayerConfig.enablePicking,
29
- enableMultiPassRenderer = _layer$getLayerConfig.enableMultiPassRenderer; // const enablePicking = true;
30
-
27
+ enablePicking = _layer$getLayerConfig.enablePicking;
31
28
 
32
29
  styleAttributeService.registerStyleAttribute({
33
30
  name: 'pickingColor',
@@ -40,7 +37,7 @@ var PixelPickingPlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/functi
40
37
  },
41
38
  size: 3,
42
39
  // TODO: 固定 feature range 范围内的 pickingColor 都是固定的,可以生成 cache
43
- update: function update(feature, featureIdx) {
40
+ update: function update(feature) {
44
41
  // 只有开启拾取才需要 encode
45
42
  var id = feature.id;
46
43
  return enablePicking ? encodePickingColor(id) : [0, 0, 0];
@@ -48,7 +45,6 @@ var PixelPickingPlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/functi
48
45
  }
49
46
  });
50
47
  }); // 必须要与 PixelPickingPass 结合使用,因此必须开启 multiPassRenderer
51
- // if (layer.multiPassRenderer) {
52
48
 
53
49
  layer.hooks.beforePickingEncode.tap('PixelPickingPlugin', function () {
54
50
  var _layer$getLayerConfig2 = layer.getLayerConfig(),
@@ -79,23 +75,12 @@ var PixelPickingPlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/functi
79
75
  var _layer$getLayerConfig4 = layer.getLayerConfig(),
80
76
  highlightColor = _layer$getLayerConfig4.highlightColor,
81
77
  _layer$getLayerConfig5 = _layer$getLayerConfig4.activeMix,
82
- activeMix = _layer$getLayerConfig5 === void 0 ? 0 : _layer$getLayerConfig5; // const {
83
- // highlightColor,
84
- // activeMix = 0,
85
- // enableSelect,
86
- // } = layer.getLayerConfig();
87
-
88
-
89
- var highlightColorInArray = typeof highlightColor === 'string' ? rgb2arr(highlightColor) : highlightColor || [1, 0, 0, 1]; // const { selectColor } = layer.getLayerConfig();
90
- // const selectColorInArray =
91
- // typeof selectColor === 'string'
92
- // ? rgb2arr(selectColor)
93
- // : selectColor || [1, 0, 0, 1];
78
+ activeMix = _layer$getLayerConfig5 === void 0 ? 0 : _layer$getLayerConfig5;
94
79
 
80
+ var highlightColorInArray = typeof highlightColor === 'string' ? rgb2arr(highlightColor) : highlightColor || [1, 0, 0, 1];
95
81
  layer.updateLayerConfig({
96
82
  pickedFeatureID: decodePickingColor(new Uint8Array(pickedColor))
97
- }); // const currentSelectedId = layer.getCurrentSelectedId();
98
-
83
+ });
99
84
  layer.models.forEach(function (model) {
100
85
  return model.addUniforms({
101
86
  u_PickingStage: PickingStage.HIGHLIGHT,
@@ -103,12 +88,7 @@ var PixelPickingPlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/functi
103
88
  u_HighlightColor: highlightColorInArray.map(function (c) {
104
89
  return c * 255;
105
90
  }),
106
- u_activeMix: activeMix // u_CurrentSelectedId: currentSelectedId
107
- // ? encodePickingColor(layer.getCurrentSelectedId()!)
108
- // : [0, 0, 0],
109
- // u_SelectColor: selectColorInArray.map((c) => c * 255),
110
- // u_EnableSelect: +(enableSelect || false),
111
-
91
+ u_activeMix: activeMix
112
92
  });
113
93
  });
114
94
  });
@@ -137,7 +117,7 @@ var PixelPickingPlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/functi
137
117
  u_EnableSelect: 1
138
118
  });
139
119
  });
140
- }); // }
120
+ });
141
121
  }
142
122
  }]);
143
123
 
@@ -8,4 +8,8 @@ export default class RegisterStyleAttributePlugin implements ILayerPlugin {
8
8
  styleAttributeService: IStyleAttributeService;
9
9
  }): void;
10
10
  private registerBuiltinAttributes;
11
+ private registerPositionAttribute;
12
+ private registerFilterAttribute;
13
+ private registerColorAttribute;
14
+ private registerVertexIdAttribute;
11
15
  }
@@ -22,12 +22,51 @@ var RegisterStyleAttributePlugin = (_dec = injectable(), _dec(_class = /*#__PURE
22
22
 
23
23
  var styleAttributeService = _ref.styleAttributeService;
24
24
  layer.hooks.init.tap('RegisterStyleAttributePlugin', function () {
25
- _this.registerBuiltinAttributes(styleAttributeService);
25
+ _this.registerBuiltinAttributes(styleAttributeService, layer);
26
26
  });
27
27
  }
28
28
  }, {
29
29
  key: "registerBuiltinAttributes",
30
- value: function registerBuiltinAttributes(styleAttributeService) {
30
+ value: function registerBuiltinAttributes(styleAttributeService, layer) {
31
+ // 过滤 tileGroup layer (瓦片图层)
32
+ var source = layer.getSource();
33
+
34
+ switch (source.parser.type) {
35
+ case 'mvt':
36
+ case 'testTile':
37
+ case 'rasterTile':
38
+ // layer 仅作为 group 使用
39
+ return;
40
+ }
41
+
42
+ if (layer.type === 'MaskLayer') {
43
+ this.registerPositionAttribute(styleAttributeService);
44
+ return;
45
+ }
46
+
47
+ var _layer$getLayerConfig = layer.getLayerConfig(),
48
+ usage = _layer$getLayerConfig.usage;
49
+
50
+ if (usage === 'basemap ') {
51
+ this.registerPositionAttribute(styleAttributeService);
52
+ return;
53
+ }
54
+
55
+ if (layer.isTileLayer) {
56
+ this.registerPositionAttribute(styleAttributeService);
57
+ this.registerColorAttribute(styleAttributeService);
58
+ return;
59
+ } // Tip: normal render layer
60
+
61
+
62
+ this.registerPositionAttribute(styleAttributeService);
63
+ this.registerFilterAttribute(styleAttributeService);
64
+ this.registerColorAttribute(styleAttributeService);
65
+ this.registerVertexIdAttribute(styleAttributeService);
66
+ }
67
+ }, {
68
+ key: "registerPositionAttribute",
69
+ value: function registerPositionAttribute(styleAttributeService) {
31
70
  styleAttributeService.registerStyleAttribute({
32
71
  name: 'position',
33
72
  type: AttributeType.Attribute,
@@ -43,6 +82,10 @@ var RegisterStyleAttributePlugin = (_dec = injectable(), _dec(_class = /*#__PURE
43
82
  }
44
83
  }
45
84
  });
85
+ }
86
+ }, {
87
+ key: "registerFilterAttribute",
88
+ value: function registerFilterAttribute(styleAttributeService) {
46
89
  styleAttributeService.registerStyleAttribute({
47
90
  name: 'filter',
48
91
  type: AttributeType.Attribute,
@@ -55,12 +98,16 @@ var RegisterStyleAttributePlugin = (_dec = injectable(), _dec(_class = /*#__PURE
55
98
  type: gl.FLOAT
56
99
  },
57
100
  size: 1,
58
- update: function update(feature, featureIdx) {
101
+ update: function update(feature) {
59
102
  var filter = feature.filter;
60
103
  return filter ? [1] : [0];
61
104
  }
62
105
  }
63
106
  });
107
+ }
108
+ }, {
109
+ key: "registerColorAttribute",
110
+ value: function registerColorAttribute(styleAttributeService) {
64
111
  styleAttributeService.registerStyleAttribute({
65
112
  name: 'color',
66
113
  type: AttributeType.Attribute,
@@ -73,12 +120,16 @@ var RegisterStyleAttributePlugin = (_dec = injectable(), _dec(_class = /*#__PURE
73
120
  type: gl.FLOAT
74
121
  },
75
122
  size: 4,
76
- update: function update(feature, featureIdx) {
123
+ update: function update(feature) {
77
124
  var color = feature.color;
78
125
  return !color || !color.length ? [1, 1, 1, 1] : color;
79
126
  }
80
127
  }
81
128
  });
129
+ }
130
+ }, {
131
+ key: "registerVertexIdAttribute",
132
+ value: function registerVertexIdAttribute(styleAttributeService) {
82
133
  styleAttributeService.registerStyleAttribute({
83
134
  // 统一注册每个顶点的唯一编号(目前用于样式的数据映射计算使用)
84
135
  name: 'vertexId',
@@ -92,7 +143,7 @@ var RegisterStyleAttributePlugin = (_dec = injectable(), _dec(_class = /*#__PURE
92
143
  type: gl.FLOAT
93
144
  },
94
145
  size: 1,
95
- update: function update(feature, featureIdx, vertex, attributeIdx) {
146
+ update: function update(feature, featureIdx) {
96
147
  return [featureIdx];
97
148
  }
98
149
  }
@@ -24,11 +24,7 @@ var UpdateStyleAttributePlugin = (_dec = injectable(), _dec(_class = /*#__PURE__
24
24
  _this.initStyleAttribute(layer, {
25
25
  styleAttributeService: styleAttributeService
26
26
  });
27
- }); // layer.hooks.beforeRenderData.tap('styleAttributeService', () => {
28
- // // layer.layerModelNeedUpdate = true;
29
- // return true;
30
- // });
31
-
27
+ });
32
28
  layer.hooks.beforeRender.tap('UpdateStyleAttributePlugin', function () {
33
29
  if (layer.layerModelNeedUpdate) {
34
30
  return;
@@ -45,11 +41,8 @@ var UpdateStyleAttributePlugin = (_dec = injectable(), _dec(_class = /*#__PURE__
45
41
  var styleAttributeService = _ref2.styleAttributeService;
46
42
  var attributes = styleAttributeService.getLayerStyleAttributes() || [];
47
43
  var filter = styleAttributeService.getLayerStyleAttribute('filter');
48
- var shape = styleAttributeService.getLayerStyleAttribute('shape');
49
44
 
50
- if (filter && filter.needRegenerateVertices // ||
51
- // (shape && shape.needRegenerateVertices) // TODO:Shape 更新重新build
52
- ) {
45
+ if (filter && filter.needRegenerateVertices) {
53
46
  layer.layerModelNeedUpdate = true;
54
47
  attributes.forEach(function (attr) {
55
48
  return attr.needRegenerateVertices = false;
package/es/point/index.js CHANGED
@@ -64,7 +64,9 @@ var PointLayer = /*#__PURE__*/function (_BaseLayer) {
64
64
 
65
65
  _this2.layerService.updateLayerRenderList();
66
66
 
67
- _this2.renderLayers();
67
+ _this2.emit('modelLoaded', null);
68
+
69
+ _this2.layerService.throttleRenderLayers();
68
70
  });
69
71
  }
70
72
  }, {
@@ -73,7 +75,9 @@ var PointLayer = /*#__PURE__*/function (_BaseLayer) {
73
75
  var _this3 = this;
74
76
 
75
77
  this.layerModel.buildModels(function (models) {
76
- return _this3.models = models;
78
+ _this3.models = models;
79
+
80
+ _this3.emit('modelLoaded', null);
77
81
  });
78
82
  }
79
83
  /**
@@ -21,13 +21,13 @@ import BaseModel from "../../core/BaseModel";
21
21
  /* babel-plugin-inline-import '../shaders/animate/wave_frag.glsl' */
22
22
  // import { PointFillTriangulation } from '../../core/triangulation';
23
23
  // animate pointLayer shader - support animate
24
- var waveFillFrag = "\nuniform float u_additive;\n\nvarying mat4 styleMappingMat; // \u4F20\u9012\u4ECE\u7247\u5143\u4E2D\u4F20\u9012\u7684\u6620\u5C04\u6570\u636E\n\nvarying vec4 v_data;\nvarying vec4 v_color;\nvarying float v_radius;\nuniform float u_time;\nuniform vec4 u_aimate: [ 0, 2., 1.0, 0.2 ];\n\n#pragma include \"sdf_2d\"\n#pragma include \"picking\"\n\nvoid main() {\n\n vec4 textrueStroke = vec4(\n styleMappingMat[1][0],\n styleMappingMat[1][1],\n styleMappingMat[1][2],\n styleMappingMat[1][3]\n );\n\n float opacity = styleMappingMat[0][0];\n\n lowp float antialiasblur = v_data.z;\n float r = v_radius / (v_radius);\n\n float outer_df;\n float inner_df;\n // 'circle', 'triangle', 'square', 'pentagon', 'hexagon', 'octogon', 'hexagram', 'rhombus', 'vesica'\n \n outer_df = sdCircle(v_data.xy, 1.0);\n inner_df = sdCircle(v_data.xy, r);\n\n\n float opacity_t = smoothstep(0.0, antialiasblur, outer_df);\n\n float color_t = smoothstep(\n antialiasblur,\n 0.0,\n inner_df\n );\n float PI = 3.14159;\n float N_RINGS = 3.0;\n float FREQ = 1.0;\n\n gl_FragColor = vec4(v_color.rgb, v_color.a * opacity);\n\n float d = length(v_data.xy);\n if(d > 0.5) {\n discard;\n }\n float intensity = clamp(cos(d * PI), 0.0, 1.0) * clamp(cos(2.0 * PI * (d * 2.0 * u_aimate.z - u_aimate.y * u_time)), 0.0, 1.0);\n \n // TODO: \u6839\u636E\u53E0\u52A0\u6A21\u5F0F\u9009\u62E9\u6548\u679C\n if(u_additive > 0.0) {\n gl_FragColor *= intensity;\n // TODO: \u4F18\u5316\u6C34\u6CE2\u70B9 blend additive \u6A21\u5F0F\u4E0B\u6709\u7684\u62FE\u53D6\u6548\u679C \n gl_FragColor = filterColorAlpha(gl_FragColor, gl_FragColor.a);\n } else {\n gl_FragColor = vec4(gl_FragColor.xyz, gl_FragColor.a * intensity);\n gl_FragColor = filterColor(gl_FragColor);\n }\n}\n"; // static pointLayer shader - not support animate
24
+ var waveFillFrag = "\nuniform float u_additive;\n\nvarying mat4 styleMappingMat; // \u4F20\u9012\u4ECE\u7247\u5143\u4E2D\u4F20\u9012\u7684\u6620\u5C04\u6570\u636E\n\nvarying vec4 v_data;\nvarying vec4 v_color;\nvarying float v_radius;\nuniform float u_time;\nuniform vec4 u_aimate: [ 1., 2., 1.0, 0.2 ];\n\n#pragma include \"sdf_2d\"\n#pragma include \"picking\"\n\nvoid main() {\n\n vec4 textrueStroke = vec4(\n styleMappingMat[1][0],\n styleMappingMat[1][1],\n styleMappingMat[1][2],\n styleMappingMat[1][3]\n );\n\n float opacity = styleMappingMat[0][0];\n\n lowp float antialiasblur = v_data.z;\n float r = v_radius / (v_radius);\n\n float outer_df;\n float inner_df;\n // 'circle', 'triangle', 'square', 'pentagon', 'hexagon', 'octogon', 'hexagram', 'rhombus', 'vesica'\n \n outer_df = sdCircle(v_data.xy, 1.0);\n inner_df = sdCircle(v_data.xy, r);\n\n\n float opacity_t = smoothstep(0.0, antialiasblur, outer_df);\n\n float color_t = smoothstep(\n antialiasblur,\n 0.0,\n inner_df\n );\n float PI = 3.14159;\n float N_RINGS = 3.0;\n float FREQ = 1.0;\n\n gl_FragColor = vec4(v_color.rgb, v_color.a * opacity);\n\n float d = length(v_data.xy);\n if(d > 0.5) {\n discard;\n }\n float intensity = clamp(cos(d * PI), 0.0, 1.0) * clamp(cos(2.0 * PI * (d * 2.0 * u_aimate.z - u_aimate.y * u_time)), 0.0, 1.0);\n \n // \u6839\u636E\u53E0\u52A0\u6A21\u5F0F\u9009\u62E9\u6548\u679C\n if(u_additive > 0.0) {\n gl_FragColor *= intensity;\n // \u4F18\u5316\u6C34\u6CE2\u70B9 blend additive \u6A21\u5F0F\u4E0B\u6709\u7684\u62FE\u53D6\u6548\u679C \n gl_FragColor = filterColorAlpha(gl_FragColor, gl_FragColor.a);\n } else {\n gl_FragColor = vec4(gl_FragColor.xyz, gl_FragColor.a * intensity);\n gl_FragColor = filterColor(gl_FragColor);\n }\n}\n"; // static pointLayer shader - not support animate
25
25
 
26
26
  /* babel-plugin-inline-import '../shaders/fill_frag.glsl' */
27
27
  var pointFillFrag = "uniform float u_additive;\n\nvarying mat4 styleMappingMat; // \u4F20\u9012\u4ECE\u7247\u5143\u4E2D\u4F20\u9012\u7684\u6620\u5C04\u6570\u636E\n\nvarying vec4 v_data;\nvarying vec4 v_color;\nvarying float v_radius;\n\n#pragma include \"sdf_2d\"\n#pragma include \"picking\"\n\n\nvoid main() {\n int shape = int(floor(v_data.w + 0.5));\n\n vec4 textrueStroke = vec4(\n styleMappingMat[1][0],\n styleMappingMat[1][1],\n styleMappingMat[1][2],\n styleMappingMat[1][3]\n );\n\n float opacity = styleMappingMat[0][0];\n float stroke_opacity = styleMappingMat[0][1];\n float strokeWidth = styleMappingMat[0][2];\n vec4 strokeColor = textrueStroke == vec4(0) ? v_color : textrueStroke;\n\n lowp float antialiasblur = v_data.z;\n float r = v_radius / (v_radius + strokeWidth);\n\n float outer_df;\n float inner_df;\n // 'circle', 'triangle', 'square', 'pentagon', 'hexagon', 'octogon', 'hexagram', 'rhombus', 'vesica'\n if (shape == 0) {\n outer_df = sdCircle(v_data.xy, 1.0);\n inner_df = sdCircle(v_data.xy, r);\n } else if (shape == 1) {\n outer_df = sdEquilateralTriangle(1.1 * v_data.xy);\n inner_df = sdEquilateralTriangle(1.1 / r * v_data.xy);\n } else if (shape == 2) {\n outer_df = sdBox(v_data.xy, vec2(1.));\n inner_df = sdBox(v_data.xy, vec2(r));\n } else if (shape == 3) {\n outer_df = sdPentagon(v_data.xy, 0.8);\n inner_df = sdPentagon(v_data.xy, r * 0.8);\n } else if (shape == 4) {\n outer_df = sdHexagon(v_data.xy, 0.8);\n inner_df = sdHexagon(v_data.xy, r * 0.8);\n } else if (shape == 5) {\n outer_df = sdOctogon(v_data.xy, 1.0);\n inner_df = sdOctogon(v_data.xy, r);\n } else if (shape == 6) {\n outer_df = sdHexagram(v_data.xy, 0.52);\n inner_df = sdHexagram(v_data.xy, r * 0.52);\n } else if (shape == 7) {\n outer_df = sdRhombus(v_data.xy, vec2(1.0));\n inner_df = sdRhombus(v_data.xy, vec2(r));\n } else if (shape == 8) {\n outer_df = sdVesica(v_data.xy, 1.1, 0.8);\n inner_df = sdVesica(v_data.xy, r * 1.1, r * 0.8);\n }\n\n float opacity_t = smoothstep(0.0, antialiasblur, outer_df);\n\n float color_t = strokeWidth < 0.01 ? 0.0 : smoothstep(\n antialiasblur,\n 0.0,\n inner_df\n );\n\n if(strokeWidth < 0.01) {\n gl_FragColor = vec4(v_color.rgb, v_color.a * opacity);\n } else {\n gl_FragColor = mix(vec4(v_color.rgb, v_color.a * opacity), strokeColor * stroke_opacity, color_t);\n }\n\n if(u_additive > 0.0) {\n gl_FragColor *= opacity_t;\n gl_FragColor = filterColorAlpha(gl_FragColor, gl_FragColor.a);\n } else {\n gl_FragColor.a *= opacity_t;\n gl_FragColor = filterColor(gl_FragColor);\n }\n}\n";
28
28
 
29
29
  /* babel-plugin-inline-import '../shaders/fill_vert.glsl' */
30
- var pointFillVert = "attribute vec4 a_Color;\nattribute vec3 a_Position;\nattribute vec3 a_Extrude;\nattribute float a_Size;\nattribute float a_Shape;\n\nvarying mat4 styleMappingMat; // \u7528\u4E8E\u5C06\u5728\u9876\u70B9\u7740\u8272\u5668\u4E2D\u8BA1\u7B97\u597D\u7684\u6837\u5F0F\u503C\u4F20\u9012\u7ED9\u7247\u5143\n\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nuniform float u_meter2coord;\nuniform float u_meteryScale;\nuniform float u_isMeter;\n\nvarying vec4 v_data;\nvarying vec4 v_color;\nvarying float v_radius;\n\nuniform float u_opacity : 1;\nuniform float u_stroke_opacity : 1;\nuniform float u_stroke_width : 2;\nuniform vec4 u_stroke_color : [0.0, 0.0, 0.0, 0.0];\nuniform vec2 u_offsets;\n\nuniform float u_blur : 0.0;\nuniform float u_raisingHeight: 0.0;\nuniform float u_heightfixed: 0.0;\n\n#pragma include \"styleMapping\"\n#pragma include \"styleMappingCalOpacity\"\n#pragma include \"styleMappingCalStrokeOpacity\"\n#pragma include \"styleMappingCalStrokeWidth\"\n\n#pragma include \"projection\"\n#pragma include \"picking\"\n\n\nvoid main() {\n vec3 extrude = a_Extrude;\n float shape_type = a_Shape;\n /*\n * setPickingSize \u8BBE\u7F6E\u62FE\u53D6\u5927\u5C0F\n * u_meter2coord \u5728\u7B49\u9762\u79EF\u5927\u5C0F\u7684\u65F6\u5019\u8BBE\u7F6E\u5355\u4F4D\n */\n float newSize = setPickingSize(a_Size) * u_meter2coord;\n // float newSize = setPickingSize(a_Size) * 0.00001038445708445579;\n\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\n );\n\n float rowCount = u_cellTypeLayout[0][0]; // \u5F53\u524D\u7684\u6570\u636E\u7EB9\u7406\u6709\u51E0\u884C\n float columnCount = u_cellTypeLayout[0][1]; // \u5F53\u770B\u5230\u6570\u636E\u7EB9\u7406\u6709\u51E0\u5217\n float columnWidth = 1.0/columnCount; // \u5217\u5BBD\n float rowHeight = 1.0/rowCount; // \u884C\u9AD8\n float cellCount = calCellCount(); // opacity - strokeOpacity - strokeWidth - stroke - offsets\n float id = a_vertexId; // \u7B2Cn\u4E2A\u9876\u70B9\n float cellCurrentRow = floor(id * cellCount / columnCount) + 1.0; // \u8D77\u59CB\u70B9\u5728\u7B2C\u51E0\u884C\n float cellCurrentColumn = mod(id * cellCount, columnCount) + 1.0; // \u8D77\u59CB\u70B9\u5728\u7B2C\u51E0\u5217\n \n // cell \u56FA\u5B9A\u987A\u5E8F opacity -> strokeOpacity -> strokeWidth -> stroke ... \n // \u6309\u987A\u5E8F\u4ECE cell \u4E2D\u53D6\u503C\u3001\u82E5\u6CA1\u6709\u5219\u81EA\u52A8\u5F80\u4E0B\u53D6\u503C\n float textureOffset = 0.0; // \u5728 cell \u4E2D\u53D6\u503C\u7684\u504F\u79FB\u91CF\n\n vec2 opacityAndOffset = calOpacityAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);\n styleMappingMat[0][0] = opacityAndOffset.r;\n textureOffset = opacityAndOffset.g;\n\n vec2 strokeOpacityAndOffset = calStrokeOpacityAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);\n styleMappingMat[0][1] = strokeOpacityAndOffset.r;\n textureOffset = strokeOpacityAndOffset.g;\n\n vec2 strokeWidthAndOffset = calStrokeWidthAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);\n styleMappingMat[0][2] = strokeWidthAndOffset.r;\n textureOffset = strokeWidthAndOffset.g;\n\n vec4 textrueStroke = vec4(-1.0, -1.0, -1.0, -1.0);\n if(hasStroke()) {\n vec2 valueRPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n styleMappingMat[1][0] = pos2value(valueRPos, columnWidth, rowHeight); // R\n textureOffset += 1.0;\n\n vec2 valueGPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n styleMappingMat[1][1] = pos2value(valueGPos, columnWidth, rowHeight); // G\n textureOffset += 1.0;\n\n vec2 valueBPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n styleMappingMat[1][2] = pos2value(valueBPos, columnWidth, rowHeight); // B\n textureOffset += 1.0;\n\n vec2 valueAPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n styleMappingMat[1][3] = pos2value(valueAPos, columnWidth, rowHeight); // A\n textureOffset += 1.0;\n } else {\n if(u_stroke_color == vec4(0.0)) {\n styleMappingMat[1][0] = v_color.r;\n styleMappingMat[1][1] = v_color.g;\n styleMappingMat[1][2] = v_color.b;\n styleMappingMat[1][3] = v_color.a;\n } else {\n styleMappingMat[1][0] = u_stroke_color.r;\n styleMappingMat[1][1] = u_stroke_color.g;\n styleMappingMat[1][2] = u_stroke_color.b;\n styleMappingMat[1][3] = u_stroke_color.a;\n }\n }\n\n vec2 textrueOffsets = vec2(0.0, 0.0);\n if(hasOffsets()) {\n vec2 valueXPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n textrueOffsets.r = pos2value(valueXPos, columnWidth, rowHeight); // x\n textureOffset += 1.0;\n\n vec2 valueYPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n textrueOffsets.g = pos2value(valueYPos, columnWidth, rowHeight); // x\n textureOffset += 1.0;\n } else {\n textrueOffsets = u_offsets;\n }\n\n // cal style mapping\n\n // unpack color(vec2)\n v_color = a_Color;\n\n // radius(16-bit)\n v_radius = newSize;\n\n // TODO: billboard\n // anti-alias\n // float antialiased_blur = -max(u_blur, antialiasblur);\n float antialiasblur = -max(2.0 / u_DevicePixelRatio / newSize, u_blur);\n\n vec2 offset = (extrude.xy * (newSize + u_stroke_width) + textrueOffsets);\n vec3 aPosition = a_Position;\n if(u_isMeter < 1.0) {\n // \u4E0D\u4EE5\u7C73\u4E3A\u5B9E\u9645\u5355\u4F4D\n offset = project_pixel(offset);\n } else {\n // \u4EE5\u7C73\u4E3A\u5B9E\u9645\u5355\u4F4D\n if(newSize * pow(2.0, u_Zoom) < 48.0) {\n antialiasblur = max(antialiasblur, -0.05);\n } else if(newSize * pow(2.0, u_Zoom) < 128.0) {\n antialiasblur = max(antialiasblur, -0.6/pow(u_Zoom, 2.0));\n } else {\n antialiasblur = max(antialiasblur, -0.8/pow(u_Zoom, 2.0));\n }\n \n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n aPosition.x += offset.x / u_meteryScale;\n aPosition.y += offset.y;\n offset = vec2(0.0);\n }\n }\n\n // TODP: /abs(extrude.x) \u662F\u4E3A\u4E86\u517C\u5BB9\u5730\u7403\u6A21\u5F0F\n v_data = vec4(extrude.x/abs(extrude.x), extrude.y/abs(extrude.y), antialiasblur,shape_type);\n\n\n // vec4 project_pos = project_position(vec4(a_Position.xy, 0.0, 1.0));\n vec4 project_pos = project_position(vec4(aPosition.xy, 0.0, 1.0));\n // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, project_pixel(setPickingOrder(0.0)), 1.0));\n\n float raisingHeight = u_raisingHeight;\n\n if(u_heightfixed < 1.0) { // false\n raisingHeight = project_pixel(u_raisingHeight);\n } else {\n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);\n raisingHeight = u_raisingHeight * mapboxZoomScale;\n }\n }\n \n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * vec4(project_pos.xy + offset, raisingHeight, 1.0);\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, raisingHeight, 1.0));\n }\n \n // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, 0.0, 1.0));\n\n setPickingColor(a_PickingColor);\n}\n";
30
+ var pointFillVert = "attribute vec4 a_Color;\nattribute vec3 a_Position;\nattribute vec3 a_Extrude;\nattribute float a_Size;\nattribute float a_Shape;\n\nvarying mat4 styleMappingMat; // \u7528\u4E8E\u5C06\u5728\u9876\u70B9\u7740\u8272\u5668\u4E2D\u8BA1\u7B97\u597D\u7684\u6837\u5F0F\u503C\u4F20\u9012\u7ED9\u7247\u5143\n\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nuniform float u_meter2coord;\nuniform float u_meteryScale;\nuniform float u_isMeter;\n\nvarying vec4 v_data;\nvarying vec4 v_color;\nvarying float v_radius;\n\nuniform float u_opacity : 1;\nuniform float u_stroke_opacity : 1;\nuniform float u_stroke_width : 2;\nuniform vec4 u_stroke_color : [0.0, 0.0, 0.0, 0.0];\nuniform vec2 u_offsets;\n\nuniform float u_blur : 0.0;\nuniform float u_raisingHeight: 0.0;\nuniform float u_heightfixed: 0.0;\n\n#pragma include \"styleMapping\"\n#pragma include \"styleMappingCalOpacity\"\n#pragma include \"styleMappingCalStrokeOpacity\"\n#pragma include \"styleMappingCalStrokeWidth\"\n\n#pragma include \"projection\"\n#pragma include \"picking\"\n\n\nvoid main() {\n vec3 extrude = a_Extrude;\n float shape_type = a_Shape;\n /*\n * setPickingSize \u8BBE\u7F6E\u62FE\u53D6\u5927\u5C0F\n * u_meter2coord \u5728\u7B49\u9762\u79EF\u5927\u5C0F\u7684\u65F6\u5019\u8BBE\u7F6E\u5355\u4F4D\n */\n float newSize = setPickingSize(a_Size) * u_meter2coord;\n // float newSize = setPickingSize(a_Size) * 0.00001038445708445579;\n\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\n );\n\n float rowCount = u_cellTypeLayout[0][0]; // \u5F53\u524D\u7684\u6570\u636E\u7EB9\u7406\u6709\u51E0\u884C\n float columnCount = u_cellTypeLayout[0][1]; // \u5F53\u770B\u5230\u6570\u636E\u7EB9\u7406\u6709\u51E0\u5217\n float columnWidth = 1.0/columnCount; // \u5217\u5BBD\n float rowHeight = 1.0/rowCount; // \u884C\u9AD8\n float cellCount = calCellCount(); // opacity - strokeOpacity - strokeWidth - stroke - offsets\n float id = a_vertexId; // \u7B2Cn\u4E2A\u9876\u70B9\n float cellCurrentRow = floor(id * cellCount / columnCount) + 1.0; // \u8D77\u59CB\u70B9\u5728\u7B2C\u51E0\u884C\n float cellCurrentColumn = mod(id * cellCount, columnCount) + 1.0; // \u8D77\u59CB\u70B9\u5728\u7B2C\u51E0\u5217\n \n // cell \u56FA\u5B9A\u987A\u5E8F opacity -> strokeOpacity -> strokeWidth -> stroke ... \n // \u6309\u987A\u5E8F\u4ECE cell \u4E2D\u53D6\u503C\u3001\u82E5\u6CA1\u6709\u5219\u81EA\u52A8\u5F80\u4E0B\u53D6\u503C\n float textureOffset = 0.0; // \u5728 cell \u4E2D\u53D6\u503C\u7684\u504F\u79FB\u91CF\n\n vec2 opacityAndOffset = calOpacityAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);\n styleMappingMat[0][0] = opacityAndOffset.r;\n textureOffset = opacityAndOffset.g;\n\n vec2 strokeOpacityAndOffset = calStrokeOpacityAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);\n styleMappingMat[0][1] = strokeOpacityAndOffset.r;\n textureOffset = strokeOpacityAndOffset.g;\n\n vec2 strokeWidthAndOffset = calStrokeWidthAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);\n styleMappingMat[0][2] = strokeWidthAndOffset.r;\n textureOffset = strokeWidthAndOffset.g;\n\n vec4 textrueStroke = vec4(-1.0, -1.0, -1.0, -1.0);\n if(hasStroke()) {\n vec2 valueRPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n styleMappingMat[1][0] = pos2value(valueRPos, columnWidth, rowHeight); // R\n textureOffset += 1.0;\n\n vec2 valueGPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n styleMappingMat[1][1] = pos2value(valueGPos, columnWidth, rowHeight); // G\n textureOffset += 1.0;\n\n vec2 valueBPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n styleMappingMat[1][2] = pos2value(valueBPos, columnWidth, rowHeight); // B\n textureOffset += 1.0;\n\n vec2 valueAPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n styleMappingMat[1][3] = pos2value(valueAPos, columnWidth, rowHeight); // A\n textureOffset += 1.0;\n } else {\n if(u_stroke_color == vec4(0.0)) {\n styleMappingMat[1][0] = v_color.r;\n styleMappingMat[1][1] = v_color.g;\n styleMappingMat[1][2] = v_color.b;\n styleMappingMat[1][3] = v_color.a;\n } else {\n styleMappingMat[1][0] = u_stroke_color.r;\n styleMappingMat[1][1] = u_stroke_color.g;\n styleMappingMat[1][2] = u_stroke_color.b;\n styleMappingMat[1][3] = u_stroke_color.a;\n }\n }\n\n vec2 textrueOffsets = vec2(0.0, 0.0);\n if(hasOffsets()) {\n vec2 valueXPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n textrueOffsets.r = pos2value(valueXPos, columnWidth, rowHeight); // x\n textureOffset += 1.0;\n\n vec2 valueYPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n textrueOffsets.g = pos2value(valueYPos, columnWidth, rowHeight); // x\n textureOffset += 1.0;\n } else {\n textrueOffsets = u_offsets;\n }\n\n // cal style mapping\n\n // unpack color(vec2)\n v_color = a_Color;\n\n // radius(16-bit)\n v_radius = newSize;\n\n // anti-alias\n // float antialiased_blur = -max(u_blur, antialiasblur);\n float antialiasblur = -max(2.0 / u_DevicePixelRatio / newSize, u_blur);\n\n vec2 offset = (extrude.xy * (newSize + u_stroke_width) + textrueOffsets);\n vec3 aPosition = a_Position;\n if(u_isMeter < 1.0) {\n // \u4E0D\u4EE5\u7C73\u4E3A\u5B9E\u9645\u5355\u4F4D\n offset = project_pixel(offset);\n } else {\n // \u4EE5\u7C73\u4E3A\u5B9E\u9645\u5355\u4F4D\n if(newSize * pow(2.0, u_Zoom) < 48.0) {\n antialiasblur = max(antialiasblur, -0.05);\n } else if(newSize * pow(2.0, u_Zoom) < 128.0) {\n antialiasblur = max(antialiasblur, -0.6/pow(u_Zoom, 2.0));\n } else {\n antialiasblur = max(antialiasblur, -0.8/pow(u_Zoom, 2.0));\n }\n \n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n aPosition.x += offset.x / u_meteryScale;\n aPosition.y += offset.y;\n offset = vec2(0.0);\n }\n }\n\n // TODP: /abs(extrude.x) \u662F\u4E3A\u4E86\u517C\u5BB9\u5730\u7403\u6A21\u5F0F\n v_data = vec4(extrude.x/abs(extrude.x), extrude.y/abs(extrude.y), antialiasblur,shape_type);\n\n\n // vec4 project_pos = project_position(vec4(a_Position.xy, 0.0, 1.0));\n vec4 project_pos = project_position(vec4(aPosition.xy, 0.0, 1.0));\n // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, project_pixel(setPickingOrder(0.0)), 1.0));\n\n float raisingHeight = u_raisingHeight;\n\n if(u_heightfixed < 1.0) { // false\n raisingHeight = project_pixel(u_raisingHeight);\n } else {\n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);\n raisingHeight = u_raisingHeight * mapboxZoomScale;\n }\n }\n \n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * vec4(project_pos.xy + offset, raisingHeight, 1.0);\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, raisingHeight, 1.0));\n }\n \n // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, 0.0, 1.0));\n\n setPickingColor(a_PickingColor);\n}\n";
31
31
  import { Version } from '@antv/l7-maps';
32
32
 
33
33
  var FillModel = /*#__PURE__*/function (_BaseModel) {
@@ -59,7 +59,7 @@ var FillImageModel = /*#__PURE__*/function (_BaseModel) {
59
59
  // TODO: 更新完纹理后在更新的图层的时候需要更新所有的图层
60
60
 
61
61
 
62
- _this.layer.renderLayers();
62
+ _this.layerService.throttleRenderLayers();
63
63
 
64
64
  return;
65
65
  }
@@ -50,7 +50,7 @@ var ImageModel = /*#__PURE__*/function (_BaseModel) {
50
50
  }); // TODO: 更新完纹理后在更新的图层的时候需要更新所有的图层
51
51
 
52
52
 
53
- _this.layer.renderLayers();
53
+ _this.layerService.throttleRenderLayers();
54
54
 
55
55
  return;
56
56
  }
@@ -13,5 +13,4 @@ export default class NormalModel extends BaseModel {
13
13
  buildModels(callbackModel: (models: IModel[]) => void): void;
14
14
  clearModels(): void;
15
15
  protected registerBuiltinAttributes(): void;
16
- private defaultStyleOptions;
17
16
  }
@@ -9,16 +9,16 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
9
9
 
10
10
  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; } }
11
11
 
12
- import { AttributeType, BlendType, gl } from '@antv/l7-core';
12
+ import { AttributeType, gl } from '@antv/l7-core';
13
13
  import { getMask } from '@antv/l7-utils';
14
14
  import { isNumber } from 'lodash';
15
15
  import BaseModel from "../../core/BaseModel";
16
16
 
17
17
  /* babel-plugin-inline-import '../shaders/normal_frag.glsl' */
18
- var normalFrag = "\nuniform float u_opacity : 1;\nuniform vec2 u_offsets;\nvarying vec4 v_color;\nvarying mat4 styleMappingMat; // \u4F20\u9012\u4ECE\u7247\u5143\u4E2D\u4F20\u9012\u7684\u6620\u5C04\u6570\u636E\n\n#pragma include \"picking\"\nvoid main() {\n float opacity = styleMappingMat[0][0];\n\n gl_FragColor = v_color;\n // gl_FragColor.a =gl_FragColor.a * u_opacity;\n gl_FragColor.a =gl_FragColor.a * opacity;\n gl_FragColor = filterColor(gl_FragColor);\n}\n";
18
+ var normalFrag = "uniform float u_opacity : 1;\nvarying vec4 v_color;\nvoid main() {\n gl_FragColor = v_color;\n gl_FragColor.a *= u_opacity;\n}\n";
19
19
 
20
20
  /* babel-plugin-inline-import '../shaders/normal_vert.glsl' */
21
- var normalVert = "\nattribute vec3 a_Position;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nattribute float a_Size;\nattribute vec4 a_Color;\nvarying vec4 v_color;\n\nuniform float u_opacity : 1;\nuniform vec2 u_offsets;\n\nvarying mat4 styleMappingMat; // \u7528\u4E8E\u5C06\u5728\u9876\u70B9\u7740\u8272\u5668\u4E2D\u8BA1\u7B97\u597D\u7684\u6837\u5F0F\u503C\u4F20\u9012\u7ED9\u7247\u5143\n\n#pragma include \"styleMapping\"\n#pragma include \"styleMappingCalOpacity\"\n\n#pragma include \"projection\"\n#pragma include \"picking\"\n#pragma include \"project\"\nvoid main() {\n v_color = a_Color;\n\n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\nstyleMappingMat = mat4(\n 0.0, 0.0, 0.0, 0.0, // opacity - strokeOpacity - strokeWidth - empty\n 0.0, 0.0, 0.0, 0.0, // strokeR - strokeG - strokeB - strokeA\n 0.0, 0.0, 0.0, 0.0, // offsets[0] - offsets[1]\n 0.0, 0.0, 0.0, 0.0\n );\n\n float rowCount = u_cellTypeLayout[0][0]; // \u5F53\u524D\u7684\u6570\u636E\u7EB9\u7406\u6709\u51E0\u884C\n float columnCount = u_cellTypeLayout[0][1]; // \u5F53\u770B\u5230\u6570\u636E\u7EB9\u7406\u6709\u51E0\u5217\n float columnWidth = 1.0/columnCount; // \u5217\u5BBD\n float rowHeight = 1.0/rowCount; // \u884C\u9AD8\n float cellCount = calCellCount(); // opacity - strokeOpacity - strokeWidth - stroke - offsets\n float id = a_vertexId; // \u7B2Cn\u4E2A\u9876\u70B9\n float cellCurrentRow = floor(id * cellCount / columnCount) + 1.0; // \u8D77\u59CB\u70B9\u5728\u7B2C\u51E0\u884C\n float cellCurrentColumn = mod(id * cellCount, columnCount) + 1.0; // \u8D77\u59CB\u70B9\u5728\u7B2C\u51E0\u5217\n \n // cell \u56FA\u5B9A\u987A\u5E8F opacity -> strokeOpacity -> strokeWidth -> stroke ... \n // \u6309\u987A\u5E8F\u4ECE cell \u4E2D\u53D6\u503C\u3001\u82E5\u6CA1\u6709\u5219\u81EA\u52A8\u5F80\u4E0B\u53D6\u503C\n float textureOffset = 0.0; // \u5728 cell \u4E2D\u53D6\u503C\u7684\u504F\u79FB\u91CF\n\n vec2 opacityAndOffset = calOpacityAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);\n styleMappingMat[0][0] = opacityAndOffset.r;\n textureOffset = opacityAndOffset.g;\n\n vec2 textrueOffsets = vec2(0.0, 0.0);\n if(hasOffsets()) {\n vec2 valueXPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n textrueOffsets.r = pos2value(valueXPos, columnWidth, rowHeight); // x\n textureOffset += 1.0;\n\n vec2 valueYPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n textrueOffsets.g = pos2value(valueYPos, columnWidth, rowHeight); // x\n textureOffset += 1.0;\n } else {\n textrueOffsets = u_offsets;\n }\n\n // cal style mapping\n \n // vec2 offset = project_pixel(u_offsets);\n vec2 offset = project_pixel(textrueOffsets);\n // vec4 project_pos = project_position(vec4(a_Position, 1.0)) + vec4(a_Size / 2.,-a_Size /2.,0.,0.);\n // gl_Position = project_common_position_to_clipspace(vec4(vec2(project_pos.xy+offset),project_pos.z,project_pos.w));\\\n // \n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n // vec2 offset = project_pixel((u_offsets));\n gl_Position = u_Mvp * vec4(a_Position.xy + offset, a_Position.z, 1.0);\n } else { // else\n // vec2 offset = project_pixel(u_offsets);\n vec4 project_pos = project_position(vec4(a_Position, 1.0)) + vec4(a_Size / 2.,-a_Size /2.,0.,0.);\n gl_Position = project_common_position_to_clipspace(vec4(vec2(project_pos.xy+offset),project_pos.z,project_pos.w));\n }\n\n gl_PointSize = a_Size * 2.0 * u_DevicePixelRatio;\n setPickingColor(a_PickingColor);\n}\n";
21
+ var normalVert = "\nattribute vec3 a_Position;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nattribute float a_Size;\nattribute vec4 a_Color;\n\nvarying vec4 v_color;\n\n#pragma include \"projection\"\n#pragma include \"project\"\n\nvoid main() {\n v_color = a_Color;\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * vec4(a_Position.xy, a_Position.z, 1.0);\n } else {\n vec4 project_pos = project_position(vec4(a_Position, 1.0)) + vec4(a_Size / 2.,-a_Size /2.,0.,0.);\n gl_Position = project_common_position_to_clipspace(vec4(vec2(project_pos.xy),project_pos.z,project_pos.w));\n }\n\n gl_PointSize = a_Size * 2.0 * u_DevicePixelRatio;\n}\n";
22
22
  export function PointTriangulation(feature) {
23
23
  var coordinates = feature.coordinates;
24
24
  return {
@@ -51,51 +51,10 @@ var NormalModel = /*#__PURE__*/function (_BaseModel) {
51
51
  value: function getUninforms() {
52
52
  var _ref = this.layer.getLayerConfig(),
53
53
  _ref$opacity = _ref.opacity,
54
- opacity = _ref$opacity === void 0 ? 1 : _ref$opacity,
55
- _ref$offsets = _ref.offsets,
56
- offsets = _ref$offsets === void 0 ? [0, 0] : _ref$offsets;
57
-
58
- if (this.dataTextureTest && this.dataTextureNeedUpdate({
59
- opacity: opacity,
60
- offsets: offsets
61
- })) {
62
- // 判断当前的样式中哪些是需要进行数据映射的,哪些是常量,同时计算用于构建数据纹理的一些中间变量
63
- this.judgeStyleAttributes({
64
- opacity: opacity,
65
- offsets: offsets
66
- });
67
- var encodeData = this.layer.getEncodedData();
68
-
69
- var _this$calDataFrame = this.calDataFrame(this.cellLength, encodeData, this.cellProperties),
70
- data = _this$calDataFrame.data,
71
- width = _this$calDataFrame.width,
72
- height = _this$calDataFrame.height;
73
-
74
- this.rowCount = height; // 当前数据纹理有多少行
75
-
76
- this.dataTexture = this.cellLength > 0 && data.length > 0 ? this.createTexture2D({
77
- flipY: true,
78
- data: data,
79
- format: gl.LUMINANCE,
80
- type: gl.FLOAT,
81
- width: width,
82
- height: height
83
- }) : this.createTexture2D({
84
- flipY: true,
85
- data: [1],
86
- format: gl.LUMINANCE,
87
- type: gl.FLOAT,
88
- width: 1,
89
- height: 1
90
- });
91
- }
54
+ opacity = _ref$opacity === void 0 ? 1 : _ref$opacity;
92
55
 
93
56
  return {
94
- u_dataTexture: this.dataTexture,
95
- // 数据纹理 - 有数据映射的时候纹理中带数据,若没有任何数据映射时纹理是 [1]
96
- u_cellTypeLayout: this.getCellTypeLayout(),
97
- u_opacity: isNumber(opacity) ? opacity : 1.0,
98
- u_offsets: this.isOffsetStatic(offsets) ? offsets : [0, 0]
57
+ u_opacity: isNumber(opacity) ? opacity : 1.0
99
58
  };
100
59
  }
101
60
  }, {
@@ -123,7 +82,8 @@ var NormalModel = /*#__PURE__*/function (_BaseModel) {
123
82
  },
124
83
  primitive: gl.POINTS,
125
84
  blend: this.getBlend(),
126
- stencil: getMask(mask, maskInside)
85
+ stencil: getMask(mask, maskInside),
86
+ pick: false
127
87
  }).then(function (model) {
128
88
  callbackModel([model]);
129
89
  }).catch(function (err) {
@@ -133,11 +93,7 @@ var NormalModel = /*#__PURE__*/function (_BaseModel) {
133
93
  }
134
94
  }, {
135
95
  key: "clearModels",
136
- value: function clearModels() {
137
- var _this$dataTexture;
138
-
139
- (_this$dataTexture = this.dataTexture) === null || _this$dataTexture === void 0 ? void 0 : _this$dataTexture.destroy();
140
- }
96
+ value: function clearModels() {}
141
97
  }, {
142
98
  key: "registerBuiltinAttributes",
143
99
  value: function registerBuiltinAttributes() {
@@ -154,7 +110,7 @@ var NormalModel = /*#__PURE__*/function (_BaseModel) {
154
110
  type: gl.FLOAT
155
111
  },
156
112
  size: 1,
157
- update: function update(feature, featureIdx, vertex, attributeIdx) {
113
+ update: function update(feature) {
158
114
  var _feature$size = feature.size,
159
115
  size = _feature$size === void 0 ? 1 : _feature$size;
160
116
  return Array.isArray(size) ? [size[0]] : [size];
@@ -162,13 +118,6 @@ var NormalModel = /*#__PURE__*/function (_BaseModel) {
162
118
  }
163
119
  });
164
120
  }
165
- }, {
166
- key: "defaultStyleOptions",
167
- value: function defaultStyleOptions() {
168
- return {
169
- blend: BlendType.additive
170
- };
171
- }
172
121
  }]);
173
122
 
174
123
  return NormalModel;