@antv/l7-layers 2.25.7 → 2.25.9
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.
- package/es/canvas/index.d.ts +18 -0
- package/es/canvas/index.js +70 -0
- package/es/canvas/models/canvas.d.ts +23 -0
- package/es/canvas/models/canvas.js +141 -0
- package/es/canvas/models/constants.d.ts +2 -0
- package/es/canvas/models/constants.js +6 -0
- package/es/canvas/models/index.d.ts +2 -0
- package/es/canvas/models/index.js +2 -0
- package/es/citybuilding/building.d.ts +7 -0
- package/es/citybuilding/building.js +25 -0
- package/es/citybuilding/models/build.d.ts +33 -0
- package/es/citybuilding/models/build.js +160 -0
- package/es/citybuilding/shaders/build_frag.glsl +123 -0
- package/es/citybuilding/shaders/build_vert.glsl +58 -0
- package/es/core/BaseLayer.d.ts +265 -0
- package/es/core/BaseLayer.js +1310 -0
- package/es/core/BaseModel.d.ts +95 -0
- package/es/core/BaseModel.js +367 -0
- package/es/core/CommonStyleAttribute.d.ts +16 -0
- package/es/core/CommonStyleAttribute.js +114 -0
- package/es/core/LayerPickService.d.ts +12 -0
- package/es/core/LayerPickService.js +102 -0
- package/es/core/TextureService.d.ts +15 -0
- package/es/core/TextureService.js +65 -0
- package/es/core/constant.d.ts +6 -0
- package/es/core/constant.js +19 -0
- package/es/core/interface.d.ts +284 -0
- package/es/core/interface.js +32 -0
- package/es/core/line_trangluation.d.ts +19 -0
- package/es/core/line_trangluation.js +86 -0
- package/es/core/schema.d.ts +27 -0
- package/es/core/schema.js +25 -0
- package/es/core/shape/Path.d.ts +40 -0
- package/es/core/shape/Path.js +69 -0
- package/es/core/shape/arrow.d.ts +25 -0
- package/es/core/shape/arrow.js +144 -0
- package/es/core/shape/extrude.d.ts +17 -0
- package/es/core/shape/extrude.js +133 -0
- package/es/core/triangulation.d.ts +136 -0
- package/es/core/triangulation.js +601 -0
- package/es/core/utils.d.ts +5 -0
- package/es/core/utils.js +36 -0
- package/es/earth/index.d.ts +22 -0
- package/es/earth/index.js +54 -0
- package/es/earth/models/atmosphere.d.ts +30 -0
- package/es/earth/models/atmosphere.js +116 -0
- package/es/earth/models/base.d.ts +37 -0
- package/es/earth/models/base.js +172 -0
- package/es/earth/models/bloomsphere.d.ts +30 -0
- package/es/earth/models/bloomsphere.js +115 -0
- package/es/earth/shaders/atmosphere/atmosphere_frag.glsl +17 -0
- package/es/earth/shaders/atmosphere/atmosphere_vert.glsl +24 -0
- package/es/earth/shaders/base/base_frag.glsl +11 -0
- package/es/earth/shaders/base/base_vert.glsl +52 -0
- package/es/earth/shaders/bloomshpere/bloomsphere_frag.glsl +15 -0
- package/es/earth/shaders/bloomshpere/bloomsphere_vert.glsl +20 -0
- package/es/earth/utils.d.ts +26 -0
- package/es/earth/utils.js +99 -0
- package/es/geometry/index.d.ts +22 -0
- package/es/geometry/index.js +53 -0
- package/es/geometry/models/billboard.d.ts +39 -0
- package/es/geometry/models/billboard.js +175 -0
- package/es/geometry/models/index.d.ts +5 -0
- package/es/geometry/models/index.js +9 -0
- package/es/geometry/models/plane.d.ts +58 -0
- package/es/geometry/models/plane.js +308 -0
- package/es/geometry/models/sprite.d.ts +48 -0
- package/es/geometry/models/sprite.js +225 -0
- package/es/geometry/shaders/billboard_frag.glsl +18 -0
- package/es/geometry/shaders/billboard_vert.glsl +43 -0
- package/es/geometry/shaders/plane_frag.glsl +23 -0
- package/es/geometry/shaders/plane_vert.glsl +31 -0
- package/es/geometry/shaders/sprite_frag.glsl +23 -0
- package/es/geometry/shaders/sprite_vert.glsl +21 -0
- package/es/heatmap/index.d.ts +13 -0
- package/es/heatmap/index.js +87 -0
- package/es/heatmap/models/grid.d.ts +29 -0
- package/es/heatmap/models/grid.js +83 -0
- package/es/heatmap/models/grid3d.d.ts +31 -0
- package/es/heatmap/models/grid3d.js +122 -0
- package/es/heatmap/models/heatmap.d.ts +46 -0
- package/es/heatmap/models/heatmap.js +447 -0
- package/es/heatmap/models/hexagon.d.ts +29 -0
- package/es/heatmap/models/hexagon.js +83 -0
- package/es/heatmap/models/index.d.ts +5 -0
- package/es/heatmap/models/index.js +12 -0
- package/es/heatmap/shaders/grid/grid_frag.glsl +9 -0
- package/es/heatmap/shaders/grid/grid_vert.glsl +30 -0
- package/es/heatmap/shaders/grid3d/grid_3d_frag.glsl +17 -0
- package/es/heatmap/shaders/grid3d/grid_3d_vert.glsl +34 -0
- package/es/heatmap/shaders/heatmap/heatmap_3d_frag.glsl +23 -0
- package/es/heatmap/shaders/heatmap/heatmap_3d_vert.glsl +59 -0
- package/es/heatmap/shaders/heatmap/heatmap_frag.glsl +40 -0
- package/es/heatmap/shaders/heatmap/heatmap_framebuffer_frag.glsl +17 -0
- package/es/heatmap/shaders/heatmap/heatmap_framebuffer_vert.glsl +36 -0
- package/es/heatmap/shaders/heatmap/heatmap_vert.glsl +21 -0
- package/es/heatmap/shaders/hexagon/hexagon_frag.glsl +8 -0
- package/es/heatmap/shaders/hexagon/hexagon_vert.glsl +30 -0
- package/es/heatmap/triangulation.d.ts +5 -0
- package/es/heatmap/triangulation.js +33 -0
- package/es/image/index.d.ts +9 -0
- package/es/image/index.js +28 -0
- package/es/image/models/image.d.ts +31 -0
- package/es/image/models/image.js +113 -0
- package/es/image/models/index.d.ts +5 -0
- package/es/image/models/index.js +5 -0
- package/es/image/shaders/dataImage_frag.glsl +32 -0
- package/es/image/shaders/image_frag.glsl +38 -0
- package/es/image/shaders/image_vert.glsl +20 -0
- package/es/index.d.ts +18 -0
- package/es/index.js +18 -0
- package/es/line/index.d.ts +36 -0
- package/es/line/index.js +90 -0
- package/es/line/models/arc.d.ts +40 -0
- package/es/line/models/arc.js +279 -0
- package/es/line/models/arc_3d.d.ts +40 -0
- package/es/line/models/arc_3d.js +269 -0
- package/es/line/models/flow.d.ts +31 -0
- package/es/line/models/flow.js +140 -0
- package/es/line/models/great_circle.d.ts +34 -0
- package/es/line/models/great_circle.js +240 -0
- package/es/line/models/index.d.ts +5 -0
- package/es/line/models/index.js +18 -0
- package/es/line/models/line.d.ts +44 -0
- package/es/line/models/line.js +273 -0
- package/es/line/models/simple_line.d.ts +33 -0
- package/es/line/models/simple_line.js +118 -0
- package/es/line/models/wall.d.ts +34 -0
- package/es/line/models/wall.js +223 -0
- package/es/line/shaders/arc/line_arc_frag.glsl +92 -0
- package/es/line/shaders/arc/line_arc_vert.glsl +156 -0
- package/es/line/shaders/arc3d/line_arc_3d_frag.glsl +108 -0
- package/es/line/shaders/arc3d/line_arc_3d_vert.glsl +177 -0
- package/es/line/shaders/flow/flow_line_frag.glsl +13 -0
- package/es/line/shaders/flow/flow_line_vert.glsl +76 -0
- package/es/line/shaders/greatCircle/line_arc_great_circle_frag.glsl +99 -0
- package/es/line/shaders/greatCircle/line_arc_great_circle_vert.glsl +165 -0
- package/es/line/shaders/line/line_frag.glsl +122 -0
- package/es/line/shaders/line/line_vert.glsl +101 -0
- package/es/line/shaders/simple/simpleline_frag.glsl +30 -0
- package/es/line/shaders/simple/simpleline_vert.glsl +45 -0
- package/es/line/shaders/wall/wall_frag.glsl +94 -0
- package/es/line/shaders/wall/wall_vert.glsl +90 -0
- package/es/mask/index.d.ts +16 -0
- package/es/mask/index.js +21 -0
- package/es/mask/models/fill.d.ts +18 -0
- package/es/mask/models/fill.js +61 -0
- package/es/mask/models/index.d.ts +5 -0
- package/es/mask/models/index.js +5 -0
- package/es/mask/shaders/mask_vert.glsl +14 -0
- package/es/plugins/DataMappingPlugin.d.ts +12 -0
- package/es/plugins/DataMappingPlugin.js +226 -0
- package/es/plugins/DataSourcePlugin.d.ts +6 -0
- package/es/plugins/DataSourcePlugin.js +75 -0
- package/es/plugins/FeatureScalePlugin.d.ts +20 -0
- package/es/plugins/FeatureScalePlugin.js +295 -0
- package/es/plugins/LayerAnimateStylePlugin.d.ts +4 -0
- package/es/plugins/LayerAnimateStylePlugin.js +14 -0
- package/es/plugins/LayerMaskPlugin.d.ts +7 -0
- package/es/plugins/LayerMaskPlugin.js +19 -0
- package/es/plugins/LayerModelPlugin.d.ts +10 -0
- package/es/plugins/LayerModelPlugin.js +60 -0
- package/es/plugins/LayerStylePlugin.d.ts +7 -0
- package/es/plugins/LayerStylePlugin.js +18 -0
- package/es/plugins/LightingPlugin.d.ts +35 -0
- package/es/plugins/LightingPlugin.js +84 -0
- package/es/plugins/MultiPassRendererPlugin.d.ts +22 -0
- package/es/plugins/MultiPassRendererPlugin.js +52 -0
- package/es/plugins/PixelPickingPlugin.d.ts +11 -0
- package/es/plugins/PixelPickingPlugin.js +146 -0
- package/es/plugins/RegisterStyleAttributePlugin.d.ts +10 -0
- package/es/plugins/RegisterStyleAttributePlugin.js +72 -0
- package/es/plugins/ShaderUniformPlugin.d.ts +17 -0
- package/es/plugins/ShaderUniformPlugin.js +196 -0
- package/es/plugins/UpdateModelPlugin.d.ts +7 -0
- package/es/plugins/UpdateModelPlugin.js +20 -0
- package/es/plugins/UpdateStyleAttributePlugin.d.ts +9 -0
- package/es/plugins/UpdateStyleAttributePlugin.js +54 -0
- package/es/plugins/index.d.ts +15 -0
- package/es/plugins/index.js +18 -0
- package/es/point/index.d.ts +35 -0
- package/es/point/index.js +153 -0
- package/es/point/models/billboard_point.d.ts +35 -0
- package/es/point/models/billboard_point.js +95 -0
- package/es/point/models/earthExtrude.d.ts +32 -0
- package/es/point/models/earthExtrude.js +199 -0
- package/es/point/models/earthFill.d.ts +31 -0
- package/es/point/models/earthFill.js +158 -0
- package/es/point/models/extrude.d.ts +32 -0
- package/es/point/models/extrude.js +195 -0
- package/es/point/models/fill.d.ts +47 -0
- package/es/point/models/fill.js +180 -0
- package/es/point/models/fillImage.d.ts +42 -0
- package/es/point/models/fillImage.js +189 -0
- package/es/point/models/image.d.ts +48 -0
- package/es/point/models/image.js +293 -0
- package/es/point/models/index.d.ts +5 -0
- package/es/point/models/index.js +24 -0
- package/es/point/models/normal.d.ts +36 -0
- package/es/point/models/normal.js +89 -0
- package/es/point/models/radar.d.ts +37 -0
- package/es/point/models/radar.js +115 -0
- package/es/point/models/text.d.ts +85 -0
- package/es/point/models/text.js +503 -0
- package/es/point/shaders/billboard/billboard_point_frag.glsl +48 -0
- package/es/point/shaders/billboard/billboard_point_vert.glsl +33 -0
- package/es/point/shaders/earthExtrude/earthExtrude_frag.glsl +36 -0
- package/es/point/shaders/earthExtrude/earthExtrude_vert.glsl +118 -0
- package/es/point/shaders/earthFill/earthFill_frag.glsl +79 -0
- package/es/point/shaders/earthFill/earthFill_vert.glsl +46 -0
- package/es/point/shaders/extrude/extrude_frag.glsl +29 -0
- package/es/point/shaders/extrude/extrude_vert.glsl +95 -0
- package/es/point/shaders/fill/fill_frag.glsl +97 -0
- package/es/point/shaders/fill/fill_vert.glsl +79 -0
- package/es/point/shaders/fillImage/fillImage_frag.glsl +23 -0
- package/es/point/shaders/fillImage/fillImage_vert.glsl +46 -0
- package/es/point/shaders/image/image_frag.glsl +45 -0
- package/es/point/shaders/image/image_vert.glsl +47 -0
- package/es/point/shaders/normal/normal_frag.glsl +5 -0
- package/es/point/shaders/normal/normal_vert.glsl +22 -0
- package/es/point/shaders/radar/radar_frag.glsl +52 -0
- package/es/point/shaders/radar/radar_vert.glsl +53 -0
- package/es/point/shaders/text/text_frag.glsl +47 -0
- package/es/point/shaders/text/text_vert.glsl +65 -0
- package/es/point/shape/extrude.d.ts +15 -0
- package/es/point/shape/extrude.js +48 -0
- package/es/polygon/index.d.ts +18 -0
- package/es/polygon/index.js +71 -0
- package/es/polygon/models/extrude.d.ts +41 -0
- package/es/polygon/models/extrude.js +248 -0
- package/es/polygon/models/extrusion.d.ts +40 -0
- package/es/polygon/models/extrusion.js +137 -0
- package/es/polygon/models/fill.d.ts +32 -0
- package/es/polygon/models/fill.js +127 -0
- package/es/polygon/models/index.d.ts +5 -0
- package/es/polygon/models/index.js +26 -0
- package/es/polygon/models/ocean.d.ts +37 -0
- package/es/polygon/models/ocean.js +172 -0
- package/es/polygon/models/water.d.ts +35 -0
- package/es/polygon/models/water.js +150 -0
- package/es/polygon/shaders/extrude/polygon_extrude_frag.glsl +24 -0
- package/es/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +49 -0
- package/es/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +53 -0
- package/es/polygon/shaders/extrude/polygon_extrude_vert.glsl +74 -0
- package/es/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +55 -0
- package/es/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +54 -0
- package/es/polygon/shaders/extrusion/polygon_extrusion_frag.glsl +8 -0
- package/es/polygon/shaders/extrusion/polygon_extrusion_vert.glsl +24 -0
- package/es/polygon/shaders/fill/fill_frag.glsl +8 -0
- package/es/polygon/shaders/fill/fill_linear_frag.glsl +23 -0
- package/es/polygon/shaders/fill/fill_linear_vert.glsl +36 -0
- package/es/polygon/shaders/fill/fill_vert.glsl +35 -0
- package/es/polygon/shaders/ocean/ocean_frag.glsl +277 -0
- package/es/polygon/shaders/ocean/ocean_vert.glsl +21 -0
- package/es/polygon/shaders/water/polygon_water_frag.glsl +78 -0
- package/es/polygon/shaders/water/polygon_water_vert.glsl +22 -0
- package/es/raster/buffers/triangulation.d.ts +6 -0
- package/es/raster/buffers/triangulation.js +25 -0
- package/es/raster/index.d.ts +11 -0
- package/es/raster/index.js +55 -0
- package/es/raster/models/index.d.ts +5 -0
- package/es/raster/models/index.js +10 -0
- package/es/raster/models/raster.d.ts +35 -0
- package/es/raster/models/raster.js +156 -0
- package/es/raster/models/rasterRgb.d.ts +35 -0
- package/es/raster/models/rasterRgb.js +158 -0
- package/es/raster/models/rasterTerrainRgb.d.ts +30 -0
- package/es/raster/models/rasterTerrainRgb.js +118 -0
- package/es/raster/shaders/raster/raster_2d_frag.glsl +37 -0
- package/es/raster/shaders/raster/raster_2d_vert.glsl +21 -0
- package/es/raster/shaders/rgb/raster_rgb_frag.glsl +30 -0
- package/es/raster/shaders/rgb/raster_rgb_vert.glsl +21 -0
- package/es/raster/shaders/terrain/terrain_rgb_frag.glsl +40 -0
- package/es/raster/shaders/terrain/terrain_rgb_vert.glsl +19 -0
- package/es/shader/minify_frag.glsl +11 -0
- package/es/shader/minify_picking_frag.glsl +10 -0
- package/es/tile/core/BaseLayer.d.ts +50 -0
- package/es/tile/core/BaseLayer.js +256 -0
- package/es/tile/core/TileDebugLayer.d.ts +15 -0
- package/es/tile/core/TileDebugLayer.js +23 -0
- package/es/tile/interaction/getFeatureData.d.ts +0 -0
- package/es/tile/interaction/getFeatureData.js +0 -0
- package/es/tile/interaction/getRasterData.d.ts +4 -0
- package/es/tile/interaction/getRasterData.js +45 -0
- package/es/tile/interaction/utils.d.ts +11 -0
- package/es/tile/interaction/utils.js +69 -0
- package/es/tile/interface.d.ts +29 -0
- package/es/tile/interface.js +1 -0
- package/es/tile/service/TileLayerService.d.ts +58 -0
- package/es/tile/service/TileLayerService.js +195 -0
- package/es/tile/service/TilePickService.d.ts +26 -0
- package/es/tile/service/TilePickService.js +126 -0
- package/es/tile/service/TileSourceService.d.ts +7 -0
- package/es/tile/service/TileSourceService.js +26 -0
- package/es/tile/tile/DebugTile.d.ts +16 -0
- package/es/tile/tile/DebugTile.js +47 -0
- package/es/tile/tile/ImageTile.d.ts +14 -0
- package/es/tile/tile/ImageTile.js +39 -0
- package/es/tile/tile/MaskTile.d.ts +18 -0
- package/es/tile/tile/MaskTile.js +54 -0
- package/es/tile/tile/RasterRGBTile.d.ts +11 -0
- package/es/tile/tile/RasterRGBTile.js +47 -0
- package/es/tile/tile/RasterTerrainRGBTile.d.ts +14 -0
- package/es/tile/tile/RasterTerrainRGBTile.js +39 -0
- package/es/tile/tile/RasterTile.d.ts +18 -0
- package/es/tile/tile/RasterTile.js +81 -0
- package/es/tile/tile/Tile.d.ts +112 -0
- package/es/tile/tile/Tile.js +166 -0
- package/es/tile/tile/VectorTile.d.ts +26 -0
- package/es/tile/tile/VectorTile.js +87 -0
- package/es/tile/tile/index.d.ts +12 -0
- package/es/tile/tile/index.js +44 -0
- package/es/tile/tile/util.d.ts +5 -0
- package/es/tile/tile/util.js +18 -0
- package/es/tile/utils/constants.d.ts +1 -0
- package/es/tile/utils/constants.js +8 -0
- package/es/tile/utils/utils.d.ts +8 -0
- package/es/tile/utils/utils.js +11 -0
- package/es/utils/blend.d.ts +2 -0
- package/es/utils/blend.js +57 -0
- package/es/utils/collision-index.d.ts +47 -0
- package/es/utils/collision-index.js +87 -0
- package/es/utils/extrude_polyline.d.ts +53 -0
- package/es/utils/extrude_polyline.js +319 -0
- package/es/utils/grid-index.d.ts +28 -0
- package/es/utils/grid-index.js +128 -0
- package/es/utils/identityScale.d.ts +8 -0
- package/es/utils/identityScale.js +26 -0
- package/es/utils/load-image.d.ts +1 -0
- package/es/utils/load-image.js +22 -0
- package/es/utils/multiPassRender.d.ts +16 -0
- package/es/utils/multiPassRender.js +37 -0
- package/es/utils/polylineNormal.d.ts +9 -0
- package/es/utils/polylineNormal.js +182 -0
- package/es/utils/rampcolor_legend.d.ts +6 -0
- package/es/utils/rampcolor_legend.js +12 -0
- package/es/utils/scale.d.ts +87 -0
- package/es/utils/scale.js +595 -0
- package/es/utils/simpleLine.d.ts +23 -0
- package/es/utils/simpleLine.js +76 -0
- package/es/utils/stencil.d.ts +7 -0
- package/es/utils/stencil.js +49 -0
- package/es/utils/symbol-layout.d.ts +43 -0
- package/es/utils/symbol-layout.js +251 -0
- package/es/wind/index.d.ts +11 -0
- package/es/wind/index.js +34 -0
- package/es/wind/models/index.d.ts +5 -0
- package/es/wind/models/index.js +5 -0
- package/es/wind/models/utils.d.ts +19 -0
- package/es/wind/models/utils.js +213 -0
- package/es/wind/models/wind.d.ts +38 -0
- package/es/wind/models/wind.js +240 -0
- package/es/wind/models/windRender.d.ts +104 -0
- package/es/wind/models/windRender.js +333 -0
- package/es/wind/models/windShader.d.ts +12 -0
- package/es/wind/models/windShader.js +151 -0
- package/es/wind/shaders/wind_frag.glsl +9 -0
- package/es/wind/shaders/wind_vert.glsl +14 -0
- package/lib/canvas/index.d.ts +18 -0
- package/lib/canvas/index.js +79 -0
- package/lib/canvas/models/canvas.d.ts +23 -0
- package/lib/canvas/models/canvas.js +149 -0
- package/lib/canvas/models/constants.d.ts +2 -0
- package/lib/canvas/models/constants.js +12 -0
- package/lib/canvas/models/index.d.ts +2 -0
- package/lib/canvas/models/index.js +27 -0
- package/lib/citybuilding/building.d.ts +7 -0
- package/lib/citybuilding/building.js +33 -0
- package/lib/citybuilding/models/build.d.ts +33 -0
- package/lib/citybuilding/models/build.js +168 -0
- package/lib/citybuilding/shaders/build_frag.glsl +123 -0
- package/lib/citybuilding/shaders/build_vert.glsl +58 -0
- package/lib/core/BaseLayer.d.ts +265 -0
- package/lib/core/BaseLayer.js +1317 -0
- package/lib/core/BaseModel.d.ts +95 -0
- package/lib/core/BaseModel.js +375 -0
- package/lib/core/CommonStyleAttribute.d.ts +16 -0
- package/lib/core/CommonStyleAttribute.js +120 -0
- package/lib/core/LayerPickService.d.ts +12 -0
- package/lib/core/LayerPickService.js +110 -0
- package/lib/core/TextureService.d.ts +15 -0
- package/lib/core/TextureService.js +73 -0
- package/lib/core/constant.d.ts +6 -0
- package/lib/core/constant.js +25 -0
- package/lib/core/interface.d.ts +284 -0
- package/lib/core/interface.js +34 -0
- package/lib/core/line_trangluation.d.ts +19 -0
- package/lib/core/line_trangluation.js +94 -0
- package/lib/core/schema.d.ts +27 -0
- package/lib/core/schema.js +31 -0
- package/lib/core/shape/Path.d.ts +40 -0
- package/lib/core/shape/Path.js +81 -0
- package/lib/core/shape/arrow.d.ts +25 -0
- package/lib/core/shape/arrow.js +158 -0
- package/lib/core/shape/extrude.d.ts +17 -0
- package/lib/core/shape/extrude.js +142 -0
- package/lib/core/triangulation.d.ts +136 -0
- package/lib/core/triangulation.js +628 -0
- package/lib/core/utils.d.ts +5 -0
- package/lib/core/utils.js +44 -0
- package/lib/earth/index.d.ts +22 -0
- package/lib/earth/index.js +62 -0
- package/lib/earth/models/atmosphere.d.ts +30 -0
- package/lib/earth/models/atmosphere.js +124 -0
- package/lib/earth/models/base.d.ts +37 -0
- package/lib/earth/models/base.js +180 -0
- package/lib/earth/models/bloomsphere.d.ts +30 -0
- package/lib/earth/models/bloomsphere.js +123 -0
- package/lib/earth/shaders/atmosphere/atmosphere_frag.glsl +17 -0
- package/lib/earth/shaders/atmosphere/atmosphere_vert.glsl +24 -0
- package/lib/earth/shaders/base/base_frag.glsl +11 -0
- package/lib/earth/shaders/base/base_vert.glsl +52 -0
- package/lib/earth/shaders/bloomshpere/bloomsphere_frag.glsl +15 -0
- package/lib/earth/shaders/bloomshpere/bloomsphere_vert.glsl +20 -0
- package/lib/earth/utils.d.ts +26 -0
- package/lib/earth/utils.js +107 -0
- package/lib/geometry/index.d.ts +22 -0
- package/lib/geometry/index.js +61 -0
- package/lib/geometry/models/billboard.d.ts +39 -0
- package/lib/geometry/models/billboard.js +183 -0
- package/lib/geometry/models/index.d.ts +5 -0
- package/lib/geometry/models/index.js +16 -0
- package/lib/geometry/models/plane.d.ts +58 -0
- package/lib/geometry/models/plane.js +316 -0
- package/lib/geometry/models/sprite.d.ts +48 -0
- package/lib/geometry/models/sprite.js +233 -0
- package/lib/geometry/shaders/billboard_frag.glsl +18 -0
- package/lib/geometry/shaders/billboard_vert.glsl +43 -0
- package/lib/geometry/shaders/plane_frag.glsl +23 -0
- package/lib/geometry/shaders/plane_vert.glsl +31 -0
- package/lib/geometry/shaders/sprite_frag.glsl +23 -0
- package/lib/geometry/shaders/sprite_vert.glsl +21 -0
- package/lib/heatmap/index.d.ts +13 -0
- package/lib/heatmap/index.js +95 -0
- package/lib/heatmap/models/grid.d.ts +29 -0
- package/lib/heatmap/models/grid.js +91 -0
- package/lib/heatmap/models/grid3d.d.ts +31 -0
- package/lib/heatmap/models/grid3d.js +130 -0
- package/lib/heatmap/models/heatmap.d.ts +46 -0
- package/lib/heatmap/models/heatmap.js +455 -0
- package/lib/heatmap/models/hexagon.d.ts +29 -0
- package/lib/heatmap/models/hexagon.js +91 -0
- package/lib/heatmap/models/index.d.ts +5 -0
- package/lib/heatmap/models/index.js +19 -0
- package/lib/heatmap/shaders/grid/grid_frag.glsl +9 -0
- package/lib/heatmap/shaders/grid/grid_vert.glsl +30 -0
- package/lib/heatmap/shaders/grid3d/grid_3d_frag.glsl +17 -0
- package/lib/heatmap/shaders/grid3d/grid_3d_vert.glsl +34 -0
- package/lib/heatmap/shaders/heatmap/heatmap_3d_frag.glsl +23 -0
- package/lib/heatmap/shaders/heatmap/heatmap_3d_vert.glsl +59 -0
- package/lib/heatmap/shaders/heatmap/heatmap_frag.glsl +40 -0
- package/lib/heatmap/shaders/heatmap/heatmap_framebuffer_frag.glsl +17 -0
- package/lib/heatmap/shaders/heatmap/heatmap_framebuffer_vert.glsl +36 -0
- package/lib/heatmap/shaders/heatmap/heatmap_vert.glsl +21 -0
- package/lib/heatmap/shaders/hexagon/hexagon_frag.glsl +8 -0
- package/lib/heatmap/shaders/hexagon/hexagon_vert.glsl +30 -0
- package/lib/heatmap/triangulation.d.ts +5 -0
- package/lib/heatmap/triangulation.js +39 -0
- package/lib/image/index.d.ts +9 -0
- package/lib/image/index.js +36 -0
- package/lib/image/models/image.d.ts +31 -0
- package/lib/image/models/image.js +121 -0
- package/lib/image/models/index.d.ts +5 -0
- package/lib/image/models/index.js +12 -0
- package/lib/image/shaders/dataImage_frag.glsl +32 -0
- package/lib/image/shaders/image_frag.glsl +38 -0
- package/lib/image/shaders/image_vert.glsl +20 -0
- package/lib/index.d.ts +18 -0
- package/lib/index.js +148 -0
- package/lib/line/index.d.ts +36 -0
- package/lib/line/index.js +98 -0
- package/lib/line/models/arc.d.ts +40 -0
- package/lib/line/models/arc.js +287 -0
- package/lib/line/models/arc_3d.d.ts +40 -0
- package/lib/line/models/arc_3d.js +277 -0
- package/lib/line/models/flow.d.ts +31 -0
- package/lib/line/models/flow.js +148 -0
- package/lib/line/models/great_circle.d.ts +34 -0
- package/lib/line/models/great_circle.js +248 -0
- package/lib/line/models/index.d.ts +5 -0
- package/lib/line/models/index.js +25 -0
- package/lib/line/models/line.d.ts +44 -0
- package/lib/line/models/line.js +281 -0
- package/lib/line/models/simple_line.d.ts +33 -0
- package/lib/line/models/simple_line.js +126 -0
- package/lib/line/models/wall.d.ts +34 -0
- package/lib/line/models/wall.js +231 -0
- package/lib/line/shaders/arc/line_arc_frag.glsl +92 -0
- package/lib/line/shaders/arc/line_arc_vert.glsl +156 -0
- package/lib/line/shaders/arc3d/line_arc_3d_frag.glsl +108 -0
- package/lib/line/shaders/arc3d/line_arc_3d_vert.glsl +177 -0
- package/lib/line/shaders/flow/flow_line_frag.glsl +13 -0
- package/lib/line/shaders/flow/flow_line_vert.glsl +76 -0
- package/lib/line/shaders/greatCircle/line_arc_great_circle_frag.glsl +99 -0
- package/lib/line/shaders/greatCircle/line_arc_great_circle_vert.glsl +165 -0
- package/lib/line/shaders/line/line_frag.glsl +122 -0
- package/lib/line/shaders/line/line_vert.glsl +101 -0
- package/lib/line/shaders/simple/simpleline_frag.glsl +30 -0
- package/lib/line/shaders/simple/simpleline_vert.glsl +45 -0
- package/lib/line/shaders/wall/wall_frag.glsl +94 -0
- package/lib/line/shaders/wall/wall_vert.glsl +90 -0
- package/lib/mask/index.d.ts +16 -0
- package/lib/mask/index.js +29 -0
- package/lib/mask/models/fill.d.ts +18 -0
- package/lib/mask/models/fill.js +69 -0
- package/lib/mask/models/index.d.ts +5 -0
- package/lib/mask/models/index.js +12 -0
- package/lib/mask/shaders/mask_vert.glsl +14 -0
- package/lib/plugins/DataMappingPlugin.d.ts +12 -0
- package/lib/plugins/DataMappingPlugin.js +234 -0
- package/lib/plugins/DataSourcePlugin.d.ts +6 -0
- package/lib/plugins/DataSourcePlugin.js +83 -0
- package/lib/plugins/FeatureScalePlugin.d.ts +20 -0
- package/lib/plugins/FeatureScalePlugin.js +303 -0
- package/lib/plugins/LayerAnimateStylePlugin.d.ts +4 -0
- package/lib/plugins/LayerAnimateStylePlugin.js +22 -0
- package/lib/plugins/LayerMaskPlugin.d.ts +7 -0
- package/lib/plugins/LayerMaskPlugin.js +26 -0
- package/lib/plugins/LayerModelPlugin.d.ts +10 -0
- package/lib/plugins/LayerModelPlugin.js +68 -0
- package/lib/plugins/LayerStylePlugin.d.ts +7 -0
- package/lib/plugins/LayerStylePlugin.js +25 -0
- package/lib/plugins/LightingPlugin.d.ts +35 -0
- package/lib/plugins/LightingPlugin.js +93 -0
- package/lib/plugins/MultiPassRendererPlugin.d.ts +22 -0
- package/lib/plugins/MultiPassRendererPlugin.js +59 -0
- package/lib/plugins/PixelPickingPlugin.d.ts +11 -0
- package/lib/plugins/PixelPickingPlugin.js +154 -0
- package/lib/plugins/RegisterStyleAttributePlugin.d.ts +10 -0
- package/lib/plugins/RegisterStyleAttributePlugin.js +78 -0
- package/lib/plugins/ShaderUniformPlugin.d.ts +17 -0
- package/lib/plugins/ShaderUniformPlugin.js +203 -0
- package/lib/plugins/UpdateModelPlugin.d.ts +7 -0
- package/lib/plugins/UpdateModelPlugin.js +27 -0
- package/lib/plugins/UpdateStyleAttributePlugin.d.ts +9 -0
- package/lib/plugins/UpdateStyleAttributePlugin.js +61 -0
- package/lib/plugins/index.d.ts +15 -0
- package/lib/plugins/index.js +26 -0
- package/lib/point/index.d.ts +35 -0
- package/lib/point/index.js +161 -0
- package/lib/point/models/billboard_point.d.ts +35 -0
- package/lib/point/models/billboard_point.js +104 -0
- package/lib/point/models/earthExtrude.d.ts +32 -0
- package/lib/point/models/earthExtrude.js +207 -0
- package/lib/point/models/earthFill.d.ts +31 -0
- package/lib/point/models/earthFill.js +166 -0
- package/lib/point/models/extrude.d.ts +32 -0
- package/lib/point/models/extrude.js +203 -0
- package/lib/point/models/fill.d.ts +47 -0
- package/lib/point/models/fill.js +188 -0
- package/lib/point/models/fillImage.d.ts +42 -0
- package/lib/point/models/fillImage.js +197 -0
- package/lib/point/models/image.d.ts +48 -0
- package/lib/point/models/image.js +301 -0
- package/lib/point/models/index.d.ts +5 -0
- package/lib/point/models/index.js +32 -0
- package/lib/point/models/normal.d.ts +36 -0
- package/lib/point/models/normal.js +98 -0
- package/lib/point/models/radar.d.ts +37 -0
- package/lib/point/models/radar.js +123 -0
- package/lib/point/models/text.d.ts +85 -0
- package/lib/point/models/text.js +512 -0
- package/lib/point/shaders/billboard/billboard_point_frag.glsl +48 -0
- package/lib/point/shaders/billboard/billboard_point_vert.glsl +33 -0
- package/lib/point/shaders/earthExtrude/earthExtrude_frag.glsl +36 -0
- package/lib/point/shaders/earthExtrude/earthExtrude_vert.glsl +118 -0
- package/lib/point/shaders/earthFill/earthFill_frag.glsl +79 -0
- package/lib/point/shaders/earthFill/earthFill_vert.glsl +46 -0
- package/lib/point/shaders/extrude/extrude_frag.glsl +29 -0
- package/lib/point/shaders/extrude/extrude_vert.glsl +95 -0
- package/lib/point/shaders/fill/fill_frag.glsl +97 -0
- package/lib/point/shaders/fill/fill_vert.glsl +79 -0
- package/lib/point/shaders/fillImage/fillImage_frag.glsl +23 -0
- package/lib/point/shaders/fillImage/fillImage_vert.glsl +46 -0
- package/lib/point/shaders/image/image_frag.glsl +45 -0
- package/lib/point/shaders/image/image_vert.glsl +47 -0
- package/lib/point/shaders/normal/normal_frag.glsl +5 -0
- package/lib/point/shaders/normal/normal_vert.glsl +22 -0
- package/lib/point/shaders/radar/radar_frag.glsl +52 -0
- package/lib/point/shaders/radar/radar_vert.glsl +53 -0
- package/lib/point/shaders/text/text_frag.glsl +47 -0
- package/lib/point/shaders/text/text_vert.glsl +65 -0
- package/lib/point/shape/extrude.d.ts +15 -0
- package/lib/point/shape/extrude.js +56 -0
- package/lib/polygon/index.d.ts +18 -0
- package/lib/polygon/index.js +79 -0
- package/lib/polygon/models/extrude.d.ts +41 -0
- package/lib/polygon/models/extrude.js +256 -0
- package/lib/polygon/models/extrusion.d.ts +40 -0
- package/lib/polygon/models/extrusion.js +145 -0
- package/lib/polygon/models/fill.d.ts +32 -0
- package/lib/polygon/models/fill.js +135 -0
- package/lib/polygon/models/index.d.ts +5 -0
- package/lib/polygon/models/index.js +33 -0
- package/lib/polygon/models/ocean.d.ts +37 -0
- package/lib/polygon/models/ocean.js +180 -0
- package/lib/polygon/models/water.d.ts +35 -0
- package/lib/polygon/models/water.js +158 -0
- package/lib/polygon/shaders/extrude/polygon_extrude_frag.glsl +24 -0
- package/lib/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +49 -0
- package/lib/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +53 -0
- package/lib/polygon/shaders/extrude/polygon_extrude_vert.glsl +74 -0
- package/lib/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +55 -0
- package/lib/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +54 -0
- package/lib/polygon/shaders/extrusion/polygon_extrusion_frag.glsl +8 -0
- package/lib/polygon/shaders/extrusion/polygon_extrusion_vert.glsl +24 -0
- package/lib/polygon/shaders/fill/fill_frag.glsl +8 -0
- package/lib/polygon/shaders/fill/fill_linear_frag.glsl +23 -0
- package/lib/polygon/shaders/fill/fill_linear_vert.glsl +36 -0
- package/lib/polygon/shaders/fill/fill_vert.glsl +35 -0
- package/lib/polygon/shaders/ocean/ocean_frag.glsl +277 -0
- package/lib/polygon/shaders/ocean/ocean_vert.glsl +21 -0
- package/lib/polygon/shaders/water/polygon_water_frag.glsl +78 -0
- package/lib/polygon/shaders/water/polygon_water_vert.glsl +22 -0
- package/lib/raster/buffers/triangulation.d.ts +6 -0
- package/lib/raster/buffers/triangulation.js +33 -0
- package/lib/raster/index.d.ts +11 -0
- package/lib/raster/index.js +63 -0
- package/lib/raster/models/index.d.ts +5 -0
- package/lib/raster/models/index.js +17 -0
- package/lib/raster/models/raster.d.ts +35 -0
- package/lib/raster/models/raster.js +164 -0
- package/lib/raster/models/rasterRgb.d.ts +35 -0
- package/lib/raster/models/rasterRgb.js +166 -0
- package/lib/raster/models/rasterTerrainRgb.d.ts +30 -0
- package/lib/raster/models/rasterTerrainRgb.js +126 -0
- package/lib/raster/shaders/raster/raster_2d_frag.glsl +37 -0
- package/lib/raster/shaders/raster/raster_2d_vert.glsl +21 -0
- package/lib/raster/shaders/rgb/raster_rgb_frag.glsl +30 -0
- package/lib/raster/shaders/rgb/raster_rgb_vert.glsl +21 -0
- package/lib/raster/shaders/terrain/terrain_rgb_frag.glsl +40 -0
- package/lib/raster/shaders/terrain/terrain_rgb_vert.glsl +19 -0
- package/lib/shader/minify_frag.glsl +11 -0
- package/lib/shader/minify_picking_frag.glsl +10 -0
- package/lib/tile/core/BaseLayer.d.ts +50 -0
- package/lib/tile/core/BaseLayer.js +264 -0
- package/lib/tile/core/TileDebugLayer.d.ts +15 -0
- package/lib/tile/core/TileDebugLayer.js +31 -0
- package/lib/tile/interaction/getFeatureData.d.ts +0 -0
- package/lib/tile/interaction/getFeatureData.js +1 -0
- package/lib/tile/interaction/getRasterData.d.ts +4 -0
- package/lib/tile/interaction/getRasterData.js +52 -0
- package/lib/tile/interaction/utils.d.ts +11 -0
- package/lib/tile/interaction/utils.js +81 -0
- package/lib/tile/interface.d.ts +29 -0
- package/lib/tile/interface.js +5 -0
- package/lib/tile/service/TileLayerService.d.ts +58 -0
- package/lib/tile/service/TileLayerService.js +203 -0
- package/lib/tile/service/TilePickService.d.ts +26 -0
- package/lib/tile/service/TilePickService.js +134 -0
- package/lib/tile/service/TileSourceService.d.ts +7 -0
- package/lib/tile/service/TileSourceService.js +35 -0
- package/lib/tile/tile/DebugTile.d.ts +16 -0
- package/lib/tile/tile/DebugTile.js +55 -0
- package/lib/tile/tile/ImageTile.d.ts +14 -0
- package/lib/tile/tile/ImageTile.js +47 -0
- package/lib/tile/tile/MaskTile.d.ts +18 -0
- package/lib/tile/tile/MaskTile.js +62 -0
- package/lib/tile/tile/RasterRGBTile.d.ts +11 -0
- package/lib/tile/tile/RasterRGBTile.js +55 -0
- package/lib/tile/tile/RasterTerrainRGBTile.d.ts +14 -0
- package/lib/tile/tile/RasterTerrainRGBTile.js +47 -0
- package/lib/tile/tile/RasterTile.d.ts +18 -0
- package/lib/tile/tile/RasterTile.js +89 -0
- package/lib/tile/tile/Tile.d.ts +112 -0
- package/lib/tile/tile/Tile.js +174 -0
- package/lib/tile/tile/VectorTile.d.ts +26 -0
- package/lib/tile/tile/VectorTile.js +95 -0
- package/lib/tile/tile/index.d.ts +12 -0
- package/lib/tile/tile/index.js +76 -0
- package/lib/tile/tile/util.d.ts +5 -0
- package/lib/tile/tile/util.js +26 -0
- package/lib/tile/utils/constants.d.ts +1 -0
- package/lib/tile/utils/constants.js +14 -0
- package/lib/tile/utils/utils.d.ts +8 -0
- package/lib/tile/utils/utils.js +18 -0
- package/lib/utils/blend.d.ts +2 -0
- package/lib/utils/blend.js +63 -0
- package/lib/utils/collision-index.d.ts +47 -0
- package/lib/utils/collision-index.js +96 -0
- package/lib/utils/extrude_polyline.d.ts +53 -0
- package/lib/utils/extrude_polyline.js +331 -0
- package/lib/utils/grid-index.d.ts +28 -0
- package/lib/utils/grid-index.js +135 -0
- package/lib/utils/identityScale.d.ts +8 -0
- package/lib/utils/identityScale.js +32 -0
- package/lib/utils/load-image.d.ts +1 -0
- package/lib/utils/load-image.js +29 -0
- package/lib/utils/multiPassRender.d.ts +16 -0
- package/lib/utils/multiPassRender.js +44 -0
- package/lib/utils/polylineNormal.d.ts +9 -0
- package/lib/utils/polylineNormal.js +191 -0
- package/lib/utils/rampcolor_legend.d.ts +6 -0
- package/lib/utils/rampcolor_legend.js +18 -0
- package/lib/utils/scale.d.ts +87 -0
- package/lib/utils/scale.js +610 -0
- package/lib/utils/simpleLine.d.ts +23 -0
- package/lib/utils/simpleLine.js +85 -0
- package/lib/utils/stencil.d.ts +7 -0
- package/lib/utils/stencil.js +56 -0
- package/lib/utils/symbol-layout.d.ts +43 -0
- package/lib/utils/symbol-layout.js +258 -0
- package/lib/wind/index.d.ts +11 -0
- package/lib/wind/index.js +42 -0
- package/lib/wind/models/index.d.ts +5 -0
- package/lib/wind/models/index.js +12 -0
- package/lib/wind/models/utils.d.ts +19 -0
- package/lib/wind/models/utils.js +229 -0
- package/lib/wind/models/wind.d.ts +38 -0
- package/lib/wind/models/wind.js +248 -0
- package/lib/wind/models/windRender.d.ts +104 -0
- package/lib/wind/models/windRender.js +343 -0
- package/lib/wind/models/windShader.d.ts +12 -0
- package/lib/wind/models/windShader.js +157 -0
- package/lib/wind/shaders/wind_frag.glsl +9 -0
- package/lib/wind/shaders/wind_vert.glsl +14 -0
- package/package.json +6 -6
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
9
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
|
+
var _l7Core = require("@antv/l7-core");
|
|
11
|
+
var _l7Utils = require("@antv/l7-utils");
|
|
12
|
+
var _BaseModel = _interopRequireDefault(require("../../core/BaseModel"));
|
|
13
|
+
var _triangulation = require("../../core/triangulation");
|
|
14
|
+
/* babel-plugin-inline-import '../shaders/extrude/extrude_frag.glsl' */
|
|
15
|
+
const pointExtrudeFrag = "in vec4 v_color;\nin float v_lightWeight;\nout vec4 outputColor;\n\nlayout(std140) uniform commonUniforms {\n float u_pickLight;\n float u_heightfixed;\n float u_r;\n float u_linearColor;\n vec4 u_sourceColor;\n vec4 u_targetColor;\n float u_opacitylinear;\n float u_opacitylinear_dir;\n float u_lightEnable;\n};\n\n#pragma include \"scene_uniforms\"\n#pragma include \"picking\"\n\nvoid main() {\n outputColor = v_color;\n // \u5F00\u542F\u900F\u660E\u5EA6\u6E10\u53D8\n // picking\n if (u_pickLight > 0.0) {\n outputColor = filterColorAlpha(outputColor, v_lightWeight);\n } else {\n outputColor = filterColor(outputColor);\n }\n}\n";
|
|
16
|
+
/* babel-plugin-inline-import '../shaders/extrude/extrude_vert.glsl' */
|
|
17
|
+
const pointExtrudeVert = "#define pi (3.1415926535)\n\nlayout(location = ATTRIBUTE_LOCATION_POSITION) in vec3 a_Position;\nlayout(location = ATTRIBUTE_LOCATION_COLOR) in vec4 a_Color;\nlayout(location = ATTRIBUTE_LOCATION_SIZE) in vec3 a_Size;\nlayout(location = ATTRIBUTE_LOCATION_EXTRUDE) in vec4 a_Extrude;\nlayout(location = ATTRIBUTE_LOCATION_NORMAL) in vec3 a_Normal;\n\nlayout(std140) uniform commonUniforms {\n float u_pickLight;\n float u_heightfixed;\n float u_r;\n float u_linearColor;\n vec4 u_sourceColor;\n vec4 u_targetColor;\n float u_opacitylinear;\n float u_opacitylinear_dir;\n float u_lightEnable;\n};\nout vec4 v_color;\nout float v_lightWeight;\n\n#pragma include \"projection\"\n#pragma include \"light\"\n#pragma include \"picking\"\n\nfloat getYRadian(float x, float z) {\n if (x > 0.0 && z > 0.0) {\n return atan(x / z);\n } else if (x > 0.0 && z <= 0.0) {\n return atan(-z / x) + pi / 2.0;\n } else if (x <= 0.0 && z <= 0.0) {\n return pi + atan(x / z); //atan(x/z) +\n } else {\n return atan(z / -x) + pi * 3.0 / 2.0;\n }\n}\n\nfloat getXRadian(float y, float r) {\n return atan(y / r);\n}\n\nvoid main() {\n vec3 size = a_Size * a_Position;\n\n vec3 offset = size; // \u63A7\u5236\u5706\u67F1\u4F53\u7684\u5927\u5C0F - \u4ECE\u6807\u51C6\u5355\u4F4D\u5706\u67F1\u4F53\u8FDB\u884C\u504F\u79FB\n\n if (u_heightfixed < 1.0) {\n // \u5706\u67F1\u4F53\u4E0D\u56FA\u5B9A\u9AD8\u5EA6\n } else {\n // \u5706\u67F1\u4F53\u56FA\u5B9A\u9AD8\u5EA6 \uFF08 \u5904\u7406 mapbox \uFF09\n if (\n u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\n u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET\n ) {\n offset *= 4.0 / pow(2.0, 21.0 - u_Zoom);\n }\n }\n\n vec2 positions = a_Extrude.xy;\n vec2 positions64Low = a_Extrude.zw;\n vec4 project_pos = project_position(vec4(positions, 0.0, 1.0), positions64Low);\n\n // u_r \u63A7\u5236\u5706\u67F1\u7684\u751F\u957F\n vec4 pos = vec4(project_pos.xy + offset.xy, offset.z * u_r, 1.0);\n\n // // \u5706\u67F1\u5149\u7167\u6548\u679C\n float lightWeight = 1.0;\n\n if (u_lightEnable > 0.0) {\n // \u53D6\u6D88\u4E09\u5143\u8868\u8FBE\u5F0F\uFF0C\u589E\u5F3A\u5065\u58EE\u6027\n lightWeight = calc_lighting(pos);\n }\n\n v_lightWeight = lightWeight;\n\n v_color = a_Color;\n\n // \u8BBE\u7F6E\u5706\u67F1\u7684\u5E95\u8272\n if (u_linearColor == 1.0) {\n // \u4F7F\u7528\u6E10\u53D8\u989C\u8272\n v_color = mix(u_sourceColor, u_targetColor, a_Position.z);\n v_color.a = v_color.a * opacity;\n } else {\n v_color = vec4(a_Color.rgb * lightWeight, a_Color.w * opacity);\n }\n\n if (u_opacitylinear > 0.0) {\n v_color.a *= u_opacitylinear_dir > 0.0 ? 1.0 - a_Position.z : a_Position.z;\n }\n\n gl_Position = project_common_position_to_clipspace(pos);\n\n setPickingColor(a_PickingColor);\n}\n";
|
|
18
|
+
class ExtrudeModel extends _BaseModel.default {
|
|
19
|
+
constructor(...args) {
|
|
20
|
+
super(...args);
|
|
21
|
+
(0, _defineProperty2.default)(this, "raiseCount", 0);
|
|
22
|
+
(0, _defineProperty2.default)(this, "raiseRepeat", 0);
|
|
23
|
+
}
|
|
24
|
+
get attributeLocation() {
|
|
25
|
+
return Object.assign(super.attributeLocation, {
|
|
26
|
+
MAX: super.attributeLocation.MAX,
|
|
27
|
+
SIZE: 9,
|
|
28
|
+
EXTRUDE: 10,
|
|
29
|
+
NORMAL: 11
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
getCommonUniformsInfo() {
|
|
33
|
+
const {
|
|
34
|
+
animateOption = {
|
|
35
|
+
enable: false,
|
|
36
|
+
speed: 0.01,
|
|
37
|
+
repeat: false
|
|
38
|
+
},
|
|
39
|
+
sourceColor,
|
|
40
|
+
targetColor,
|
|
41
|
+
pickLight = false,
|
|
42
|
+
heightfixed = false,
|
|
43
|
+
opacityLinear = {
|
|
44
|
+
enable: false,
|
|
45
|
+
dir: 'up'
|
|
46
|
+
},
|
|
47
|
+
lightEnable = true
|
|
48
|
+
} = this.layer.getLayerConfig();
|
|
49
|
+
|
|
50
|
+
// 转化渐变色
|
|
51
|
+
let useLinearColor = 0; // 默认不生效
|
|
52
|
+
let sourceColorArr = [0, 0, 0, 0];
|
|
53
|
+
let targetColorArr = [0, 0, 0, 0];
|
|
54
|
+
if (sourceColor && targetColor) {
|
|
55
|
+
sourceColorArr = (0, _l7Utils.rgb2arr)(sourceColor);
|
|
56
|
+
targetColorArr = (0, _l7Utils.rgb2arr)(targetColor);
|
|
57
|
+
useLinearColor = 1;
|
|
58
|
+
}
|
|
59
|
+
if (this.raiseCount < 1 && this.raiseRepeat > 0) {
|
|
60
|
+
if (animateOption.enable) {
|
|
61
|
+
const {
|
|
62
|
+
speed = 0.01
|
|
63
|
+
} = animateOption;
|
|
64
|
+
this.raiseCount += speed;
|
|
65
|
+
if (this.raiseCount >= 1) {
|
|
66
|
+
if (this.raiseRepeat > 1) {
|
|
67
|
+
this.raiseCount = 0;
|
|
68
|
+
this.raiseRepeat--;
|
|
69
|
+
} else {
|
|
70
|
+
this.raiseCount = 1;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
const commonOptions = {
|
|
76
|
+
// 圆柱体的拾取高亮是否要计算光照
|
|
77
|
+
u_pickLight: Number(pickLight),
|
|
78
|
+
// 圆柱体是否固定高度
|
|
79
|
+
u_heightfixed: Number(heightfixed),
|
|
80
|
+
u_r: animateOption.enable && this.raiseRepeat > 0 ? this.raiseCount : 1.0,
|
|
81
|
+
// 渐变色支持参数
|
|
82
|
+
u_linearColor: useLinearColor,
|
|
83
|
+
u_sourceColor: sourceColorArr,
|
|
84
|
+
u_targetColor: targetColorArr,
|
|
85
|
+
// 透明度渐变
|
|
86
|
+
u_opacitylinear: Number(opacityLinear.enable),
|
|
87
|
+
u_opacitylinear_dir: opacityLinear.dir === 'up' ? 1.0 : 0.0,
|
|
88
|
+
// 光照计算开关
|
|
89
|
+
u_lightEnable: Number(lightEnable)
|
|
90
|
+
};
|
|
91
|
+
const commonBufferInfo = this.getUniformsBufferInfo(commonOptions);
|
|
92
|
+
return commonBufferInfo;
|
|
93
|
+
}
|
|
94
|
+
initModels() {
|
|
95
|
+
var _this = this;
|
|
96
|
+
return (0, _asyncToGenerator2.default)(function* () {
|
|
97
|
+
return _this.buildModels();
|
|
98
|
+
})();
|
|
99
|
+
}
|
|
100
|
+
buildModels() {
|
|
101
|
+
var _this2 = this;
|
|
102
|
+
return (0, _asyncToGenerator2.default)(function* () {
|
|
103
|
+
const {
|
|
104
|
+
depth = true,
|
|
105
|
+
animateOption: {
|
|
106
|
+
repeat = 1
|
|
107
|
+
}
|
|
108
|
+
} = _this2.layer.getLayerConfig();
|
|
109
|
+
_this2.raiseRepeat = repeat;
|
|
110
|
+
_this2.initUniformsBuffer();
|
|
111
|
+
const model = yield _this2.layer.buildLayerModel({
|
|
112
|
+
moduleName: 'pointExtrude',
|
|
113
|
+
vertexShader: pointExtrudeVert,
|
|
114
|
+
fragmentShader: pointExtrudeFrag,
|
|
115
|
+
triangulation: _triangulation.PointExtrudeTriangulation,
|
|
116
|
+
defines: _this2.getDefines(),
|
|
117
|
+
inject: _this2.getInject(),
|
|
118
|
+
cull: {
|
|
119
|
+
enable: true,
|
|
120
|
+
face: _l7Core.gl.FRONT
|
|
121
|
+
},
|
|
122
|
+
depth: {
|
|
123
|
+
enable: depth
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
return [model];
|
|
127
|
+
})();
|
|
128
|
+
}
|
|
129
|
+
registerBuiltinAttributes() {
|
|
130
|
+
// point layer size;
|
|
131
|
+
this.styleAttributeService.registerStyleAttribute({
|
|
132
|
+
name: 'size',
|
|
133
|
+
type: _l7Core.AttributeType.Attribute,
|
|
134
|
+
descriptor: {
|
|
135
|
+
name: 'a_Size',
|
|
136
|
+
shaderLocation: this.attributeLocation.SIZE,
|
|
137
|
+
buffer: {
|
|
138
|
+
usage: _l7Core.gl.DYNAMIC_DRAW,
|
|
139
|
+
data: [],
|
|
140
|
+
type: _l7Core.gl.FLOAT
|
|
141
|
+
},
|
|
142
|
+
size: 3,
|
|
143
|
+
update: feature => {
|
|
144
|
+
const {
|
|
145
|
+
size
|
|
146
|
+
} = feature;
|
|
147
|
+
if (size) {
|
|
148
|
+
let buffersize = [];
|
|
149
|
+
if (Array.isArray(size)) {
|
|
150
|
+
buffersize = size.length === 2 ? [size[0], size[0], size[1]] : size;
|
|
151
|
+
}
|
|
152
|
+
if (!Array.isArray(size)) {
|
|
153
|
+
buffersize = [size, size, size];
|
|
154
|
+
}
|
|
155
|
+
return buffersize;
|
|
156
|
+
} else {
|
|
157
|
+
return [2, 2, 2];
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
this.styleAttributeService.registerStyleAttribute({
|
|
163
|
+
name: 'normal',
|
|
164
|
+
type: _l7Core.AttributeType.Attribute,
|
|
165
|
+
descriptor: {
|
|
166
|
+
name: 'a_Normal',
|
|
167
|
+
shaderLocation: this.attributeLocation.NORMAL,
|
|
168
|
+
buffer: {
|
|
169
|
+
// give the WebGL driver a hint that this buffer may change
|
|
170
|
+
usage: _l7Core.gl.STATIC_DRAW,
|
|
171
|
+
data: [],
|
|
172
|
+
type: _l7Core.gl.FLOAT
|
|
173
|
+
},
|
|
174
|
+
size: 3,
|
|
175
|
+
update: (feature, featureIdx, vertex, attributeIdx, normal) => {
|
|
176
|
+
return normal;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
this.styleAttributeService.registerStyleAttribute({
|
|
181
|
+
name: 'extrude',
|
|
182
|
+
type: _l7Core.AttributeType.Attribute,
|
|
183
|
+
descriptor: {
|
|
184
|
+
name: 'a_Extrude',
|
|
185
|
+
shaderLocation: this.attributeLocation.EXTRUDE,
|
|
186
|
+
buffer: {
|
|
187
|
+
// give the WebGL driver a hint that this buffer may change
|
|
188
|
+
usage: _l7Core.gl.DYNAMIC_DRAW,
|
|
189
|
+
data: [],
|
|
190
|
+
type: _l7Core.gl.FLOAT
|
|
191
|
+
},
|
|
192
|
+
size: 4,
|
|
193
|
+
update: feature => {
|
|
194
|
+
const coordinates = (0, _l7Utils.calculateCentroid)(feature.coordinates);
|
|
195
|
+
// [lng, lat, lowLng, lowLat]
|
|
196
|
+
// low part for enabled double precision
|
|
197
|
+
return [coordinates[0], coordinates[1], (0, _l7Utils.fp64LowPart)(coordinates[0]), (0, _l7Utils.fp64LowPart)(coordinates[1])];
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
exports.default = ExtrudeModel;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { IAnimateOption, IAttribute, IElements, IModel, IModelUniform } from '@antv/l7-core';
|
|
2
|
+
import BaseModel from '../../core/BaseModel';
|
|
3
|
+
export default class FillModel extends BaseModel {
|
|
4
|
+
protected get attributeLocation(): {
|
|
5
|
+
readonly POSITION: 0;
|
|
6
|
+
readonly POSITION_64LOW: 1;
|
|
7
|
+
readonly COLOR: 2;
|
|
8
|
+
readonly PICKING_COLOR: 3;
|
|
9
|
+
readonly STROKE: 4;
|
|
10
|
+
readonly OPACITY: 5;
|
|
11
|
+
readonly OFFSETS: 6;
|
|
12
|
+
readonly ROTATION: 7;
|
|
13
|
+
readonly MAX: 8;
|
|
14
|
+
} & Record<string, number> & {
|
|
15
|
+
MAX: 8;
|
|
16
|
+
SIZE: number;
|
|
17
|
+
SHAPE: number;
|
|
18
|
+
EXTRUDE: number;
|
|
19
|
+
};
|
|
20
|
+
protected getCommonUniformsInfo(): {
|
|
21
|
+
uniformsArray: number[];
|
|
22
|
+
uniformsLength: number;
|
|
23
|
+
uniformsOption: {
|
|
24
|
+
[key: string]: any;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
getAnimateUniforms(): IModelUniform;
|
|
28
|
+
getAttribute(): {
|
|
29
|
+
attributes: {
|
|
30
|
+
[attributeName: string]: IAttribute;
|
|
31
|
+
};
|
|
32
|
+
elements: IElements;
|
|
33
|
+
};
|
|
34
|
+
initModels(): Promise<IModel[]>;
|
|
35
|
+
buildModels(): Promise<IModel[]>;
|
|
36
|
+
/**
|
|
37
|
+
* 根据 animateOption 的值返回对应的 shader 代码
|
|
38
|
+
* @returns
|
|
39
|
+
*/
|
|
40
|
+
getShaders(): {
|
|
41
|
+
frag: string;
|
|
42
|
+
vert: string;
|
|
43
|
+
type: string;
|
|
44
|
+
};
|
|
45
|
+
protected animateOption2Array(option: Partial<IAnimateOption>): number[];
|
|
46
|
+
protected registerBuiltinAttributes(): void;
|
|
47
|
+
}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
9
|
+
var _l7Core = require("@antv/l7-core");
|
|
10
|
+
var _BaseModel = _interopRequireDefault(require("../../core/BaseModel"));
|
|
11
|
+
var _triangulation = require("../../core/triangulation");
|
|
12
|
+
var _interface = require("../../core/interface");
|
|
13
|
+
/* babel-plugin-inline-import '../shaders/fill/fill_frag.glsl' */
|
|
14
|
+
const pointFillFrag = "layout(std140) uniform commonUniforms {\n vec3 u_blur_height_fixed;\n float u_stroke_width;\n float u_additive;\n float u_stroke_opacity;\n float u_size_unit;\n float u_time;\n vec4 u_animate;\n};\n\nin vec4 v_color;\nin vec4 v_stroke;\nin vec4 v_data;\nin float v_radius;\n\n#pragma include \"scene_uniforms\"\n#pragma include \"sdf_2d\"\n#pragma include \"picking\"\n\nout vec4 outputColor;\n\nvoid main() {\n int shape = int(floor(v_data.w + 0.5));\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.0));\n inner_df = sdBox(v_data.xy, vec2(r));\n } else if (shape == 3) {\n outer_df = sdPentagon(v_data.xy, 0.8);\n inner_df = sdPentagon(v_data.xy, r * 0.8);\n } else if (shape == 4) {\n outer_df = sdHexagon(v_data.xy, 0.8);\n inner_df = sdHexagon(v_data.xy, r * 0.8);\n } else if (shape == 5) {\n outer_df = sdOctogon(v_data.xy, 1.0);\n inner_df = sdOctogon(v_data.xy, r);\n } else if (shape == 6) {\n outer_df = sdHexagram(v_data.xy, 0.52);\n inner_df = sdHexagram(v_data.xy, r * 0.52);\n } else if (shape == 7) {\n outer_df = sdRhombus(v_data.xy, vec2(1.0));\n inner_df = sdRhombus(v_data.xy, vec2(r));\n } else if (shape == 8) {\n outer_df = sdVesica(v_data.xy, 1.1, 0.8);\n inner_df = sdVesica(v_data.xy, r * 1.1, r * 0.8);\n }\n\n float opacity_t = smoothstep(0.0, antialiasblur, outer_df);\n\n float color_t = u_stroke_width < 0.01 ? 0.0 : smoothstep(antialiasblur, 0.0, inner_df);\n\n float PI = 3.14159;\n float N_RINGS = 3.0;\n float FREQ = 1.0;\n\n if (u_stroke_width < 0.01) {\n outputColor = v_color;\n } else {\n outputColor = mix(v_color, v_stroke * u_stroke_opacity, color_t);\n }\n float intensity = 1.0;\n if (u_time != -1.0) {\n //wave\u76F8\u5173\u903B\u8F91\n float d = length(v_data.xy);\n if (d > 0.5) {\n discard;\n }\n intensity =\n clamp(cos(d * PI), 0.0, 1.0) *\n clamp(cos(2.0 * PI * (d * 2.0 * u_animate.z - u_animate.y * u_time)), 0.0, 1.0);\n }\n\n if (u_additive > 0.0) {\n outputColor *= opacity_t;\n outputColor *= intensity; //wave\n outputColor = filterColorAlpha(outputColor, outputColor.a);\n } else {\n outputColor.a *= opacity_t;\n outputColor.a *= intensity; //wave\n outputColor = filterColor(outputColor);\n }\n // \u4F5C\u4E3A mask \u6A21\u677F\u65F6\u9700\u8981\u4E22\u5F03\u900F\u660E\u7684\u50CF\u7D20\n if (outputColor.a < 0.01) {\n discard;\n }\n}\n";
|
|
15
|
+
/* babel-plugin-inline-import '../shaders/fill/fill_vert.glsl' */
|
|
16
|
+
const pointFillVert = "layout(location = ATTRIBUTE_LOCATION_POSITION) in vec3 a_Position;\nlayout(location = ATTRIBUTE_LOCATION_POSITION_64LOW) in vec2 a_Position64Low;\nlayout(location = ATTRIBUTE_LOCATION_COLOR) in vec4 a_Color;\nlayout(location = ATTRIBUTE_LOCATION_SIZE) in float a_Size;\nlayout(location = ATTRIBUTE_LOCATION_SHAPE) in float a_Shape;\nlayout(location = ATTRIBUTE_LOCATION_EXTRUDE) in vec3 a_Extrude;\n\nlayout(std140) uniform commonUniforms {\n vec3 u_blur_height_fixed;\n float u_stroke_width;\n float u_additive;\n float u_stroke_opacity;\n float u_size_unit;\n float u_time;\n vec4 u_animate;\n};\n\nout vec4 v_color;\nout vec4 v_stroke;\nout vec4 v_data;\nout float v_radius;\n\n#pragma include \"projection\"\n#pragma include \"picking\"\n#pragma include \"rotation_2d\"\n\nvoid main() {\n // \u900F\u660E\u5EA6\u8BA1\u7B97\n v_stroke = stroke;\n vec3 extrude = a_Extrude;\n float shape_type = a_Shape;\n /*\n * setPickingSize \u8BBE\u7F6E\u62FE\u53D6\u5927\u5C0F\n * u_meter2coord \u5728\u7B49\u9762\u79EF\u5927\u5C0F\u7684\u65F6\u5019\u8BBE\u7F6E\u5355\u4F4D\n */\n float newSize = setPickingSize(a_Size);\n // float newSize = setPickingSize(a_Size) * 0.00001038445708445579;\n\n\n\n // unpack color(vec2)\n v_color = vec4(a_Color.xyz, a_Color.w * opacity);\n\n if(u_size_unit == 1.0) {\n newSize = newSize * u_PixelsPerMeter.z;\n }\n\n v_radius = newSize;\n\n // anti-alias\n // float antialiased_blur = -max(u_blur, antialiasblur);\n float antialiasblur = -max(2.0 / u_DevicePixelRatio / newSize, u_blur_height_fixed.x);\n\n vec2 offset = (extrude.xy * (newSize + u_stroke_width) + u_offsets);\n\n offset = project_pixel(offset);\n offset = rotate_matrix(offset,rotation);\n\n // TODP: /abs(extrude.x) \u662F\u4E3A\u4E86\u517C\u5BB9\u5730\u7403\u6A21\u5F0F\n v_data = vec4(extrude.x/abs(extrude.x), extrude.y/abs(extrude.y), antialiasblur,shape_type);\n\n vec4 project_pos = project_position(vec4(a_Position.xy, 0.0, 1.0), a_Position64Low);\n // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, project_pixel(setPickingOrder(0.0)), 1.0));\n\n float raisingHeight = u_blur_height_fixed.y;\n\n if(u_blur_height_fixed.z < 1.0) { // false\n raisingHeight = project_pixel(u_blur_height_fixed.y);\n } else {\n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);\n raisingHeight = u_blur_height_fixed.y * mapboxZoomScale;\n }\n }\n\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, raisingHeight, 1.0));\n\n setPickingColor(a_PickingColor);\n}\n";
|
|
17
|
+
class FillModel extends _BaseModel.default {
|
|
18
|
+
get attributeLocation() {
|
|
19
|
+
return Object.assign(super.attributeLocation, {
|
|
20
|
+
MAX: super.attributeLocation.MAX,
|
|
21
|
+
SIZE: 9,
|
|
22
|
+
SHAPE: 10,
|
|
23
|
+
EXTRUDE: 11
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
getCommonUniformsInfo() {
|
|
27
|
+
const {
|
|
28
|
+
strokeOpacity = 1,
|
|
29
|
+
strokeWidth = 0,
|
|
30
|
+
blend,
|
|
31
|
+
blur = 0,
|
|
32
|
+
raisingHeight = 0,
|
|
33
|
+
heightfixed = false,
|
|
34
|
+
unit = 'pixel'
|
|
35
|
+
} = this.layer.getLayerConfig();
|
|
36
|
+
let u_time = this.getAnimateUniforms().u_time;
|
|
37
|
+
if (isNaN(u_time)) {
|
|
38
|
+
u_time = -1.0;
|
|
39
|
+
}
|
|
40
|
+
const commonOptions = {
|
|
41
|
+
u_blur_height_fixed: [blur, Number(raisingHeight), Number(heightfixed)],
|
|
42
|
+
u_stroke_width: strokeWidth,
|
|
43
|
+
u_additive: blend === 'additive' ? 1.0 : 0.0,
|
|
44
|
+
u_stroke_opacity: strokeOpacity,
|
|
45
|
+
u_size_unit: _interface.SizeUnitType[unit],
|
|
46
|
+
u_time,
|
|
47
|
+
u_animate: this.getAnimateUniforms().u_animate
|
|
48
|
+
};
|
|
49
|
+
const commonBufferInfo = this.getUniformsBufferInfo(commonOptions);
|
|
50
|
+
return commonBufferInfo;
|
|
51
|
+
}
|
|
52
|
+
getAnimateUniforms() {
|
|
53
|
+
const {
|
|
54
|
+
animateOption = {
|
|
55
|
+
enable: false
|
|
56
|
+
}
|
|
57
|
+
} = this.layer.getLayerConfig();
|
|
58
|
+
return {
|
|
59
|
+
u_animate: this.animateOption2Array(animateOption),
|
|
60
|
+
u_time: animateOption.enable ? this.layer.getLayerAnimateTime() : -1.0
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
getAttribute() {
|
|
64
|
+
return this.styleAttributeService.createAttributesAndIndices(this.layer.getEncodedData(), _triangulation.PointFillTriangulation);
|
|
65
|
+
}
|
|
66
|
+
initModels() {
|
|
67
|
+
var _this = this;
|
|
68
|
+
return (0, _asyncToGenerator2.default)(function* () {
|
|
69
|
+
return _this.buildModels();
|
|
70
|
+
})();
|
|
71
|
+
}
|
|
72
|
+
buildModels() {
|
|
73
|
+
var _this2 = this;
|
|
74
|
+
return (0, _asyncToGenerator2.default)(function* () {
|
|
75
|
+
const {
|
|
76
|
+
frag,
|
|
77
|
+
vert,
|
|
78
|
+
type
|
|
79
|
+
} = _this2.getShaders();
|
|
80
|
+
_this2.layer.triangulation = _triangulation.PointFillTriangulation;
|
|
81
|
+
_this2.initUniformsBuffer();
|
|
82
|
+
const model = yield _this2.layer.buildLayerModel({
|
|
83
|
+
moduleName: type,
|
|
84
|
+
vertexShader: vert,
|
|
85
|
+
fragmentShader: frag,
|
|
86
|
+
defines: _this2.getDefines(),
|
|
87
|
+
inject: _this2.getInject(),
|
|
88
|
+
triangulation: _triangulation.PointFillTriangulation,
|
|
89
|
+
depth: {
|
|
90
|
+
enable: false
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
return [model];
|
|
94
|
+
})();
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* 根据 animateOption 的值返回对应的 shader 代码
|
|
99
|
+
* @returns
|
|
100
|
+
*/
|
|
101
|
+
getShaders() {
|
|
102
|
+
return {
|
|
103
|
+
frag: pointFillFrag,
|
|
104
|
+
vert: pointFillVert,
|
|
105
|
+
type: 'pointFill'
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// overwrite baseModel func
|
|
110
|
+
animateOption2Array(option) {
|
|
111
|
+
return [option.enable ? 0 : 1.0, option.speed || 1, option.rings || 3, 0];
|
|
112
|
+
}
|
|
113
|
+
registerBuiltinAttributes() {
|
|
114
|
+
// 注册 Style 参与数据映射的内置属性
|
|
115
|
+
const shape2d = this.layer.getLayerConfig().shape2d;
|
|
116
|
+
|
|
117
|
+
// 注册 Position 属性 64 位地位部分,经纬度数据开启双精度,避免大于 20层级以上出现数据偏移
|
|
118
|
+
this.registerPosition64LowAttribute();
|
|
119
|
+
this.styleAttributeService.registerStyleAttribute({
|
|
120
|
+
name: 'extrude',
|
|
121
|
+
type: _l7Core.AttributeType.Attribute,
|
|
122
|
+
descriptor: {
|
|
123
|
+
name: 'a_Extrude',
|
|
124
|
+
shaderLocation: this.attributeLocation.EXTRUDE,
|
|
125
|
+
buffer: {
|
|
126
|
+
// give the WebGL driver a hint that this buffer may change
|
|
127
|
+
usage: _l7Core.gl.DYNAMIC_DRAW,
|
|
128
|
+
data: [],
|
|
129
|
+
type: _l7Core.gl.FLOAT
|
|
130
|
+
},
|
|
131
|
+
size: 3,
|
|
132
|
+
update: (feature, featureIdx, vertex, attributeIdx) => {
|
|
133
|
+
const extrude = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, -1, 0];
|
|
134
|
+
const extrudeIndex = attributeIdx % 4 * 3;
|
|
135
|
+
return [extrude[extrudeIndex], extrude[extrudeIndex + 1], extrude[extrudeIndex + 2]];
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
// point layer size;
|
|
141
|
+
this.styleAttributeService.registerStyleAttribute({
|
|
142
|
+
name: 'size',
|
|
143
|
+
type: _l7Core.AttributeType.Attribute,
|
|
144
|
+
descriptor: {
|
|
145
|
+
name: 'a_Size',
|
|
146
|
+
shaderLocation: this.attributeLocation.SIZE,
|
|
147
|
+
buffer: {
|
|
148
|
+
// give the WebGL driver a hint that this buffer may change
|
|
149
|
+
usage: _l7Core.gl.DYNAMIC_DRAW,
|
|
150
|
+
data: [],
|
|
151
|
+
type: _l7Core.gl.FLOAT
|
|
152
|
+
},
|
|
153
|
+
size: 1,
|
|
154
|
+
update: feature => {
|
|
155
|
+
const {
|
|
156
|
+
size = 5
|
|
157
|
+
} = feature;
|
|
158
|
+
return Array.isArray(size) ? [size[0]] : [size];
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
// point layer shape;
|
|
164
|
+
this.styleAttributeService.registerStyleAttribute({
|
|
165
|
+
name: 'shape',
|
|
166
|
+
type: _l7Core.AttributeType.Attribute,
|
|
167
|
+
descriptor: {
|
|
168
|
+
name: 'a_Shape',
|
|
169
|
+
shaderLocation: this.attributeLocation.SHAPE,
|
|
170
|
+
buffer: {
|
|
171
|
+
// give the WebGL driver a hint that this buffer may change
|
|
172
|
+
usage: _l7Core.gl.DYNAMIC_DRAW,
|
|
173
|
+
data: [],
|
|
174
|
+
type: _l7Core.gl.FLOAT
|
|
175
|
+
},
|
|
176
|
+
size: 1,
|
|
177
|
+
update: feature => {
|
|
178
|
+
const {
|
|
179
|
+
shape = 2
|
|
180
|
+
} = feature;
|
|
181
|
+
const shapeIndex = shape2d.indexOf(shape);
|
|
182
|
+
return [shapeIndex];
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
exports.default = FillModel;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { IAttribute, IElements, IModel } from '@antv/l7-core';
|
|
2
|
+
import BaseModel from '../../core/BaseModel';
|
|
3
|
+
export default class FillImageModel extends BaseModel {
|
|
4
|
+
protected get attributeLocation(): {
|
|
5
|
+
readonly POSITION: 0;
|
|
6
|
+
readonly POSITION_64LOW: 1;
|
|
7
|
+
readonly COLOR: 2;
|
|
8
|
+
readonly PICKING_COLOR: 3;
|
|
9
|
+
readonly STROKE: 4;
|
|
10
|
+
readonly OPACITY: 5;
|
|
11
|
+
readonly OFFSETS: 6;
|
|
12
|
+
readonly ROTATION: 7;
|
|
13
|
+
readonly MAX: 8;
|
|
14
|
+
} & Record<string, number> & {
|
|
15
|
+
MAX: 8;
|
|
16
|
+
SIZE: number;
|
|
17
|
+
EXTRUDE: number;
|
|
18
|
+
UV: number;
|
|
19
|
+
};
|
|
20
|
+
private meter2coord;
|
|
21
|
+
private texture;
|
|
22
|
+
private isMeter;
|
|
23
|
+
private radian;
|
|
24
|
+
protected getCommonUniformsInfo(): {
|
|
25
|
+
uniformsArray: number[];
|
|
26
|
+
uniformsLength: number;
|
|
27
|
+
uniformsOption: {
|
|
28
|
+
[key: string]: any;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
getAttribute(): {
|
|
32
|
+
attributes: {
|
|
33
|
+
[attributeName: string]: IAttribute;
|
|
34
|
+
};
|
|
35
|
+
elements: IElements;
|
|
36
|
+
};
|
|
37
|
+
initModels(): Promise<IModel[]>;
|
|
38
|
+
buildModels(): Promise<IModel[]>;
|
|
39
|
+
clearModels(): void;
|
|
40
|
+
protected registerBuiltinAttributes(): void;
|
|
41
|
+
private updateTexture;
|
|
42
|
+
}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
9
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
|
+
var _l7Core = require("@antv/l7-core");
|
|
11
|
+
var _BaseModel = _interopRequireDefault(require("../../core/BaseModel"));
|
|
12
|
+
var _interface = require("../../core/interface");
|
|
13
|
+
var _triangulation = require("../../core/triangulation");
|
|
14
|
+
/* babel-plugin-inline-import '../shaders/fillImage/fillImage_frag.glsl' */
|
|
15
|
+
const pointFillFrag = "in vec2 v_uv;// \u672C\u8EAB\u7684 uv \u5750\u6807\nin vec2 v_Iconuv;\nin float v_opacity;\nout vec4 outputColor;\n\nuniform sampler2D u_texture;\nlayout(std140) uniform commonUniform {\n vec2 u_textSize;\n float u_heightfixed: 0.0;\n float u_raisingHeight: 0.0;\n float u_size_unit;\n};\n\n#pragma include \"scene_uniforms\"\n#pragma include \"sdf_2d\"\n#pragma include \"picking\"\n\nvoid main() {\n vec2 pos = v_Iconuv / u_textSize + v_uv / u_textSize * 64.;\n outputColor = texture(SAMPLER_2D(u_texture), pos);\n outputColor.a *= v_opacity;\n outputColor = filterColor(outputColor);\n}\n";
|
|
16
|
+
/* babel-plugin-inline-import '../shaders/fillImage/fillImage_vert.glsl' */
|
|
17
|
+
const pointFillVert = "layout(location = ATTRIBUTE_LOCATION_POSITION) in vec3 a_Position;\nlayout(location = ATTRIBUTE_LOCATION_POSITION_64LOW) in vec2 a_Position64Low;\nlayout(location = ATTRIBUTE_LOCATION_COLOR) in vec4 a_Color;\nlayout(location = ATTRIBUTE_LOCATION_SIZE) in float a_Size;\nlayout(location = ATTRIBUTE_LOCATION_EXTRUDE) in vec3 a_Extrude;\nlayout(location = ATTRIBUTE_LOCATION_UV) in vec2 a_Uv;\n\nlayout(std140) uniform commonUniform {\n vec2 u_textSize;\n float u_heightfixed;\n float u_raisingHeight;\n float u_size_unit;\n};\n\nout vec2 v_uv;\nout vec2 v_Iconuv;\nout float v_opacity;\n\n#pragma include \"projection\"\n#pragma include \"picking\"\n#pragma include \"rotation_2d\"\n\nvoid main() {\n vec3 extrude = a_Extrude;\n v_uv = (a_Extrude.xy + 1.0) / 2.0;\n v_uv.x = 1.0 - v_uv.x;\n v_uv.y = 1.0 - v_uv.y;\n v_Iconuv = a_Uv;\n v_opacity = opacity;\n float newSize = a_Size;\n if (u_size_unit == 1.0) {\n newSize = newSize * u_PixelsPerMeter.z;\n }\n\n // vec2 offset = (u_RotateMatrix * extrude.xy * (a_Size) + textrueOffsets);\n vec2 offset = extrude.xy * newSize + offsets;\n\n offset = rotate_matrix(offset, rotation);\n\n offset = project_pixel(offset);\n\n vec4 project_pos = project_position(vec4(a_Position.xy, 0.0, 1.0), a_Position64Low);\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, 0.0, 1.0));\n\n setPickingColor(a_PickingColor);\n}\n";
|
|
18
|
+
class FillImageModel extends _BaseModel.default {
|
|
19
|
+
constructor(...args) {
|
|
20
|
+
super(...args);
|
|
21
|
+
(0, _defineProperty2.default)(this, "meter2coord", 1);
|
|
22
|
+
(0, _defineProperty2.default)(this, "texture", void 0);
|
|
23
|
+
(0, _defineProperty2.default)(this, "isMeter", false);
|
|
24
|
+
(0, _defineProperty2.default)(this, "radian", 0);
|
|
25
|
+
(0, _defineProperty2.default)(this, "updateTexture", () => {
|
|
26
|
+
const {
|
|
27
|
+
createTexture2D
|
|
28
|
+
} = this.rendererService;
|
|
29
|
+
if (this.texture) {
|
|
30
|
+
this.texture.update({
|
|
31
|
+
data: this.iconService.getCanvas(),
|
|
32
|
+
mag: 'linear',
|
|
33
|
+
min: 'linear mipmap nearest',
|
|
34
|
+
mipmap: true
|
|
35
|
+
});
|
|
36
|
+
// 更新完纹理后在更新的图层的时候需要更新所有的图层
|
|
37
|
+
this.layerService.throttleRenderLayers();
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
this.texture = createTexture2D({
|
|
41
|
+
data: this.iconService.getCanvas(),
|
|
42
|
+
mag: _l7Core.gl.LINEAR,
|
|
43
|
+
min: _l7Core.gl.LINEAR_MIPMAP_LINEAR,
|
|
44
|
+
premultiplyAlpha: false,
|
|
45
|
+
width: 1024,
|
|
46
|
+
height: this.iconService.canvasHeight || 128,
|
|
47
|
+
mipmap: true
|
|
48
|
+
});
|
|
49
|
+
this.textures = [this.texture];
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
get attributeLocation() {
|
|
53
|
+
return Object.assign(super.attributeLocation, {
|
|
54
|
+
MAX: super.attributeLocation.MAX,
|
|
55
|
+
SIZE: 9,
|
|
56
|
+
EXTRUDE: 10,
|
|
57
|
+
UV: 11
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
// 旋转的弧度
|
|
61
|
+
getCommonUniformsInfo() {
|
|
62
|
+
const {
|
|
63
|
+
raisingHeight = 0.0,
|
|
64
|
+
heightfixed = false,
|
|
65
|
+
unit = 'pixel'
|
|
66
|
+
} = this.layer.getLayerConfig();
|
|
67
|
+
if (this.rendererService.getDirty()) {
|
|
68
|
+
var _this$texture;
|
|
69
|
+
(_this$texture = this.texture) === null || _this$texture === void 0 || _this$texture.bind();
|
|
70
|
+
}
|
|
71
|
+
const commonOptions = {
|
|
72
|
+
u_textSize: [1024, this.iconService.canvasHeight || 128],
|
|
73
|
+
u_heightfixed: Number(heightfixed),
|
|
74
|
+
u_raisingHeight: Number(raisingHeight),
|
|
75
|
+
u_size_unit: _interface.SizeUnitType[unit]
|
|
76
|
+
}; //2+1+1+1
|
|
77
|
+
const commonBufferInfo = this.getUniformsBufferInfo(commonOptions);
|
|
78
|
+
return commonBufferInfo;
|
|
79
|
+
}
|
|
80
|
+
getAttribute() {
|
|
81
|
+
return this.styleAttributeService.createAttributesAndIndices(this.layer.getEncodedData(), _triangulation.PointFillTriangulation);
|
|
82
|
+
}
|
|
83
|
+
initModels() {
|
|
84
|
+
var _this = this;
|
|
85
|
+
return (0, _asyncToGenerator2.default)(function* () {
|
|
86
|
+
_this.iconService.on('imageUpdate', _this.updateTexture);
|
|
87
|
+
_this.updateTexture();
|
|
88
|
+
return _this.buildModels();
|
|
89
|
+
})();
|
|
90
|
+
}
|
|
91
|
+
buildModels() {
|
|
92
|
+
var _this2 = this;
|
|
93
|
+
return (0, _asyncToGenerator2.default)(function* () {
|
|
94
|
+
_this2.initUniformsBuffer();
|
|
95
|
+
const model = yield _this2.layer.buildLayerModel({
|
|
96
|
+
moduleName: 'pointFillImage',
|
|
97
|
+
vertexShader: pointFillVert,
|
|
98
|
+
fragmentShader: pointFillFrag,
|
|
99
|
+
triangulation: _triangulation.PointFillTriangulation,
|
|
100
|
+
depth: {
|
|
101
|
+
enable: false
|
|
102
|
+
},
|
|
103
|
+
defines: _this2.getDefines(),
|
|
104
|
+
inject: _this2.getInject(),
|
|
105
|
+
cull: {
|
|
106
|
+
enable: true,
|
|
107
|
+
face: _l7Core.gl.FRONT
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
return [model];
|
|
111
|
+
})();
|
|
112
|
+
}
|
|
113
|
+
clearModels() {
|
|
114
|
+
var _this$texture2;
|
|
115
|
+
this.iconService.off('imageUpdate', this.updateTexture);
|
|
116
|
+
(_this$texture2 = this.texture) === null || _this$texture2 === void 0 || _this$texture2.destroy();
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// overwrite baseModel func
|
|
120
|
+
registerBuiltinAttributes() {
|
|
121
|
+
// 注册 Position 属性 64 位地位部分,经纬度数据开启双精度,避免大于 20层级以上出现数据偏移
|
|
122
|
+
this.registerPosition64LowAttribute();
|
|
123
|
+
this.styleAttributeService.registerStyleAttribute({
|
|
124
|
+
name: 'uv',
|
|
125
|
+
type: _l7Core.AttributeType.Attribute,
|
|
126
|
+
descriptor: {
|
|
127
|
+
name: 'a_Uv',
|
|
128
|
+
shaderLocation: this.attributeLocation.UV,
|
|
129
|
+
buffer: {
|
|
130
|
+
// give the WebGL driver a hint that this buffer may change
|
|
131
|
+
usage: _l7Core.gl.DYNAMIC_DRAW,
|
|
132
|
+
data: [],
|
|
133
|
+
type: _l7Core.gl.FLOAT
|
|
134
|
+
},
|
|
135
|
+
size: 2,
|
|
136
|
+
update: feature => {
|
|
137
|
+
const iconMap = this.iconService.getIconMap();
|
|
138
|
+
const {
|
|
139
|
+
shape
|
|
140
|
+
} = feature;
|
|
141
|
+
const {
|
|
142
|
+
x,
|
|
143
|
+
y
|
|
144
|
+
} = iconMap[shape] || {
|
|
145
|
+
x: -64,
|
|
146
|
+
y: -64
|
|
147
|
+
};
|
|
148
|
+
return [x, y];
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
this.styleAttributeService.registerStyleAttribute({
|
|
153
|
+
name: 'extrude',
|
|
154
|
+
type: _l7Core.AttributeType.Attribute,
|
|
155
|
+
descriptor: {
|
|
156
|
+
name: 'a_Extrude',
|
|
157
|
+
shaderLocation: this.attributeLocation.EXTRUDE,
|
|
158
|
+
buffer: {
|
|
159
|
+
// give the WebGL driver a hint that this buffer may change
|
|
160
|
+
usage: _l7Core.gl.DYNAMIC_DRAW,
|
|
161
|
+
data: [],
|
|
162
|
+
type: _l7Core.gl.FLOAT
|
|
163
|
+
},
|
|
164
|
+
size: 3,
|
|
165
|
+
update: (feature, featureIdx, vertex, attributeIdx) => {
|
|
166
|
+
const extrude = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, -1, 0];
|
|
167
|
+
const extrudeIndex = attributeIdx % 4 * 3;
|
|
168
|
+
return [extrude[extrudeIndex], extrude[extrudeIndex + 1], extrude[extrudeIndex + 2]];
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
// point layer size;
|
|
174
|
+
this.styleAttributeService.registerStyleAttribute({
|
|
175
|
+
name: 'size',
|
|
176
|
+
type: _l7Core.AttributeType.Attribute,
|
|
177
|
+
descriptor: {
|
|
178
|
+
name: 'a_Size',
|
|
179
|
+
shaderLocation: this.attributeLocation.SIZE,
|
|
180
|
+
buffer: {
|
|
181
|
+
// give the WebGL driver a hint that this buffer may change
|
|
182
|
+
usage: _l7Core.gl.DYNAMIC_DRAW,
|
|
183
|
+
data: [],
|
|
184
|
+
type: _l7Core.gl.FLOAT
|
|
185
|
+
},
|
|
186
|
+
size: 1,
|
|
187
|
+
update: feature => {
|
|
188
|
+
const {
|
|
189
|
+
size = 5
|
|
190
|
+
} = feature;
|
|
191
|
+
return Array.isArray(size) ? [size[0]] : [size];
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
exports.default = FillImageModel;
|