@antv/l7-layers 2.20.5 → 2.20.6
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 +3 -3
- package/es/citybuliding/models/build.d.ts +7 -12
- package/es/citybuliding/models/build.js +22 -11
- package/es/citybuliding/shaders/build_frag.glsl +26 -23
- package/es/citybuliding/shaders/build_vert.glsl +24 -16
- package/es/core/BaseLayer.d.ts +14 -2
- package/es/core/BaseLayer.js +53 -9
- package/es/core/BaseModel.d.ts +1 -1
- package/es/core/BaseModel.js +41 -15
- package/es/core/CommonStyleAttribute.d.ts +4 -2
- package/es/core/CommonStyleAttribute.js +3 -0
- package/es/core/LayerPickService.d.ts +1 -1
- package/es/core/TextureService.d.ts +2 -2
- package/es/core/interface.d.ts +7 -3
- package/es/core/interface.js +0 -1
- package/es/core/line_trangluation.d.ts +1 -1
- package/es/core/shape/arrow.d.ts +1 -1
- package/es/core/shape/extrude.d.ts +1 -1
- package/es/core/triangulation.d.ts +1 -1
- package/es/core/triangulation.js +13 -7
- package/es/core/utils.js +1 -1
- package/es/earth/index.d.ts +1 -1
- package/es/earth/models/atmosphere.d.ts +8 -2
- package/es/earth/models/atmosphere.js +15 -8
- package/es/earth/models/base.d.ts +8 -2
- package/es/earth/models/base.js +21 -12
- package/es/earth/models/bloomsphere.d.ts +8 -2
- package/es/earth/models/bloomsphere.js +15 -8
- package/es/earth/shaders/{atmosphere_frag.glsl → atmosphere/atmosphere_frag.glsl} +9 -6
- package/es/earth/shaders/atmosphere/atmosphere_vert.glsl +22 -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 +16 -0
- package/es/earth/shaders/bloomshpere/bloomsphere_vert.glsl +19 -0
- package/es/geometry/index.d.ts +2 -2
- package/es/geometry/models/billboard.d.ts +8 -1
- package/es/geometry/models/billboard.js +26 -11
- package/es/geometry/models/plane.d.ts +8 -1
- package/es/geometry/models/plane.js +23 -6
- package/es/geometry/models/sprite.d.ts +12 -2
- package/es/geometry/models/sprite.js +44 -18
- package/es/geometry/shaders/billboard_frag.glsl +11 -6
- package/es/geometry/shaders/billboard_vert.glsl +12 -15
- package/es/geometry/shaders/plane_frag.glsl +14 -10
- package/es/geometry/shaders/plane_vert.glsl +11 -10
- package/es/geometry/shaders/sprite_frag.glsl +11 -7
- package/es/geometry/shaders/sprite_vert.glsl +10 -9
- package/es/heatmap/index.d.ts +3 -3
- package/es/heatmap/models/grid.d.ts +8 -1
- package/es/heatmap/models/grid.js +25 -12
- package/es/heatmap/models/grid3d.d.ts +8 -1
- package/es/heatmap/models/grid3d.js +29 -13
- package/es/heatmap/models/heatmap.d.ts +6 -4
- package/es/heatmap/models/heatmap.js +123 -75
- package/es/heatmap/models/hexagon.d.ts +8 -1
- package/es/heatmap/models/hexagon.js +25 -12
- package/es/heatmap/shaders/grid/grid_frag.glsl +8 -0
- package/es/heatmap/shaders/{grid_vert.glsl → grid/grid_vert.glsl} +15 -15
- package/es/heatmap/shaders/grid3d/grid_3d_frag.glsl +8 -0
- package/{lib/heatmap/shaders/hexagon_3d_vert.glsl → es/heatmap/shaders/grid3d/grid_3d_vert.glsl} +13 -16
- package/es/heatmap/shaders/heatmap/heatmap_3d_frag.glsl +24 -0
- package/es/heatmap/shaders/{heatmap_3d_vert.glsl → heatmap/heatmap_3d_vert.glsl} +19 -9
- package/es/heatmap/shaders/heatmap/heatmap_frag.glsl +52 -0
- package/es/heatmap/shaders/heatmap/heatmap_framebuffer_frag.glsl +16 -0
- package/{lib/heatmap/shaders → es/heatmap/shaders/heatmap}/heatmap_framebuffer_vert.glsl +14 -9
- package/es/heatmap/shaders/heatmap/heatmap_vert.glsl +19 -0
- package/es/heatmap/shaders/hexagon/hexagon_frag.glsl +8 -0
- package/es/heatmap/shaders/{hexagon_vert.glsl → hexagon/hexagon_vert.glsl} +12 -13
- package/es/image/index.d.ts +2 -2
- package/es/image/models/image.d.ts +9 -2
- package/es/image/models/image.js +83 -44
- package/es/image/shaders/image_frag.glsl +34 -7
- package/es/image/shaders/image_vert.glsl +11 -5
- package/es/line/index.d.ts +4 -4
- package/es/line/index.js +2 -1
- package/es/line/models/arc.d.ts +8 -3
- package/es/line/models/arc.js +57 -76
- package/es/line/models/arc_3d.d.ts +8 -3
- package/es/line/models/arc_3d.js +46 -57
- package/es/line/models/flow.d.ts +8 -2
- package/es/line/models/flow.js +14 -12
- package/es/line/models/great_circle.d.ts +8 -3
- package/es/line/models/great_circle.js +40 -29
- package/es/line/models/index.d.ts +1 -1
- package/es/line/models/index.js +3 -6
- package/es/line/models/line.d.ts +8 -3
- package/es/line/models/line.js +67 -140
- package/es/line/models/{simpleLine.d.ts → simple_line.d.ts} +8 -2
- package/es/line/models/simple_line.js +204 -0
- package/es/line/models/wall.d.ts +8 -3
- package/es/line/models/wall.js +35 -27
- package/es/line/shaders/{line_arc_frag.glsl → arc/line_arc_frag.glsl} +36 -26
- package/es/line/shaders/{line_arc_vert.glsl → arc/line_arc_vert.glsl} +52 -22
- package/es/line/shaders/{line_arc_3d_frag.glsl → arc3d/line_arc_3d_frag.glsl} +32 -24
- package/{lib/line/shaders → es/line/shaders/arc3d}/line_arc_3d_vert.glsl +37 -27
- package/es/line/shaders/flow/flow_line_frag.glsl +5 -4
- package/es/line/shaders/flow/flow_line_vert.glsl +17 -18
- package/es/line/shaders/{line_arc_great_circle_frag.glsl → greatCircle/line_arc_great_circle_frag.glsl} +30 -30
- package/{lib/line/shaders → es/line/shaders/greatCircle}/line_arc_great_circle_vert.glsl +43 -40
- package/es/line/shaders/{line_frag.glsl → line/line_frag.glsl} +55 -28
- package/es/line/shaders/line/line_vert.glsl +114 -0
- package/es/line/shaders/simple/simpleline_frag.glsl +27 -3
- package/es/line/shaders/simple/simpleline_vert.glsl +20 -20
- package/es/line/shaders/wall/wall_frag.glsl +31 -26
- package/es/line/shaders/wall/wall_vert.glsl +29 -22
- package/es/mask/index.d.ts +2 -2
- package/es/mask/models/fill.d.ts +1 -1
- package/es/plugins/DataMappingPlugin.d.ts +1 -1
- package/es/plugins/DataMappingPlugin.js +1 -3
- package/es/plugins/DataSourcePlugin.d.ts +1 -1
- package/es/plugins/FeatureScalePlugin.d.ts +1 -1
- package/es/plugins/FeatureScalePlugin.js +14 -3
- package/es/plugins/LayerAnimateStylePlugin.d.ts +1 -1
- package/es/plugins/LayerMaskPlugin.d.ts +1 -1
- package/es/plugins/LayerModelPlugin.d.ts +1 -1
- package/es/plugins/LayerStylePlugin.d.ts +1 -1
- package/es/plugins/LightingPlugin.d.ts +1 -1
- package/es/plugins/MultiPassRendererPlugin.d.ts +1 -1
- package/es/plugins/PixelPickingPlugin.d.ts +6 -2
- package/es/plugins/PixelPickingPlugin.js +36 -49
- package/es/plugins/RegisterStyleAttributePlugin.d.ts +1 -1
- package/es/plugins/ShaderUniformPlugin.d.ts +1 -1
- package/es/plugins/ShaderUniformPlugin.js +11 -6
- package/es/plugins/UpdateModelPlugin.d.ts +1 -1
- package/es/plugins/UpdateStyleAttributePlugin.d.ts +1 -1
- package/es/point/index.d.ts +2 -2
- package/es/point/index.js +1 -0
- package/es/point/models/billboard_point.d.ts +9 -3
- package/es/point/models/billboard_point.js +18 -18
- package/es/point/models/earthExtrude.d.ts +7 -12
- package/es/point/models/earthExtrude.js +21 -13
- package/es/point/models/earthFill.d.ts +8 -3
- package/es/point/models/earthFill.js +18 -30
- package/es/point/models/extrude.d.ts +1 -4
- package/es/point/models/extrude.js +2 -11
- package/es/point/models/fill.d.ts +8 -2
- package/es/point/models/fill.js +33 -84
- package/es/point/models/{fillmage.d.ts → fillImage.d.ts} +8 -2
- package/es/point/models/{fillmage.js → fillImage.js} +23 -15
- package/es/point/models/image.d.ts +8 -1
- package/es/point/models/image.js +31 -17
- package/es/point/models/index.js +1 -1
- package/es/point/models/normal.d.ts +9 -3
- package/es/point/models/normal.js +13 -30
- package/es/point/models/radar.d.ts +8 -2
- package/es/point/models/radar.js +23 -45
- package/es/point/models/text.d.ts +9 -2
- package/es/point/models/text.js +31 -32
- package/{lib/point/shaders → es/point/shaders/billboard}/billboard_point_frag.glsl +17 -13
- package/{lib/point/shaders → es/point/shaders/billboard}/billboard_point_vert.glsl +13 -14
- package/es/point/shaders/earthExtrude/earthExtrude_frag.glsl +36 -0
- package/{lib/point/shaders/earth/extrude_vert.glsl → es/point/shaders/earthExtrude/earthExtrude_vert.glsl} +25 -22
- package/{lib/point/shaders/earth/fill_frag.glsl → es/point/shaders/earthFill/earthFill_frag.glsl} +20 -18
- package/{lib/point/shaders/earth/fill_vert.glsl → es/point/shaders/earthFill/earthFill_vert.glsl} +17 -22
- package/es/point/shaders/extrude/extrude_vert.glsl +0 -3
- package/{lib/point/shaders → es/point/shaders/fill}/fill_frag.glsl +18 -1
- package/es/point/shaders/{fill_vert.glsl → fill/fill_vert.glsl} +5 -4
- package/es/point/shaders/fillImage/fillImage_frag.glsl +24 -0
- package/{lib/point/shaders/image → es/point/shaders/fillImage}/fillImage_vert.glsl +15 -17
- package/es/point/shaders/image/image_frag.glsl +42 -0
- package/{lib/point/shaders → es/point/shaders/image}/image_vert.glsl +14 -13
- package/es/point/shaders/radar/radar_frag.glsl +19 -14
- package/es/point/shaders/radar/radar_vert.glsl +21 -24
- package/es/point/shaders/text/text_frag.glsl +44 -0
- package/es/point/shaders/{text_vert.glsl → text/text_vert.glsl} +19 -17
- package/es/point/shape/extrude.d.ts +1 -1
- package/es/polygon/index.d.ts +2 -2
- package/es/polygon/models/extrude.d.ts +9 -9
- package/es/polygon/models/extrude.js +38 -15
- package/es/polygon/models/extrusion.d.ts +8 -1
- package/es/polygon/models/extrusion.js +24 -7
- package/es/polygon/models/fill.d.ts +9 -4
- package/es/polygon/models/fill.js +26 -13
- package/es/polygon/models/ocean.d.ts +9 -7
- package/es/polygon/models/ocean.js +30 -14
- package/es/polygon/models/water.d.ts +9 -4
- package/es/polygon/models/water.js +26 -10
- package/es/polygon/shaders/extrude/polygon_extrude_frag.glsl +14 -14
- package/es/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +17 -15
- package/es/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +18 -18
- package/es/polygon/shaders/extrude/polygon_extrude_vert.glsl +18 -24
- package/es/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +19 -15
- package/es/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +20 -24
- package/es/polygon/shaders/extrusion/polygon_extrusion_frag.glsl +4 -8
- package/es/polygon/shaders/extrusion/polygon_extrusion_vert.glsl +7 -16
- package/es/polygon/shaders/fill/fill_frag.glsl +7 -0
- package/es/polygon/shaders/fill/fill_linear_frag.glsl +20 -0
- package/{lib/polygon/shaders/polygon_linear_vert.glsl → es/polygon/shaders/fill/fill_linear_vert.glsl} +12 -11
- package/es/polygon/shaders/{polygon_vert.glsl → fill/fill_vert.glsl} +6 -6
- package/es/polygon/shaders/{water/polygon_ocean_frag.glsl → ocean/ocean_frag.glsl} +13 -13
- package/es/polygon/shaders/ocean/ocean_vert.glsl +22 -0
- package/es/polygon/shaders/water/polygon_water_frag.glsl +14 -12
- package/es/polygon/shaders/water/polygon_water_vert.glsl +10 -10
- package/es/raster/buffers/triangulation.d.ts +1 -1
- package/es/raster/index.d.ts +2 -2
- package/es/raster/models/raster.d.ts +9 -8
- package/es/raster/models/raster.js +54 -38
- package/es/raster/models/rasterRgb.d.ts +9 -7
- package/es/raster/models/rasterRgb.js +36 -19
- package/es/raster/models/rasterTerrainRgb.d.ts +1 -1
- package/es/raster/models/rasterTerrainRgb.js +2 -2
- package/es/raster/shaders/raster/raster_2d_frag.glsl +34 -0
- package/es/raster/shaders/raster/raster_2d_vert.glsl +21 -0
- package/es/raster/shaders/rgb/raster_rgb_frag.glsl +26 -0
- package/es/raster/shaders/rgb/raster_rgb_vert.glsl +21 -0
- package/es/tile/core/BaseLayer.d.ts +2 -2
- package/es/tile/core/TileDebugLayer.d.ts +1 -1
- package/es/tile/interaction/getRasterData.d.ts +2 -2
- package/es/tile/interaction/utils.d.ts +1 -1
- package/es/tile/interface.d.ts +2 -2
- package/es/tile/service/TileLayerService.d.ts +2 -2
- package/es/tile/service/TilePickService.d.ts +2 -2
- package/es/tile/service/TileSourceService.d.ts +1 -1
- package/es/tile/tile/Tile.d.ts +2 -3
- package/es/tile/tile/VectorTile.d.ts +1 -1
- package/es/tile/tile/index.d.ts +1 -1
- package/es/tile/utils/constants.js +1 -1
- package/es/tile/utils/utils.d.ts +1 -1
- package/es/utils/blend.d.ts +1 -1
- package/es/utils/multiPassRender.d.ts +1 -1
- package/es/utils/stencil.d.ts +1 -1
- package/es/wind/index.d.ts +3 -3
- package/es/wind/models/wind.d.ts +1 -1
- package/lib/citybuliding/models/build.js +22 -11
- package/lib/citybuliding/shaders/build_frag.glsl +26 -23
- package/lib/citybuliding/shaders/build_vert.glsl +24 -16
- package/lib/core/BaseLayer.js +53 -9
- package/lib/core/BaseModel.js +41 -15
- package/lib/core/CommonStyleAttribute.js +3 -0
- package/lib/core/triangulation.js +12 -6
- package/lib/core/utils.js +1 -1
- package/lib/earth/models/atmosphere.js +15 -8
- package/lib/earth/models/base.js +21 -12
- package/lib/earth/models/bloomsphere.js +15 -8
- package/lib/earth/shaders/{atmosphere_frag.glsl → atmosphere/atmosphere_frag.glsl} +9 -6
- package/lib/earth/shaders/atmosphere/atmosphere_vert.glsl +22 -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 +16 -0
- package/lib/earth/shaders/bloomshpere/bloomsphere_vert.glsl +19 -0
- package/lib/geometry/models/billboard.js +26 -11
- package/lib/geometry/models/plane.js +23 -6
- package/lib/geometry/models/sprite.js +44 -18
- package/lib/geometry/shaders/billboard_frag.glsl +11 -6
- package/lib/geometry/shaders/billboard_vert.glsl +12 -15
- package/lib/geometry/shaders/plane_frag.glsl +14 -10
- package/lib/geometry/shaders/plane_vert.glsl +11 -10
- package/lib/geometry/shaders/sprite_frag.glsl +11 -7
- package/lib/geometry/shaders/sprite_vert.glsl +10 -9
- package/lib/heatmap/models/grid.js +25 -12
- package/lib/heatmap/models/grid3d.js +29 -13
- package/lib/heatmap/models/heatmap.js +122 -74
- package/lib/heatmap/models/hexagon.js +25 -12
- package/lib/heatmap/shaders/grid/grid_frag.glsl +8 -0
- package/lib/heatmap/shaders/{grid_vert.glsl → grid/grid_vert.glsl} +15 -15
- package/lib/heatmap/shaders/grid3d/grid_3d_frag.glsl +8 -0
- package/{es/heatmap/shaders/hexagon_3d_vert.glsl → lib/heatmap/shaders/grid3d/grid_3d_vert.glsl} +13 -16
- package/lib/heatmap/shaders/heatmap/heatmap_3d_frag.glsl +24 -0
- package/lib/heatmap/shaders/{heatmap_3d_vert.glsl → heatmap/heatmap_3d_vert.glsl} +19 -9
- package/lib/heatmap/shaders/heatmap/heatmap_frag.glsl +52 -0
- package/lib/heatmap/shaders/heatmap/heatmap_framebuffer_frag.glsl +16 -0
- package/{es/heatmap/shaders → lib/heatmap/shaders/heatmap}/heatmap_framebuffer_vert.glsl +14 -9
- package/lib/heatmap/shaders/heatmap/heatmap_vert.glsl +19 -0
- package/lib/heatmap/shaders/hexagon/hexagon_frag.glsl +8 -0
- package/lib/heatmap/shaders/{hexagon_vert.glsl → hexagon/hexagon_vert.glsl} +12 -13
- package/lib/image/models/image.js +83 -44
- package/lib/image/shaders/image_frag.glsl +34 -7
- package/lib/image/shaders/image_vert.glsl +11 -5
- package/lib/line/index.js +2 -1
- package/lib/line/models/arc.js +57 -76
- package/lib/line/models/arc_3d.js +47 -59
- package/lib/line/models/flow.js +14 -12
- package/lib/line/models/great_circle.js +40 -29
- package/lib/line/models/index.js +4 -7
- package/lib/line/models/line.js +67 -142
- package/lib/line/models/{simpleLine.js → simple_line.js} +84 -74
- package/lib/line/models/wall.js +35 -27
- package/lib/line/shaders/{line_arc_frag.glsl → arc/line_arc_frag.glsl} +36 -26
- package/lib/line/shaders/{line_arc_vert.glsl → arc/line_arc_vert.glsl} +52 -22
- package/lib/line/shaders/{line_arc_3d_frag.glsl → arc3d/line_arc_3d_frag.glsl} +32 -24
- package/{es/line/shaders → lib/line/shaders/arc3d}/line_arc_3d_vert.glsl +37 -27
- package/lib/line/shaders/flow/flow_line_frag.glsl +5 -4
- package/lib/line/shaders/flow/flow_line_vert.glsl +17 -18
- package/lib/line/shaders/{line_arc_great_circle_frag.glsl → greatCircle/line_arc_great_circle_frag.glsl} +30 -30
- package/{es/line/shaders → lib/line/shaders/greatCircle}/line_arc_great_circle_vert.glsl +43 -40
- package/lib/line/shaders/{line_frag.glsl → line/line_frag.glsl} +55 -28
- package/lib/line/shaders/line/line_vert.glsl +114 -0
- package/lib/line/shaders/simple/simpleline_frag.glsl +27 -3
- package/lib/line/shaders/simple/simpleline_vert.glsl +20 -20
- package/lib/line/shaders/wall/wall_frag.glsl +31 -26
- package/lib/line/shaders/wall/wall_vert.glsl +29 -22
- package/lib/plugins/DataMappingPlugin.js +1 -3
- package/lib/plugins/FeatureScalePlugin.js +14 -3
- package/lib/plugins/PixelPickingPlugin.js +35 -48
- package/lib/plugins/ShaderUniformPlugin.js +11 -6
- package/lib/point/index.js +1 -0
- package/lib/point/models/billboard_point.js +18 -18
- package/lib/point/models/earthExtrude.js +21 -13
- package/lib/point/models/earthFill.js +18 -30
- package/lib/point/models/extrude.js +2 -11
- package/lib/point/models/fill.js +33 -84
- package/lib/point/models/{fillmage.js → fillImage.js} +24 -17
- package/lib/point/models/image.js +31 -17
- package/lib/point/models/index.js +2 -2
- package/lib/point/models/normal.js +13 -30
- package/lib/point/models/radar.js +23 -45
- package/lib/point/models/text.js +31 -32
- package/{es/point/shaders → lib/point/shaders/billboard}/billboard_point_frag.glsl +17 -13
- package/{es/point/shaders → lib/point/shaders/billboard}/billboard_point_vert.glsl +13 -14
- package/lib/point/shaders/earthExtrude/earthExtrude_frag.glsl +36 -0
- package/{es/point/shaders/earth/extrude_vert.glsl → lib/point/shaders/earthExtrude/earthExtrude_vert.glsl} +25 -22
- package/{es/point/shaders/earth/fill_frag.glsl → lib/point/shaders/earthFill/earthFill_frag.glsl} +20 -18
- package/{es/point/shaders/earth/fill_vert.glsl → lib/point/shaders/earthFill/earthFill_vert.glsl} +17 -22
- package/lib/point/shaders/extrude/extrude_vert.glsl +0 -3
- package/{es/point/shaders → lib/point/shaders/fill}/fill_frag.glsl +18 -1
- package/lib/point/shaders/{fill_vert.glsl → fill/fill_vert.glsl} +5 -4
- package/lib/point/shaders/fillImage/fillImage_frag.glsl +24 -0
- package/{es/point/shaders/image → lib/point/shaders/fillImage}/fillImage_vert.glsl +15 -17
- package/lib/point/shaders/image/image_frag.glsl +42 -0
- package/{es/point/shaders → lib/point/shaders/image}/image_vert.glsl +14 -13
- package/lib/point/shaders/radar/radar_frag.glsl +19 -14
- package/lib/point/shaders/radar/radar_vert.glsl +21 -24
- package/lib/point/shaders/text/text_frag.glsl +44 -0
- package/lib/point/shaders/{text_vert.glsl → text/text_vert.glsl} +19 -17
- package/lib/polygon/models/extrude.js +38 -15
- package/lib/polygon/models/extrusion.js +24 -7
- package/lib/polygon/models/fill.js +26 -13
- package/lib/polygon/models/ocean.js +30 -14
- package/lib/polygon/models/water.js +26 -10
- package/lib/polygon/shaders/extrude/polygon_extrude_frag.glsl +14 -14
- package/lib/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +17 -15
- package/lib/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +18 -18
- package/lib/polygon/shaders/extrude/polygon_extrude_vert.glsl +18 -24
- package/lib/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +19 -15
- package/lib/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +20 -24
- package/lib/polygon/shaders/extrusion/polygon_extrusion_frag.glsl +4 -8
- package/lib/polygon/shaders/extrusion/polygon_extrusion_vert.glsl +7 -16
- package/lib/polygon/shaders/fill/fill_frag.glsl +7 -0
- package/lib/polygon/shaders/fill/fill_linear_frag.glsl +20 -0
- package/{es/polygon/shaders/polygon_linear_vert.glsl → lib/polygon/shaders/fill/fill_linear_vert.glsl} +12 -11
- package/lib/polygon/shaders/{polygon_vert.glsl → fill/fill_vert.glsl} +6 -6
- package/lib/polygon/shaders/{water/polygon_ocean_frag.glsl → ocean/ocean_frag.glsl} +13 -13
- package/lib/polygon/shaders/ocean/ocean_vert.glsl +22 -0
- package/lib/polygon/shaders/water/polygon_water_frag.glsl +14 -12
- package/lib/polygon/shaders/water/polygon_water_vert.glsl +10 -10
- package/lib/raster/models/raster.js +54 -38
- package/lib/raster/models/rasterRgb.js +36 -19
- package/lib/raster/models/rasterTerrainRgb.js +2 -2
- package/lib/raster/shaders/raster/raster_2d_frag.glsl +34 -0
- package/lib/raster/shaders/raster/raster_2d_vert.glsl +21 -0
- package/lib/raster/shaders/rgb/raster_rgb_frag.glsl +26 -0
- package/lib/raster/shaders/rgb/raster_rgb_vert.glsl +21 -0
- package/lib/tile/utils/constants.js +1 -1
- package/package.json +7 -7
- package/es/earth/shaders/atmosphere_vert.glsl +0 -26
- package/es/earth/shaders/base_frag.glsl +0 -13
- package/es/earth/shaders/base_vert.glsl +0 -52
- package/es/earth/shaders/bloomsphere_frag.glsl +0 -15
- package/es/earth/shaders/bloomsphere_vert.glsl +0 -20
- package/es/heatmap/shaders/heatmap_3d_frag.glsl +0 -14
- package/es/heatmap/shaders/heatmap_frag.glsl +0 -47
- package/es/heatmap/shaders/heatmap_framebuffer_frag.glsl +0 -10
- package/es/heatmap/shaders/heatmap_vert.glsl +0 -10
- package/es/heatmap/shaders/hexagon_frag.glsl +0 -12
- package/es/line/models/earthArc_3d.d.ts +0 -17
- package/es/line/models/earthArc_3d.js +0 -285
- package/es/line/models/linearline.d.ts +0 -11
- package/es/line/models/linearline.js +0 -241
- package/es/line/models/simpleLine.js +0 -194
- package/es/line/shaders/arc_chunks.vert.glsl +0 -21
- package/es/line/shaders/dash/arc_dash_frag.glsl +0 -21
- package/es/line/shaders/dash/arc_dash_vert.glsl +0 -102
- package/es/line/shaders/dash/line_dash_frag.glsl +0 -27
- package/es/line/shaders/dash/line_dash_vert.glsl +0 -82
- package/es/line/shaders/line_arc2d_vert.glsl +0 -114
- package/es/line/shaders/line_bezier_vert.glsl +0 -85
- package/es/line/shaders/line_vert.glsl +0 -165
- package/es/line/shaders/linear/arc3d_linear_frag.glsl +0 -32
- package/es/line/shaders/linear/arc3d_linear_vert.glsl +0 -161
- package/es/line/shaders/linear/arc_linear_frag.glsl +0 -10
- package/es/line/shaders/linear/arc_linear_vert.glsl +0 -98
- package/es/line/shaders/linear/line_linear_frag.glsl +0 -25
- package/es/line/shaders/linearLine/line_linear_frag.glsl +0 -8
- package/es/line/shaders/linearLine/line_linear_vert.glsl +0 -93
- package/es/line/shaders/simple/simpleline_linear_frag.glsl +0 -8
- package/es/point/shaders/animate/wave_frag.glsl +0 -55
- package/es/point/shaders/earth/extrude_frag.glsl +0 -32
- package/es/point/shaders/image/fillImage_frag.glsl +0 -18
- package/es/point/shaders/image_frag.glsl +0 -37
- package/es/point/shaders/text_frag.glsl +0 -39
- package/es/polygon/shaders/polygon_frag.glsl +0 -7
- package/es/polygon/shaders/polygon_linear_frag.glsl +0 -15
- package/es/polygon/shaders/water/polygon_ocean_vert.glsl +0 -16
- package/es/raster/shaders/raster_2d_frag.glsl +0 -32
- package/es/raster/shaders/raster_2d_vert.glsl +0 -13
- package/es/raster/shaders/raster_frag.glsl +0 -11
- package/es/raster/shaders/raster_rgb_frag.glsl +0 -20
- package/es/raster/shaders/raster_vert.glsl +0 -34
- package/lib/earth/shaders/atmosphere_vert.glsl +0 -26
- package/lib/earth/shaders/base_frag.glsl +0 -13
- package/lib/earth/shaders/base_vert.glsl +0 -52
- package/lib/earth/shaders/bloomsphere_frag.glsl +0 -15
- package/lib/earth/shaders/bloomsphere_vert.glsl +0 -20
- package/lib/heatmap/shaders/heatmap_3d_frag.glsl +0 -14
- package/lib/heatmap/shaders/heatmap_frag.glsl +0 -47
- package/lib/heatmap/shaders/heatmap_framebuffer_frag.glsl +0 -10
- package/lib/heatmap/shaders/heatmap_vert.glsl +0 -10
- package/lib/heatmap/shaders/hexagon_frag.glsl +0 -12
- package/lib/line/models/earthArc_3d.js +0 -291
- package/lib/line/models/linearline.js +0 -247
- package/lib/line/shaders/arc_chunks.vert.glsl +0 -21
- package/lib/line/shaders/dash/arc_dash_frag.glsl +0 -21
- package/lib/line/shaders/dash/arc_dash_vert.glsl +0 -102
- package/lib/line/shaders/dash/line_dash_frag.glsl +0 -27
- package/lib/line/shaders/dash/line_dash_vert.glsl +0 -82
- package/lib/line/shaders/line_arc2d_vert.glsl +0 -114
- package/lib/line/shaders/line_bezier_vert.glsl +0 -85
- package/lib/line/shaders/line_vert.glsl +0 -165
- package/lib/line/shaders/linear/arc3d_linear_frag.glsl +0 -32
- package/lib/line/shaders/linear/arc3d_linear_vert.glsl +0 -161
- package/lib/line/shaders/linear/arc_linear_frag.glsl +0 -10
- package/lib/line/shaders/linear/arc_linear_vert.glsl +0 -98
- package/lib/line/shaders/linear/line_linear_frag.glsl +0 -25
- package/lib/line/shaders/linearLine/line_linear_frag.glsl +0 -8
- package/lib/line/shaders/linearLine/line_linear_vert.glsl +0 -93
- package/lib/line/shaders/simple/simpleline_linear_frag.glsl +0 -8
- package/lib/point/shaders/animate/wave_frag.glsl +0 -55
- package/lib/point/shaders/earth/extrude_frag.glsl +0 -32
- package/lib/point/shaders/image/fillImage_frag.glsl +0 -18
- package/lib/point/shaders/image_frag.glsl +0 -37
- package/lib/point/shaders/text_frag.glsl +0 -39
- package/lib/polygon/shaders/polygon_frag.glsl +0 -7
- package/lib/polygon/shaders/polygon_linear_frag.glsl +0 -15
- package/lib/polygon/shaders/water/polygon_ocean_vert.glsl +0 -16
- package/lib/raster/shaders/raster_2d_frag.glsl +0 -32
- package/lib/raster/shaders/raster_2d_vert.glsl +0 -13
- package/lib/raster/shaders/raster_frag.glsl +0 -11
- package/lib/raster/shaders/raster_rgb_frag.glsl +0 -20
- package/lib/raster/shaders/raster_vert.glsl +0 -34
- /package/es/point/shaders/{normal_frag.glsl → normal/normal_frag.glsl} +0 -0
- /package/es/point/shaders/{normal_vert.glsl → normal/normal_vert.glsl} +0 -0
- /package/es/raster/shaders/{raster_terrain_rgb_frag.glsl → terrain/terrain_rgb_frag.glsl} +0 -0
- /package/es/raster/shaders/{rater_terrain_rgb_vert.glsl → terrain/terrain_rgb_vert.glsl} +0 -0
- /package/lib/point/shaders/{normal_frag.glsl → normal/normal_frag.glsl} +0 -0
- /package/lib/point/shaders/{normal_vert.glsl → normal/normal_vert.glsl} +0 -0
- /package/lib/raster/shaders/{raster_terrain_rgb_frag.glsl → terrain/terrain_rgb_frag.glsl} +0 -0
- /package/lib/raster/shaders/{rater_terrain_rgb_vert.glsl → terrain/terrain_rgb_vert.glsl} +0 -0
package/es/point/models/radar.js
CHANGED
|
@@ -12,9 +12,10 @@ import BaseModel from "../../core/BaseModel";
|
|
|
12
12
|
import { SizeUnitType } from "../../core/interface";
|
|
13
13
|
import { PointFillTriangulation } from "../../core/triangulation";
|
|
14
14
|
/* babel-plugin-inline-import '../shaders/radar/radar_frag.glsl' */
|
|
15
|
-
var pointFillFrag = "\
|
|
15
|
+
var pointFillFrag = "\nlayout(std140) uniform commonUniorm{\n float u_additive;\n float u_size_unit;\n float u_speed: 1.0;\n float u_time;\n};\nin vec4 v_data;\nin vec4 v_color;\nin float v_radius;\nin vec2 v_extrude;\n#pragma include \"sdf_2d\"\n#pragma include \"picking\"\n\nout vec4 outputColor;\n\nvoid main() {\n\n lowp float antialiasblur = v_data.z;\n float r = v_radius / (v_radius);\n\n float outer_df = sdCircle(v_data.xy, 1.0);\n float inner_df = sdCircle(v_data.xy, r);\n\n float opacity_t = smoothstep(0.0, antialiasblur, outer_df);\n\n outputColor = vec4(v_color.rgb, v_color.a);\n\n if(u_additive > 0.0) {\n outputColor *= opacity_t;\n } else {\n outputColor.a *= opacity_t;\n }\n\n if(outputColor.a > 0.0) {\n outputColor = filterColor(outputColor);\n }\n\n vec2 extrude = v_extrude;\n vec2 dir = normalize(extrude);\n vec2 baseDir = vec2(1.0, 0.0);\n float pi = 3.14159265359;\n float flag = sign(dir.y);\n float rades = dot(dir, baseDir);\n float radar_v = (flag - 1.0) * -0.5 * acos(rades)/pi;\n // simple AA\n if(radar_v > 0.99) {\n radar_v = 1.0 - (radar_v - 0.99)/0.01;\n }\n\n outputColor.a *= radar_v;\n}\n";
|
|
16
16
|
/* babel-plugin-inline-import '../shaders/radar/radar_vert.glsl' */
|
|
17
|
-
var pointFillVert = "
|
|
17
|
+
var pointFillVert = "layout(location = 0) in vec3 a_Position;\nlayout(location = 1) in vec4 a_Color;\nlayout(location = 11) in vec4 a_ExtrudeAndSize;\n\nlayout(std140) uniform commonUniorm {\n float u_additive;\n float u_size_unit;\n float u_speed: 1.0;\n float u_time;\n};\n\nout vec4 v_data;\nout vec4 v_color;\nout float v_radius;\nout vec2 v_extrude;\n\n#pragma include \"projection\"\n#pragma include \"picking\"\n\nvoid main() {\n vec3 extrude = a_ExtrudeAndSize.xyz;\n float newSize = setPickingSize(a_ExtrudeAndSize.w);\n\n float time = u_time * u_speed;\n mat2 rotateMatrix = mat2( \n cos(time), sin(time), \n -sin(time), cos(time)\n );\n v_extrude = rotateMatrix * a_ExtrudeAndSize.xy;\n\n v_color = a_Color;\n v_color.a *= opacity;\n\n float blur = 0.0;\n float antialiasblur = -max(2.0 / u_DevicePixelRatio / a_ExtrudeAndSize.w, blur);\n\n if(u_size_unit == 1.) {\n newSize = newSize * u_PixelsPerMeter.z;\n }\n v_radius = newSize;\n\n vec2 offset = (extrude.xy * (newSize));\n vec3 aPosition = a_Position;\n \n offset = project_pixel(offset);\n \n v_data = vec4(extrude.x, extrude.y, antialiasblur, -1.0);\n\n vec4 project_pos = project_position(vec4(aPosition.xy, 0.0, 1.0));\n gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy + offset, project_pixel(setPickingOrder(0.0)), 1.0));\n\n setPickingColor(a_PickingColor);\n}\n";
|
|
18
|
+
import { ShaderLocation } from "../../core/CommonStyleAttribute";
|
|
18
19
|
var RadarModel = /*#__PURE__*/function (_BaseModel) {
|
|
19
20
|
_inherits(RadarModel, _BaseModel);
|
|
20
21
|
var _super = _createSuper(RadarModel);
|
|
@@ -23,35 +24,27 @@ var RadarModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
23
24
|
return _super.apply(this, arguments);
|
|
24
25
|
}
|
|
25
26
|
_createClass(RadarModel, [{
|
|
26
|
-
key: "
|
|
27
|
-
value: function
|
|
27
|
+
key: "getCommonUniformsInfo",
|
|
28
|
+
value: function getCommonUniformsInfo() {
|
|
28
29
|
var _ref = this.layer.getLayerConfig(),
|
|
29
|
-
_ref$opacity = _ref.opacity,
|
|
30
|
-
opacity = _ref$opacity === void 0 ? 1 : _ref$opacity,
|
|
31
30
|
blend = _ref.blend,
|
|
32
31
|
_ref$speed = _ref.speed,
|
|
33
32
|
speed = _ref$speed === void 0 ? 1 : _ref$speed,
|
|
34
33
|
_ref$unit = _ref.unit,
|
|
35
34
|
unit = _ref$unit === void 0 ? 'pixel' : _ref$unit;
|
|
36
|
-
|
|
35
|
+
var commonOptions = {
|
|
36
|
+
u_additive: blend === 'additive' ? 1.0 : 0.0,
|
|
37
37
|
u_size_unit: SizeUnitType[unit],
|
|
38
38
|
u_speed: speed,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
u_time: this.layer.getLayerAnimateTime()
|
|
40
|
+
}; //1+1+1+1
|
|
41
|
+
var commonBufferInfo = this.getUniformsBufferInfo(commonOptions);
|
|
42
|
+
return commonBufferInfo;
|
|
42
43
|
}
|
|
43
44
|
}, {
|
|
44
45
|
key: "getAnimateUniforms",
|
|
45
46
|
value: function getAnimateUniforms() {
|
|
46
|
-
|
|
47
|
-
_ref2$animateOption = _ref2.animateOption,
|
|
48
|
-
animateOption = _ref2$animateOption === void 0 ? {
|
|
49
|
-
enable: false
|
|
50
|
-
} : _ref2$animateOption;
|
|
51
|
-
return {
|
|
52
|
-
u_animate: this.animateOption2Array(animateOption),
|
|
53
|
-
u_time: this.layer.getLayerAnimateTime()
|
|
54
|
-
};
|
|
47
|
+
return {};
|
|
55
48
|
}
|
|
56
49
|
}, {
|
|
57
50
|
key: "getAttribute",
|
|
@@ -85,20 +78,22 @@ var RadarModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
85
78
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
86
79
|
while (1) switch (_context2.prev = _context2.next) {
|
|
87
80
|
case 0:
|
|
88
|
-
|
|
81
|
+
this.initUniformsBuffer();
|
|
82
|
+
_context2.next = 3;
|
|
89
83
|
return this.layer.buildLayerModel({
|
|
90
84
|
moduleName: 'pointRadar',
|
|
91
85
|
vertexShader: pointFillVert,
|
|
92
86
|
fragmentShader: pointFillFrag,
|
|
93
87
|
triangulation: PointFillTriangulation,
|
|
88
|
+
inject: this.getInject(),
|
|
94
89
|
depth: {
|
|
95
90
|
enable: false
|
|
96
91
|
}
|
|
97
92
|
});
|
|
98
|
-
case
|
|
93
|
+
case 3:
|
|
99
94
|
model = _context2.sent;
|
|
100
95
|
return _context2.abrupt("return", [model]);
|
|
101
|
-
case
|
|
96
|
+
case 5:
|
|
102
97
|
case "end":
|
|
103
98
|
return _context2.stop();
|
|
104
99
|
}
|
|
@@ -118,42 +113,25 @@ var RadarModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
118
113
|
key: "registerBuiltinAttributes",
|
|
119
114
|
value: function registerBuiltinAttributes() {
|
|
120
115
|
this.styleAttributeService.registerStyleAttribute({
|
|
121
|
-
name: '
|
|
116
|
+
name: 'extrudeAndSize',
|
|
122
117
|
type: AttributeType.Attribute,
|
|
123
118
|
descriptor: {
|
|
124
|
-
name: '
|
|
119
|
+
name: 'a_ExtrudeAndSize',
|
|
120
|
+
shaderLocation: ShaderLocation.EXTRUDE,
|
|
125
121
|
buffer: {
|
|
126
122
|
// give the WebGL driver a hint that this buffer may change
|
|
127
123
|
usage: gl.DYNAMIC_DRAW,
|
|
128
124
|
data: [],
|
|
129
125
|
type: gl.FLOAT
|
|
130
126
|
},
|
|
131
|
-
size:
|
|
127
|
+
size: 4,
|
|
132
128
|
update: function update(feature, featureIdx, vertex, attributeIdx) {
|
|
133
129
|
var extrude = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, -1, 0];
|
|
134
130
|
var 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: AttributeType.Attribute,
|
|
144
|
-
descriptor: {
|
|
145
|
-
name: 'a_Size',
|
|
146
|
-
buffer: {
|
|
147
|
-
// give the WebGL driver a hint that this buffer may change
|
|
148
|
-
usage: gl.DYNAMIC_DRAW,
|
|
149
|
-
data: [],
|
|
150
|
-
type: gl.FLOAT
|
|
151
|
-
},
|
|
152
|
-
size: 1,
|
|
153
|
-
update: function update(feature) {
|
|
154
131
|
var _feature$size = feature.size,
|
|
155
132
|
size = _feature$size === void 0 ? 5 : _feature$size;
|
|
156
|
-
|
|
133
|
+
var a_Size = Array.isArray(size) ? size[0] : size;
|
|
134
|
+
return [extrude[extrudeIndex], extrude[extrudeIndex + 1], extrude[extrudeIndex + 2], a_Size];
|
|
157
135
|
}
|
|
158
136
|
}
|
|
159
137
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { IEncodeFeature, IModel, IModelUniform } from '@antv/l7-core';
|
|
1
|
+
import type { IEncodeFeature, IModel, IModelUniform } from '@antv/l7-core';
|
|
2
2
|
import BaseModel from '../../core/BaseModel';
|
|
3
|
-
import { IGlyphQuad } from '../../utils/symbol-layout';
|
|
3
|
+
import type { IGlyphQuad } from '../../utils/symbol-layout';
|
|
4
4
|
export declare function TextTrianglation(feature: IEncodeFeature): {
|
|
5
5
|
vertices: number[];
|
|
6
6
|
indices: number[];
|
|
@@ -23,6 +23,13 @@ export default class TextModel extends BaseModel {
|
|
|
23
23
|
private textCount;
|
|
24
24
|
private preTextStyle;
|
|
25
25
|
getUninforms(): IModelUniform;
|
|
26
|
+
protected getCommonUniformsInfo(): {
|
|
27
|
+
uniformsArray: number[];
|
|
28
|
+
uniformsLength: number;
|
|
29
|
+
uniformsOption: {
|
|
30
|
+
[key: string]: any;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
26
33
|
initModels(): Promise<IModel[]>;
|
|
27
34
|
buildModels(): Promise<IModel[]>;
|
|
28
35
|
needUpdate(): Promise<boolean>;
|
package/es/point/models/text.js
CHANGED
|
@@ -19,10 +19,11 @@ import { boundsContains, calculateCentroid, lodashUtil, padBounds, rgb2arr } fro
|
|
|
19
19
|
import BaseModel from "../../core/BaseModel";
|
|
20
20
|
import CollisionIndex from "../../utils/collision-index";
|
|
21
21
|
import { getGlyphQuads, shapeText } from "../../utils/symbol-layout";
|
|
22
|
-
/* babel-plugin-inline-import '../shaders/text_frag.glsl' */
|
|
23
|
-
var textFrag = "#define SDF_PX 8.0\n#define EDGE_GAMMA 0.105\n#define FONT_SIZE 48.0\nuniform sampler2D u_sdf_map;\
|
|
24
|
-
/* babel-plugin-inline-import '../shaders/text_vert.glsl' */
|
|
25
|
-
var textVert = "#define SDF_PX 8.0\n#define EDGE_GAMMA 0.105\n#define FONT_SIZE 24.0\
|
|
22
|
+
/* babel-plugin-inline-import '../shaders/text/text_frag.glsl' */
|
|
23
|
+
var textFrag = "#define SDF_PX 8.0\n#define EDGE_GAMMA 0.105\n#define FONT_SIZE 48.0\n\nuniform sampler2D u_sdf_map;\nlayout(std140) uniform commonUniforms {\n vec4 u_stroke_color : [0.0, 0.0, 0.0, 0.0];\n vec2 u_sdf_map_size;\n float u_raisingHeight: 0.0;\n float u_stroke_width : 2;\n float u_gamma_scale : 0.5;\n float u_halo_blur : 0.5;\n};\n\nin vec4 v_color;\nin vec4 v_stroke_color;\nin vec2 v_uv;\nin float v_gamma_scale;\nin float v_fontScale;\nout vec4 outputColor;\n\n#pragma include \"picking\"\nvoid main() {\n // get style data mapping\n\n // get sdf from atlas\n float dist = texture(SAMPLER_2D(u_sdf_map), v_uv).a;\n\n lowp float buff = (6.0 - u_stroke_width / v_fontScale) / SDF_PX;\n highp float gamma = (u_halo_blur * 1.19 / SDF_PX + EDGE_GAMMA) / (v_fontScale * u_gamma_scale) / 1.0;\n\n highp float gamma_scaled = gamma * v_gamma_scale;\n\n highp float alpha = smoothstep(buff - gamma_scaled, buff + gamma_scaled, dist);\n\n outputColor = mix(v_color, v_stroke_color, smoothstep(0., 0.5, 1.- dist));\n\n outputColor.a *= alpha;\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 outputColor = filterColor(outputColor);\n}\n";
|
|
24
|
+
/* babel-plugin-inline-import '../shaders/text/text_vert.glsl' */
|
|
25
|
+
var textVert = "#define SDF_PX 8.0\n#define EDGE_GAMMA 0.105\n#define FONT_SIZE 24.0\n\nlayout(location = 0) in vec3 a_Position;\nlayout(location = 1) in vec4 a_Color;\nlayout(location = 9) in float a_Size;\nlayout(location = 14) in vec4 a_textUvAndOffsets;\n\nlayout(std140) uniform commonUniforms {\n vec4 u_stroke_color : [0.0, 0.0, 0.0, 0.0];\n vec2 u_sdf_map_size;\n float u_raisingHeight: 0.0;\n float u_stroke_width : 2;\n float u_gamma_scale : 0.5;\n float u_halo_blur : 0.5;\n};\n\nout vec2 v_uv;\nout float v_gamma_scale;\nout vec4 v_color;\nout vec4 v_stroke_color;\nout float v_fontScale;\n\n\n\n#pragma include \"projection\"\n#pragma include \"picking\"\n#pragma include \"rotation_2d\"\n\nvoid main() {\n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\n \n v_uv = a_textUvAndOffsets.xy / u_sdf_map_size;\n\n\n\n v_color = vec4(a_Color.xyz, a_Color.w * opacity);\n v_stroke_color = vec4(u_stroke_color.xyz, u_stroke_color.w * opacity);\n\n // \u6587\u672C\u7F29\u653E\u6BD4\u4F8B\n float fontScale = a_Size / FONT_SIZE;\n v_fontScale = fontScale;\n\n vec4 project_pos = project_position(vec4(a_Position, 1.0));\n // vec4 projected_position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n\n vec2 offset = rotate_matrix(a_textUvAndOffsets.zw,rotation);\n \n // gl_Position = vec4(projected_position.xy / projected_position.w + rotation_matrix * a_textOffsets * fontScale / u_ViewportSize * 2.0 * u_DevicePixelRatio, 0.0, 1.0);\n\n float raiseHeight = 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 raiseHeight = u_raisingHeight * mapboxZoomScale;\n }\n\n vec4 projected_position = project_common_position_to_clipspace_v2(vec4(project_pos.xyz + vec3(0.0, 0.0, raiseHeight), 1.0));\n\n gl_Position = vec4(\n projected_position.xy / projected_position.w + offset * fontScale / u_ViewportSize * 2.0 * u_DevicePixelRatio, 0.0, 1.0);\n v_gamma_scale = gl_Position.w;\n setPickingColor(a_PickingColor);\n\n}\n";
|
|
26
|
+
import { ShaderLocation } from "../../core/CommonStyleAttribute";
|
|
26
27
|
var isEqual = lodashUtil.isEqual;
|
|
27
28
|
export function TextTrianglation(feature) {
|
|
28
29
|
// @ts-ignore
|
|
@@ -85,6 +86,16 @@ var TextModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
85
86
|
_createClass(TextModel, [{
|
|
86
87
|
key: "getUninforms",
|
|
87
88
|
value: function getUninforms() {
|
|
89
|
+
var commoninfo = this.getCommonUniformsInfo();
|
|
90
|
+
var attributeInfo = this.getUniformsBufferInfo(this.getStyleAttribute());
|
|
91
|
+
this.updateStyleUnifoms();
|
|
92
|
+
return _objectSpread(_objectSpread(_objectSpread({}, commoninfo.uniformsOption), attributeInfo.uniformsOption), {
|
|
93
|
+
u_sdf_map: this.textures[0]
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
}, {
|
|
97
|
+
key: "getCommonUniformsInfo",
|
|
98
|
+
value: function getCommonUniformsInfo() {
|
|
88
99
|
var _ref2 = this.layer.getLayerConfig(),
|
|
89
100
|
_ref2$stroke = _ref2.stroke,
|
|
90
101
|
stroke = _ref2$stroke === void 0 ? '#fff' : _ref2$stroke,
|
|
@@ -103,15 +114,16 @@ var TextModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
103
114
|
this.textCount = Object.keys(mapping).length;
|
|
104
115
|
}
|
|
105
116
|
this.preTextStyle = this.getTextStyle();
|
|
106
|
-
|
|
117
|
+
var commonOptions = {
|
|
118
|
+
u_stroke_color: rgb2arr(stroke),
|
|
119
|
+
u_sdf_map_size: [(canvas === null || canvas === void 0 ? void 0 : canvas.width) || 1, (canvas === null || canvas === void 0 ? void 0 : canvas.height) || 1],
|
|
107
120
|
u_raisingHeight: Number(raisingHeight),
|
|
108
121
|
u_stroke_width: strokeWidth,
|
|
109
|
-
u_stroke_color: rgb2arr(stroke),
|
|
110
|
-
u_sdf_map: this.texture,
|
|
111
|
-
u_halo_blur: halo,
|
|
112
122
|
u_gamma_scale: gamma,
|
|
113
|
-
|
|
114
|
-
}
|
|
123
|
+
u_halo_blur: halo
|
|
124
|
+
};
|
|
125
|
+
var commonBufferInfo = this.getUniformsBufferInfo(commonOptions);
|
|
126
|
+
return commonBufferInfo;
|
|
115
127
|
}
|
|
116
128
|
}, {
|
|
117
129
|
key: "initModels",
|
|
@@ -125,8 +137,9 @@ var TextModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
125
137
|
this.extent = this.textExtent();
|
|
126
138
|
this.rawEncodeData = this.layer.getEncodedData();
|
|
127
139
|
this.preTextStyle = this.getTextStyle();
|
|
140
|
+
this.initUniformsBuffer();
|
|
128
141
|
return _context2.abrupt("return", this.buildModels());
|
|
129
|
-
case
|
|
142
|
+
case 6:
|
|
130
143
|
case "end":
|
|
131
144
|
return _context2.stop();
|
|
132
145
|
}
|
|
@@ -242,30 +255,31 @@ var TextModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
242
255
|
key: "registerBuiltinAttributes",
|
|
243
256
|
value: function registerBuiltinAttributes() {
|
|
244
257
|
this.styleAttributeService.registerStyleAttribute({
|
|
245
|
-
name: '
|
|
258
|
+
name: 'textUvAndOffsets',
|
|
246
259
|
type: AttributeType.Attribute,
|
|
247
260
|
descriptor: {
|
|
248
|
-
name: '
|
|
261
|
+
name: 'a_textUvAndOffsets',
|
|
249
262
|
// 文字偏移量
|
|
263
|
+
shaderLocation: ShaderLocation.UV,
|
|
250
264
|
buffer: {
|
|
251
265
|
// give the WebGL driver a hint that this buffer may change
|
|
252
266
|
usage: gl.STATIC_DRAW,
|
|
253
267
|
data: [],
|
|
254
268
|
type: gl.FLOAT
|
|
255
269
|
},
|
|
256
|
-
size:
|
|
270
|
+
size: 4,
|
|
257
271
|
update: function update(feature, featureIdx, vertex) {
|
|
258
|
-
return [vertex[5], vertex[6]];
|
|
272
|
+
return [vertex[3], vertex[4], vertex[5], vertex[6]];
|
|
259
273
|
}
|
|
260
274
|
}
|
|
261
275
|
});
|
|
262
|
-
|
|
263
276
|
// point layer size;
|
|
264
277
|
this.styleAttributeService.registerStyleAttribute({
|
|
265
278
|
name: 'size',
|
|
266
279
|
type: AttributeType.Attribute,
|
|
267
280
|
descriptor: {
|
|
268
281
|
name: 'a_Size',
|
|
282
|
+
shaderLocation: ShaderLocation.SIZE,
|
|
269
283
|
buffer: {
|
|
270
284
|
// give the WebGL driver a hint that this buffer may change
|
|
271
285
|
usage: gl.DYNAMIC_DRAW,
|
|
@@ -280,22 +294,6 @@ var TextModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
280
294
|
}
|
|
281
295
|
}
|
|
282
296
|
});
|
|
283
|
-
this.styleAttributeService.registerStyleAttribute({
|
|
284
|
-
name: 'textUv',
|
|
285
|
-
type: AttributeType.Attribute,
|
|
286
|
-
descriptor: {
|
|
287
|
-
name: 'a_tex',
|
|
288
|
-
buffer: {
|
|
289
|
-
usage: gl.DYNAMIC_DRAW,
|
|
290
|
-
data: [],
|
|
291
|
-
type: gl.FLOAT
|
|
292
|
-
},
|
|
293
|
-
size: 2,
|
|
294
|
-
update: function update(feature, featureIdx, vertex) {
|
|
295
|
-
return [vertex[3], vertex[4]];
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
});
|
|
299
297
|
}
|
|
300
298
|
}, {
|
|
301
299
|
key: "bindEvent",
|
|
@@ -569,6 +567,7 @@ var TextModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
569
567
|
width: canvas.width,
|
|
570
568
|
height: canvas.height
|
|
571
569
|
});
|
|
570
|
+
this.textures = [this.texture];
|
|
572
571
|
}
|
|
573
572
|
}, {
|
|
574
573
|
key: "reBuildModel",
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
|
|
2
|
-
uniform
|
|
3
|
-
|
|
2
|
+
layout(std140) uniform commonUniorm {
|
|
3
|
+
vec4 u_stroke_color;
|
|
4
|
+
float u_additive;
|
|
5
|
+
float u_stroke_opacity;
|
|
6
|
+
float u_stroke_width;
|
|
7
|
+
};
|
|
4
8
|
|
|
5
|
-
|
|
9
|
+
in vec4 v_color;
|
|
10
|
+
in float v_blur;
|
|
11
|
+
in float v_innerRadius;
|
|
6
12
|
|
|
7
|
-
|
|
8
|
-
varying float v_blur;
|
|
9
|
-
varying float v_innerRadius;
|
|
13
|
+
out vec4 outputColor;
|
|
10
14
|
|
|
11
15
|
#pragma include "picking"
|
|
12
16
|
void main() {
|
|
@@ -23,24 +27,24 @@ void main() {
|
|
|
23
27
|
float blurWidth = (1.0 - v_blur)/2.0;
|
|
24
28
|
vec4 stroke = vec4(u_stroke_color.rgb, u_stroke_opacity);
|
|
25
29
|
if(fragmengTocenter > v_innerRadius + blurWidth) {
|
|
26
|
-
|
|
30
|
+
outputColor = stroke;
|
|
27
31
|
} else if(fragmengTocenter > v_innerRadius - blurWidth){
|
|
28
32
|
float mixR = (fragmengTocenter - (v_innerRadius - blurWidth)) / (blurWidth * 2.0);
|
|
29
|
-
|
|
33
|
+
outputColor = mix(v_color, stroke, mixR);
|
|
30
34
|
} else {
|
|
31
|
-
|
|
35
|
+
outputColor = v_color;
|
|
32
36
|
}
|
|
33
37
|
} else {
|
|
34
38
|
// 当不存在 stroke 或 stroke <= 0.01
|
|
35
|
-
|
|
39
|
+
outputColor = v_color;
|
|
36
40
|
}
|
|
37
41
|
|
|
38
|
-
|
|
42
|
+
outputColor = filterColor(outputColor);
|
|
39
43
|
|
|
40
44
|
if(u_additive > 0.0) {
|
|
41
|
-
|
|
45
|
+
outputColor *= circleClipOpacity;
|
|
42
46
|
} else {
|
|
43
|
-
|
|
47
|
+
outputColor.a *= circleClipOpacity;
|
|
44
48
|
}
|
|
45
49
|
|
|
46
50
|
}
|
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
attribute float a_Size;
|
|
6
|
-
attribute vec4 a_Color;
|
|
7
|
-
varying vec4 v_color;
|
|
8
|
-
|
|
9
|
-
uniform float u_opacity : 1;
|
|
10
|
-
uniform vec2 u_offsets;
|
|
11
|
-
uniform float u_stroke_width;
|
|
12
|
-
|
|
13
|
-
varying float v_blur;
|
|
14
|
-
varying float v_innerRadius;
|
|
2
|
+
layout(location = 0) in vec3 a_Position;
|
|
3
|
+
layout(location = 1) in vec4 a_Color;
|
|
4
|
+
layout(location = 9) in float a_Size;
|
|
15
5
|
|
|
6
|
+
layout(std140) uniform commonUniorm {
|
|
7
|
+
vec4 u_stroke_color;
|
|
8
|
+
float u_additive;
|
|
9
|
+
float u_stroke_opacity;
|
|
10
|
+
float u_stroke_width;
|
|
11
|
+
};
|
|
16
12
|
|
|
13
|
+
out vec4 v_color;
|
|
14
|
+
out float v_blur;
|
|
15
|
+
out float v_innerRadius;
|
|
17
16
|
|
|
18
17
|
#pragma include "projection"
|
|
19
18
|
#pragma include "picking"
|
|
20
19
|
#pragma include "project"
|
|
21
20
|
void main() {
|
|
22
|
-
v_color = vec4(a_Color.xyz, a_Color.w *
|
|
21
|
+
v_color = vec4(a_Color.xyz, a_Color.w * opacity);
|
|
23
22
|
v_blur = 1.0 - max(2.0/a_Size, 0.05);
|
|
24
23
|
v_innerRadius = max((a_Size - u_stroke_width) / a_Size, 0.0);
|
|
25
24
|
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
precision highp float;
|
|
2
|
+
in vec4 v_color;
|
|
3
|
+
|
|
4
|
+
#pragma include "picking"
|
|
5
|
+
|
|
6
|
+
layout(std140) uniform commonUniform {
|
|
7
|
+
vec4 u_sourceColor;
|
|
8
|
+
vec4 u_targetColor;
|
|
9
|
+
float u_linearColor: 0;
|
|
10
|
+
float u_heightfixed: 0.0; // 默认不固定
|
|
11
|
+
float u_globel;
|
|
12
|
+
float u_r;
|
|
13
|
+
float u_pickLight: 0.0;
|
|
14
|
+
float u_opacitylinear: 0.0;
|
|
15
|
+
float u_opacitylinear_dir: 1.0;
|
|
16
|
+
float u_lightEnable: 1.0;
|
|
17
|
+
};
|
|
18
|
+
in float v_lightWeight;
|
|
19
|
+
in float v_barLinearZ;
|
|
20
|
+
out vec4 outputColor;
|
|
21
|
+
void main() {
|
|
22
|
+
|
|
23
|
+
outputColor = v_color;
|
|
24
|
+
|
|
25
|
+
// 开启透明度渐变
|
|
26
|
+
if(u_opacitylinear > 0.0) {
|
|
27
|
+
outputColor.a *= u_opacitylinear_dir > 0.0 ? (1.0 - v_barLinearZ): v_barLinearZ;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// picking
|
|
31
|
+
if(u_pickLight > 0.0) {
|
|
32
|
+
outputColor = filterColorAlpha(outputColor, v_lightWeight);
|
|
33
|
+
} else {
|
|
34
|
+
outputColor = filterColor(outputColor);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -5,23 +5,30 @@ precision highp float;
|
|
|
5
5
|
#define diffuseRatio 0.3
|
|
6
6
|
#define specularRatio 0.2
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
uniform
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
8
|
+
|
|
9
|
+
layout(location = 0) in vec3 a_Position;
|
|
10
|
+
layout(location = 1) in vec4 a_Color;
|
|
11
|
+
layout(location = 9) in vec3 a_Size;
|
|
12
|
+
layout(location = 11) in vec3 a_Pos;
|
|
13
|
+
layout(location = 13) in vec3 a_Normal;
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
layout(std140) uniform commonUniform {
|
|
17
|
+
vec4 u_sourceColor;
|
|
18
|
+
vec4 u_targetColor;
|
|
19
|
+
float u_linearColor: 0;
|
|
20
|
+
float u_heightfixed: 0.0; // 默认不固定
|
|
21
|
+
float u_globel;
|
|
22
|
+
float u_r;
|
|
23
|
+
float u_pickLight: 0.0;
|
|
24
|
+
float u_opacitylinear: 0.0;
|
|
25
|
+
float u_opacitylinear_dir: 1.0;
|
|
26
|
+
float u_lightEnable: 1.0;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
out vec4 v_color;
|
|
30
|
+
out float v_lightWeight;
|
|
31
|
+
out float v_barLinearZ;
|
|
25
32
|
// 用于将在顶点着色器中计算好的样式值传递给片元
|
|
26
33
|
|
|
27
34
|
|
|
@@ -47,10 +54,6 @@ float getXRadian(float y, float r) {
|
|
|
47
54
|
|
|
48
55
|
void main() {
|
|
49
56
|
|
|
50
|
-
|
|
51
|
-
float textureOffset = 0.0; // 在 cell 中取值的偏移量
|
|
52
|
-
|
|
53
|
-
textureOffset = opacityAndOffset.g;
|
|
54
57
|
// cal style mapping - 数据纹理映射部分的计算
|
|
55
58
|
vec3 size = a_Size * a_Position;
|
|
56
59
|
|
|
@@ -88,7 +91,7 @@ void main() {
|
|
|
88
91
|
v_lightWeight = lightWeight;
|
|
89
92
|
// 设置圆柱的底色
|
|
90
93
|
if(u_linearColor == 1.0) { // 使用渐变颜色
|
|
91
|
-
v_color = mix(u_sourceColor, u_targetColor,
|
|
94
|
+
v_color = mix(u_sourceColor, u_targetColor, v_barLinearZ);
|
|
92
95
|
v_color.rgb *= lightWeight;
|
|
93
96
|
} else { // 使用 color 方法传入的颜色
|
|
94
97
|
v_color = a_Color;
|
package/{lib/point/shaders/earth/fill_frag.glsl → es/point/shaders/earthFill/earthFill_frag.glsl}
RENAMED
|
@@ -1,23 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
uniform float u_stroke_width : 2;
|
|
5
|
-
|
|
6
|
-
varying vec4 v_data;
|
|
7
|
-
varying vec4 v_color;
|
|
8
|
-
varying float v_radius;
|
|
1
|
+
in vec4 v_data;
|
|
2
|
+
in vec4 v_color;
|
|
3
|
+
in float v_radius;
|
|
9
4
|
|
|
5
|
+
layout(std140) uniform commonUniform {
|
|
6
|
+
float u_additive;
|
|
7
|
+
float u_stroke_opacity : 1;
|
|
8
|
+
float u_stroke_width : 2;
|
|
9
|
+
float u_blur : 0.0;
|
|
10
|
+
};
|
|
10
11
|
#pragma include "sdf_2d"
|
|
11
12
|
#pragma include "picking"
|
|
12
13
|
|
|
14
|
+
out vec4 outputColor;
|
|
13
15
|
|
|
14
16
|
void main() {
|
|
15
17
|
int shape = int(floor(v_data.w + 0.5));
|
|
16
18
|
|
|
17
|
-
vec4 strokeColor =
|
|
19
|
+
vec4 strokeColor = u_stroke == vec4(0.0) ? v_color : u_stroke;
|
|
18
20
|
|
|
19
21
|
lowp float antialiasblur = v_data.z;
|
|
20
|
-
float r = v_radius / (v_radius +
|
|
22
|
+
float r = v_radius / (v_radius + u_stroke_width);
|
|
21
23
|
|
|
22
24
|
float outer_df;
|
|
23
25
|
float inner_df;
|
|
@@ -55,23 +57,23 @@ void main() {
|
|
|
55
57
|
|
|
56
58
|
float opacity_t = smoothstep(0.0, antialiasblur, outer_df);
|
|
57
59
|
|
|
58
|
-
float color_t =
|
|
60
|
+
float color_t = u_stroke_width < 0.01 ? 0.0 : smoothstep(
|
|
59
61
|
antialiasblur,
|
|
60
62
|
0.0,
|
|
61
63
|
inner_df
|
|
62
64
|
);
|
|
63
65
|
|
|
64
|
-
if(
|
|
65
|
-
|
|
66
|
+
if(u_stroke_width < 0.01) {
|
|
67
|
+
outputColor = vec4(v_color.rgb, v_color.a * u_opacity);
|
|
66
68
|
} else {
|
|
67
|
-
|
|
69
|
+
outputColor = mix(vec4(v_color.rgb, v_color.a * u_opacity), strokeColor * u_stroke_opacity, color_t);
|
|
68
70
|
}
|
|
69
71
|
|
|
70
72
|
if(u_additive > 0.0) {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
+
outputColor *= opacity_t;
|
|
74
|
+
outputColor = filterColorAlpha(outputColor, outputColor.a);
|
|
73
75
|
} else {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
+
outputColor.a *= opacity_t;
|
|
77
|
+
outputColor = filterColor(outputColor);
|
|
76
78
|
}
|
|
77
79
|
}
|
package/{lib/point/shaders/earth/fill_vert.glsl → es/point/shaders/earthFill/earthFill_vert.glsl}
RENAMED
|
@@ -1,22 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
uniform vec4 u_stroke_color : [0.0, 0.0, 0.0, 0.0];
|
|
17
|
-
uniform vec2 u_offsets;
|
|
18
|
-
|
|
19
|
-
uniform float u_blur : 0.0;
|
|
1
|
+
layout(location = 0) in vec3 a_Position;
|
|
2
|
+
layout(location = 1) in vec4 a_Color;
|
|
3
|
+
layout(location = 9) in float a_Size;
|
|
4
|
+
layout(location = 10) in float a_Shape;
|
|
5
|
+
layout(location = 11) in vec3 a_Extrude;
|
|
6
|
+
|
|
7
|
+
layout(std140) uniform commonUniform {
|
|
8
|
+
float u_additive;
|
|
9
|
+
float u_stroke_opacity : 1;
|
|
10
|
+
float u_stroke_width : 2;
|
|
11
|
+
float u_blur : 0.0;
|
|
12
|
+
};
|
|
13
|
+
out vec4 v_data;
|
|
14
|
+
out vec4 v_color;
|
|
15
|
+
out float v_radius;
|
|
20
16
|
|
|
21
17
|
#pragma include "projection"
|
|
22
18
|
#pragma include "picking"
|
|
@@ -44,8 +40,7 @@ void main() {
|
|
|
44
40
|
// TODP: /abs(extrude.x) 是为了兼容地球模式
|
|
45
41
|
v_data = vec4(extrude.x/abs(extrude.x), extrude.y/abs(extrude.y), antialiasblur,shape_type);
|
|
46
42
|
|
|
47
|
-
|
|
48
|
-
gl_Position = u_ViewProjectionMatrix * vec4(a_Position + extrude * newSize * 0.1 + u_offsets, 1.0);
|
|
43
|
+
gl_Position = u_ViewProjectionMatrix * vec4(a_Position + extrude * newSize * 0.1 + vec3(u_offsets,0.0), 1.0);
|
|
49
44
|
|
|
50
45
|
setPickingColor(a_PickingColor);
|
|
51
|
-
}
|
|
46
|
+
}
|