@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
@@ -18,10 +18,10 @@ import BaseModel from "../../core/BaseModel";
18
18
  import { PointFillTriangulation } from "../../core/triangulation";
19
19
 
20
20
  /* babel-plugin-inline-import '../shaders/radar/radar_frag.glsl' */
21
- var pointFillFrag = "\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;\n\n#pragma include \"sdf_2d\"\n#pragma include \"picking\"\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\n lowp float antialiasblur = v_data.z;\n float r = v_radius / (v_radius);\n\n float outer_df = sdCircle(v_data.xy, 1.0);\n float inner_df = sdCircle(v_data.xy, r);\n\n float opacity_t = smoothstep(0.0, antialiasblur, outer_df);\n\n gl_FragColor = vec4(v_color.rgb, v_color.a * opacity);\n\n if(u_additive > 0.0) {\n gl_FragColor *= opacity_t;\n } else {\n gl_FragColor.a *= opacity_t;\n }\n\n if(gl_FragColor.a > 0.0) {\n gl_FragColor = filterColor(gl_FragColor);\n }\n\n vec2 extrude = styleMappingMat[2].ba;\n vec2 dir = normalize(extrude);\n vec2 baseDir = vec2(1.0, 0.0);\n float pi = 3.14159265359;\n // full circle\n // float rades = dot(dir, baseDir);\n // float flag = sign(dir.y);\n // float radar_v = (flag - 1.0) * -0.5 + flag * acos(rades)/pi/2.0;\n \n // half circle\n float flag = sign(dir.y);\n float rades = dot(dir, baseDir);\n float radar_v = (flag - 1.0) * -0.5 * acos(rades)/pi;\n // simple AA\n if(radar_v > 0.99) {\n radar_v = 1.0 - (radar_v - 0.99)/0.01;\n }\n\n gl_FragColor.a *= radar_v;\n}\n";
21
+ var pointFillFrag = "\nuniform float u_additive;\nuniform float u_opacity: 1.0;\n\nvarying vec4 v_data;\nvarying vec4 v_color;\nvarying float v_radius;\nvarying vec2 v_exteude;\n#pragma include \"sdf_2d\"\n#pragma include \"picking\"\n\nvoid main() {\n\n lowp float antialiasblur = v_data.z;\n float r = v_radius / (v_radius);\n\n float outer_df = sdCircle(v_data.xy, 1.0);\n float inner_df = sdCircle(v_data.xy, r);\n\n float opacity_t = smoothstep(0.0, antialiasblur, outer_df);\n\n gl_FragColor = vec4(v_color.rgb, v_color.a * u_opacity);\n\n if(u_additive > 0.0) {\n gl_FragColor *= opacity_t;\n } else {\n gl_FragColor.a *= opacity_t;\n }\n\n if(gl_FragColor.a > 0.0) {\n gl_FragColor = filterColor(gl_FragColor);\n }\n\n vec2 extrude = v_exteude;\n vec2 dir = normalize(extrude);\n vec2 baseDir = vec2(1.0, 0.0);\n float pi = 3.14159265359;\n // full circle\n // float rades = dot(dir, baseDir);\n // float flag = sign(dir.y);\n // float radar_v = (flag - 1.0) * -0.5 + flag * acos(rades)/pi/2.0;\n \n // half circle\n float flag = sign(dir.y);\n float rades = dot(dir, baseDir);\n float radar_v = (flag - 1.0) * -0.5 * acos(rades)/pi;\n // simple AA\n if(radar_v > 0.99) {\n radar_v = 1.0 - (radar_v - 0.99)/0.01;\n }\n\n gl_FragColor.a *= radar_v;\n}\n";
22
22
 
23
23
  /* babel-plugin-inline-import '../shaders/radar/radar_vert.glsl' */
24
- var pointFillVert = "attribute vec4 a_Color;\nattribute vec3 a_Position;\nattribute vec3 a_Extrude;\nattribute float a_Size;\nattribute float a_Shape;\nuniform float u_speed: 1.0;\nuniform float u_time;\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_isMeter;\n\nvarying vec4 v_data;\nvarying vec4 v_color;\nvarying float v_radius;\n\nuniform float u_opacity : 1;\nuniform vec2 u_offsets;\n\n#pragma include \"styleMapping\"\n#pragma include \"styleMappingCalOpacity\"\n\n#pragma include \"projection\"\n#pragma include \"picking\"\n\nvoid main() {\n vec3 extrude = a_Extrude;\n float shape_type = a_Shape;\n float newSize = setPickingSize(a_Size);\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 - empty - empty - empty\n 0.0, 0.0, 0.0, 0.0, // empty - empty - empty - empty\n 0.0, 0.0, 0.0, 0.0, // offsets[0] - offsets[1] - a_Extrude.x - a_Extrude.y\n 0.0, 0.0, 0.0, 0.0 // \n );\n\n float time = u_time * u_speed;\n mat2 rotateMatrix = mat2( \n cos(time), sin(time), \n -sin(time), cos(time)\n );\n styleMappingMat[2].ba = rotateMatrix * a_Extrude.xy;\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 -> empty -> empty ... \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\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 blur = 0.0;\n float antialiasblur = -max(2.0 / u_DevicePixelRatio / a_Size, blur);\n\n vec2 offset = (extrude.xy * (newSize) + 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 antialiasblur *= pow(19.0 - u_Zoom, 2.0);\n antialiasblur = max(antialiasblur, -0.01);\n // offset *= 0.5;\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n aPosition.xy += offset;\n offset.x = 0.0;\n offset.y = 0.0;\n }\n }\n\n v_data = vec4(extrude.x, extrude.y, antialiasblur,shape_type);\n\n vec4 project_pos = project_position(vec4(aPosition.xy, 0.0, 1.0));\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * vec4(project_pos.xy + offset, 0.0, 1.0);\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, project_pixel(setPickingOrder(0.0)), 1.0));\n }\n\n setPickingColor(a_PickingColor);\n}\n";
24
+ var pointFillVert = "attribute vec4 a_Color;\nattribute vec3 a_Position;\nattribute vec3 a_Extrude;\nattribute float a_Size;\nuniform float u_speed: 1.0;\nuniform float u_time;\n\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nuniform float u_isMeter;\n\nvarying vec4 v_data;\nvarying vec4 v_color;\nvarying float v_radius;\nvarying vec2 v_exteude;\n\n#pragma include \"projection\"\n#pragma include \"picking\"\n\nvoid main() {\n vec3 extrude = a_Extrude;\n float newSize = setPickingSize(a_Size);\n\n float time = u_time * u_speed;\n mat2 rotateMatrix = mat2( \n cos(time), sin(time), \n -sin(time), cos(time)\n );\n v_exteude = rotateMatrix * a_Extrude.xy;\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 blur = 0.0;\n float antialiasblur = -max(2.0 / u_DevicePixelRatio / a_Size, blur);\n\n vec2 offset = (extrude.xy * (newSize));\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 antialiasblur *= pow(19.0 - u_Zoom, 2.0);\n antialiasblur = max(antialiasblur, -0.01);\n // offset *= 0.5;\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n aPosition.xy += offset;\n offset.x = 0.0;\n offset.y = 0.0;\n }\n }\n\n v_data = vec4(extrude.x, extrude.y, antialiasblur, -1.0);\n\n vec4 project_pos = project_position(vec4(aPosition.xy, 0.0, 1.0));\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * vec4(project_pos.xy + offset, 0.0, 1.0);\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, project_pixel(setPickingOrder(0.0)), 1.0));\n }\n\n setPickingColor(a_PickingColor);\n}\n";
25
25
  import { Version } from '@antv/l7-maps';
26
26
 
27
27
  var RadarModel = /*#__PURE__*/function (_BaseModel) {
@@ -53,56 +53,15 @@ var RadarModel = /*#__PURE__*/function (_BaseModel) {
53
53
  var _ref = this.layer.getLayerConfig(),
54
54
  _ref$opacity = _ref.opacity,
55
55
  opacity = _ref$opacity === void 0 ? 1 : _ref$opacity,
56
- _ref$offsets = _ref.offsets,
57
- offsets = _ref$offsets === void 0 ? [0, 0] : _ref$offsets,
58
56
  blend = _ref.blend,
59
57
  _ref$speed = _ref.speed,
60
58
  speed = _ref$speed === void 0 ? 1 : _ref$speed;
61
59
 
62
- if (this.dataTextureTest && this.dataTextureNeedUpdate({
63
- opacity: opacity,
64
- offsets: offsets
65
- })) {
66
- // 判断当前的样式中哪些是需要进行数据映射的,哪些是常量,同时计算用于构建数据纹理的一些中间变量
67
- this.judgeStyleAttributes({
68
- opacity: opacity,
69
- offsets: offsets
70
- });
71
- var encodeData = this.layer.getEncodedData();
72
-
73
- var _this$calDataFrame = this.calDataFrame(this.cellLength, encodeData, this.cellProperties),
74
- data = _this$calDataFrame.data,
75
- width = _this$calDataFrame.width,
76
- height = _this$calDataFrame.height;
77
-
78
- this.rowCount = height; // 当前数据纹理有多少行
79
-
80
- this.dataTexture = this.cellLength > 0 && data.length > 0 ? this.createTexture2D({
81
- flipY: true,
82
- data: data,
83
- format: gl.LUMINANCE,
84
- type: gl.FLOAT,
85
- width: width,
86
- height: height
87
- }) : this.createTexture2D({
88
- flipY: true,
89
- data: [1],
90
- format: gl.LUMINANCE,
91
- type: gl.FLOAT,
92
- width: 1,
93
- height: 1
94
- });
95
- }
96
-
97
60
  return {
98
61
  u_isMeter: Number(this.isMeter),
99
62
  u_speed: speed,
100
63
  u_additive: blend === 'additive' ? 1.0 : 0.0,
101
- u_dataTexture: this.dataTexture,
102
- // 数据纹理 - 有数据映射的时候纹理中带数据,若没有任何数据映射时纹理是 [1]
103
- u_cellTypeLayout: this.getCellTypeLayout(),
104
- u_opacity: isNumber(opacity) ? opacity : 1.0,
105
- u_offsets: this.isOffsetStatic(offsets) ? offsets : [0, 0]
64
+ u_opacity: isNumber(opacity) ? opacity : 1.0
106
65
  };
107
66
  }
108
67
  }, {
@@ -257,36 +216,12 @@ var RadarModel = /*#__PURE__*/function (_BaseModel) {
257
216
  type: gl.FLOAT
258
217
  },
259
218
  size: 1,
260
- update: function update(feature, featureIdx, vertex, attributeIdx) {
219
+ update: function update(feature) {
261
220
  var _feature$size = feature.size,
262
221
  size = _feature$size === void 0 ? 5 : _feature$size;
263
222
  return Array.isArray(size) ? [size[0] * _this2.meter2coord] : [size * _this2.meter2coord];
264
223
  }
265
224
  }
266
- }); // point layer size;
267
-
268
- this.styleAttributeService.registerStyleAttribute({
269
- name: 'shape',
270
- type: AttributeType.Attribute,
271
- descriptor: {
272
- name: 'a_Shape',
273
- buffer: {
274
- // give the WebGL driver a hint that this buffer may change
275
- usage: gl.DYNAMIC_DRAW,
276
- data: [],
277
- type: gl.FLOAT
278
- },
279
- size: 1,
280
- update: function update(feature, featureIdx, vertex, attributeIdx) {
281
- var _feature$shape = feature.shape,
282
- shape = _feature$shape === void 0 ? 2 : _feature$shape;
283
-
284
- var shape2d = _this2.layer.getLayerConfig().shape2d;
285
-
286
- var shapeIndex = shape2d.indexOf(shape);
287
- return [shapeIndex];
288
- }
289
- }
290
225
  });
291
226
  }
292
227
  }]);
@@ -13,5 +13,4 @@ export default class SimplePointModel 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,7 +9,7 @@ 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";
@@ -152,20 +152,18 @@ var SimplePointModel = /*#__PURE__*/function (_BaseModel) {
152
152
  }, {
153
153
  key: "registerBuiltinAttributes",
154
154
  value: function registerBuiltinAttributes() {
155
- // point layer size;
156
155
  this.styleAttributeService.registerStyleAttribute({
157
156
  name: 'size',
158
157
  type: AttributeType.Attribute,
159
158
  descriptor: {
160
159
  name: 'a_Size',
161
160
  buffer: {
162
- // give the WebGL driver a hint that this buffer may change
163
161
  usage: gl.DYNAMIC_DRAW,
164
162
  data: [],
165
163
  type: gl.FLOAT
166
164
  },
167
165
  size: 1,
168
- update: function update(feature, featureIdx, vertex, attributeIdx) {
166
+ update: function update(feature) {
169
167
  var _feature$size = feature.size,
170
168
  size = _feature$size === void 0 ? 1 : _feature$size;
171
169
  return Array.isArray(size) ? [size[0]] : [size];
@@ -173,13 +171,6 @@ var SimplePointModel = /*#__PURE__*/function (_BaseModel) {
173
171
  }
174
172
  });
175
173
  }
176
- }, {
177
- key: "defaultStyleOptions",
178
- value: function defaultStyleOptions() {
179
- return {
180
- blend: BlendType.additive
181
- };
182
- }
183
174
  }]);
184
175
 
185
176
  return SimplePointModel;
@@ -289,7 +289,7 @@ var TextModel = /*#__PURE__*/function (_BaseModel) {
289
289
  type: gl.FLOAT
290
290
  },
291
291
  size: 1,
292
- update: function update(feature, featureIdx, vertex, attributeIdx) {
292
+ update: function update(feature) {
293
293
  var _feature$rotate = feature.rotate,
294
294
  rotate = _feature$rotate === void 0 ? 0 : _feature$rotate;
295
295
  return Array.isArray(rotate) ? [rotate[0]] : [rotate];
@@ -308,7 +308,7 @@ var TextModel = /*#__PURE__*/function (_BaseModel) {
308
308
  type: gl.FLOAT
309
309
  },
310
310
  size: 2,
311
- update: function update(feature, featureIdx, vertex, attributeIdx) {
311
+ update: function update(feature, featureIdx, vertex) {
312
312
  return [vertex[5], vertex[6]];
313
313
  }
314
314
  }
@@ -326,7 +326,7 @@ var TextModel = /*#__PURE__*/function (_BaseModel) {
326
326
  type: gl.FLOAT
327
327
  },
328
328
  size: 1,
329
- update: function update(feature, featureIdx, vertex, attributeIdx) {
329
+ update: function update(feature) {
330
330
  var _feature$size = feature.size,
331
331
  size = _feature$size === void 0 ? 12 : _feature$size;
332
332
  return Array.isArray(size) ? [size[0]] : [size];
@@ -346,7 +346,7 @@ var TextModel = /*#__PURE__*/function (_BaseModel) {
346
346
  type: gl.FLOAT
347
347
  },
348
348
  size: 2,
349
- update: function update(feature, featureIdx, vertex, attributeIdx) {
349
+ update: function update(feature, featureIdx, vertex) {
350
350
  return [vertex[3], vertex[4]];
351
351
  }
352
352
  }
@@ -443,7 +443,7 @@ var TextModel = /*#__PURE__*/function (_BaseModel) {
443
443
  value: function generateGlyphLayout(iconfont) {
444
444
  var _this2 = this;
445
445
 
446
- // TODO:更新文字布局
446
+ // 更新文字布局
447
447
  var mapping = this.fontService.mapping;
448
448
 
449
449
  var _ref8 = this.layer.getLayerConfig(),
@@ -531,7 +531,6 @@ var TextModel = /*#__PURE__*/function (_BaseModel) {
531
531
  box = _collisionIndex$place.box;
532
532
 
533
533
  if (box && box.length) {
534
- // TODO:featureIndex
535
534
  collisionIndex.insertCollisionBox(box, id);
536
535
  return true;
537
536
  } else {
@@ -608,7 +607,7 @@ var TextModel = /*#__PURE__*/function (_BaseModel) {
608
607
  }).then(function (model) {
609
608
  _this4.layer.models = [model];
610
609
 
611
- _this4.layer.renderLayers();
610
+ _this4.layerService.throttleRenderLayers();
612
611
  }).catch(function (err) {
613
612
  console.warn(err);
614
613
  _this4.layer.models = [];
@@ -1,8 +1,6 @@
1
1
  import { IAttribute, IElements, IModel, IModelUniform } from '@antv/l7-core';
2
2
  import BaseModel from '../../core/BaseModel';
3
3
  export default class FillModel extends BaseModel {
4
- meter2coord: number;
5
- private isMeter;
6
4
  getUninforms(): IModelUniform;
7
5
  getAttribute(): {
8
6
  attributes: {
@@ -11,11 +9,6 @@ export default class FillModel extends BaseModel {
11
9
  elements: IElements;
12
10
  };
13
11
  initModels(callbackModel: (models: IModel[]) => void): void;
14
- /**
15
- * 计算等面积点图层(unit meter)笛卡尔坐标标度与世界坐标标度的比例
16
- * @returns
17
- */
18
- calMeter2Coord(): void;
19
12
  buildModels(callbackModel: (models: IModel[]) => void): void;
20
13
  clearModels(): void;
21
14
  protected registerBuiltinAttributes(): void;
@@ -1,27 +1,23 @@
1
- import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
1
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
2
  import _createClass from "@babel/runtime/helpers/createClass";
4
- import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
5
3
  import _inherits from "@babel/runtime/helpers/inherits";
6
4
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
7
5
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
8
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
9
6
 
10
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); }; }
11
8
 
12
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; } }
13
10
 
14
11
  import { AttributeType, gl } from '@antv/l7-core';
15
- import { getCullFace, getMask } from '@antv/l7-utils';
12
+ import { getCullFace } from '@antv/l7-utils';
16
13
  import BaseModel from "../../core/BaseModel";
17
14
  import { PointFillTriangulation } from "../../core/triangulation";
18
15
 
19
16
  /* babel-plugin-inline-import '../shaders/tile/fill_tile_frag.glsl' */
20
- var point_tile_frag = "uniform float u_additive;\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\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\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";
17
+ var point_tile_frag = "uniform float u_additive;\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];\n\nvarying vec4 v_data;\nvarying vec4 v_color;\nvarying float v_radius;\n\n#pragma include \"sdf_2d\"\n#pragma include \"picking\"\n\nvoid main() {\n int shape = int(floor(v_data.w + 0.5));\n\n\n lowp float antialiasblur = v_data.z;\n float r = v_radius / (v_radius + u_stroke_width);\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\n float opacity_t = smoothstep(0.0, antialiasblur, outer_df);\n\n float color_t = u_stroke_width < 0.01 ? 0.0 : smoothstep(\n antialiasblur,\n 0.0,\n inner_df\n );\n\n if(u_stroke_width < 0.01) {\n gl_FragColor = vec4(v_color.rgb, v_color.a * u_opacity);\n } else {\n gl_FragColor = mix(vec4(v_color.rgb, v_color.a * u_opacity), u_stroke_color * u_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";
21
18
 
22
19
  /* babel-plugin-inline-import '../shaders/tile/fill_tile_vert.glsl' */
23
- var point_tile_vert = "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_isMeter;\n\nuniform vec2 u_tileOrigin;\nuniform float u_coord;\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;\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\nvoid main() {\n vec3 extrude = a_Extrude;\n float shape_type = a_Shape;\n float newSize = setPickingSize(a_Size);\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 v_color = a_Color;\n v_radius = newSize;\n\n // anti-alias\n // float antialiased_blur = -max(u_blur, antialiasblur);\n float antialiasblur = -max(2.0 / u_DevicePixelRatio / a_Size, 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 antialiasblur *= pow(19.0 - u_Zoom, 2.0);\n antialiasblur = max(antialiasblur, -0.01);\n // offset *= 0.5;\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n aPosition.xy += offset;\n offset.x = 0.0;\n offset.y = 0.0;\n }\n }\n\n v_data = vec4(extrude.x, extrude.y, antialiasblur,shape_type);\n\n vec4 project_pos = project_position(vec4(aPosition.xy, 0.0, 1.0));\n\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 }\n\nif(u_coord > 0.0) {\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * vec4(project_pos.xy + offset, 0.0, 1.0);\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, 0.0, 1.0));\n }\n} else {\n gl_PointSize = 24.0;\n vec2 pointPos = a_Position.xy;\n vec4 world = vec4(project_mvt_offset_position(vec4(u_tileOrigin, 0.0, 1.0)).xyz, 1.0); // \u74E6\u7247\u8D77\u59CB\u70B9\u7684\u4E16\u754C\u5750\u6807\n\n vec2 pointOffset = pointPos * pow(2.0, u_Zoom); // \u74E6\u7247\u5185\u7684\u70B9\u7684\u504F\u79FB\u5750\u6807\n \n world.xy += offset;\n world.xy += pointOffset;\n\n if (u_CoordinateSystem == COORDINATE_SYSTEM_METER_OFFSET || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n // Needs to be divided with project_uCommonUnitsPerMeter\n world.w *= u_PixelsPerMeter.z;\n }\n\n gl_Position = u_ViewProjectionMatrix * world + u_ViewportCenterProjection;\n}\n\n \n setPickingColor(a_PickingColor);\n\n\n}\n";
24
- import { Version } from '@antv/l7-maps';
20
+ var point_tile_vert = "attribute vec4 a_Color;\nattribute vec3 a_Position;\nattribute vec3 a_Extrude;\nattribute float a_Size;\nattribute float a_Shape;\n\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\n\n// uniform vec2 u_tileOrigin;\n// uniform float u_coord;\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];\n\n#pragma include \"projection\"\n#pragma include \"picking\"\n\nvoid main() {\n vec3 extrude = a_Extrude;\n float shape_type = a_Shape;\n float newSize = setPickingSize(a_Size);\n\n // cal style mapping\n\n v_color = a_Color;\n v_radius = newSize;\n\n // anti-alias\n // float antialiased_blur = -max(u_blur, antialiasblur);\n float antialiasblur = -max(2.0 / u_DevicePixelRatio / a_Size, 0.0);\n\n vec2 offset = (extrude.xy * (newSize + u_stroke_width));\n offset = project_pixel(offset);\n\n v_data = vec4(extrude.x, extrude.y, antialiasblur,shape_type);\n\n vec4 project_pos = project_position(vec4(a_Position.xy, 0.0, 1.0));\n\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 }\n\n// if(u_coord > 0.0) {\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * vec4(project_pos.xy + offset, 0.0, 1.0);\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, 0.0, 1.0));\n }\n// } else {\n\n // vec2 pointPos = a_Position.xy;\n // vec4 world = vec4(project_mvt_offset_position(vec4(u_tileOrigin, 0.0, 1.0)).xyz, 1.0); // \u74E6\u7247\u8D77\u59CB\u70B9\u7684\u4E16\u754C\u5750\u6807\n\n // vec2 pointOffset = pointPos * pow(2.0, u_Zoom); // \u74E6\u7247\u5185\u7684\u70B9\u7684\u504F\u79FB\u5750\u6807\n \n // world.xy += offset;\n // world.xy += pointOffset;\n\n // if (u_CoordinateSystem == COORDINATE_SYSTEM_METER_OFFSET || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n // // Needs to be divided with project_uCommonUnitsPerMeter\n // world.w *= u_PixelsPerMeter.z;\n // }\n\n // gl_Position = u_ViewProjectionMatrix * world + u_ViewportCenterProjection;\n// }\n\n \n setPickingColor(a_PickingColor);\n\n\n}\n";
25
21
 
26
22
  var FillModel = /*#__PURE__*/function (_BaseModel) {
27
23
  _inherits(FillModel, _BaseModel);
@@ -29,21 +25,9 @@ var FillModel = /*#__PURE__*/function (_BaseModel) {
29
25
  var _super = _createSuper(FillModel);
30
26
 
31
27
  function FillModel() {
32
- var _this;
33
-
34
28
  _classCallCheck(this, FillModel);
35
29
 
36
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
37
- args[_key] = arguments[_key];
38
- }
39
-
40
- _this = _super.call.apply(_super, [this].concat(args));
41
-
42
- _defineProperty(_assertThisInitialized(_this), "meter2coord", 1);
43
-
44
- _defineProperty(_assertThisInitialized(_this), "isMeter", false);
45
-
46
- return _this;
30
+ return _super.apply(this, arguments);
47
31
  }
48
32
 
49
33
  _createClass(FillModel, [{
@@ -58,70 +42,16 @@ var FillModel = /*#__PURE__*/function (_BaseModel) {
58
42
  strokeWidth = _ref$strokeWidth === void 0 ? 0 : _ref$strokeWidth,
59
43
  _ref$stroke = _ref.stroke,
60
44
  stroke = _ref$stroke === void 0 ? 'rgba(0,0,0,0)' : _ref$stroke,
61
- _ref$offsets = _ref.offsets,
62
- offsets = _ref$offsets === void 0 ? [0, 0] : _ref$offsets,
63
- blend = _ref.blend,
64
- _ref$blur = _ref.blur,
65
- blur = _ref$blur === void 0 ? 0 : _ref$blur,
66
- _ref$coord = _ref.coord,
67
- coord = _ref$coord === void 0 ? 'lnglat' : _ref$coord,
68
- tileOrigin = _ref.tileOrigin;
69
-
70
- if (this.dataTextureTest && this.dataTextureNeedUpdate({
71
- opacity: opacity,
72
- strokeOpacity: strokeOpacity,
73
- strokeWidth: strokeWidth,
74
- stroke: stroke,
75
- offsets: offsets
76
- })) {
77
- // 判断当前的样式中哪些是需要进行数据映射的,哪些是常量,同时计算用于构建数据纹理的一些中间变量
78
- this.judgeStyleAttributes({
79
- opacity: opacity,
80
- strokeOpacity: strokeOpacity,
81
- strokeWidth: strokeWidth,
82
- stroke: stroke,
83
- offsets: offsets
84
- });
85
- var encodeData = this.layer.getEncodedData();
86
-
87
- var _this$calDataFrame = this.calDataFrame(this.cellLength, encodeData, this.cellProperties),
88
- data = _this$calDataFrame.data,
89
- width = _this$calDataFrame.width,
90
- height = _this$calDataFrame.height;
91
-
92
- this.rowCount = height; // 当前数据纹理有多少行
93
-
94
- this.dataTexture = this.cellLength > 0 && data.length > 0 ? this.createTexture2D({
95
- flipY: true,
96
- data: data,
97
- format: gl.LUMINANCE,
98
- type: gl.FLOAT,
99
- width: width,
100
- height: height
101
- }) : this.createTexture2D({
102
- flipY: true,
103
- data: [1],
104
- format: gl.LUMINANCE,
105
- type: gl.FLOAT,
106
- width: 1,
107
- height: 1
108
- });
109
- }
45
+ blend = _ref.blend;
110
46
 
111
47
  return {
112
- u_tileOrigin: tileOrigin || [0, 0],
113
- u_coord: coord === 'lnglat' ? 1.0 : 0.0,
114
- u_isMeter: Number(this.isMeter),
115
- u_blur: blur,
48
+ // u_tileOrigin: tileOrigin || [0, 0],
49
+ // u_coord: coord === 'lnglat' ? 1.0 : 0.0,
116
50
  u_additive: blend === 'additive' ? 1.0 : 0.0,
117
- u_dataTexture: this.dataTexture,
118
- // 数据纹理 - 有数据映射的时候纹理中带数据,若没有任何数据映射时纹理是 [1]
119
- u_cellTypeLayout: this.getCellTypeLayout(),
120
51
  u_opacity: Number(opacity),
121
52
  u_stroke_opacity: Number(strokeOpacity),
122
53
  u_stroke_width: Number(strokeWidth),
123
- u_stroke_color: this.getStrokeColor(stroke),
124
- u_offsets: this.isOffsetStatic(offsets) ? offsets : [0, 0]
54
+ u_stroke_color: this.getStrokeColor(stroke)
125
55
  };
126
56
  }
127
57
  }, {
@@ -132,74 +62,19 @@ var FillModel = /*#__PURE__*/function (_BaseModel) {
132
62
  }, {
133
63
  key: "initModels",
134
64
  value: function initModels(callbackModel) {
135
- var _ref2 = this.layer.getLayerConfig(),
136
- _ref2$unit = _ref2.unit,
137
- unit = _ref2$unit === void 0 ? 'l7size' : _ref2$unit;
138
-
139
- var version = this.mapService.version;
140
-
141
- if (unit === 'meter' && version !== Version.L7MAP && version !== Version.GLOBEL) {
142
- this.isMeter = true;
143
- this.calMeter2Coord();
144
- }
145
-
146
65
  this.buildModels(callbackModel);
147
66
  }
148
- /**
149
- * 计算等面积点图层(unit meter)笛卡尔坐标标度与世界坐标标度的比例
150
- * @returns
151
- */
152
-
153
- }, {
154
- key: "calMeter2Coord",
155
- value: function calMeter2Coord() {
156
- var _this$layer$getSource = _slicedToArray(this.layer.getSource().extent, 4),
157
- minLng = _this$layer$getSource[0],
158
- minLat = _this$layer$getSource[1],
159
- maxLng = _this$layer$getSource[2],
160
- maxLat = _this$layer$getSource[3];
161
-
162
- var center = [(minLng + maxLng) / 2, (minLat + maxLat) / 2];
163
- var version = this.mapService.version;
164
-
165
- if (version === Version.MAPBOX && window.mapboxgl.MercatorCoordinate) {
166
- var coord = window.mapboxgl.MercatorCoordinate.fromLngLat({
167
- lng: center[0],
168
- lat: center[1]
169
- }, 0);
170
- var offsetInMeters = 1;
171
- var offsetInMercatorCoordinateUnits = offsetInMeters * coord.meterInMercatorCoordinateUnits();
172
- var westCoord = new window.mapboxgl.MercatorCoordinate(coord.x - offsetInMercatorCoordinateUnits, coord.y, coord.z);
173
- var westLnglat = westCoord.toLngLat();
174
- this.meter2coord = center[0] - westLnglat.lng;
175
- return;
176
- } // @ts-ignore
177
-
178
-
179
- var m1 = this.mapService.meterToCoord(center, [minLng, minLat]); // @ts-ignore
180
-
181
- var m2 = this.mapService.meterToCoord(center, [maxLng === minLng ? maxLng + 0.1 : maxLng, maxLat === minLat ? minLat + 0.1 : maxLat]);
182
- this.meter2coord = (m1 + m2) / 2;
183
-
184
- if (!this.meter2coord) {
185
- // Tip: 兼容单个数据导致的 m1、m2 为 NaN
186
- this.meter2coord = 7.70681090738883;
187
- }
188
- }
189
67
  }, {
190
68
  key: "buildModels",
191
69
  value: function buildModels(callbackModel) {
192
- var _ref3 = this.layer.getLayerConfig(),
193
- _ref3$mask = _ref3.mask,
194
- mask = _ref3$mask === void 0 ? false : _ref3$mask,
195
- _ref3$maskInside = _ref3.maskInside,
196
- maskInside = _ref3$maskInside === void 0 ? true : _ref3$maskInside,
197
- _ref3$workerEnabled = _ref3.workerEnabled,
198
- workerEnabled = _ref3$workerEnabled === void 0 ? false : _ref3$workerEnabled;
70
+ var _ref2 = this.layer.getLayerConfig(),
71
+ _ref2$workerEnabled = _ref2.workerEnabled,
72
+ workerEnabled = _ref2$workerEnabled === void 0 ? false : _ref2$workerEnabled,
73
+ usage = _ref2.usage;
199
74
 
200
75
  this.layer.triangulation = PointFillTriangulation;
201
76
  this.layer.buildLayerModel({
202
- moduleName: 'pointTile',
77
+ moduleName: 'pointTile_' + usage,
203
78
  vertexShader: point_tile_vert,
204
79
  fragmentShader: point_tile_frag,
205
80
  triangulation: PointFillTriangulation,
@@ -211,11 +86,11 @@ var FillModel = /*#__PURE__*/function (_BaseModel) {
211
86
  face: getCullFace(this.mapService.version)
212
87
  },
213
88
  blend: this.getBlend(),
214
- stencil: getMask(mask, maskInside),
215
89
  workerEnabled: workerEnabled,
216
90
  workerOptions: {
217
91
  modelType: 'pointTile'
218
- }
92
+ },
93
+ pick: usage !== 'basemap'
219
94
  }).then(function (model) {
220
95
  callbackModel([model]);
221
96
  }).catch(function (err) {
@@ -225,16 +100,11 @@ var FillModel = /*#__PURE__*/function (_BaseModel) {
225
100
  }
226
101
  }, {
227
102
  key: "clearModels",
228
- value: function clearModels() {
229
- var _this$dataTexture;
230
-
231
- (_this$dataTexture = this.dataTexture) === null || _this$dataTexture === void 0 ? void 0 : _this$dataTexture.destroy();
232
- } // overwrite baseModel func
233
-
103
+ value: function clearModels() {}
234
104
  }, {
235
105
  key: "registerBuiltinAttributes",
236
106
  value: function registerBuiltinAttributes() {
237
- var _this2 = this;
107
+ var _this = this;
238
108
 
239
109
  this.styleAttributeService.registerStyleAttribute({
240
110
  name: 'extrude',
@@ -254,8 +124,7 @@ var FillModel = /*#__PURE__*/function (_BaseModel) {
254
124
  return [extrude[extrudeIndex], extrude[extrudeIndex + 1], extrude[extrudeIndex + 2]];
255
125
  }
256
126
  }
257
- }); // point layer size;
258
-
127
+ });
259
128
  this.styleAttributeService.registerStyleAttribute({
260
129
  name: 'size',
261
130
  type: AttributeType.Attribute,
@@ -270,13 +139,11 @@ var FillModel = /*#__PURE__*/function (_BaseModel) {
270
139
  size: 1,
271
140
  update: function update(feature, featureIdx, vertex, attributeIdx) {
272
141
  var _feature$size = feature.size,
273
- size = _feature$size === void 0 ? 5 : _feature$size; // console.log('featureIdx', featureIdx, feature)
274
-
275
- return Array.isArray(size) ? [size[0] * _this2.meter2coord] : [size * _this2.meter2coord];
142
+ size = _feature$size === void 0 ? 5 : _feature$size;
143
+ return Array.isArray(size) ? [size[0]] : [size];
276
144
  }
277
145
  }
278
- }); // point layer size;
279
-
146
+ });
280
147
  this.styleAttributeService.registerStyleAttribute({
281
148
  name: 'shape',
282
149
  type: AttributeType.Attribute,
@@ -293,7 +160,7 @@ var FillModel = /*#__PURE__*/function (_BaseModel) {
293
160
  var _feature$shape = feature.shape,
294
161
  shape = _feature$shape === void 0 ? 2 : _feature$shape;
295
162
 
296
- var shape2d = _this2.layer.getLayerConfig().shape2d;
163
+ var shape2d = _this.layer.getLayerConfig().shape2d;
297
164
 
298
165
  var shapeIndex = shape2d.indexOf(shape);
299
166
  return [shapeIndex];
@@ -32,10 +32,6 @@ export default class TextModel extends BaseModel {
32
32
  * 生成文字纹理(生成文字纹理字典)
33
33
  */
34
34
  private initTextFont;
35
- /**
36
- * 生成 iconfont 纹理字典
37
- */
38
- private initIconFontTex;
39
35
  /**
40
36
  * 生成文字布局(对照文字纹理字典提取对应文字的位置很好信息)
41
37
  */