@antv/l7-layers 2.10.5 → 2.10.7

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 (387) hide show
  1. package/es/Geometry/index.d.ts +2 -3
  2. package/es/Geometry/index.js +27 -17
  3. package/es/Geometry/models/billboard.d.ts +2 -2
  4. package/es/Geometry/models/billboard.js +77 -37
  5. package/es/Geometry/models/plane.d.ts +2 -2
  6. package/es/Geometry/models/plane.js +80 -40
  7. package/es/Geometry/models/sprite.d.ts +2 -2
  8. package/es/Geometry/models/sprite.js +83 -45
  9. package/es/canvas/index.d.ts +2 -3
  10. package/es/canvas/index.js +29 -19
  11. package/es/canvas/models/canvas.d.ts +2 -2
  12. package/es/canvas/models/canvas.js +54 -15
  13. package/es/citybuliding/building.d.ts +2 -3
  14. package/es/citybuliding/building.js +26 -17
  15. package/es/citybuliding/models/build.d.ts +2 -2
  16. package/es/citybuliding/models/build.js +70 -25
  17. package/es/core/BaseLayer.d.ts +22 -18
  18. package/es/core/BaseLayer.js +387 -266
  19. package/es/core/BaseModel.d.ts +2 -2
  20. package/es/core/BaseModel.js +47 -6
  21. package/es/core/LayerPickService.d.ts +12 -0
  22. package/es/core/LayerPickService.js +165 -0
  23. package/es/core/TextureService.d.ts +14 -0
  24. package/es/core/TextureService.js +67 -0
  25. package/es/core/triangulation.js +8 -1
  26. package/es/earth/index.d.ts +2 -2
  27. package/es/earth/index.js +28 -9
  28. package/es/earth/models/atmosphere.d.ts +2 -2
  29. package/es/earth/models/atmosphere.js +67 -22
  30. package/es/earth/models/base.d.ts +2 -2
  31. package/es/earth/models/base.js +89 -43
  32. package/es/earth/models/bloomsphere.d.ts +2 -2
  33. package/es/earth/models/bloomsphere.js +67 -22
  34. package/es/heatmap/index.d.ts +2 -3
  35. package/es/heatmap/index.js +33 -24
  36. package/es/heatmap/models/grid.d.ts +2 -2
  37. package/es/heatmap/models/grid.js +68 -27
  38. package/es/heatmap/models/grid3d.d.ts +2 -2
  39. package/es/heatmap/models/grid3d.js +70 -29
  40. package/es/heatmap/models/heatmap.d.ts +2 -2
  41. package/es/heatmap/models/heatmap.js +40 -14
  42. package/es/heatmap/models/hexagon.d.ts +2 -2
  43. package/es/heatmap/models/hexagon.js +69 -28
  44. package/es/heatmap/shaders/hexagon_3d_vert.glsl +2 -13
  45. package/es/image/index.d.ts +3 -4
  46. package/es/image/index.js +29 -34
  47. package/es/image/models/image.d.ts +2 -2
  48. package/es/image/models/image.js +117 -67
  49. package/es/image/models/index.d.ts +1 -1
  50. package/es/image/models/index.js +1 -5
  51. package/es/image/shaders/dataImage_frag.glsl +10 -16
  52. package/es/index.d.ts +2 -2
  53. package/es/index.js +2 -2
  54. package/es/line/index.d.ts +5 -4
  55. package/es/line/index.js +51 -25
  56. package/es/line/models/arc.d.ts +2 -2
  57. package/es/line/models/arc.js +73 -38
  58. package/es/line/models/arc_3d.d.ts +2 -2
  59. package/es/line/models/arc_3d.js +69 -34
  60. package/es/line/models/earthArc_3d.d.ts +2 -2
  61. package/es/line/models/earthArc_3d.js +72 -37
  62. package/es/line/models/great_circle.d.ts +2 -2
  63. package/es/line/models/great_circle.js +70 -29
  64. package/es/line/models/half.d.ts +2 -2
  65. package/es/line/models/half.js +40 -17
  66. package/es/line/models/index.d.ts +1 -1
  67. package/es/line/models/index.js +0 -2
  68. package/es/line/models/line.d.ts +2 -2
  69. package/es/line/models/line.js +79 -47
  70. package/es/line/models/linearline.d.ts +2 -2
  71. package/es/line/models/linearline.js +70 -31
  72. package/es/line/models/simpleLine.d.ts +2 -2
  73. package/es/line/models/simpleLine.js +71 -34
  74. package/es/line/models/simpleTileLine.d.ts +2 -2
  75. package/es/line/models/simpleTileLine.js +70 -30
  76. package/es/line/models/tile.d.ts +2 -2
  77. package/es/line/models/tile.js +40 -17
  78. package/es/line/models/wall.d.ts +2 -2
  79. package/es/line/models/wall.js +67 -22
  80. package/es/mask/index.d.ts +2 -4
  81. package/es/mask/index.js +27 -97
  82. package/es/mask/models/fill.d.ts +2 -2
  83. package/es/mask/models/fill.js +40 -16
  84. package/es/mask/models/index.d.ts +1 -1
  85. package/es/mask/models/index.js +1 -3
  86. package/es/plugins/DataMappingPlugin.d.ts +0 -2
  87. package/es/plugins/DataMappingPlugin.js +90 -152
  88. package/es/plugins/DataSourcePlugin.js +67 -30
  89. package/es/plugins/FeatureScalePlugin.d.ts +0 -1
  90. package/es/plugins/FeatureScalePlugin.js +85 -61
  91. package/es/plugins/LayerModelPlugin.d.ts +2 -2
  92. package/es/plugins/LayerModelPlugin.js +121 -37
  93. package/es/plugins/LayerStylePlugin.js +1 -6
  94. package/es/plugins/MultiPassRendererPlugin.js +1 -1
  95. package/es/plugins/PixelPickingPlugin.js +1 -1
  96. package/es/plugins/RegisterStyleAttributePlugin.js +1 -16
  97. package/es/plugins/UpdateModelPlugin.js +3 -0
  98. package/es/plugins/UpdateStyleAttributePlugin.js +3 -6
  99. package/es/point/index.d.ts +4 -4
  100. package/es/point/index.js +55 -23
  101. package/es/point/models/earthExtrude.d.ts +2 -2
  102. package/es/point/models/earthExtrude.js +73 -30
  103. package/es/point/models/earthFill.d.ts +2 -2
  104. package/es/point/models/earthFill.js +66 -21
  105. package/es/point/models/extrude.d.ts +2 -2
  106. package/es/point/models/extrude.js +40 -17
  107. package/es/point/models/fill.d.ts +2 -2
  108. package/es/point/models/fill.js +43 -20
  109. package/es/point/models/fillmage.d.ts +2 -2
  110. package/es/point/models/fillmage.js +82 -43
  111. package/es/point/models/image.d.ts +2 -2
  112. package/es/point/models/image.js +72 -31
  113. package/es/point/models/index.d.ts +1 -1
  114. package/es/point/models/index.js +0 -2
  115. package/es/point/models/normal.d.ts +2 -2
  116. package/es/point/models/normal.js +71 -30
  117. package/es/point/models/radar.d.ts +2 -2
  118. package/es/point/models/radar.js +75 -35
  119. package/es/point/models/simplePoint.d.ts +2 -2
  120. package/es/point/models/simplePoint.js +70 -29
  121. package/es/point/models/text.d.ts +3 -2
  122. package/es/point/models/text.js +185 -112
  123. package/es/point/models/tile.d.ts +2 -2
  124. package/es/point/models/tile.js +77 -35
  125. package/es/point/models/tileText.d.ts +2 -2
  126. package/es/point/models/tileText.js +151 -116
  127. package/es/polygon/index.d.ts +2 -3
  128. package/es/polygon/index.js +27 -24
  129. package/es/polygon/models/extrude.d.ts +2 -2
  130. package/es/polygon/models/extrude.js +69 -32
  131. package/es/polygon/models/fill.d.ts +2 -2
  132. package/es/polygon/models/fill.js +76 -43
  133. package/es/polygon/models/index.d.ts +1 -1
  134. package/es/polygon/models/index.js +0 -2
  135. package/es/polygon/models/ocean.d.ts +2 -2
  136. package/es/polygon/models/ocean.js +69 -28
  137. package/es/polygon/models/tile.d.ts +2 -2
  138. package/es/polygon/models/tile.js +70 -30
  139. package/es/polygon/models/water.d.ts +2 -2
  140. package/es/polygon/models/water.js +69 -28
  141. package/es/polygon/shaders/extrude/polygon_extrude_frag.glsl +1 -2
  142. package/es/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +1 -2
  143. package/es/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +1 -2
  144. package/es/raster/index.d.ts +2 -3
  145. package/es/raster/index.js +30 -20
  146. package/es/raster/models/index.d.ts +1 -1
  147. package/es/raster/models/index.js +2 -2
  148. package/es/raster/models/raster.d.ts +2 -2
  149. package/es/raster/models/raster.js +39 -28
  150. package/es/raster/models/rasterRgb.d.ts +7 -8
  151. package/es/raster/models/rasterRgb.js +75 -45
  152. package/es/{image/models/tileDataImage.d.ts → raster/models/rasterTerrainRgb.d.ts} +3 -3
  153. package/es/raster/models/rasterTerrainRgb.js +184 -0
  154. package/es/raster/models/rasterTile.d.ts +2 -2
  155. package/es/raster/models/rasterTile.js +78 -37
  156. package/es/raster/shaders/raster_2d_frag.glsl +2 -38
  157. package/es/raster/shaders/raster_rgb_frag.glsl +10 -4
  158. package/es/raster/shaders/raster_terrain_rgb_frag.glsl +31 -0
  159. package/es/raster/shaders/rater_terrain_rgb_vert.glsl +17 -0
  160. package/es/tile/interaction/getRasterData.d.ts +2 -2
  161. package/es/tile/interaction/utils.js +3 -11
  162. package/es/tile/interface.d.ts +5 -4
  163. package/es/tile/manager/base.d.ts +17 -12
  164. package/es/tile/manager/base.js +212 -47
  165. package/es/tile/service/TileLayerService.d.ts +34 -0
  166. package/es/tile/service/TileLayerService.js +220 -0
  167. package/es/tile/service/TilePickService.d.ts +26 -0
  168. package/es/tile/service/TilePickService.js +174 -0
  169. package/es/tile/service/TileSourceService.d.ts +7 -0
  170. package/es/tile/service/TileSourceService.js +39 -0
  171. package/es/tile/style/constants.d.ts +1 -13
  172. package/es/tile/style/constants.js +6 -15
  173. package/es/tile/style/utils.d.ts +1 -8
  174. package/es/tile/style/utils.js +0 -126
  175. package/es/tile/tileFactory/DebugTile.d.ts +16 -0
  176. package/es/tile/tileFactory/DebugTile.js +100 -0
  177. package/es/tile/tileFactory/ImageTile.d.ts +14 -0
  178. package/es/tile/tileFactory/ImageTile.js +89 -0
  179. package/es/tile/tileFactory/MaskTile.d.ts +18 -0
  180. package/es/tile/tileFactory/MaskTile.js +105 -0
  181. package/es/tile/tileFactory/RasterRGBTile.d.ts +11 -0
  182. package/es/tile/tileFactory/RasterRGBTile.js +98 -0
  183. package/es/tile/tileFactory/RasterTerrainRGBTile.d.ts +14 -0
  184. package/es/tile/tileFactory/RasterTerrainRGBTile.js +89 -0
  185. package/es/tile/tileFactory/RasterTile.d.ts +18 -0
  186. package/es/tile/tileFactory/RasterTile.js +133 -0
  187. package/es/tile/tileFactory/Tile.d.ts +34 -0
  188. package/es/tile/tileFactory/Tile.js +161 -0
  189. package/es/tile/tileFactory/VectorTile.d.ts +27 -0
  190. package/es/tile/tileFactory/VectorTile.js +198 -0
  191. package/es/tile/tileFactory/index.d.ts +11 -4
  192. package/es/tile/tileFactory/index.js +34 -23
  193. package/es/tile/tileFactory/layers/{rasterDataLayer.d.ts → RasterDataLayer.d.ts} +3 -3
  194. package/es/tile/tileFactory/layers/{rasterDataLayer.js → RasterDataLayer.js} +34 -22
  195. package/es/tile/tileFactory/layers/{tileTest.d.ts → TileDebugLayer.d.ts} +2 -2
  196. package/es/tile/tileFactory/layers/{tileTest.js → TileDebugLayer.js} +23 -10
  197. package/es/tile/tileFactory/util.d.ts +5 -0
  198. package/es/tile/tileFactory/util.js +21 -0
  199. package/es/tile/tileLayer/BaseLayer.d.ts +45 -0
  200. package/es/tile/tileLayer/BaseLayer.js +348 -0
  201. package/es/tile/utils.d.ts +1 -11
  202. package/es/tile/utils.js +0 -129
  203. package/es/utils/dataMappingStyle.d.ts +4 -4
  204. package/es/utils/dataMappingStyle.js +16 -18
  205. package/es/utils/layerData.js +5 -11
  206. package/es/wind/index.d.ts +2 -3
  207. package/es/wind/index.js +27 -17
  208. package/es/wind/models/wind.d.ts +2 -2
  209. package/es/wind/models/wind.js +123 -104
  210. package/lib/Geometry/index.js +29 -17
  211. package/lib/Geometry/models/billboard.js +79 -37
  212. package/lib/Geometry/models/plane.js +82 -40
  213. package/lib/Geometry/models/sprite.js +85 -45
  214. package/lib/canvas/index.js +31 -19
  215. package/lib/canvas/models/canvas.js +56 -15
  216. package/lib/citybuliding/building.js +28 -17
  217. package/lib/citybuliding/models/build.js +72 -25
  218. package/lib/core/BaseLayer.js +388 -261
  219. package/lib/core/BaseModel.js +48 -6
  220. package/lib/core/LayerPickService.js +179 -0
  221. package/lib/core/TextureService.js +77 -0
  222. package/lib/core/triangulation.js +8 -1
  223. package/lib/earth/index.js +30 -9
  224. package/lib/earth/models/atmosphere.js +69 -22
  225. package/lib/earth/models/base.js +90 -42
  226. package/lib/earth/models/bloomsphere.js +69 -22
  227. package/lib/heatmap/index.js +35 -24
  228. package/lib/heatmap/models/grid.js +70 -27
  229. package/lib/heatmap/models/grid3d.js +72 -29
  230. package/lib/heatmap/models/heatmap.js +40 -14
  231. package/lib/heatmap/models/hexagon.js +71 -28
  232. package/lib/heatmap/shaders/hexagon_3d_vert.glsl +2 -13
  233. package/lib/image/index.js +31 -34
  234. package/lib/image/models/image.js +119 -67
  235. package/lib/image/models/index.js +1 -7
  236. package/lib/image/shaders/dataImage_frag.glsl +10 -16
  237. package/lib/index.js +5 -5
  238. package/lib/line/index.js +53 -26
  239. package/lib/line/models/arc.js +75 -38
  240. package/lib/line/models/arc_3d.js +71 -34
  241. package/lib/line/models/earthArc_3d.js +74 -37
  242. package/lib/line/models/great_circle.js +72 -29
  243. package/lib/line/models/half.js +40 -17
  244. package/lib/line/models/index.js +0 -3
  245. package/lib/line/models/line.js +81 -47
  246. package/lib/line/models/linearline.js +72 -31
  247. package/lib/line/models/simpleLine.js +73 -34
  248. package/lib/line/models/simpleTileLine.js +72 -30
  249. package/lib/line/models/tile.js +40 -17
  250. package/lib/line/models/wall.js +69 -22
  251. package/lib/mask/index.js +28 -99
  252. package/lib/mask/models/fill.js +40 -16
  253. package/lib/mask/models/index.js +1 -4
  254. package/lib/plugins/DataMappingPlugin.js +91 -149
  255. package/lib/plugins/DataSourcePlugin.js +69 -30
  256. package/lib/plugins/FeatureScalePlugin.js +87 -61
  257. package/lib/plugins/LayerModelPlugin.js +128 -41
  258. package/lib/plugins/LayerStylePlugin.js +1 -6
  259. package/lib/plugins/MultiPassRendererPlugin.js +1 -1
  260. package/lib/plugins/PixelPickingPlugin.js +1 -1
  261. package/lib/plugins/RegisterStyleAttributePlugin.js +1 -16
  262. package/lib/plugins/UpdateModelPlugin.js +3 -0
  263. package/lib/plugins/UpdateStyleAttributePlugin.js +3 -6
  264. package/lib/point/index.js +56 -24
  265. package/lib/point/models/earthExtrude.js +75 -30
  266. package/lib/point/models/earthFill.js +68 -21
  267. package/lib/point/models/extrude.js +40 -17
  268. package/lib/point/models/fill.js +44 -21
  269. package/lib/point/models/fillmage.js +84 -43
  270. package/lib/point/models/image.js +74 -31
  271. package/lib/point/models/index.js +0 -3
  272. package/lib/point/models/normal.js +73 -30
  273. package/lib/point/models/radar.js +77 -35
  274. package/lib/point/models/simplePoint.js +72 -29
  275. package/lib/point/models/text.js +185 -111
  276. package/lib/point/models/tile.js +79 -35
  277. package/lib/point/models/tileText.js +151 -115
  278. package/lib/polygon/index.js +29 -25
  279. package/lib/polygon/models/extrude.js +71 -32
  280. package/lib/polygon/models/fill.js +78 -43
  281. package/lib/polygon/models/index.js +0 -3
  282. package/lib/polygon/models/ocean.js +71 -28
  283. package/lib/polygon/models/tile.js +72 -30
  284. package/lib/polygon/models/water.js +71 -28
  285. package/lib/polygon/shaders/extrude/polygon_extrude_frag.glsl +1 -2
  286. package/lib/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +1 -2
  287. package/lib/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +1 -2
  288. package/lib/raster/index.js +32 -20
  289. package/lib/raster/models/index.js +3 -3
  290. package/lib/raster/models/raster.js +39 -29
  291. package/lib/raster/models/rasterRgb.js +78 -43
  292. package/lib/raster/models/rasterTerrainRgb.js +200 -0
  293. package/lib/raster/models/rasterTile.js +80 -37
  294. package/lib/raster/shaders/raster_2d_frag.glsl +2 -38
  295. package/lib/raster/shaders/raster_rgb_frag.glsl +10 -4
  296. package/lib/raster/shaders/raster_terrain_rgb_frag.glsl +31 -0
  297. package/lib/raster/shaders/rater_terrain_rgb_vert.glsl +17 -0
  298. package/lib/tile/interaction/utils.js +3 -11
  299. package/lib/tile/manager/base.js +213 -47
  300. package/lib/tile/service/TileLayerService.js +233 -0
  301. package/lib/tile/service/TilePickService.js +190 -0
  302. package/lib/tile/service/TileSourceService.js +59 -0
  303. package/lib/tile/style/constants.js +8 -19
  304. package/lib/tile/style/utils.js +0 -140
  305. package/lib/tile/tileFactory/DebugTile.js +115 -0
  306. package/lib/tile/tileFactory/ImageTile.js +104 -0
  307. package/lib/tile/tileFactory/MaskTile.js +120 -0
  308. package/lib/tile/tileFactory/RasterRGBTile.js +112 -0
  309. package/lib/tile/tileFactory/RasterTerrainRGBTile.js +104 -0
  310. package/lib/tile/tileFactory/RasterTile.js +149 -0
  311. package/lib/tile/tileFactory/Tile.js +171 -0
  312. package/lib/tile/tileFactory/VectorTile.js +214 -0
  313. package/lib/tile/tileFactory/index.js +46 -23
  314. package/lib/tile/tileFactory/layers/{rasterDataLayer.js → RasterDataLayer.js} +36 -22
  315. package/lib/tile/tileFactory/layers/{tileTest.js → TileDebugLayer.js} +24 -11
  316. package/lib/tile/tileFactory/util.js +35 -0
  317. package/lib/tile/tileLayer/BaseLayer.js +363 -0
  318. package/lib/tile/utils.js +0 -148
  319. package/lib/utils/dataMappingStyle.js +18 -20
  320. package/lib/utils/layerData.js +4 -10
  321. package/lib/wind/index.js +29 -17
  322. package/lib/wind/models/wind.js +125 -104
  323. package/package.json +7 -7
  324. package/es/heatmap/shaders/hexagon_3d_frag.glsl +0 -0
  325. package/es/image/models/dataImage.d.ts +0 -13
  326. package/es/image/models/dataImage.js +0 -186
  327. package/es/image/models/tileDataImage.js +0 -160
  328. package/es/raster/raster.d.ts +0 -21
  329. package/es/raster/raster.js +0 -161
  330. package/es/tile/interaction/TilePickService.d.ts +0 -16
  331. package/es/tile/interaction/TilePickService.js +0 -129
  332. package/es/tile/manager/layerManager.d.ts +0 -19
  333. package/es/tile/manager/layerManager.js +0 -254
  334. package/es/tile/manager/mapLayerManager.d.ts +0 -7
  335. package/es/tile/manager/mapLayerManager.js +0 -119
  336. package/es/tile/models/tileModel.d.ts +0 -10
  337. package/es/tile/models/tileModel.js +0 -81
  338. package/es/tile/render/TileRenderService.d.ts +0 -10
  339. package/es/tile/render/TileRenderService.js +0 -68
  340. package/es/tile/style/TileStyleService.d.ts +0 -17
  341. package/es/tile/style/TileStyleService.js +0 -118
  342. package/es/tile/tileFactory/base.d.ts +0 -45
  343. package/es/tile/tileFactory/base.js +0 -403
  344. package/es/tile/tileFactory/layers/vectorLayer.d.ts +0 -30
  345. package/es/tile/tileFactory/layers/vectorLayer.js +0 -253
  346. package/es/tile/tileFactory/line.d.ts +0 -12
  347. package/es/tile/tileFactory/line.js +0 -59
  348. package/es/tile/tileFactory/mask.d.ts +0 -12
  349. package/es/tile/tileFactory/mask.js +0 -60
  350. package/es/tile/tileFactory/point.d.ts +0 -12
  351. package/es/tile/tileFactory/point.js +0 -60
  352. package/es/tile/tileFactory/polygon.d.ts +0 -12
  353. package/es/tile/tileFactory/polygon.js +0 -59
  354. package/es/tile/tileFactory/raster.d.ts +0 -12
  355. package/es/tile/tileFactory/raster.js +0 -55
  356. package/es/tile/tileFactory/rasterData.d.ts +0 -12
  357. package/es/tile/tileFactory/rasterData.js +0 -81
  358. package/es/tile/tileFactory/test.d.ts +0 -12
  359. package/es/tile/tileFactory/test.js +0 -94
  360. package/es/tile/tileLayer/MapTileLayer.d.ts +0 -6
  361. package/es/tile/tileLayer/MapTileLayer.js +0 -48
  362. package/es/tile/tileLayer/TileLayer.d.ts +0 -22
  363. package/es/tile/tileLayer/TileLayer.js +0 -198
  364. package/es/tile/tileLayer/base.d.ts +0 -33
  365. package/es/tile/tileLayer/base.js +0 -212
  366. package/lib/heatmap/shaders/hexagon_3d_frag.glsl +0 -0
  367. package/lib/image/models/dataImage.js +0 -201
  368. package/lib/image/models/tileDataImage.js +0 -174
  369. package/lib/raster/raster.js +0 -178
  370. package/lib/tile/interaction/TilePickService.js +0 -143
  371. package/lib/tile/manager/layerManager.js +0 -275
  372. package/lib/tile/manager/mapLayerManager.js +0 -134
  373. package/lib/tile/models/tileModel.js +0 -94
  374. package/lib/tile/render/TileRenderService.js +0 -78
  375. package/lib/tile/style/TileStyleService.js +0 -133
  376. package/lib/tile/tileFactory/base.js +0 -427
  377. package/lib/tile/tileFactory/layers/vectorLayer.js +0 -268
  378. package/lib/tile/tileFactory/line.js +0 -70
  379. package/lib/tile/tileFactory/mask.js +0 -71
  380. package/lib/tile/tileFactory/point.js +0 -71
  381. package/lib/tile/tileFactory/polygon.js +0 -70
  382. package/lib/tile/tileFactory/raster.js +0 -68
  383. package/lib/tile/tileFactory/rasterData.js +0 -93
  384. package/lib/tile/tileFactory/test.js +0 -106
  385. package/lib/tile/tileLayer/MapTileLayer.js +0 -63
  386. package/lib/tile/tileLayer/TileLayer.js +0 -215
  387. package/lib/tile/tileLayer/base.js +0 -225
@@ -113,47 +113,6 @@ var TextModel = /*#__PURE__*/function (_BaseModel) {
113
113
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "textureHeight", 0);
114
114
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "textCount", 0);
115
115
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "preTextStyle", {});
116
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "buildModels", /*#__PURE__*/function () {
117
- var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(callbackModel) {
118
- var _this$layer$getLayerC, usage;
119
-
120
- return _regenerator.default.wrap(function _callee$(_context) {
121
- while (1) {
122
- switch (_context.prev = _context.next) {
123
- case 0:
124
- _this.mapping();
125
-
126
- _this$layer$getLayerC = _this.layer.getLayerConfig(), usage = _this$layer$getLayerC.usage;
127
-
128
- _this.layer.buildLayerModel({
129
- moduleName: 'pointTileText_' + usage,
130
- vertexShader: usage === 'basemap' ? text_map_vert : text_vert,
131
- fragmentShader: usage === 'basemap' ? text_map_frag : text_frag,
132
- triangulation: TextTriangulation.bind((0, _assertThisInitialized2.default)(_this)),
133
- depth: {
134
- enable: false
135
- },
136
- blend: _this.getBlend(),
137
- pick: usage !== 'basemap'
138
- }).then(function (model) {
139
- callbackModel([model]);
140
- }).catch(function (err) {
141
- console.warn(err);
142
- callbackModel([]);
143
- });
144
-
145
- case 3:
146
- case "end":
147
- return _context.stop();
148
- }
149
- }
150
- }, _callee);
151
- }));
152
-
153
- return function (_x) {
154
- return _ref.apply(this, arguments);
155
- };
156
- }());
157
116
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "mapping", function () {
158
117
  _this.initGlyph();
159
118
 
@@ -169,26 +128,26 @@ var TextModel = /*#__PURE__*/function (_BaseModel) {
169
128
  (0, _createClass2.default)(TextModel, [{
170
129
  key: "getUninforms",
171
130
  value: function getUninforms() {
172
- var _ref2 = this.layer.getLayerConfig(),
173
- _ref2$opacity = _ref2.opacity,
174
- opacity = _ref2$opacity === void 0 ? 1.0 : _ref2$opacity,
175
- _ref2$stroke = _ref2.stroke,
176
- stroke = _ref2$stroke === void 0 ? '#fff' : _ref2$stroke,
177
- _ref2$strokeWidth = _ref2.strokeWidth,
178
- strokeWidth = _ref2$strokeWidth === void 0 ? 0 : _ref2$strokeWidth,
179
- _ref2$textAnchor = _ref2.textAnchor,
180
- textAnchor = _ref2$textAnchor === void 0 ? 'center' : _ref2$textAnchor,
181
- _ref2$textAllowOverla = _ref2.textAllowOverlap,
182
- textAllowOverlap = _ref2$textAllowOverla === void 0 ? false : _ref2$textAllowOverla,
183
- _ref2$halo = _ref2.halo,
184
- halo = _ref2$halo === void 0 ? 0.5 : _ref2$halo,
185
- _ref2$gamma = _ref2.gamma,
186
- gamma = _ref2$gamma === void 0 ? 2.0 : _ref2$gamma,
187
- usage = _ref2.usage,
188
- _ref2$color = _ref2.color,
189
- color = _ref2$color === void 0 ? '#fff' : _ref2$color,
190
- _ref2$size = _ref2.size,
191
- size = _ref2$size === void 0 ? 1 : _ref2$size;
131
+ var _ref = this.layer.getLayerConfig(),
132
+ _ref$opacity = _ref.opacity,
133
+ opacity = _ref$opacity === void 0 ? 1.0 : _ref$opacity,
134
+ _ref$stroke = _ref.stroke,
135
+ stroke = _ref$stroke === void 0 ? '#fff' : _ref$stroke,
136
+ _ref$strokeWidth = _ref.strokeWidth,
137
+ strokeWidth = _ref$strokeWidth === void 0 ? 0 : _ref$strokeWidth,
138
+ _ref$textAnchor = _ref.textAnchor,
139
+ textAnchor = _ref$textAnchor === void 0 ? 'center' : _ref$textAnchor,
140
+ _ref$textAllowOverlap = _ref.textAllowOverlap,
141
+ textAllowOverlap = _ref$textAllowOverlap === void 0 ? false : _ref$textAllowOverlap,
142
+ _ref$halo = _ref.halo,
143
+ halo = _ref$halo === void 0 ? 0.5 : _ref$halo,
144
+ _ref$gamma = _ref.gamma,
145
+ gamma = _ref$gamma === void 0 ? 2.0 : _ref$gamma,
146
+ usage = _ref.usage,
147
+ _ref$color = _ref.color,
148
+ color = _ref$color === void 0 ? '#fff' : _ref$color,
149
+ _ref$size = _ref.size,
150
+ size = _ref$size === void 0 ? 1 : _ref$size;
192
151
 
193
152
  var _this$fontService = this.fontService,
194
153
  canvas = _this$fontService.canvas,
@@ -217,21 +176,83 @@ var TextModel = /*#__PURE__*/function (_BaseModel) {
217
176
  }
218
177
  }, {
219
178
  key: "initModels",
220
- value: function initModels(callbackModel) {
221
- this.extent = this.textExtent();
179
+ value: function () {
180
+ var _initModels = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
181
+ var _ref2, _ref2$textAnchor, textAnchor, _ref2$textAllowOverla, textAllowOverlap;
222
182
 
223
- var _ref3 = this.layer.getLayerConfig(),
224
- _ref3$textAnchor = _ref3.textAnchor,
225
- textAnchor = _ref3$textAnchor === void 0 ? 'center' : _ref3$textAnchor,
226
- _ref3$textAllowOverla = _ref3.textAllowOverlap,
227
- textAllowOverlap = _ref3$textAllowOverla === void 0 ? true : _ref3$textAllowOverla;
183
+ return _regenerator.default.wrap(function _callee$(_context) {
184
+ while (1) {
185
+ switch (_context.prev = _context.next) {
186
+ case 0:
187
+ this.extent = this.textExtent();
188
+ _ref2 = this.layer.getLayerConfig(), _ref2$textAnchor = _ref2.textAnchor, textAnchor = _ref2$textAnchor === void 0 ? 'center' : _ref2$textAnchor, _ref2$textAllowOverla = _ref2.textAllowOverlap, textAllowOverlap = _ref2$textAllowOverla === void 0 ? true : _ref2$textAllowOverla;
189
+ this.preTextStyle = {
190
+ textAnchor: textAnchor,
191
+ textAllowOverlap: textAllowOverlap
192
+ };
193
+ _context.next = 5;
194
+ return this.buildModels();
195
+
196
+ case 5:
197
+ return _context.abrupt("return", _context.sent);
198
+
199
+ case 6:
200
+ case "end":
201
+ return _context.stop();
202
+ }
203
+ }
204
+ }, _callee, this);
205
+ }));
228
206
 
229
- this.preTextStyle = {
230
- textAnchor: textAnchor,
231
- textAllowOverlap: textAllowOverlap
232
- };
233
- this.buildModels(callbackModel);
234
- }
207
+ function initModels() {
208
+ return _initModels.apply(this, arguments);
209
+ }
210
+
211
+ return initModels;
212
+ }()
213
+ }, {
214
+ key: "buildModels",
215
+ value: function () {
216
+ var _buildModels = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
217
+ var _this$layer$getLayerC, usage, model;
218
+
219
+ return _regenerator.default.wrap(function _callee2$(_context2) {
220
+ while (1) {
221
+ switch (_context2.prev = _context2.next) {
222
+ case 0:
223
+ this.mapping();
224
+ _this$layer$getLayerC = this.layer.getLayerConfig(), usage = _this$layer$getLayerC.usage;
225
+ _context2.next = 4;
226
+ return this.layer.buildLayerModel({
227
+ moduleName: 'pointTileText_' + usage,
228
+ vertexShader: usage === 'basemap' ? text_map_vert : text_vert,
229
+ fragmentShader: usage === 'basemap' ? text_map_frag : text_frag,
230
+ triangulation: TextTriangulation.bind(this),
231
+ depth: {
232
+ enable: false
233
+ },
234
+ blend: this.getBlend(),
235
+ pick: usage !== 'basemap'
236
+ });
237
+
238
+ case 4:
239
+ model = _context2.sent;
240
+ return _context2.abrupt("return", [model]);
241
+
242
+ case 6:
243
+ case "end":
244
+ return _context2.stop();
245
+ }
246
+ }
247
+ }, _callee2, this);
248
+ }));
249
+
250
+ function buildModels() {
251
+ return _buildModels.apply(this, arguments);
252
+ }
253
+
254
+ return buildModels;
255
+ }()
235
256
  }, {
236
257
  key: "clearModels",
237
258
  value: function clearModels() {
@@ -313,11 +334,11 @@ var TextModel = /*#__PURE__*/function (_BaseModel) {
313
334
  }, {
314
335
  key: "initTextFont",
315
336
  value: function initTextFont() {
316
- var _ref4 = this.layer.getLayerConfig(),
317
- _ref4$fontWeight = _ref4.fontWeight,
318
- fontWeight = _ref4$fontWeight === void 0 ? '400' : _ref4$fontWeight,
319
- _ref4$fontFamily = _ref4.fontFamily,
320
- fontFamily = _ref4$fontFamily === void 0 ? 'sans-serif' : _ref4$fontFamily;
337
+ var _ref3 = this.layer.getLayerConfig(),
338
+ _ref3$fontWeight = _ref3.fontWeight,
339
+ fontWeight = _ref3$fontWeight === void 0 ? '400' : _ref3$fontWeight,
340
+ _ref3$fontFamily = _ref3.fontFamily,
341
+ fontFamily = _ref3$fontFamily === void 0 ? 'sans-serif' : _ref3$fontFamily;
321
342
 
322
343
  var data = this.layer.getEncodedData();
323
344
  var characterSet = [];
@@ -362,11 +383,11 @@ var TextModel = /*#__PURE__*/function (_BaseModel) {
362
383
 
363
384
  var mapping = this.fontService.mapping;
364
385
 
365
- var _ref5 = this.layer.getLayerConfig(),
366
- _ref5$spacing = _ref5.spacing,
367
- spacing = _ref5$spacing === void 0 ? 2 : _ref5$spacing,
368
- _ref5$textAnchor = _ref5.textAnchor,
369
- textAnchor = _ref5$textAnchor === void 0 ? 'center' : _ref5$textAnchor;
386
+ var _ref4 = this.layer.getLayerConfig(),
387
+ _ref4$spacing = _ref4.spacing,
388
+ spacing = _ref4$spacing === void 0 ? 2 : _ref4$spacing,
389
+ _ref4$textAnchor = _ref4.textAnchor,
390
+ textAnchor = _ref4$textAnchor === void 0 ? 'center' : _ref4$textAnchor;
370
391
 
371
392
  var data = this.layer.getEncodedData();
372
393
  this.glyphInfo = data.map(function (feature) {
@@ -402,11 +423,11 @@ var TextModel = /*#__PURE__*/function (_BaseModel) {
402
423
  value: function filterGlyphs() {
403
424
  var _this3 = this;
404
425
 
405
- var _ref6 = this.layer.getLayerConfig(),
406
- _ref6$padding = _ref6.padding,
407
- padding = _ref6$padding === void 0 ? [4, 4] : _ref6$padding,
408
- _ref6$textAllowOverla = _ref6.textAllowOverlap,
409
- textAllowOverlap = _ref6$textAllowOverla === void 0 ? false : _ref6$textAllowOverla;
426
+ var _ref5 = this.layer.getLayerConfig(),
427
+ _ref5$padding = _ref5.padding,
428
+ padding = _ref5$padding === void 0 ? [4, 4] : _ref5$padding,
429
+ _ref5$textAllowOverla = _ref5.textAllowOverlap,
430
+ textAllowOverlap = _ref5$textAllowOverla === void 0 ? false : _ref5$textAllowOverla;
410
431
 
411
432
  if (textAllowOverlap) {
412
433
  // 如果允许文本覆盖
@@ -491,32 +512,47 @@ var TextModel = /*#__PURE__*/function (_BaseModel) {
491
512
  }
492
513
  }, {
493
514
  key: "reBuildModel",
494
- value: function reBuildModel() {
495
- var _this4 = this;
496
-
497
- var _this$layer$getLayerC3 = this.layer.getLayerConfig(),
498
- usage = _this$layer$getLayerC3.usage;
499
-
500
- this.filterGlyphs();
501
- this.layer.buildLayerModel({
502
- moduleName: 'pointTileText_' + usage,
503
- vertexShader: usage === 'basemap' ? text_map_vert : text_vert,
504
- fragmentShader: usage === 'basemap' ? text_map_frag : text_frag,
505
- triangulation: TextTriangulation.bind(this),
506
- depth: {
507
- enable: false
508
- },
509
- blend: this.getBlend(),
510
- pick: usage !== 'basemap'
511
- }).then(function (model) {
512
- _this4.layer.models = [model];
513
-
514
- _this4.layerService.throttleRenderLayers();
515
- }).catch(function (err) {
516
- console.warn(err);
517
- _this4.layer.models = [];
518
- });
519
- }
515
+ value: function () {
516
+ var _reBuildModel = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
517
+ var _this$layer$getLayerC3, usage, model;
518
+
519
+ return _regenerator.default.wrap(function _callee3$(_context3) {
520
+ while (1) {
521
+ switch (_context3.prev = _context3.next) {
522
+ case 0:
523
+ _this$layer$getLayerC3 = this.layer.getLayerConfig(), usage = _this$layer$getLayerC3.usage;
524
+ this.filterGlyphs();
525
+ _context3.next = 4;
526
+ return this.layer.buildLayerModel({
527
+ moduleName: 'pointTileText_' + usage,
528
+ vertexShader: usage === 'basemap' ? text_map_vert : text_vert,
529
+ fragmentShader: usage === 'basemap' ? text_map_frag : text_frag,
530
+ triangulation: TextTriangulation.bind(this),
531
+ depth: {
532
+ enable: false
533
+ },
534
+ blend: this.getBlend(),
535
+ pick: usage !== 'basemap'
536
+ });
537
+
538
+ case 4:
539
+ model = _context3.sent;
540
+ return _context3.abrupt("return", [model]);
541
+
542
+ case 6:
543
+ case "end":
544
+ return _context3.stop();
545
+ }
546
+ }
547
+ }, _callee3, this);
548
+ }));
549
+
550
+ function reBuildModel() {
551
+ return _reBuildModel.apply(this, arguments);
552
+ }
553
+
554
+ return reBuildModel;
555
+ }()
520
556
  }]);
521
557
  return TextModel;
522
558
  }(_BaseModel2.default);
@@ -7,6 +7,10 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.default = void 0;
9
9
 
10
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
11
+
12
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
13
+
10
14
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
15
 
12
16
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
@@ -23,8 +27,6 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
23
27
 
24
28
  var _BaseLayer2 = _interopRequireDefault(require("../core/BaseLayer"));
25
29
 
26
- var _utils = require("../tile/utils");
27
-
28
30
  var _models = _interopRequireDefault(require("./models/"));
29
31
 
30
32
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
@@ -52,35 +54,37 @@ var PolygonLayer = /*#__PURE__*/function (_BaseLayer) {
52
54
 
53
55
  (0, _createClass2.default)(PolygonLayer, [{
54
56
  key: "buildModels",
55
- value: function buildModels() {
56
- var _this2 = this;
57
-
58
- var shape = this.getModelType();
59
- this.layerModel = new _models.default[shape](this);
60
- this.layerModel.initModels(function (models) {
61
- _this2.dispatchModelLoad(models);
62
- });
63
- }
64
- }, {
65
- key: "rebuildModels",
66
- value: function rebuildModels() {
67
- var _this3 = this;
57
+ value: function () {
58
+ var _buildModels = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
59
+ var shape;
60
+ return _regenerator.default.wrap(function _callee$(_context) {
61
+ while (1) {
62
+ switch (_context.prev = _context.next) {
63
+ case 0:
64
+ shape = this.getModelType();
65
+ this.layerModel = new _models.default[shape](this);
66
+ _context.next = 4;
67
+ return this.initLayerModels();
68
+
69
+ case 4:
70
+ case "end":
71
+ return _context.stop();
72
+ }
73
+ }
74
+ }, _callee, this);
75
+ }));
76
+
77
+ function buildModels() {
78
+ return _buildModels.apply(this, arguments);
79
+ }
68
80
 
69
- this.layerModel.buildModels(function (models) {
70
- _this3.dispatchModelLoad(models);
71
- });
72
- }
81
+ return buildModels;
82
+ }()
73
83
  }, {
74
84
  key: "getModelType",
75
85
  value: function getModelType() {
76
86
  var _shapeAttribute$scale;
77
87
 
78
- var parserType = this.layerSource.getParserType();
79
-
80
- if ((0, _utils.isVectorTile)(parserType)) {
81
- return 'vectorpolygon';
82
- }
83
-
84
88
  var shapeAttribute = this.styleAttributeService.getLayerStyleAttribute('shape');
85
89
  var shape = shapeAttribute === null || shapeAttribute === void 0 ? void 0 : (_shapeAttribute$scale = shapeAttribute.scale) === null || _shapeAttribute$scale === void 0 ? void 0 : _shapeAttribute$scale.field;
86
90
 
@@ -7,8 +7,12 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.default = void 0;
9
9
 
10
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
11
+
10
12
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
13
 
14
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
15
+
12
16
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
13
17
 
14
18
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
@@ -34,19 +38,19 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
34
38
  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; } }
35
39
 
36
40
  /* babel-plugin-inline-import '../shaders/extrude/polygon_extrude_frag.glsl' */
37
- var polygonExtrudeFrag = "uniform float u_opacity: 1.0;\nuniform vec4 u_sourceColor;\nuniform vec4 u_targetColor;\nuniform float u_linearColor: 0;\n\nuniform float u_topsurface: 1.0;\nuniform float u_sidesurface: 1.0;\n\nvarying vec4 v_Color;\nvarying mat4 styleMappingMat; // \u4F20\u9012\u4ECE\u7247\u5143\u4E2D\u4F20\u9012\u7684\u6620\u5C04\u6570\u636E\n#pragma include \"picking\"\n\nvoid main() {\n float opacity = styleMappingMat[0][0]; \n float isSide = styleMappingMat[0][3];\n float sidey = styleMappingMat[3][0];\n float lightWeight = styleMappingMat[3][1];\n\n // Tip: \u90E8\u5206\u673A\u578B GPU \u8BA1\u7B97\u7CBE\u5EA6\u517C\u5BB9\n if(isSide < 0.999) {\n // side face\n if(u_sidesurface < 1.0) {\n discard;\n }\n\n if(u_linearColor == 1.0) {\n vec4 linearColor = mix(u_targetColor, u_sourceColor, sidey);\n linearColor.rgb *= lightWeight;\n gl_FragColor = linearColor;\n } else {\n gl_FragColor = v_Color;\n }\n\n } else {\n // top face\n if(u_topsurface < 1.0) {\n discard;\n }\n\n gl_FragColor = v_Color;\n }\n\n gl_FragColor.a *= opacity;\n gl_FragColor = filterColor(gl_FragColor);\n}\n"; // extrude
41
+ var polygonExtrudeFrag = "uniform float u_opacity: 1.0;\nuniform vec4 u_sourceColor;\nuniform vec4 u_targetColor;\nuniform float u_linearColor: 0;\n\nuniform float u_topsurface: 1.0;\nuniform float u_sidesurface: 1.0;\n\nvarying vec4 v_Color;\nvarying mat4 styleMappingMat; // \u4F20\u9012\u4ECE\u7247\u5143\u4E2D\u4F20\u9012\u7684\u6620\u5C04\u6570\u636E\n#pragma include \"picking\"\n\nvoid main() {\n float opacity = styleMappingMat[0][0]; \n float isSide = styleMappingMat[0][3];\n float sidey = styleMappingMat[3][0];\n float lightWeight = styleMappingMat[3][1];\n\n if(isSide < 1.0) {\n // side face\n if(u_sidesurface < 1.0) {\n discard;\n }\n\n if(u_linearColor == 1.0) {\n vec4 linearColor = mix(u_targetColor, u_sourceColor, sidey);\n linearColor.rgb *= lightWeight;\n gl_FragColor = linearColor;\n } else {\n gl_FragColor = v_Color;\n }\n\n } else {\n // top face\n if(u_topsurface < 1.0) {\n discard;\n }\n\n gl_FragColor = v_Color;\n }\n\n gl_FragColor.a *= opacity;\n gl_FragColor = filterColor(gl_FragColor);\n}\n"; // extrude
38
42
 
39
43
  /* babel-plugin-inline-import '../shaders/extrude/polygon_extrude_vert.glsl' */
40
44
  var polygonExtrudeVert = "precision highp float;\n\n#define ambientRatio 0.5\n#define diffuseRatio 0.3\n#define specularRatio 0.2\n\nattribute vec4 a_Color;\nattribute vec3 a_Position;\nattribute vec3 a_Normal;\nattribute float a_Size;\nattribute vec3 a_uvs;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\n\nvarying vec4 v_Color;\nuniform float u_heightfixed: 0.0; // \u9ED8\u8BA4\u4E0D\u56FA\u5B9A\nuniform float u_raisingHeight: 0.0;\nuniform float u_opacity: 1.0;\nvarying mat4 styleMappingMat; // \u7528\u4E8E\u5C06\u5728\u9876\u70B9\u7740\u8272\u5668\u4E2D\u8BA1\u7B97\u597D\u7684\u6837\u5F0F\u503C\u4F20\u9012\u7ED9\u7247\u5143\n\n#pragma include \"styleMapping\"\n#pragma include \"styleMappingCalOpacity\"\n\n#pragma include \"projection\"\n#pragma include \"light\"\n#pragma include \"picking\"\n\nvoid main() {\n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\n styleMappingMat = mat4(\n 0.0, 0.0, 0.0, 0.0, // opacity - strokeOpacity - strokeWidth - isSide\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 // sidey\n );\n styleMappingMat[0][3] = a_Position.z;\n styleMappingMat[3][0] = a_uvs[2];\n\n float rowCount = u_cellTypeLayout[0][0]; // \u5F53\u524D\u7684\u6570\u636E\u7EB9\u7406\u6709\u51E0\u884C\n float columnCount = u_cellTypeLayout[0][1]; // \u5F53\u770B\u5230\u6570\u636E\u7EB9\u7406\u6709\u51E0\u5217\n float columnWidth = 1.0/columnCount; // \u5217\u5BBD\n float rowHeight = 1.0/rowCount; // \u884C\u9AD8\n float cellCount = calCellCount(); // opacity - strokeOpacity - strokeWidth - stroke - offsets\n float id = a_vertexId; // \u7B2Cn\u4E2A\u9876\u70B9\n float cellCurrentRow = floor(id * cellCount / columnCount) + 1.0; // \u8D77\u59CB\u70B9\u5728\u7B2C\u51E0\u884C\n float cellCurrentColumn = mod(id * cellCount, columnCount) + 1.0; // \u8D77\u59CB\u70B9\u5728\u7B2C\u51E0\u5217\n \n // cell \u56FA\u5B9A\u987A\u5E8F opacity -> strokeOpacity -> strokeWidth -> stroke ... \n // \u6309\u987A\u5E8F\u4ECE cell \u4E2D\u53D6\u503C\u3001\u82E5\u6CA1\u6709\u5219\u81EA\u52A8\u5F80\u4E0B\u53D6\u503C\n float textureOffset = 0.0; // \u5728 cell \u4E2D\u53D6\u503C\u7684\u504F\u79FB\u91CF\n\n vec2 opacityAndOffset = calOpacityAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);\n styleMappingMat[0][0] = opacityAndOffset.r;\n textureOffset = opacityAndOffset.g;\n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\n\n vec4 pos = vec4(a_Position.xy, a_Position.z * a_Size, 1.0);\n vec4 project_pos = project_position(pos);\n\n if(u_heightfixed > 0.0) { // \u5224\u65AD\u51E0\u4F55\u4F53\u662F\u5426\u56FA\u5B9A\u9AD8\u5EA6\n project_pos.z = a_Position.z * a_Size;\n project_pos.z += u_raisingHeight;\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 project_pos.z *= mapboxZoomScale;\n project_pos.z += u_raisingHeight * mapboxZoomScale;\n }\n }\n\n // project_pos.z += 500000.0; // amap1\n\n // project_pos.z += (500000.0 * 4.0)/pow(2.0, 21.0 - u_Zoom); // mapbox\n // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n // gl_Position = u_Mvp * (vec4(project_pos.xyz * vec3(1.0, 1.0, -1.0), 1.0));\n gl_Position = u_Mvp * (vec4(project_pos.xyz, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n }\n\n float lightWeight = calc_lighting(pos);\n // v_Color = a_Color;\n v_Color = vec4(a_Color.rgb * lightWeight, a_Color.w);\n\n styleMappingMat[3][1] = lightWeight;\n\n setPickingColor(a_PickingColor);\n}\n";
41
45
 
42
46
  /* babel-plugin-inline-import '../shaders/extrude/polygon_extrudetex_frag.glsl' */
43
- var polygonExtrudeTexFrag = "uniform sampler2D u_texture;\nuniform float u_opacity: 1.0;\nuniform vec4 u_sourceColor;\nuniform vec4 u_targetColor;\nuniform float u_linearColor: 0;\n\nuniform float u_topsurface: 1.0;\nuniform float u_sidesurface: 1.0;\n\nvarying vec4 v_Color;\nvarying mat4 styleMappingMat; // \u4F20\u9012\u4ECE\u7247\u5143\u4E2D\u4F20\u9012\u7684\u6620\u5C04\u6570\u636E\n#pragma include \"picking\"\n\nvoid main() {\n float opacity = styleMappingMat[0][0];\n float isSide = styleMappingMat[0][3];\n float lightWeight = styleMappingMat[3][1];\n float topU = styleMappingMat[2][2];\n float topV = styleMappingMat[2][3];\n\n float sidey = styleMappingMat[3][0];\n // Tip: \u90E8\u5206\u673A\u578B GPU \u8BA1\u7B97\u7CBE\u5EA6\u517C\u5BB9\n if(isSide < 0.999) {\n // side face\n if(u_sidesurface < 1.0) {\n discard;\n }\n\n if(u_linearColor == 1.0) {\n vec4 linearColor = mix(u_targetColor, u_sourceColor, sidey);\n linearColor.rgb *= lightWeight;\n gl_FragColor = linearColor;\n } else {\n gl_FragColor = v_Color;\n }\n } else {\n\n // top face\n if(u_topsurface < 1.0) {\n discard;\n }\n\n gl_FragColor = texture2D(u_texture, vec2(topU, topV));\n }\n \n\n gl_FragColor.a *= opacity;\n gl_FragColor = filterColor(gl_FragColor);\n}\n"; // texture
47
+ var polygonExtrudeTexFrag = "uniform sampler2D u_texture;\nuniform float u_opacity: 1.0;\nuniform vec4 u_sourceColor;\nuniform vec4 u_targetColor;\nuniform float u_linearColor: 0;\n\nuniform float u_topsurface: 1.0;\nuniform float u_sidesurface: 1.0;\n\nvarying vec4 v_Color;\nvarying mat4 styleMappingMat; // \u4F20\u9012\u4ECE\u7247\u5143\u4E2D\u4F20\u9012\u7684\u6620\u5C04\u6570\u636E\n#pragma include \"picking\"\n\nvoid main() {\n float opacity = styleMappingMat[0][0];\n float isSide = styleMappingMat[0][3];\n float lightWeight = styleMappingMat[3][1];\n float topU = styleMappingMat[2][2];\n float topV = styleMappingMat[2][3];\n\n float sidey = styleMappingMat[3][0];\n if(isSide < 1.0) {\n // side face\n if(u_sidesurface < 1.0) {\n discard;\n }\n\n if(u_linearColor == 1.0) {\n vec4 linearColor = mix(u_targetColor, u_sourceColor, sidey);\n linearColor.rgb *= lightWeight;\n gl_FragColor = linearColor;\n } else {\n gl_FragColor = v_Color;\n }\n } else {\n\n // top face\n if(u_topsurface < 1.0) {\n discard;\n }\n\n gl_FragColor = texture2D(u_texture, vec2(topU, topV));\n }\n \n\n gl_FragColor.a *= opacity;\n gl_FragColor = filterColor(gl_FragColor);\n}\n"; // texture
44
48
 
45
49
  /* babel-plugin-inline-import '../shaders/extrude/polygon_extrudetex_vert.glsl' */
46
50
  var polygonExtrudeTexVert = "precision highp float;\n\n#define ambientRatio 0.5\n#define diffuseRatio 0.3\n#define specularRatio 0.2\n\nattribute vec4 a_Color;\nattribute vec3 a_Position;\nattribute vec3 a_Normal;\nattribute float a_Size;\nattribute vec3 a_uvs;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\n\nvarying vec4 v_Color;\nuniform float u_heightfixed: 0.0; // \u9ED8\u8BA4\u4E0D\u56FA\u5B9A\nuniform float u_raisingHeight: 0.0;\nuniform float u_opacity: 1.0;\nvarying mat4 styleMappingMat; // \u7528\u4E8E\u5C06\u5728\u9876\u70B9\u7740\u8272\u5668\u4E2D\u8BA1\u7B97\u597D\u7684\u6837\u5F0F\u503C\u4F20\u9012\u7ED9\u7247\u5143\n\n#pragma include \"styleMapping\"\n#pragma include \"styleMappingCalOpacity\"\n\n#pragma include \"projection\"\n#pragma include \"light\"\n#pragma include \"picking\"\n\nvoid main() {\n v_Color = a_Color;\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 - a_Position.z(judge side by a_Position.z)\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] - u - v\n 0.0, 0.0, 0.0, 0.0 // sidey\n );\n \n styleMappingMat[0][3] = a_Position.z;\n styleMappingMat[2][2] = a_uvs[0];\n styleMappingMat[2][3] = 1.0 - a_uvs[1];\n styleMappingMat[3][0] = a_uvs[2];\n\n\n float rowCount = u_cellTypeLayout[0][0]; // \u5F53\u524D\u7684\u6570\u636E\u7EB9\u7406\u6709\u51E0\u884C\n float columnCount = u_cellTypeLayout[0][1]; // \u5F53\u770B\u5230\u6570\u636E\u7EB9\u7406\u6709\u51E0\u5217\n float columnWidth = 1.0/columnCount; // \u5217\u5BBD\n float rowHeight = 1.0/rowCount; // \u884C\u9AD8\n float cellCount = calCellCount(); // opacity - strokeOpacity - strokeWidth - stroke - offsets\n float id = a_vertexId; // \u7B2Cn\u4E2A\u9876\u70B9\n float cellCurrentRow = floor(id * cellCount / columnCount) + 1.0; // \u8D77\u59CB\u70B9\u5728\u7B2C\u51E0\u884C\n float cellCurrentColumn = mod(id * cellCount, columnCount) + 1.0; // \u8D77\u59CB\u70B9\u5728\u7B2C\u51E0\u5217\n \n // cell \u56FA\u5B9A\u987A\u5E8F opacity -> strokeOpacity -> strokeWidth -> stroke ... \n // \u6309\u987A\u5E8F\u4ECE cell \u4E2D\u53D6\u503C\u3001\u82E5\u6CA1\u6709\u5219\u81EA\u52A8\u5F80\u4E0B\u53D6\u503C\n float textureOffset = 0.0; // \u5728 cell \u4E2D\u53D6\u503C\u7684\u504F\u79FB\u91CF\n\n vec2 opacityAndOffset = calOpacityAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);\n styleMappingMat[0][0] = opacityAndOffset.r;\n textureOffset = opacityAndOffset.g;\n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\n\n vec4 pos = vec4(a_Position.xy, a_Position.z * a_Size, 1.0);\n vec4 project_pos = project_position(pos);\n\n if(u_heightfixed > 0.0) { // \u5224\u65AD\u51E0\u4F55\u4F53\u662F\u5426\u56FA\u5B9A\u9AD8\u5EA6\n project_pos.z = a_Position.z * a_Size;\n project_pos.z += u_raisingHeight;\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 project_pos.z *= mapboxZoomScale;\n project_pos.z += u_raisingHeight * mapboxZoomScale;\n }\n }\n\n // project_pos.z += 500000.0; // amap1\n\n // project_pos.z += (500000.0 * 4.0)/pow(2.0, 21.0 - u_Zoom); // mapbox\n // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n // gl_Position = u_Mvp * (vec4(project_pos.xyz * vec3(1.0, 1.0, -1.0), 1.0));\n gl_Position = u_Mvp * (vec4(project_pos.xyz, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n }\n\n float lightWeight = calc_lighting(pos);\n styleMappingMat[3][1] = lightWeight;\n\n setPickingColor(a_PickingColor);\n}\n"; // extrude picking
47
51
 
48
52
  /* babel-plugin-inline-import '../shaders/extrude/polygon_extrude_picklight_frag.glsl' */
49
- var polygonExtrudePickLightFrag = "uniform float u_opacity: 1.0;\nuniform vec4 u_sourceColor;\nuniform vec4 u_targetColor;\nuniform float u_linearColor: 0;\n\nuniform float u_topsurface: 1.0;\nuniform float u_sidesurface: 1.0;\n\nvarying vec4 v_Color;\nvarying mat4 styleMappingMat; // \u4F20\u9012\u4ECE\u7247\u5143\u4E2D\u4F20\u9012\u7684\u6620\u5C04\u6570\u636E\n#pragma include \"picking\"\n\nvoid main() {\n float opacity = styleMappingMat[0][0];\n float isSide = styleMappingMat[0][3];\n float sidey = styleMappingMat[3][0];\n float lightWeight = styleMappingMat[3][1];\n\n // Tip: \u90E8\u5206\u673A\u578B GPU \u8BA1\u7B97\u7CBE\u5EA6\u517C\u5BB9\n if(isSide < 0.999) {\n // side face\n if(u_sidesurface < 1.0) {\n discard;\n }\n \n if( u_linearColor == 1.0) {\n // side use linear\n vec4 linearColor = mix(u_targetColor, u_sourceColor, sidey);\n linearColor.rgb *= lightWeight;\n gl_FragColor = linearColor;\n } else {\n // side notuse linear\n gl_FragColor = v_Color;\n }\n } else {\n // top face\n if(u_topsurface < 1.0) {\n discard;\n }\n gl_FragColor = v_Color;\n }\n\n gl_FragColor.a *= opacity;\n gl_FragColor = filterColorAlpha(gl_FragColor, lightWeight);\n}\n";
53
+ var polygonExtrudePickLightFrag = "uniform float u_opacity: 1.0;\nuniform vec4 u_sourceColor;\nuniform vec4 u_targetColor;\nuniform float u_linearColor: 0;\n\nuniform float u_topsurface: 1.0;\nuniform float u_sidesurface: 1.0;\n\nvarying vec4 v_Color;\nvarying mat4 styleMappingMat; // \u4F20\u9012\u4ECE\u7247\u5143\u4E2D\u4F20\u9012\u7684\u6620\u5C04\u6570\u636E\n#pragma include \"picking\"\n\nvoid main() {\n float opacity = styleMappingMat[0][0];\n float isSide = styleMappingMat[0][3];\n float sidey = styleMappingMat[3][0];\n float lightWeight = styleMappingMat[3][1];\n\n if(isSide < 1.0) {\n // side face\n if(u_sidesurface < 1.0) {\n discard;\n }\n \n if( u_linearColor == 1.0) {\n // side use linear\n vec4 linearColor = mix(u_targetColor, u_sourceColor, sidey);\n linearColor.rgb *= lightWeight;\n gl_FragColor = linearColor;\n } else {\n // side notuse linear\n gl_FragColor = v_Color;\n }\n } else {\n // top face\n if(u_topsurface < 1.0) {\n discard;\n }\n gl_FragColor = v_Color;\n }\n\n gl_FragColor.a *= opacity;\n gl_FragColor = filterColorAlpha(gl_FragColor, lightWeight);\n}\n";
50
54
 
51
55
  /* babel-plugin-inline-import '../shaders/extrude/polygon_extrude_picklight_vert.glsl' */
52
56
  var polygonExtrudePickLightVert = "precision highp float;\n\n#define ambientRatio 0.5\n#define diffuseRatio 0.3\n#define specularRatio 0.2\n\nattribute vec4 a_Color;\nattribute vec3 a_Position;\nattribute vec3 a_Normal;\nattribute float a_Size;\nattribute vec3 a_uvs;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\n\nvarying vec4 v_Color;\nuniform float u_heightfixed: 0.0; // \u9ED8\u8BA4\u4E0D\u56FA\u5B9A\nuniform float u_raisingHeight: 0.0;\nuniform float u_opacity: 1.0;\nvarying mat4 styleMappingMat; // \u7528\u4E8E\u5C06\u5728\u9876\u70B9\u7740\u8272\u5668\u4E2D\u8BA1\u7B97\u597D\u7684\u6837\u5F0F\u503C\u4F20\u9012\u7ED9\u7247\u5143\n\n#pragma include \"styleMapping\"\n#pragma include \"styleMappingCalOpacity\"\n\n#pragma include \"projection\"\n#pragma include \"light\"\n#pragma include \"picking\"\n\nvoid main() {\n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\n styleMappingMat = mat4(\n 0.0, 0.0, 0.0, 0.0, // opacity - strokeOpacity - strokeWidth - isSide\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 // sidey\n );\n styleMappingMat[0][3] = a_Position.z;\n styleMappingMat[3][0] = a_uvs[2];\n\n float rowCount = u_cellTypeLayout[0][0]; // \u5F53\u524D\u7684\u6570\u636E\u7EB9\u7406\u6709\u51E0\u884C\n float columnCount = u_cellTypeLayout[0][1]; // \u5F53\u770B\u5230\u6570\u636E\u7EB9\u7406\u6709\u51E0\u5217\n float columnWidth = 1.0/columnCount; // \u5217\u5BBD\n float rowHeight = 1.0/rowCount; // \u884C\u9AD8\n float cellCount = calCellCount(); // opacity - strokeOpacity - strokeWidth - stroke - offsets\n float id = a_vertexId; // \u7B2Cn\u4E2A\u9876\u70B9\n float cellCurrentRow = floor(id * cellCount / columnCount) + 1.0; // \u8D77\u59CB\u70B9\u5728\u7B2C\u51E0\u884C\n float cellCurrentColumn = mod(id * cellCount, columnCount) + 1.0; // \u8D77\u59CB\u70B9\u5728\u7B2C\u51E0\u5217\n \n // cell \u56FA\u5B9A\u987A\u5E8F opacity -> strokeOpacity -> strokeWidth -> stroke ... \n // \u6309\u987A\u5E8F\u4ECE cell \u4E2D\u53D6\u503C\u3001\u82E5\u6CA1\u6709\u5219\u81EA\u52A8\u5F80\u4E0B\u53D6\u503C\n float textureOffset = 0.0; // \u5728 cell \u4E2D\u53D6\u503C\u7684\u504F\u79FB\u91CF\n\n vec2 opacityAndOffset = calOpacityAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);\n styleMappingMat[0][0] = opacityAndOffset.r;\n textureOffset = opacityAndOffset.g;\n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\n vec4 pos = vec4(a_Position.xy, a_Position.z * a_Size, 1.0);\n vec4 project_pos = project_position(pos);\n\n if(u_heightfixed > 0.0) { // \u5224\u65AD\u51E0\u4F55\u4F53\u662F\u5426\u56FA\u5B9A\u9AD8\u5EA6\n project_pos.z = a_Position.z * a_Size;\n project_pos.z += u_raisingHeight;\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 project_pos.z *= mapboxZoomScale;\n project_pos.z += u_raisingHeight * mapboxZoomScale;\n }\n }\n\n // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n // gl_Position = u_Mvp * (vec4(project_pos.xyz * vec3(1.0, 1.0, -1.0), 1.0));\n gl_Position = u_Mvp * (vec4(project_pos.xyz, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n }\n\n float lightWeight = calc_lighting(pos);\n // v_Color = a_Color;\n v_Color = vec4(a_Color.rgb * lightWeight, a_Color.w);\n\n styleMappingMat[3][1] = lightWeight;\n\n setPickingColor(a_PickingColor);\n}\n";
@@ -141,37 +145,72 @@ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
141
145
  }
142
146
  }, {
143
147
  key: "initModels",
144
- value: function initModels(callbackModel) {
145
- this.loadTexture();
146
- this.buildModels(callbackModel);
147
- }
148
+ value: function () {
149
+ var _initModels = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
150
+ return _regenerator.default.wrap(function _callee$(_context) {
151
+ while (1) {
152
+ switch (_context.prev = _context.next) {
153
+ case 0:
154
+ this.loadTexture();
155
+ _context.next = 3;
156
+ return this.buildModels();
157
+
158
+ case 3:
159
+ return _context.abrupt("return", _context.sent);
160
+
161
+ case 4:
162
+ case "end":
163
+ return _context.stop();
164
+ }
165
+ }
166
+ }, _callee, this);
167
+ }));
168
+
169
+ function initModels() {
170
+ return _initModels.apply(this, arguments);
171
+ }
172
+
173
+ return initModels;
174
+ }()
148
175
  }, {
149
176
  key: "buildModels",
150
- value: function buildModels(callbackModel) {
151
- var _ref2 = this.layer.getLayerConfig(),
152
- _ref2$mask = _ref2.mask,
153
- mask = _ref2$mask === void 0 ? false : _ref2$mask,
154
- _ref2$maskInside = _ref2.maskInside,
155
- maskInside = _ref2$maskInside === void 0 ? true : _ref2$maskInside;
156
-
157
- var _this$getShaders = this.getShaders(),
158
- frag = _this$getShaders.frag,
159
- vert = _this$getShaders.vert,
160
- type = _this$getShaders.type;
161
-
162
- this.layer.buildLayerModel({
163
- moduleName: type,
164
- vertexShader: vert,
165
- fragmentShader: frag,
166
- triangulation: _triangulation.PolygonExtrudeTriangulation,
167
- stencil: (0, _l7Utils.getMask)(mask, maskInside)
168
- }).then(function (model) {
169
- callbackModel([model]);
170
- }).catch(function (err) {
171
- console.warn(err);
172
- callbackModel([]);
173
- });
174
- }
177
+ value: function () {
178
+ var _buildModels = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
179
+ var _ref2, _ref2$mask, mask, _ref2$maskInside, maskInside, _this$getShaders, frag, vert, type, model;
180
+
181
+ return _regenerator.default.wrap(function _callee2$(_context2) {
182
+ while (1) {
183
+ switch (_context2.prev = _context2.next) {
184
+ case 0:
185
+ _ref2 = this.layer.getLayerConfig(), _ref2$mask = _ref2.mask, mask = _ref2$mask === void 0 ? false : _ref2$mask, _ref2$maskInside = _ref2.maskInside, maskInside = _ref2$maskInside === void 0 ? true : _ref2$maskInside;
186
+ _this$getShaders = this.getShaders(), frag = _this$getShaders.frag, vert = _this$getShaders.vert, type = _this$getShaders.type;
187
+ _context2.next = 4;
188
+ return this.layer.buildLayerModel({
189
+ moduleName: type,
190
+ vertexShader: vert,
191
+ fragmentShader: frag,
192
+ triangulation: _triangulation.PolygonExtrudeTriangulation,
193
+ stencil: (0, _l7Utils.getMask)(mask, maskInside)
194
+ });
195
+
196
+ case 4:
197
+ model = _context2.sent;
198
+ return _context2.abrupt("return", [model]);
199
+
200
+ case 6:
201
+ case "end":
202
+ return _context2.stop();
203
+ }
204
+ }
205
+ }, _callee2, this);
206
+ }));
207
+
208
+ function buildModels() {
209
+ return _buildModels.apply(this, arguments);
210
+ }
211
+
212
+ return buildModels;
213
+ }()
175
214
  }, {
176
215
  key: "getShaders",
177
216
  value: function getShaders() {