@antv/l7-layers 2.25.5 → 2.25.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +6 -6
- package/es/canvas/index.d.ts +0 -18
- package/es/canvas/index.js +0 -70
- package/es/canvas/models/canvas.d.ts +0 -23
- package/es/canvas/models/canvas.js +0 -141
- package/es/canvas/models/constants.d.ts +0 -2
- package/es/canvas/models/constants.js +0 -6
- package/es/canvas/models/index.d.ts +0 -2
- package/es/canvas/models/index.js +0 -2
- package/es/citybuilding/building.d.ts +0 -7
- package/es/citybuilding/building.js +0 -25
- package/es/citybuilding/models/build.d.ts +0 -33
- package/es/citybuilding/models/build.js +0 -160
- package/es/citybuilding/shaders/build_frag.glsl +0 -123
- package/es/citybuilding/shaders/build_vert.glsl +0 -58
- package/es/core/BaseLayer.d.ts +0 -265
- package/es/core/BaseLayer.js +0 -1310
- package/es/core/BaseModel.d.ts +0 -95
- package/es/core/BaseModel.js +0 -367
- package/es/core/CommonStyleAttribute.d.ts +0 -16
- package/es/core/CommonStyleAttribute.js +0 -114
- package/es/core/LayerPickService.d.ts +0 -12
- package/es/core/LayerPickService.js +0 -102
- package/es/core/TextureService.d.ts +0 -15
- package/es/core/TextureService.js +0 -65
- package/es/core/constant.d.ts +0 -6
- package/es/core/constant.js +0 -19
- package/es/core/interface.d.ts +0 -284
- package/es/core/interface.js +0 -32
- package/es/core/line_trangluation.d.ts +0 -19
- package/es/core/line_trangluation.js +0 -86
- package/es/core/schema.d.ts +0 -27
- package/es/core/schema.js +0 -25
- package/es/core/shape/Path.d.ts +0 -40
- package/es/core/shape/Path.js +0 -69
- package/es/core/shape/arrow.d.ts +0 -25
- package/es/core/shape/arrow.js +0 -144
- package/es/core/shape/extrude.d.ts +0 -17
- package/es/core/shape/extrude.js +0 -133
- package/es/core/triangulation.d.ts +0 -136
- package/es/core/triangulation.js +0 -601
- package/es/core/utils.d.ts +0 -5
- package/es/core/utils.js +0 -36
- package/es/earth/index.d.ts +0 -22
- package/es/earth/index.js +0 -54
- package/es/earth/models/atmosphere.d.ts +0 -30
- package/es/earth/models/atmosphere.js +0 -116
- package/es/earth/models/base.d.ts +0 -37
- package/es/earth/models/base.js +0 -172
- package/es/earth/models/bloomsphere.d.ts +0 -30
- package/es/earth/models/bloomsphere.js +0 -115
- package/es/earth/shaders/atmosphere/atmosphere_frag.glsl +0 -17
- package/es/earth/shaders/atmosphere/atmosphere_vert.glsl +0 -24
- package/es/earth/shaders/base/base_frag.glsl +0 -11
- package/es/earth/shaders/base/base_vert.glsl +0 -52
- package/es/earth/shaders/bloomshpere/bloomsphere_frag.glsl +0 -15
- package/es/earth/shaders/bloomshpere/bloomsphere_vert.glsl +0 -20
- package/es/earth/utils.d.ts +0 -26
- package/es/earth/utils.js +0 -99
- package/es/geometry/index.d.ts +0 -22
- package/es/geometry/index.js +0 -53
- package/es/geometry/models/billboard.d.ts +0 -39
- package/es/geometry/models/billboard.js +0 -175
- package/es/geometry/models/index.d.ts +0 -5
- package/es/geometry/models/index.js +0 -9
- package/es/geometry/models/plane.d.ts +0 -58
- package/es/geometry/models/plane.js +0 -308
- package/es/geometry/models/sprite.d.ts +0 -48
- package/es/geometry/models/sprite.js +0 -225
- package/es/geometry/shaders/billboard_frag.glsl +0 -18
- package/es/geometry/shaders/billboard_vert.glsl +0 -43
- package/es/geometry/shaders/plane_frag.glsl +0 -23
- package/es/geometry/shaders/plane_vert.glsl +0 -31
- package/es/geometry/shaders/sprite_frag.glsl +0 -23
- package/es/geometry/shaders/sprite_vert.glsl +0 -21
- package/es/heatmap/index.d.ts +0 -13
- package/es/heatmap/index.js +0 -87
- package/es/heatmap/models/grid.d.ts +0 -29
- package/es/heatmap/models/grid.js +0 -83
- package/es/heatmap/models/grid3d.d.ts +0 -31
- package/es/heatmap/models/grid3d.js +0 -122
- package/es/heatmap/models/heatmap.d.ts +0 -46
- package/es/heatmap/models/heatmap.js +0 -447
- package/es/heatmap/models/hexagon.d.ts +0 -29
- package/es/heatmap/models/hexagon.js +0 -83
- package/es/heatmap/models/index.d.ts +0 -5
- package/es/heatmap/models/index.js +0 -12
- package/es/heatmap/shaders/grid/grid_frag.glsl +0 -9
- package/es/heatmap/shaders/grid/grid_vert.glsl +0 -30
- package/es/heatmap/shaders/grid3d/grid_3d_frag.glsl +0 -17
- package/es/heatmap/shaders/grid3d/grid_3d_vert.glsl +0 -34
- package/es/heatmap/shaders/heatmap/heatmap_3d_frag.glsl +0 -23
- package/es/heatmap/shaders/heatmap/heatmap_3d_vert.glsl +0 -59
- package/es/heatmap/shaders/heatmap/heatmap_frag.glsl +0 -40
- package/es/heatmap/shaders/heatmap/heatmap_framebuffer_frag.glsl +0 -17
- package/es/heatmap/shaders/heatmap/heatmap_framebuffer_vert.glsl +0 -36
- package/es/heatmap/shaders/heatmap/heatmap_vert.glsl +0 -21
- package/es/heatmap/shaders/hexagon/hexagon_frag.glsl +0 -8
- package/es/heatmap/shaders/hexagon/hexagon_vert.glsl +0 -30
- package/es/heatmap/triangulation.d.ts +0 -5
- package/es/heatmap/triangulation.js +0 -33
- package/es/image/index.d.ts +0 -9
- package/es/image/index.js +0 -28
- package/es/image/models/image.d.ts +0 -31
- package/es/image/models/image.js +0 -113
- package/es/image/models/index.d.ts +0 -5
- package/es/image/models/index.js +0 -5
- package/es/image/shaders/dataImage_frag.glsl +0 -32
- package/es/image/shaders/image_frag.glsl +0 -38
- package/es/image/shaders/image_vert.glsl +0 -20
- package/es/index.d.ts +0 -18
- package/es/index.js +0 -18
- package/es/line/index.d.ts +0 -36
- package/es/line/index.js +0 -90
- package/es/line/models/arc.d.ts +0 -40
- package/es/line/models/arc.js +0 -279
- package/es/line/models/arc_3d.d.ts +0 -40
- package/es/line/models/arc_3d.js +0 -269
- package/es/line/models/flow.d.ts +0 -31
- package/es/line/models/flow.js +0 -140
- package/es/line/models/great_circle.d.ts +0 -34
- package/es/line/models/great_circle.js +0 -240
- package/es/line/models/index.d.ts +0 -5
- package/es/line/models/index.js +0 -18
- package/es/line/models/line.d.ts +0 -44
- package/es/line/models/line.js +0 -273
- package/es/line/models/simple_line.d.ts +0 -33
- package/es/line/models/simple_line.js +0 -118
- package/es/line/models/wall.d.ts +0 -34
- package/es/line/models/wall.js +0 -223
- package/es/line/shaders/arc/line_arc_frag.glsl +0 -92
- package/es/line/shaders/arc/line_arc_vert.glsl +0 -156
- package/es/line/shaders/arc3d/line_arc_3d_frag.glsl +0 -108
- package/es/line/shaders/arc3d/line_arc_3d_vert.glsl +0 -177
- package/es/line/shaders/flow/flow_line_frag.glsl +0 -13
- package/es/line/shaders/flow/flow_line_vert.glsl +0 -76
- package/es/line/shaders/greatCircle/line_arc_great_circle_frag.glsl +0 -99
- package/es/line/shaders/greatCircle/line_arc_great_circle_vert.glsl +0 -165
- package/es/line/shaders/line/line_frag.glsl +0 -122
- package/es/line/shaders/line/line_vert.glsl +0 -101
- package/es/line/shaders/simple/simpleline_frag.glsl +0 -30
- package/es/line/shaders/simple/simpleline_vert.glsl +0 -45
- package/es/line/shaders/wall/wall_frag.glsl +0 -94
- package/es/line/shaders/wall/wall_vert.glsl +0 -90
- package/es/mask/index.d.ts +0 -16
- package/es/mask/index.js +0 -21
- package/es/mask/models/fill.d.ts +0 -18
- package/es/mask/models/fill.js +0 -61
- package/es/mask/models/index.d.ts +0 -5
- package/es/mask/models/index.js +0 -5
- package/es/mask/shaders/mask_vert.glsl +0 -14
- package/es/plugins/DataMappingPlugin.d.ts +0 -12
- package/es/plugins/DataMappingPlugin.js +0 -226
- package/es/plugins/DataSourcePlugin.d.ts +0 -6
- package/es/plugins/DataSourcePlugin.js +0 -75
- package/es/plugins/FeatureScalePlugin.d.ts +0 -20
- package/es/plugins/FeatureScalePlugin.js +0 -295
- package/es/plugins/LayerAnimateStylePlugin.d.ts +0 -4
- package/es/plugins/LayerAnimateStylePlugin.js +0 -14
- package/es/plugins/LayerMaskPlugin.d.ts +0 -7
- package/es/plugins/LayerMaskPlugin.js +0 -19
- package/es/plugins/LayerModelPlugin.d.ts +0 -10
- package/es/plugins/LayerModelPlugin.js +0 -60
- package/es/plugins/LayerStylePlugin.d.ts +0 -7
- package/es/plugins/LayerStylePlugin.js +0 -18
- package/es/plugins/LightingPlugin.d.ts +0 -35
- package/es/plugins/LightingPlugin.js +0 -84
- package/es/plugins/MultiPassRendererPlugin.d.ts +0 -22
- package/es/plugins/MultiPassRendererPlugin.js +0 -52
- package/es/plugins/PixelPickingPlugin.d.ts +0 -11
- package/es/plugins/PixelPickingPlugin.js +0 -146
- package/es/plugins/RegisterStyleAttributePlugin.d.ts +0 -10
- package/es/plugins/RegisterStyleAttributePlugin.js +0 -72
- package/es/plugins/ShaderUniformPlugin.d.ts +0 -17
- package/es/plugins/ShaderUniformPlugin.js +0 -196
- package/es/plugins/UpdateModelPlugin.d.ts +0 -7
- package/es/plugins/UpdateModelPlugin.js +0 -20
- package/es/plugins/UpdateStyleAttributePlugin.d.ts +0 -9
- package/es/plugins/UpdateStyleAttributePlugin.js +0 -54
- package/es/plugins/index.d.ts +0 -15
- package/es/plugins/index.js +0 -18
- package/es/point/index.d.ts +0 -35
- package/es/point/index.js +0 -153
- package/es/point/models/billboard_point.d.ts +0 -35
- package/es/point/models/billboard_point.js +0 -95
- package/es/point/models/earthExtrude.d.ts +0 -32
- package/es/point/models/earthExtrude.js +0 -199
- package/es/point/models/earthFill.d.ts +0 -31
- package/es/point/models/earthFill.js +0 -158
- package/es/point/models/extrude.d.ts +0 -32
- package/es/point/models/extrude.js +0 -195
- package/es/point/models/fill.d.ts +0 -47
- package/es/point/models/fill.js +0 -180
- package/es/point/models/fillImage.d.ts +0 -42
- package/es/point/models/fillImage.js +0 -189
- package/es/point/models/image.d.ts +0 -48
- package/es/point/models/image.js +0 -293
- package/es/point/models/index.d.ts +0 -5
- package/es/point/models/index.js +0 -24
- package/es/point/models/normal.d.ts +0 -36
- package/es/point/models/normal.js +0 -89
- package/es/point/models/radar.d.ts +0 -37
- package/es/point/models/radar.js +0 -115
- package/es/point/models/text.d.ts +0 -85
- package/es/point/models/text.js +0 -503
- package/es/point/shaders/billboard/billboard_point_frag.glsl +0 -48
- package/es/point/shaders/billboard/billboard_point_vert.glsl +0 -33
- package/es/point/shaders/earthExtrude/earthExtrude_frag.glsl +0 -36
- package/es/point/shaders/earthExtrude/earthExtrude_vert.glsl +0 -118
- package/es/point/shaders/earthFill/earthFill_frag.glsl +0 -79
- package/es/point/shaders/earthFill/earthFill_vert.glsl +0 -46
- package/es/point/shaders/extrude/extrude_frag.glsl +0 -29
- package/es/point/shaders/extrude/extrude_vert.glsl +0 -95
- package/es/point/shaders/fill/fill_frag.glsl +0 -97
- package/es/point/shaders/fill/fill_vert.glsl +0 -79
- package/es/point/shaders/fillImage/fillImage_frag.glsl +0 -23
- package/es/point/shaders/fillImage/fillImage_vert.glsl +0 -46
- package/es/point/shaders/image/image_frag.glsl +0 -45
- package/es/point/shaders/image/image_vert.glsl +0 -47
- package/es/point/shaders/normal/normal_frag.glsl +0 -5
- package/es/point/shaders/normal/normal_vert.glsl +0 -22
- package/es/point/shaders/radar/radar_frag.glsl +0 -52
- package/es/point/shaders/radar/radar_vert.glsl +0 -53
- package/es/point/shaders/text/text_frag.glsl +0 -47
- package/es/point/shaders/text/text_vert.glsl +0 -65
- package/es/point/shape/extrude.d.ts +0 -15
- package/es/point/shape/extrude.js +0 -48
- package/es/polygon/index.d.ts +0 -18
- package/es/polygon/index.js +0 -71
- package/es/polygon/models/extrude.d.ts +0 -41
- package/es/polygon/models/extrude.js +0 -248
- package/es/polygon/models/extrusion.d.ts +0 -40
- package/es/polygon/models/extrusion.js +0 -137
- package/es/polygon/models/fill.d.ts +0 -32
- package/es/polygon/models/fill.js +0 -127
- package/es/polygon/models/index.d.ts +0 -5
- package/es/polygon/models/index.js +0 -26
- package/es/polygon/models/ocean.d.ts +0 -37
- package/es/polygon/models/ocean.js +0 -172
- package/es/polygon/models/water.d.ts +0 -35
- package/es/polygon/models/water.js +0 -150
- package/es/polygon/shaders/extrude/polygon_extrude_frag.glsl +0 -24
- package/es/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +0 -49
- package/es/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +0 -53
- package/es/polygon/shaders/extrude/polygon_extrude_vert.glsl +0 -74
- package/es/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +0 -55
- package/es/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +0 -54
- package/es/polygon/shaders/extrusion/polygon_extrusion_frag.glsl +0 -8
- package/es/polygon/shaders/extrusion/polygon_extrusion_vert.glsl +0 -24
- package/es/polygon/shaders/fill/fill_frag.glsl +0 -8
- package/es/polygon/shaders/fill/fill_linear_frag.glsl +0 -23
- package/es/polygon/shaders/fill/fill_linear_vert.glsl +0 -36
- package/es/polygon/shaders/fill/fill_vert.glsl +0 -35
- package/es/polygon/shaders/ocean/ocean_frag.glsl +0 -277
- package/es/polygon/shaders/ocean/ocean_vert.glsl +0 -21
- package/es/polygon/shaders/water/polygon_water_frag.glsl +0 -78
- package/es/polygon/shaders/water/polygon_water_vert.glsl +0 -22
- package/es/raster/buffers/triangulation.d.ts +0 -6
- package/es/raster/buffers/triangulation.js +0 -25
- package/es/raster/index.d.ts +0 -11
- package/es/raster/index.js +0 -55
- package/es/raster/models/index.d.ts +0 -5
- package/es/raster/models/index.js +0 -10
- package/es/raster/models/raster.d.ts +0 -35
- package/es/raster/models/raster.js +0 -156
- package/es/raster/models/rasterRgb.d.ts +0 -35
- package/es/raster/models/rasterRgb.js +0 -158
- package/es/raster/models/rasterTerrainRgb.d.ts +0 -30
- package/es/raster/models/rasterTerrainRgb.js +0 -118
- package/es/raster/shaders/raster/raster_2d_frag.glsl +0 -37
- package/es/raster/shaders/raster/raster_2d_vert.glsl +0 -21
- package/es/raster/shaders/rgb/raster_rgb_frag.glsl +0 -30
- package/es/raster/shaders/rgb/raster_rgb_vert.glsl +0 -21
- package/es/raster/shaders/terrain/terrain_rgb_frag.glsl +0 -40
- package/es/raster/shaders/terrain/terrain_rgb_vert.glsl +0 -19
- package/es/shader/minify_frag.glsl +0 -11
- package/es/shader/minify_picking_frag.glsl +0 -10
- package/es/tile/core/BaseLayer.d.ts +0 -50
- package/es/tile/core/BaseLayer.js +0 -256
- package/es/tile/core/TileDebugLayer.d.ts +0 -15
- package/es/tile/core/TileDebugLayer.js +0 -23
- package/es/tile/interaction/getFeatureData.d.ts +0 -0
- package/es/tile/interaction/getFeatureData.js +0 -0
- package/es/tile/interaction/getRasterData.d.ts +0 -4
- package/es/tile/interaction/getRasterData.js +0 -45
- package/es/tile/interaction/utils.d.ts +0 -11
- package/es/tile/interaction/utils.js +0 -69
- package/es/tile/interface.d.ts +0 -29
- package/es/tile/interface.js +0 -1
- package/es/tile/service/TileLayerService.d.ts +0 -58
- package/es/tile/service/TileLayerService.js +0 -195
- package/es/tile/service/TilePickService.d.ts +0 -26
- package/es/tile/service/TilePickService.js +0 -126
- package/es/tile/service/TileSourceService.d.ts +0 -7
- package/es/tile/service/TileSourceService.js +0 -26
- package/es/tile/tile/DebugTile.d.ts +0 -16
- package/es/tile/tile/DebugTile.js +0 -47
- package/es/tile/tile/ImageTile.d.ts +0 -14
- package/es/tile/tile/ImageTile.js +0 -39
- package/es/tile/tile/MaskTile.d.ts +0 -18
- package/es/tile/tile/MaskTile.js +0 -54
- package/es/tile/tile/RasterRGBTile.d.ts +0 -11
- package/es/tile/tile/RasterRGBTile.js +0 -47
- package/es/tile/tile/RasterTerrainRGBTile.d.ts +0 -14
- package/es/tile/tile/RasterTerrainRGBTile.js +0 -39
- package/es/tile/tile/RasterTile.d.ts +0 -18
- package/es/tile/tile/RasterTile.js +0 -81
- package/es/tile/tile/Tile.d.ts +0 -112
- package/es/tile/tile/Tile.js +0 -166
- package/es/tile/tile/VectorTile.d.ts +0 -26
- package/es/tile/tile/VectorTile.js +0 -87
- package/es/tile/tile/index.d.ts +0 -12
- package/es/tile/tile/index.js +0 -44
- package/es/tile/tile/util.d.ts +0 -5
- package/es/tile/tile/util.js +0 -18
- package/es/tile/utils/constants.d.ts +0 -1
- package/es/tile/utils/constants.js +0 -8
- package/es/tile/utils/utils.d.ts +0 -8
- package/es/tile/utils/utils.js +0 -11
- package/es/utils/blend.d.ts +0 -2
- package/es/utils/blend.js +0 -57
- package/es/utils/collision-index.d.ts +0 -47
- package/es/utils/collision-index.js +0 -87
- package/es/utils/extrude_polyline.d.ts +0 -53
- package/es/utils/extrude_polyline.js +0 -319
- package/es/utils/grid-index.d.ts +0 -28
- package/es/utils/grid-index.js +0 -128
- package/es/utils/identityScale.d.ts +0 -8
- package/es/utils/identityScale.js +0 -26
- package/es/utils/load-image.d.ts +0 -1
- package/es/utils/load-image.js +0 -22
- package/es/utils/multiPassRender.d.ts +0 -16
- package/es/utils/multiPassRender.js +0 -37
- package/es/utils/polylineNormal.d.ts +0 -9
- package/es/utils/polylineNormal.js +0 -182
- package/es/utils/rampcolor_legend.d.ts +0 -6
- package/es/utils/rampcolor_legend.js +0 -12
- package/es/utils/scale.d.ts +0 -87
- package/es/utils/scale.js +0 -595
- package/es/utils/simpleLine.d.ts +0 -23
- package/es/utils/simpleLine.js +0 -76
- package/es/utils/stencil.d.ts +0 -7
- package/es/utils/stencil.js +0 -49
- package/es/utils/symbol-layout.d.ts +0 -43
- package/es/utils/symbol-layout.js +0 -251
- package/es/wind/index.d.ts +0 -11
- package/es/wind/index.js +0 -34
- package/es/wind/models/index.d.ts +0 -5
- package/es/wind/models/index.js +0 -5
- package/es/wind/models/utils.d.ts +0 -19
- package/es/wind/models/utils.js +0 -213
- package/es/wind/models/wind.d.ts +0 -38
- package/es/wind/models/wind.js +0 -240
- package/es/wind/models/windRender.d.ts +0 -104
- package/es/wind/models/windRender.js +0 -333
- package/es/wind/models/windShader.d.ts +0 -12
- package/es/wind/models/windShader.js +0 -151
- package/es/wind/shaders/wind_frag.glsl +0 -9
- package/es/wind/shaders/wind_vert.glsl +0 -14
- package/lib/canvas/index.d.ts +0 -18
- package/lib/canvas/index.js +0 -79
- package/lib/canvas/models/canvas.d.ts +0 -23
- package/lib/canvas/models/canvas.js +0 -149
- package/lib/canvas/models/constants.d.ts +0 -2
- package/lib/canvas/models/constants.js +0 -12
- package/lib/canvas/models/index.d.ts +0 -2
- package/lib/canvas/models/index.js +0 -27
- package/lib/citybuilding/building.d.ts +0 -7
- package/lib/citybuilding/building.js +0 -33
- package/lib/citybuilding/models/build.d.ts +0 -33
- package/lib/citybuilding/models/build.js +0 -168
- package/lib/citybuilding/shaders/build_frag.glsl +0 -123
- package/lib/citybuilding/shaders/build_vert.glsl +0 -58
- package/lib/core/BaseLayer.d.ts +0 -265
- package/lib/core/BaseLayer.js +0 -1317
- package/lib/core/BaseModel.d.ts +0 -95
- package/lib/core/BaseModel.js +0 -375
- package/lib/core/CommonStyleAttribute.d.ts +0 -16
- package/lib/core/CommonStyleAttribute.js +0 -120
- package/lib/core/LayerPickService.d.ts +0 -12
- package/lib/core/LayerPickService.js +0 -110
- package/lib/core/TextureService.d.ts +0 -15
- package/lib/core/TextureService.js +0 -73
- package/lib/core/constant.d.ts +0 -6
- package/lib/core/constant.js +0 -25
- package/lib/core/interface.d.ts +0 -284
- package/lib/core/interface.js +0 -34
- package/lib/core/line_trangluation.d.ts +0 -19
- package/lib/core/line_trangluation.js +0 -94
- package/lib/core/schema.d.ts +0 -27
- package/lib/core/schema.js +0 -31
- package/lib/core/shape/Path.d.ts +0 -40
- package/lib/core/shape/Path.js +0 -81
- package/lib/core/shape/arrow.d.ts +0 -25
- package/lib/core/shape/arrow.js +0 -158
- package/lib/core/shape/extrude.d.ts +0 -17
- package/lib/core/shape/extrude.js +0 -142
- package/lib/core/triangulation.d.ts +0 -136
- package/lib/core/triangulation.js +0 -628
- package/lib/core/utils.d.ts +0 -5
- package/lib/core/utils.js +0 -44
- package/lib/earth/index.d.ts +0 -22
- package/lib/earth/index.js +0 -62
- package/lib/earth/models/atmosphere.d.ts +0 -30
- package/lib/earth/models/atmosphere.js +0 -124
- package/lib/earth/models/base.d.ts +0 -37
- package/lib/earth/models/base.js +0 -180
- package/lib/earth/models/bloomsphere.d.ts +0 -30
- package/lib/earth/models/bloomsphere.js +0 -123
- package/lib/earth/shaders/atmosphere/atmosphere_frag.glsl +0 -17
- package/lib/earth/shaders/atmosphere/atmosphere_vert.glsl +0 -24
- package/lib/earth/shaders/base/base_frag.glsl +0 -11
- package/lib/earth/shaders/base/base_vert.glsl +0 -52
- package/lib/earth/shaders/bloomshpere/bloomsphere_frag.glsl +0 -15
- package/lib/earth/shaders/bloomshpere/bloomsphere_vert.glsl +0 -20
- package/lib/earth/utils.d.ts +0 -26
- package/lib/earth/utils.js +0 -107
- package/lib/geometry/index.d.ts +0 -22
- package/lib/geometry/index.js +0 -61
- package/lib/geometry/models/billboard.d.ts +0 -39
- package/lib/geometry/models/billboard.js +0 -183
- package/lib/geometry/models/index.d.ts +0 -5
- package/lib/geometry/models/index.js +0 -16
- package/lib/geometry/models/plane.d.ts +0 -58
- package/lib/geometry/models/plane.js +0 -316
- package/lib/geometry/models/sprite.d.ts +0 -48
- package/lib/geometry/models/sprite.js +0 -233
- package/lib/geometry/shaders/billboard_frag.glsl +0 -18
- package/lib/geometry/shaders/billboard_vert.glsl +0 -43
- package/lib/geometry/shaders/plane_frag.glsl +0 -23
- package/lib/geometry/shaders/plane_vert.glsl +0 -31
- package/lib/geometry/shaders/sprite_frag.glsl +0 -23
- package/lib/geometry/shaders/sprite_vert.glsl +0 -21
- package/lib/heatmap/index.d.ts +0 -13
- package/lib/heatmap/index.js +0 -95
- package/lib/heatmap/models/grid.d.ts +0 -29
- package/lib/heatmap/models/grid.js +0 -91
- package/lib/heatmap/models/grid3d.d.ts +0 -31
- package/lib/heatmap/models/grid3d.js +0 -130
- package/lib/heatmap/models/heatmap.d.ts +0 -46
- package/lib/heatmap/models/heatmap.js +0 -455
- package/lib/heatmap/models/hexagon.d.ts +0 -29
- package/lib/heatmap/models/hexagon.js +0 -91
- package/lib/heatmap/models/index.d.ts +0 -5
- package/lib/heatmap/models/index.js +0 -19
- package/lib/heatmap/shaders/grid/grid_frag.glsl +0 -9
- package/lib/heatmap/shaders/grid/grid_vert.glsl +0 -30
- package/lib/heatmap/shaders/grid3d/grid_3d_frag.glsl +0 -17
- package/lib/heatmap/shaders/grid3d/grid_3d_vert.glsl +0 -34
- package/lib/heatmap/shaders/heatmap/heatmap_3d_frag.glsl +0 -23
- package/lib/heatmap/shaders/heatmap/heatmap_3d_vert.glsl +0 -59
- package/lib/heatmap/shaders/heatmap/heatmap_frag.glsl +0 -40
- package/lib/heatmap/shaders/heatmap/heatmap_framebuffer_frag.glsl +0 -17
- package/lib/heatmap/shaders/heatmap/heatmap_framebuffer_vert.glsl +0 -36
- package/lib/heatmap/shaders/heatmap/heatmap_vert.glsl +0 -21
- package/lib/heatmap/shaders/hexagon/hexagon_frag.glsl +0 -8
- package/lib/heatmap/shaders/hexagon/hexagon_vert.glsl +0 -30
- package/lib/heatmap/triangulation.d.ts +0 -5
- package/lib/heatmap/triangulation.js +0 -39
- package/lib/image/index.d.ts +0 -9
- package/lib/image/index.js +0 -36
- package/lib/image/models/image.d.ts +0 -31
- package/lib/image/models/image.js +0 -121
- package/lib/image/models/index.d.ts +0 -5
- package/lib/image/models/index.js +0 -12
- package/lib/image/shaders/dataImage_frag.glsl +0 -32
- package/lib/image/shaders/image_frag.glsl +0 -38
- package/lib/image/shaders/image_vert.glsl +0 -20
- package/lib/index.d.ts +0 -18
- package/lib/index.js +0 -148
- package/lib/line/index.d.ts +0 -36
- package/lib/line/index.js +0 -98
- package/lib/line/models/arc.d.ts +0 -40
- package/lib/line/models/arc.js +0 -287
- package/lib/line/models/arc_3d.d.ts +0 -40
- package/lib/line/models/arc_3d.js +0 -277
- package/lib/line/models/flow.d.ts +0 -31
- package/lib/line/models/flow.js +0 -148
- package/lib/line/models/great_circle.d.ts +0 -34
- package/lib/line/models/great_circle.js +0 -248
- package/lib/line/models/index.d.ts +0 -5
- package/lib/line/models/index.js +0 -25
- package/lib/line/models/line.d.ts +0 -44
- package/lib/line/models/line.js +0 -281
- package/lib/line/models/simple_line.d.ts +0 -33
- package/lib/line/models/simple_line.js +0 -126
- package/lib/line/models/wall.d.ts +0 -34
- package/lib/line/models/wall.js +0 -231
- package/lib/line/shaders/arc/line_arc_frag.glsl +0 -92
- package/lib/line/shaders/arc/line_arc_vert.glsl +0 -156
- package/lib/line/shaders/arc3d/line_arc_3d_frag.glsl +0 -108
- package/lib/line/shaders/arc3d/line_arc_3d_vert.glsl +0 -177
- package/lib/line/shaders/flow/flow_line_frag.glsl +0 -13
- package/lib/line/shaders/flow/flow_line_vert.glsl +0 -76
- package/lib/line/shaders/greatCircle/line_arc_great_circle_frag.glsl +0 -99
- package/lib/line/shaders/greatCircle/line_arc_great_circle_vert.glsl +0 -165
- package/lib/line/shaders/line/line_frag.glsl +0 -122
- package/lib/line/shaders/line/line_vert.glsl +0 -101
- package/lib/line/shaders/simple/simpleline_frag.glsl +0 -30
- package/lib/line/shaders/simple/simpleline_vert.glsl +0 -45
- package/lib/line/shaders/wall/wall_frag.glsl +0 -94
- package/lib/line/shaders/wall/wall_vert.glsl +0 -90
- package/lib/mask/index.d.ts +0 -16
- package/lib/mask/index.js +0 -29
- package/lib/mask/models/fill.d.ts +0 -18
- package/lib/mask/models/fill.js +0 -69
- package/lib/mask/models/index.d.ts +0 -5
- package/lib/mask/models/index.js +0 -12
- package/lib/mask/shaders/mask_vert.glsl +0 -14
- package/lib/plugins/DataMappingPlugin.d.ts +0 -12
- package/lib/plugins/DataMappingPlugin.js +0 -234
- package/lib/plugins/DataSourcePlugin.d.ts +0 -6
- package/lib/plugins/DataSourcePlugin.js +0 -83
- package/lib/plugins/FeatureScalePlugin.d.ts +0 -20
- package/lib/plugins/FeatureScalePlugin.js +0 -303
- package/lib/plugins/LayerAnimateStylePlugin.d.ts +0 -4
- package/lib/plugins/LayerAnimateStylePlugin.js +0 -22
- package/lib/plugins/LayerMaskPlugin.d.ts +0 -7
- package/lib/plugins/LayerMaskPlugin.js +0 -26
- package/lib/plugins/LayerModelPlugin.d.ts +0 -10
- package/lib/plugins/LayerModelPlugin.js +0 -68
- package/lib/plugins/LayerStylePlugin.d.ts +0 -7
- package/lib/plugins/LayerStylePlugin.js +0 -25
- package/lib/plugins/LightingPlugin.d.ts +0 -35
- package/lib/plugins/LightingPlugin.js +0 -93
- package/lib/plugins/MultiPassRendererPlugin.d.ts +0 -22
- package/lib/plugins/MultiPassRendererPlugin.js +0 -59
- package/lib/plugins/PixelPickingPlugin.d.ts +0 -11
- package/lib/plugins/PixelPickingPlugin.js +0 -154
- package/lib/plugins/RegisterStyleAttributePlugin.d.ts +0 -10
- package/lib/plugins/RegisterStyleAttributePlugin.js +0 -78
- package/lib/plugins/ShaderUniformPlugin.d.ts +0 -17
- package/lib/plugins/ShaderUniformPlugin.js +0 -203
- package/lib/plugins/UpdateModelPlugin.d.ts +0 -7
- package/lib/plugins/UpdateModelPlugin.js +0 -27
- package/lib/plugins/UpdateStyleAttributePlugin.d.ts +0 -9
- package/lib/plugins/UpdateStyleAttributePlugin.js +0 -61
- package/lib/plugins/index.d.ts +0 -15
- package/lib/plugins/index.js +0 -26
- package/lib/point/index.d.ts +0 -35
- package/lib/point/index.js +0 -161
- package/lib/point/models/billboard_point.d.ts +0 -35
- package/lib/point/models/billboard_point.js +0 -104
- package/lib/point/models/earthExtrude.d.ts +0 -32
- package/lib/point/models/earthExtrude.js +0 -207
- package/lib/point/models/earthFill.d.ts +0 -31
- package/lib/point/models/earthFill.js +0 -166
- package/lib/point/models/extrude.d.ts +0 -32
- package/lib/point/models/extrude.js +0 -203
- package/lib/point/models/fill.d.ts +0 -47
- package/lib/point/models/fill.js +0 -188
- package/lib/point/models/fillImage.d.ts +0 -42
- package/lib/point/models/fillImage.js +0 -197
- package/lib/point/models/image.d.ts +0 -48
- package/lib/point/models/image.js +0 -301
- package/lib/point/models/index.d.ts +0 -5
- package/lib/point/models/index.js +0 -32
- package/lib/point/models/normal.d.ts +0 -36
- package/lib/point/models/normal.js +0 -98
- package/lib/point/models/radar.d.ts +0 -37
- package/lib/point/models/radar.js +0 -123
- package/lib/point/models/text.d.ts +0 -85
- package/lib/point/models/text.js +0 -512
- package/lib/point/shaders/billboard/billboard_point_frag.glsl +0 -48
- package/lib/point/shaders/billboard/billboard_point_vert.glsl +0 -33
- package/lib/point/shaders/earthExtrude/earthExtrude_frag.glsl +0 -36
- package/lib/point/shaders/earthExtrude/earthExtrude_vert.glsl +0 -118
- package/lib/point/shaders/earthFill/earthFill_frag.glsl +0 -79
- package/lib/point/shaders/earthFill/earthFill_vert.glsl +0 -46
- package/lib/point/shaders/extrude/extrude_frag.glsl +0 -29
- package/lib/point/shaders/extrude/extrude_vert.glsl +0 -95
- package/lib/point/shaders/fill/fill_frag.glsl +0 -97
- package/lib/point/shaders/fill/fill_vert.glsl +0 -79
- package/lib/point/shaders/fillImage/fillImage_frag.glsl +0 -23
- package/lib/point/shaders/fillImage/fillImage_vert.glsl +0 -46
- package/lib/point/shaders/image/image_frag.glsl +0 -45
- package/lib/point/shaders/image/image_vert.glsl +0 -47
- package/lib/point/shaders/normal/normal_frag.glsl +0 -5
- package/lib/point/shaders/normal/normal_vert.glsl +0 -22
- package/lib/point/shaders/radar/radar_frag.glsl +0 -52
- package/lib/point/shaders/radar/radar_vert.glsl +0 -53
- package/lib/point/shaders/text/text_frag.glsl +0 -47
- package/lib/point/shaders/text/text_vert.glsl +0 -65
- package/lib/point/shape/extrude.d.ts +0 -15
- package/lib/point/shape/extrude.js +0 -56
- package/lib/polygon/index.d.ts +0 -18
- package/lib/polygon/index.js +0 -79
- package/lib/polygon/models/extrude.d.ts +0 -41
- package/lib/polygon/models/extrude.js +0 -256
- package/lib/polygon/models/extrusion.d.ts +0 -40
- package/lib/polygon/models/extrusion.js +0 -145
- package/lib/polygon/models/fill.d.ts +0 -32
- package/lib/polygon/models/fill.js +0 -135
- package/lib/polygon/models/index.d.ts +0 -5
- package/lib/polygon/models/index.js +0 -33
- package/lib/polygon/models/ocean.d.ts +0 -37
- package/lib/polygon/models/ocean.js +0 -180
- package/lib/polygon/models/water.d.ts +0 -35
- package/lib/polygon/models/water.js +0 -158
- package/lib/polygon/shaders/extrude/polygon_extrude_frag.glsl +0 -24
- package/lib/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +0 -49
- package/lib/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +0 -53
- package/lib/polygon/shaders/extrude/polygon_extrude_vert.glsl +0 -74
- package/lib/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +0 -55
- package/lib/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +0 -54
- package/lib/polygon/shaders/extrusion/polygon_extrusion_frag.glsl +0 -8
- package/lib/polygon/shaders/extrusion/polygon_extrusion_vert.glsl +0 -24
- package/lib/polygon/shaders/fill/fill_frag.glsl +0 -8
- package/lib/polygon/shaders/fill/fill_linear_frag.glsl +0 -23
- package/lib/polygon/shaders/fill/fill_linear_vert.glsl +0 -36
- package/lib/polygon/shaders/fill/fill_vert.glsl +0 -35
- package/lib/polygon/shaders/ocean/ocean_frag.glsl +0 -277
- package/lib/polygon/shaders/ocean/ocean_vert.glsl +0 -21
- package/lib/polygon/shaders/water/polygon_water_frag.glsl +0 -78
- package/lib/polygon/shaders/water/polygon_water_vert.glsl +0 -22
- package/lib/raster/buffers/triangulation.d.ts +0 -6
- package/lib/raster/buffers/triangulation.js +0 -33
- package/lib/raster/index.d.ts +0 -11
- package/lib/raster/index.js +0 -63
- package/lib/raster/models/index.d.ts +0 -5
- package/lib/raster/models/index.js +0 -17
- package/lib/raster/models/raster.d.ts +0 -35
- package/lib/raster/models/raster.js +0 -164
- package/lib/raster/models/rasterRgb.d.ts +0 -35
- package/lib/raster/models/rasterRgb.js +0 -166
- package/lib/raster/models/rasterTerrainRgb.d.ts +0 -30
- package/lib/raster/models/rasterTerrainRgb.js +0 -126
- package/lib/raster/shaders/raster/raster_2d_frag.glsl +0 -37
- package/lib/raster/shaders/raster/raster_2d_vert.glsl +0 -21
- package/lib/raster/shaders/rgb/raster_rgb_frag.glsl +0 -30
- package/lib/raster/shaders/rgb/raster_rgb_vert.glsl +0 -21
- package/lib/raster/shaders/terrain/terrain_rgb_frag.glsl +0 -40
- package/lib/raster/shaders/terrain/terrain_rgb_vert.glsl +0 -19
- package/lib/shader/minify_frag.glsl +0 -11
- package/lib/shader/minify_picking_frag.glsl +0 -10
- package/lib/tile/core/BaseLayer.d.ts +0 -50
- package/lib/tile/core/BaseLayer.js +0 -264
- package/lib/tile/core/TileDebugLayer.d.ts +0 -15
- package/lib/tile/core/TileDebugLayer.js +0 -31
- package/lib/tile/interaction/getFeatureData.d.ts +0 -0
- package/lib/tile/interaction/getFeatureData.js +0 -1
- package/lib/tile/interaction/getRasterData.d.ts +0 -4
- package/lib/tile/interaction/getRasterData.js +0 -52
- package/lib/tile/interaction/utils.d.ts +0 -11
- package/lib/tile/interaction/utils.js +0 -81
- package/lib/tile/interface.d.ts +0 -29
- package/lib/tile/interface.js +0 -5
- package/lib/tile/service/TileLayerService.d.ts +0 -58
- package/lib/tile/service/TileLayerService.js +0 -203
- package/lib/tile/service/TilePickService.d.ts +0 -26
- package/lib/tile/service/TilePickService.js +0 -134
- package/lib/tile/service/TileSourceService.d.ts +0 -7
- package/lib/tile/service/TileSourceService.js +0 -35
- package/lib/tile/tile/DebugTile.d.ts +0 -16
- package/lib/tile/tile/DebugTile.js +0 -55
- package/lib/tile/tile/ImageTile.d.ts +0 -14
- package/lib/tile/tile/ImageTile.js +0 -47
- package/lib/tile/tile/MaskTile.d.ts +0 -18
- package/lib/tile/tile/MaskTile.js +0 -62
- package/lib/tile/tile/RasterRGBTile.d.ts +0 -11
- package/lib/tile/tile/RasterRGBTile.js +0 -55
- package/lib/tile/tile/RasterTerrainRGBTile.d.ts +0 -14
- package/lib/tile/tile/RasterTerrainRGBTile.js +0 -47
- package/lib/tile/tile/RasterTile.d.ts +0 -18
- package/lib/tile/tile/RasterTile.js +0 -89
- package/lib/tile/tile/Tile.d.ts +0 -112
- package/lib/tile/tile/Tile.js +0 -174
- package/lib/tile/tile/VectorTile.d.ts +0 -26
- package/lib/tile/tile/VectorTile.js +0 -95
- package/lib/tile/tile/index.d.ts +0 -12
- package/lib/tile/tile/index.js +0 -76
- package/lib/tile/tile/util.d.ts +0 -5
- package/lib/tile/tile/util.js +0 -26
- package/lib/tile/utils/constants.d.ts +0 -1
- package/lib/tile/utils/constants.js +0 -14
- package/lib/tile/utils/utils.d.ts +0 -8
- package/lib/tile/utils/utils.js +0 -18
- package/lib/utils/blend.d.ts +0 -2
- package/lib/utils/blend.js +0 -63
- package/lib/utils/collision-index.d.ts +0 -47
- package/lib/utils/collision-index.js +0 -96
- package/lib/utils/extrude_polyline.d.ts +0 -53
- package/lib/utils/extrude_polyline.js +0 -331
- package/lib/utils/grid-index.d.ts +0 -28
- package/lib/utils/grid-index.js +0 -135
- package/lib/utils/identityScale.d.ts +0 -8
- package/lib/utils/identityScale.js +0 -32
- package/lib/utils/load-image.d.ts +0 -1
- package/lib/utils/load-image.js +0 -29
- package/lib/utils/multiPassRender.d.ts +0 -16
- package/lib/utils/multiPassRender.js +0 -44
- package/lib/utils/polylineNormal.d.ts +0 -9
- package/lib/utils/polylineNormal.js +0 -191
- package/lib/utils/rampcolor_legend.d.ts +0 -6
- package/lib/utils/rampcolor_legend.js +0 -18
- package/lib/utils/scale.d.ts +0 -87
- package/lib/utils/scale.js +0 -610
- package/lib/utils/simpleLine.d.ts +0 -23
- package/lib/utils/simpleLine.js +0 -85
- package/lib/utils/stencil.d.ts +0 -7
- package/lib/utils/stencil.js +0 -56
- package/lib/utils/symbol-layout.d.ts +0 -43
- package/lib/utils/symbol-layout.js +0 -258
- package/lib/wind/index.d.ts +0 -11
- package/lib/wind/index.js +0 -42
- package/lib/wind/models/index.d.ts +0 -5
- package/lib/wind/models/index.js +0 -12
- package/lib/wind/models/utils.d.ts +0 -19
- package/lib/wind/models/utils.js +0 -229
- package/lib/wind/models/wind.d.ts +0 -38
- package/lib/wind/models/wind.js +0 -248
- package/lib/wind/models/windRender.d.ts +0 -104
- package/lib/wind/models/windRender.js +0 -343
- package/lib/wind/models/windShader.d.ts +0 -12
- package/lib/wind/models/windShader.js +0 -157
- package/lib/wind/shaders/wind_frag.glsl +0 -9
- package/lib/wind/shaders/wind_vert.glsl +0 -14
|
@@ -1,248 +0,0 @@
|
|
|
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/greatCircle/line_arc_great_circle_frag.glsl' */
|
|
15
|
-
const line_arc_frag = "#define LineTypeSolid 0.0\n#define LineTypeDash 1.0\n#define Animate 0.0\n#define LineTexture 1.0\n\nuniform sampler2D u_texture;\nlayout(std140) uniform commonUniorm {\n vec4 u_animate: [ 1., 2., 1.0, 0.2 ];\n vec4 u_dash_array: [10.0, 5., 0, 0];\n vec4 u_sourceColor;\n vec4 u_targetColor;\n vec2 u_textSize;\n float segmentNumber;\n float u_line_type: 0.0;\n float u_icon_step: 100;\n float u_line_texture: 0.0;\n float u_textureBlend;\n float u_time;\n float u_linearColor: 0;\n};\n\nin vec4 v_dash_array;\nin vec4 v_color;\nin vec2 v_iconMapUV;\nin vec4 v_line_data;\nin float v_distance_ratio;\n\nout vec4 outputColor;\n#pragma include \"picking\"\n#pragma include \"project\"\n#pragma include \"projection\"\n\nvoid main() {\n\n float animateSpeed = 0.0;\n float d_segmentIndex = v_line_data.g;\n\n // \u8BBE\u7F6E\u5F27\u7EBF\u7684\u5E95\u8272\n if(u_linearColor == 1.0) { // \u4F7F\u7528\u6E10\u53D8\u989C\u8272\n outputColor = mix(u_sourceColor, u_targetColor, d_segmentIndex/segmentNumber);\n outputColor.a *= v_color.a;\n } else { // \u4F7F\u7528 color \u65B9\u6CD5\u4F20\u5165\u7684\u989C\u8272\n outputColor = v_color;\n }\n\n // float blur = 1.- smoothstep(u_blur, 1., length(v_normal.xy));\n // float blur = smoothstep(1.0, u_blur, length(v_normal.xy));\n if(u_line_type == LineTypeDash) {\n float dashLength = mod(v_distance_ratio, v_dash_array.x + v_dash_array.y + v_dash_array.z + v_dash_array.w);\n if(dashLength < v_dash_array.x || (dashLength > (v_dash_array.x + v_dash_array.y) && dashLength < v_dash_array.x + v_dash_array.y + v_dash_array.z)) {\n // \u5B9E\u7EBF\u90E8\u5206\n } else {\n // \u865A\u7EBF\u90E8\u5206\n discard;\n };\n }\n\n // \u8BBE\u7F6E\u5F27\u7EBF\u7684\u52A8\u753B\u6A21\u5F0F\n if(u_animate.x == Animate) {\n animateSpeed = u_time / u_animate.y;\n float alpha =1.0 - fract( mod(1.0- v_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + u_time / u_animate.y);\n alpha = (alpha + u_animate.w -1.0) / u_animate.w;\n alpha = smoothstep(0., 1., alpha);\n outputColor.a *= alpha;\n }\n\n // \u8BBE\u7F6E\u5F27\u7EBF\u7684\u8D34\u56FE\n if(LineTexture == u_line_texture && u_line_type != LineTypeDash) {\n float arcRadio = smoothstep( 0.0, 1.0, (d_segmentIndex / (segmentNumber - 1.0)));\n // float arcRadio = d_segmentIndex / (segmentNumber - 1.0);\n float count = v_line_data.b; // \u8D34\u56FE\u5728\u5F27\u7EBF\u4E0A\u91CD\u590D\u7684\u6570\u91CF\n float u = fract(arcRadio * count - animateSpeed * count);\n // float u = fract(arcRadio * count - animateSpeed);\n if(u_animate.x == Animate) {\n u = outputColor.a/v_color.a;\n }\n\n float v = v_line_data.a; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C\n\n vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.;\n vec4 pattern = texture(SAMPLER_2D(u_texture), uv);\n\n // \u8BBE\u7F6E\u8D34\u56FE\u548C\u5E95\u8272\u7684\u53E0\u52A0\u6A21\u5F0F\n if(u_textureBlend == 0.0) { // normal\n pattern.a = 0.0;\n outputColor = filterColor(outputColor + pattern);\n } else { // replace\n pattern.a *= v_color.a;\n if(outputColor.a <= 0.0) {\n pattern.a = 0.0;\n }\n outputColor = filterColor(pattern);\n }\n } else {\n outputColor = filterColor(outputColor);\n }\n\n // gl_FragColor = filterColor(gl_FragColor);\n}\n";
|
|
16
|
-
/* babel-plugin-inline-import '../shaders/greatCircle/line_arc_great_circle_vert.glsl' */
|
|
17
|
-
const line_arc2d_vert = "#define LineTypeSolid (0.0)\n#define LineTypeDash (1.0)\n#define Animate (0.0)\n#define LineTexture (1.0)\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 float a_Size;\nlayout(location = ATTRIBUTE_LOCATION_INSTANCE) in vec4 a_Instance;\nlayout(location = ATTRIBUTE_LOCATION_INSTANCE_64LOW) in vec4 a_Instance64Low;\nlayout(location = ATTRIBUTE_LOCATION_UV) in vec2 a_iconMapUV;\n\nlayout(std140) uniform commonUniorm {\n vec4 u_animate: [ 1., 2., 1.0, 0.2 ];\n vec4 u_dash_array: [10.0, 5., 0, 0];\n vec4 u_sourceColor;\n vec4 u_targetColor;\n vec2 u_textSize;\n float segmentNumber;\n float u_line_type: 0.0;\n float u_icon_step: 100;\n float u_line_texture: 0.0;\n float u_textureBlend;\n float u_time;\n float u_linearColor: 0;\n};\n\nout vec4 v_dash_array;\nout vec4 v_color;\nout vec2 v_iconMapUV;\nout vec4 v_line_data;\nout float v_distance_ratio;\n\n#pragma include \"projection\"\n#pragma include \"project\"\n#pragma include \"picking\"\n\nfloat maps(float value, float start1, float stop1, float start2, float stop2) {\n return start2 + (stop2 - start2) * ((value - start1) / (stop1 - start1));\n}\n\nfloat getSegmentRatio(float index) {\n return index / (segmentNumber - 1.0);\n}\n\nfloat paraboloid(vec2 source, vec2 target, float ratio) {\n vec2 x = mix(source, target, ratio);\n vec2 center = mix(source, target, 0.5);\n float dSourceCenter = distance(source, center);\n float dXCenter = distance(x, center);\n return (dSourceCenter + dXCenter) * (dSourceCenter - dXCenter);\n}\n\nvec3 getPos(vec2 source, vec2 target, float segmentRatio) {\n float vertex_height = paraboloid(source, target, segmentRatio);\n\n return vec3(mix(source, target, segmentRatio), sqrt(max(0.0, vertex_height)));\n}\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction) {\n // normalized direction of the line\n vec2 dir_screenspace = normalize(line_clipspace);\n // rotate by 90 degrees\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n vec2 offset = dir_screenspace * offset_direction * setPickingSize(a_Size) / 2.0;\n return offset;\n}\nvec2 getNormal(vec2 line_clipspace, float offset_direction) {\n // normalized direction of the line\n vec2 dir_screenspace = normalize(line_clipspace);\n // rotate by 90 degrees\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n return dir_screenspace.xy * sign(offset_direction);\n}\nfloat getAngularDist(vec2 source, vec2 target) {\n vec2 delta = source - target;\n vec2 sin_half_delta = sin(delta / 2.0);\n float a =\n sin_half_delta.y * sin_half_delta.y +\n cos(source.y) * cos(target.y) * sin_half_delta.x * sin_half_delta.x;\n return 2.0 * atan(sqrt(a), sqrt(1.0 - a));\n}\n\nvec2 midPoint(vec2 source, vec2 target) {\n vec2 center = target - source;\n float r = length(center);\n float theta = atan(center.y, center.x);\n float thetaOffset = 0.314;\n float r2 = r / 2.0 / cos(thetaOffset);\n float theta2 = theta + thetaOffset;\n vec2 mid = vec2(r2 * cos(theta2) + source.x, r2 * sin(theta2) + source.y);\n return mid;\n}\nfloat bezier3(vec3 arr, float t) {\n float ut = 1.0 - t;\n return (arr.x * ut + arr.y * t) * ut + (arr.y * ut + arr.z * t) * t;\n}\n\nvec2 interpolate(vec2 source, vec2 target, float angularDist, float t) {\n if (abs(angularDist - PI) < 0.001) {\n return (1.0 - t) * source + t * target;\n }\n float a = sin((1.0 - t) * angularDist) / sin(angularDist);\n float b = sin(t * angularDist) / sin(angularDist);\n vec2 sin_source = sin(source);\n vec2 cos_source = cos(source);\n vec2 sin_target = sin(target);\n vec2 cos_target = cos(target);\n float x = a * cos_source.y * cos_source.x + b * cos_target.y * cos_target.x;\n float y = a * cos_source.y * sin_source.x + b * cos_target.y * sin_target.x;\n float z = a * sin_source.y + b * sin_target.y;\n return vec2(atan(y, x), atan(z, sqrt(x * x + y * y)));\n\n}\n\nvoid main() {\n v_color = a_Color;\n v_color.a = v_color.a * opacity;\n vec2 source = radians(a_Instance.rg);\n vec2 target = radians(a_Instance.ba);\n float angularDist = getAngularDist(source, target);\n float segmentIndex = a_Position.x;\n float segmentRatio = getSegmentRatio(segmentIndex);\n float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\n\n if (u_line_type == LineTypeDash) {\n v_distance_ratio = segmentIndex / segmentNumber;\n float total_Distance = pixelDistance(source, target) / 2.0 * PI;\n total_Distance = total_Distance * 16.0; // total_Distance*16.0 \u8C03\u6574\u9ED8\u8BA4\u7684\u6548\u679C\n v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / total_Distance;\n }\n\n if (u_animate.x == Animate) {\n v_distance_ratio = segmentIndex / segmentNumber;\n }\n\n float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);\n v_distance_ratio = segmentIndex / segmentNumber;\n\n vec4 curr = project_position(vec4(degrees(interpolate(source, target, angularDist, segmentRatio)), 0.0, 1.0), a_Instance64Low.xy);\n vec4 next = project_position(vec4(degrees(interpolate(source, target, angularDist, nextSegmentRatio)), 0.0, 1.0), a_Instance64Low.zw);\n\n // v_normal = getNormal((next.xy - curr.xy) * indexDir, a_Position.y);\n vec2 offset = project_pixel(getExtrusionOffset((next.xy - curr.xy) * indexDir, a_Position.y));\n // vec4 project_pos = project_position(vec4(curr.xy, 0, 1.0));\n // gl_Position = project_common_position_to_clipspace(vec4(curr.xy + offset, curr.z, 1.0));\n\n v_line_data.g = a_Position.x; // \u8BE5\u9876\u70B9\u5728\u5F27\u7EBF\u4E0A\u7684\u5206\u6BB5\u6392\u5E8F\n if (LineTexture == u_line_texture) {\n float d_arcDistrance = length(source - target);\n d_arcDistrance = project_pixel(d_arcDistrance);\n\n float d_pixelLen = project_pixel(u_icon_step) / 8.0;\n v_line_data.b = floor(d_arcDistrance / d_pixelLen); // \u8D34\u56FE\u5728\u5F27\u7EBF\u4E0A\u91CD\u590D\u7684\u6570\u91CF\n\n float lineOffsetWidth = length(offset + offset * sign(a_Position.y)); // \u7EBF\u6A2A\u5411\u504F\u79FB\u7684\u8DDD\u79BB\n float linePixelSize = project_pixel(a_Size); // \u5B9A\u70B9\u4F4D\u7F6E\u504F\u79FB\uFF0C\u6309\u5730\u56FE\u7B49\u7EA7\u7F29\u653E\u540E\u7684\u8DDD\u79BB\n v_line_data.a = lineOffsetWidth / linePixelSize; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C\n\n v_iconMapUV = a_iconMapUV;\n }\n\n gl_Position = project_common_position_to_clipspace(vec4(curr.xy + offset, 0, 1.0));\n setPickingColor(a_PickingColor);\n}\n\n";
|
|
18
|
-
const lineStyleObj = {
|
|
19
|
-
solid: 0.0,
|
|
20
|
-
dash: 1.0
|
|
21
|
-
};
|
|
22
|
-
class GreatCircleModel extends _BaseModel.default {
|
|
23
|
-
constructor(...args) {
|
|
24
|
-
super(...args);
|
|
25
|
-
(0, _defineProperty2.default)(this, "texture", void 0);
|
|
26
|
-
(0, _defineProperty2.default)(this, "updateTexture", () => {
|
|
27
|
-
const {
|
|
28
|
-
createTexture2D
|
|
29
|
-
} = this.rendererService;
|
|
30
|
-
if (this.texture) {
|
|
31
|
-
this.texture.update({
|
|
32
|
-
data: this.iconService.getCanvas()
|
|
33
|
-
});
|
|
34
|
-
this.layer.render();
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
this.texture = createTexture2D({
|
|
38
|
-
data: this.iconService.getCanvas(),
|
|
39
|
-
mag: _l7Core.gl.NEAREST,
|
|
40
|
-
min: _l7Core.gl.NEAREST,
|
|
41
|
-
premultiplyAlpha: false,
|
|
42
|
-
width: 1024,
|
|
43
|
-
height: this.iconService.canvasHeight || 128
|
|
44
|
-
});
|
|
45
|
-
this.textures = [this.texture];
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
get attributeLocation() {
|
|
49
|
-
return Object.assign(super.attributeLocation, {
|
|
50
|
-
MAX: super.attributeLocation.MAX,
|
|
51
|
-
SIZE: 9,
|
|
52
|
-
INSTANCE: 10,
|
|
53
|
-
INSTANCE_64LOW: 11,
|
|
54
|
-
UV: 12
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
getCommonUniformsInfo() {
|
|
58
|
-
const {
|
|
59
|
-
sourceColor,
|
|
60
|
-
targetColor,
|
|
61
|
-
textureBlend = 'normal',
|
|
62
|
-
lineType = 'solid',
|
|
63
|
-
dashArray = [10, 5],
|
|
64
|
-
lineTexture = false,
|
|
65
|
-
iconStep = 100,
|
|
66
|
-
segmentNumber = 30
|
|
67
|
-
} = this.layer.getLayerConfig();
|
|
68
|
-
const {
|
|
69
|
-
animateOption
|
|
70
|
-
} = this.layer.getLayerConfig();
|
|
71
|
-
if (dashArray.length === 2) {
|
|
72
|
-
dashArray.push(0, 0);
|
|
73
|
-
}
|
|
74
|
-
if (this.rendererService.getDirty()) {
|
|
75
|
-
var _this$texture;
|
|
76
|
-
(_this$texture = this.texture) === null || _this$texture === void 0 || _this$texture.bind();
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
// 转化渐变色
|
|
80
|
-
let useLinearColor = 0; // 默认不生效
|
|
81
|
-
let sourceColorArr = [0, 0, 0, 0];
|
|
82
|
-
let targetColorArr = [0, 0, 0, 0];
|
|
83
|
-
if (sourceColor && targetColor) {
|
|
84
|
-
sourceColorArr = (0, _l7Utils.rgb2arr)(sourceColor);
|
|
85
|
-
targetColorArr = (0, _l7Utils.rgb2arr)(targetColor);
|
|
86
|
-
useLinearColor = 1;
|
|
87
|
-
}
|
|
88
|
-
let u_time = this.layer.getLayerAnimateTime();
|
|
89
|
-
if (isNaN(u_time)) {
|
|
90
|
-
u_time = 0.0;
|
|
91
|
-
}
|
|
92
|
-
const commonOptions = {
|
|
93
|
-
u_animate: this.animateOption2Array(animateOption),
|
|
94
|
-
u_dash_array: dashArray,
|
|
95
|
-
u_sourceColor: sourceColorArr,
|
|
96
|
-
u_targetColor: targetColorArr,
|
|
97
|
-
u_textSize: [1024, this.iconService.canvasHeight || 128],
|
|
98
|
-
segmentNumber,
|
|
99
|
-
u_line_type: lineStyleObj[lineType] || 0.0,
|
|
100
|
-
u_icon_step: iconStep,
|
|
101
|
-
u_line_texture: lineTexture ? 1.0 : 0.0,
|
|
102
|
-
// 传入线的标识
|
|
103
|
-
u_textureBlend: textureBlend === 'normal' ? 0.0 : 1.0,
|
|
104
|
-
u_time,
|
|
105
|
-
// 纹理支持参数
|
|
106
|
-
// u_texture: this.texture, // 贴图
|
|
107
|
-
// 渐变色支持参数
|
|
108
|
-
u_linearColor: useLinearColor
|
|
109
|
-
};
|
|
110
|
-
const commonBufferInfo = this.getUniformsBufferInfo(commonOptions);
|
|
111
|
-
return commonBufferInfo;
|
|
112
|
-
}
|
|
113
|
-
// public getAnimateUniforms(): IModelUniform {
|
|
114
|
-
// const { animateOption } = this.layer.getLayerConfig() as ILayerConfig;
|
|
115
|
-
// return {
|
|
116
|
-
// u_animate: this.animateOption2Array(animateOption as IAnimateOption),
|
|
117
|
-
// u_time: this.layer.getLayerAnimateTime(),
|
|
118
|
-
// };
|
|
119
|
-
// }
|
|
120
|
-
|
|
121
|
-
initModels() {
|
|
122
|
-
var _this = this;
|
|
123
|
-
return (0, _asyncToGenerator2.default)(function* () {
|
|
124
|
-
_this.initUniformsBuffer();
|
|
125
|
-
_this.updateTexture();
|
|
126
|
-
_this.iconService.on('imageUpdate', _this.updateTexture);
|
|
127
|
-
return _this.buildModels();
|
|
128
|
-
})();
|
|
129
|
-
}
|
|
130
|
-
clearModels() {
|
|
131
|
-
var _this$texture2;
|
|
132
|
-
(_this$texture2 = this.texture) === null || _this$texture2 === void 0 || _this$texture2.destroy();
|
|
133
|
-
this.iconService.off('imageUpdate', this.updateTexture);
|
|
134
|
-
}
|
|
135
|
-
buildModels() {
|
|
136
|
-
var _this2 = this;
|
|
137
|
-
return (0, _asyncToGenerator2.default)(function* () {
|
|
138
|
-
const {
|
|
139
|
-
segmentNumber = 30
|
|
140
|
-
} = _this2.layer.getLayerConfig();
|
|
141
|
-
const model = yield _this2.layer.buildLayerModel({
|
|
142
|
-
moduleName: 'lineGreatCircle',
|
|
143
|
-
vertexShader: line_arc2d_vert,
|
|
144
|
-
fragmentShader: line_arc_frag,
|
|
145
|
-
triangulation: _triangulation.LineArcTriangulation,
|
|
146
|
-
styleOption: {
|
|
147
|
-
segmentNumber
|
|
148
|
-
},
|
|
149
|
-
defines: _this2.getDefines(),
|
|
150
|
-
inject: _this2.getInject(),
|
|
151
|
-
depth: {
|
|
152
|
-
enable: false
|
|
153
|
-
}
|
|
154
|
-
});
|
|
155
|
-
return [model];
|
|
156
|
-
})();
|
|
157
|
-
}
|
|
158
|
-
registerBuiltinAttributes() {
|
|
159
|
-
this.styleAttributeService.registerStyleAttribute({
|
|
160
|
-
name: 'size',
|
|
161
|
-
type: _l7Core.AttributeType.Attribute,
|
|
162
|
-
descriptor: {
|
|
163
|
-
name: 'a_Size',
|
|
164
|
-
shaderLocation: this.attributeLocation.SIZE,
|
|
165
|
-
buffer: {
|
|
166
|
-
// give the WebGL driver a hint that this buffer may change
|
|
167
|
-
usage: _l7Core.gl.DYNAMIC_DRAW,
|
|
168
|
-
data: [],
|
|
169
|
-
type: _l7Core.gl.FLOAT
|
|
170
|
-
},
|
|
171
|
-
size: 1,
|
|
172
|
-
update: feature => {
|
|
173
|
-
const {
|
|
174
|
-
size = 1
|
|
175
|
-
} = feature;
|
|
176
|
-
return Array.isArray(size) ? [size[0]] : [size];
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
});
|
|
180
|
-
this.styleAttributeService.registerStyleAttribute({
|
|
181
|
-
name: 'instance',
|
|
182
|
-
// 弧线起始点信息
|
|
183
|
-
type: _l7Core.AttributeType.Attribute,
|
|
184
|
-
descriptor: {
|
|
185
|
-
name: 'a_Instance',
|
|
186
|
-
shaderLocation: this.attributeLocation.INSTANCE,
|
|
187
|
-
buffer: {
|
|
188
|
-
usage: _l7Core.gl.STATIC_DRAW,
|
|
189
|
-
data: [],
|
|
190
|
-
type: _l7Core.gl.FLOAT
|
|
191
|
-
},
|
|
192
|
-
size: 4,
|
|
193
|
-
update: (feature, featureIdx, vertex) => {
|
|
194
|
-
return [vertex[3], vertex[4], vertex[5], vertex[6]];
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
});
|
|
198
|
-
|
|
199
|
-
// save low part for enabled double precision INSTANCE attribute
|
|
200
|
-
this.styleAttributeService.registerStyleAttribute({
|
|
201
|
-
name: 'instance64Low',
|
|
202
|
-
type: _l7Core.AttributeType.Attribute,
|
|
203
|
-
descriptor: {
|
|
204
|
-
name: 'a_Instance64Low',
|
|
205
|
-
shaderLocation: this.attributeLocation.INSTANCE_64LOW,
|
|
206
|
-
buffer: {
|
|
207
|
-
usage: _l7Core.gl.STATIC_DRAW,
|
|
208
|
-
data: [],
|
|
209
|
-
type: _l7Core.gl.FLOAT
|
|
210
|
-
},
|
|
211
|
-
size: 4,
|
|
212
|
-
update: (feature, featureIdx, vertex) => {
|
|
213
|
-
return [(0, _l7Utils.fp64LowPart)(vertex[3]), (0, _l7Utils.fp64LowPart)(vertex[4]), (0, _l7Utils.fp64LowPart)(vertex[5]), (0, _l7Utils.fp64LowPart)(vertex[6])];
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
});
|
|
217
|
-
this.styleAttributeService.registerStyleAttribute({
|
|
218
|
-
name: 'uv',
|
|
219
|
-
type: _l7Core.AttributeType.Attribute,
|
|
220
|
-
descriptor: {
|
|
221
|
-
name: 'a_iconMapUV',
|
|
222
|
-
shaderLocation: this.attributeLocation.UV,
|
|
223
|
-
buffer: {
|
|
224
|
-
// give the WebGL driver a hint that this buffer may change
|
|
225
|
-
usage: _l7Core.gl.DYNAMIC_DRAW,
|
|
226
|
-
data: [],
|
|
227
|
-
type: _l7Core.gl.FLOAT
|
|
228
|
-
},
|
|
229
|
-
size: 2,
|
|
230
|
-
update: feature => {
|
|
231
|
-
const iconMap = this.iconService.getIconMap();
|
|
232
|
-
const {
|
|
233
|
-
texture
|
|
234
|
-
} = feature;
|
|
235
|
-
const {
|
|
236
|
-
x,
|
|
237
|
-
y
|
|
238
|
-
} = iconMap[texture] || {
|
|
239
|
-
x: 0,
|
|
240
|
-
y: 0
|
|
241
|
-
};
|
|
242
|
-
return [x, y];
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
});
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
exports.default = GreatCircleModel;
|
package/lib/line/models/index.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
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 _arc = _interopRequireDefault(require("./arc"));
|
|
9
|
-
var _arc_3d = _interopRequireDefault(require("./arc_3d"));
|
|
10
|
-
var _flow = _interopRequireDefault(require("./flow"));
|
|
11
|
-
var _great_circle = _interopRequireDefault(require("./great_circle"));
|
|
12
|
-
var _line = _interopRequireDefault(require("./line"));
|
|
13
|
-
var _simple_line = _interopRequireDefault(require("./simple_line"));
|
|
14
|
-
var _wall = _interopRequireDefault(require("./wall"));
|
|
15
|
-
const LineModels = {
|
|
16
|
-
arc: _arc.default,
|
|
17
|
-
arc3d: _arc_3d.default,
|
|
18
|
-
greatcircle: _great_circle.default,
|
|
19
|
-
wall: _wall.default,
|
|
20
|
-
line: _line.default,
|
|
21
|
-
simple: _simple_line.default,
|
|
22
|
-
flowline: _flow.default,
|
|
23
|
-
earthArc3d: _arc_3d.default
|
|
24
|
-
};
|
|
25
|
-
var _default = exports.default = LineModels;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import type { IModel, ITexture2D } from '@antv/l7-core';
|
|
2
|
-
import BaseModel from '../../core/BaseModel';
|
|
3
|
-
export default class LineModel 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
|
-
DISTANCE_INDEX: number;
|
|
18
|
-
NORMAL: number;
|
|
19
|
-
UV: number;
|
|
20
|
-
};
|
|
21
|
-
private textureEventFlag;
|
|
22
|
-
protected texture: ITexture2D;
|
|
23
|
-
protected getCommonUniformsInfo(): {
|
|
24
|
-
uniformsArray: number[];
|
|
25
|
-
uniformsLength: number;
|
|
26
|
-
uniformsOption: {
|
|
27
|
-
[key: string]: any;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
initModels(): Promise<IModel[]>;
|
|
31
|
-
clearModels(): void;
|
|
32
|
-
buildModels(): Promise<IModel[]>;
|
|
33
|
-
/**
|
|
34
|
-
* 根据参数获取不同的 shader 代码
|
|
35
|
-
* @returns
|
|
36
|
-
*/
|
|
37
|
-
getShaders(): {
|
|
38
|
-
frag: string;
|
|
39
|
-
vert: string;
|
|
40
|
-
type: string;
|
|
41
|
-
};
|
|
42
|
-
protected registerBuiltinAttributes(): void;
|
|
43
|
-
private updateTexture;
|
|
44
|
-
}
|
package/lib/line/models/line.js
DELETED
|
@@ -1,281 +0,0 @@
|
|
|
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 _interface = require("../../core/interface");
|
|
14
|
-
var _triangulation = require("../../core/triangulation");
|
|
15
|
-
/* babel-plugin-inline-import '../shaders/line/line_frag.glsl' */
|
|
16
|
-
const line_frag = "// #extension GL_OES_standard_derivatives : enable\n#define Animate 0.0\n#define LineTexture 1.0\n\nuniform sampler2D u_texture;\nlayout(std140) uniform commonUniorm {\n vec4 u_animate: [ 1., 2., 1.0, 0.2 ];\n vec4 u_dash_array;\n vec4 u_blur;\n vec4 u_sourceColor;\n vec4 u_targetColor;\n vec2 u_textSize;\n float u_icon_step: 100;\n float u_heightfixed: 0.0;\n float u_vertexScale: 1.0;\n float u_raisingHeight: 0.0;\n float u_strokeWidth: 0.0;\n float u_textureBlend;\n float u_line_texture;\n float u_linearDir: 1.0;\n float u_linearColor: 0;\n float u_time;\n};\n\nin vec4 v_color;\nin vec4 v_stroke;\n// dash\nin vec4 v_dash_array;\nin float v_d_distance_ratio;\nin vec2 v_iconMapUV;\nin vec4 v_texture_data;\n\nout vec4 outputColor;\n#pragma include \"picking\"\n\n// [animate, duration, interval, trailLength],\nvoid main() {\n if(u_dash_array!=vec4(0.0)){\n float dashLength = mod(v_d_distance_ratio, v_dash_array.x + v_dash_array.y + v_dash_array.z + v_dash_array.w);\n if(!(dashLength < v_dash_array.x || (dashLength > (v_dash_array.x + v_dash_array.y) && dashLength < v_dash_array.x + v_dash_array.y + v_dash_array.z))) {\n // \u865A\u7EBF\u90E8\u5206\n discard;\n };\n }\n float animateSpeed = 0.0; // \u8FD0\u52A8\u901F\u5EA6\n float d_distance_ratio = v_texture_data.r; // \u5F53\u524D\u70B9\u4F4D\u8DDD\u79BB\u5360\u7EBF\u603B\u957F\u7684\u6BD4\u4F8B\n if(u_linearDir < 1.0) {\n d_distance_ratio = v_texture_data.a;\n }\n if(u_linearColor == 1.0) { // \u4F7F\u7528\u6E10\u53D8\u989C\u8272\n outputColor = mix(u_sourceColor, u_targetColor, d_distance_ratio);\n outputColor.a *= v_color.a;\n } else { // \u4F7F\u7528 color \u65B9\u6CD5\u4F20\u5165\u7684\u989C\u8272\n outputColor = v_color;\n }\n // anti-alias\n // float blur = 1.0 - smoothstep(u_blur, 1., length(v_normal.xy));\n if(u_animate.x == Animate) {\n animateSpeed = u_time / u_animate.y;\n float alpha =1.0 - fract( mod(1.0- d_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + animateSpeed);\n alpha = (alpha + u_animate.w -1.0) / u_animate.w;\n alpha = smoothstep(0., 1., alpha);\n outputColor.a *= alpha;\n }\n\n if(u_line_texture == LineTexture) { // while load texture\n float aDistance = v_texture_data.g; // \u5F53\u524D\u9876\u70B9\u7684\u8DDD\u79BB\n float d_texPixelLen = v_texture_data.b; // \u8D34\u56FE\u7684\u50CF\u7D20\u957F\u5EA6\uFF0C\u6839\u636E\u5730\u56FE\u5C42\u7EA7\u7F29\u653E\n float u = fract(mod(aDistance, d_texPixelLen)/d_texPixelLen - animateSpeed);\n float v = v_texture_data.a; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C\n\n // v = max(smoothstep(0.95, 1.0, v), v);\n vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.;\n vec4 pattern = texture(SAMPLER_2D(u_texture), uv);\n\n if(u_textureBlend == 0.0) { // normal\n pattern.a = 0.0;\n outputColor += pattern;\n } else { // replace\n pattern.a *= v_color.a;\n if(outputColor.a <= 0.0) {\n pattern.a = 0.0;\n }\n outputColor = pattern;\n }\n } \n\n float v = v_texture_data.a;\n float strokeWidth = min(0.5, u_strokeWidth);\n // \u7ED8\u5236 border\n if(strokeWidth > 0.01) {\n float borderOuterWidth = strokeWidth / 2.0;\n\n\n if(v >= 1.0 - strokeWidth || v <= strokeWidth) {\n if(v > strokeWidth) { // \u5916\u4FA7\n float linear = smoothstep(0.0, 1.0, (v - (1.0 - strokeWidth))/strokeWidth);\n // float linear = step(0.0, (v - (1.0 - borderWidth))/borderWidth);\n outputColor.rgb = mix(outputColor.rgb, v_stroke.rgb, linear);\n } else if(v <= strokeWidth) {\n float linear = smoothstep(0.0, 1.0, v/strokeWidth);\n outputColor.rgb = mix(v_stroke.rgb, outputColor.rgb, linear);\n }\n }\n\n if(v < borderOuterWidth) {\n outputColor.a = mix(0.0, outputColor.a, v/borderOuterWidth);\n } else if(v > 1.0 - borderOuterWidth) {\n outputColor.a = mix(outputColor.a, 0.0, (v - (1.0 - borderOuterWidth))/borderOuterWidth);\n }\n }\n\n // blur\n float blurV = v_texture_data.a;\n if(blurV < 0.5) {\n outputColor.a *= mix(u_blur.r, u_blur.g, blurV/0.5);\n } else {\n outputColor.a *= mix(u_blur.g, u_blur.b, (blurV - 0.5)/0.5);\n }\n \n outputColor = filterColor(outputColor);\n}\n";
|
|
17
|
-
/* babel-plugin-inline-import '../shaders/line/line_vert.glsl' */
|
|
18
|
-
const line_vert = "#define Animate (0.0)\n\nlayout(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 vec2 a_Size;\nlayout(location = ATTRIBUTE_LOCATION_DISTANCE_INDEX) in vec3 a_DistanceAndIndexAndMiter;\nlayout(location = ATTRIBUTE_LOCATION_NORMAL) in vec4 a_Normal_Total_Distance;\nlayout(location = ATTRIBUTE_LOCATION_UV) in vec2 a_iconMapUV;\n\nlayout(std140) uniform commonUniorm {\n vec4 u_animate: [ 1., 2., 1.0, 0.2 ];\n vec4 u_dash_array;\n vec4 u_blur;\n vec4 u_sourceColor;\n vec4 u_targetColor;\n vec2 u_textSize;\n float u_icon_step: 100;\n float u_heightfixed: 0.0;\n float u_vertexScale: 1.0;\n float u_raisingHeight: 0.0;\n float u_strokeWidth: 0.0;\n float u_textureBlend;\n float u_line_texture;\n float u_linearDir: 1.0;\n float u_linearColor: 0;\n float u_time;\n};\n\nout vec4 v_color;\nout vec4 v_stroke;\n//dash\nout vec4 v_dash_array;\nout float v_d_distance_ratio;\n// texV \u7EBF\u56FE\u5C42 - \u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\uFF08\u7EBF\u7684\u5BBD\u5EA6\u65B9\u5411\uFF09\nout vec2 v_iconMapUV;\nout vec4 v_texture_data;\n\n#pragma include \"projection\"\n#pragma include \"picking\"\n\nvoid main() {\n vec2 a_DistanceAndIndex = a_DistanceAndIndexAndMiter.xy;\n float a_Miter = a_DistanceAndIndexAndMiter.z;\n vec3 a_Normal = a_Normal_Total_Distance.xyz;\n float a_Total_Distance = a_Normal_Total_Distance.w;\n //dash\u8F93\u51FA\n v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / a_Total_Distance;\n v_d_distance_ratio = a_DistanceAndIndex.x / a_Total_Distance;\n\n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\n float d_texPixelLen; // \u8D34\u56FE\u7684\u50CF\u7D20\u957F\u5EA6\uFF0C\u6839\u636E\u5730\u56FE\u5C42\u7EA7\u7F29\u653E\n v_iconMapUV = a_iconMapUV;\n d_texPixelLen = project_float_pixel(u_icon_step);\n\n v_color = a_Color;\n v_color.a *= opacity;\n v_stroke = stroke;\n\n vec3 size = a_Miter * setPickingSize(a_Size.x) * a_Normal;\n\n vec2 offset = project_pixel(size.xy);\n\n float lineDistance = a_DistanceAndIndex.x;\n float currentLinePointRatio = lineDistance / a_Total_Distance;\n\n float lineOffsetWidth = length(offset + offset * sign(a_Miter)); // \u7EBF\u6A2A\u5411\u504F\u79FB\u7684\u8DDD\u79BB\uFF08\u5411\u4E24\u4FA7\u504F\u79FB\u7684\u548C\uFF09\n float linePixelSize = project_pixel(a_Size.x) * 2.0; // \u5B9A\u70B9\u4F4D\u7F6E\u504F\u79FB\uFF0C\u6309\u5730\u56FE\u7B49\u7EA7\u7F29\u653E\u540E\u7684\u8DDD\u79BB \u5355\u4FA7 * 2\n float texV = lineOffsetWidth / linePixelSize; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C\n\n v_texture_data = vec4(currentLinePointRatio, lineDistance, d_texPixelLen, texV);\n // \u8BBE\u7F6E\u6570\u636E\u96C6\u7684\u53C2\u6570\n\n vec4 project_pos = project_position(vec4(a_Position.xy, 0, 1.0), a_Position64Low);\n\n // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, a_Size.y, 1.0));\n\n float h = float(a_Position.z) * u_vertexScale; // \u7EBF\u9876\u70B9\u7684\u9AD8\u5EA6 - \u517C\u5BB9\u4E0D\u5B58\u5728\u7B2C\u4E09\u4E2A\u6570\u503C\u7684\u60C5\u51B5 vertex height\n float lineHeight = a_Size.y; // size \u7B2C\u4E8C\u4E2A\u53C2\u6570\u4EE3\u8868\u7684\u9AD8\u5EA6 [linewidth, lineheight]\n\n // \u517C\u5BB9 mapbox \u5728\u7EBF\u9AD8\u5EA6\u4E0A\u7684\u6548\u679C\u8868\u73B0\u57FA\u672C\u4E00\u81F4\n if (\n u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\n u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET\n ) {\n // mapbox\n // \u4FDD\u6301\u9AD8\u5EA6\u76F8\u5BF9\u4E0D\u53D8\n float mapboxZoomScale = 4.0 / pow(2.0, 21.0 - u_Zoom);\n h *= mapboxZoomScale;\n h += u_raisingHeight * mapboxZoomScale;\n if (u_heightfixed > 0.0) {\n lineHeight *= mapboxZoomScale;\n }\n }\n\n gl_Position = project_common_position_to_clipspace(\n vec4(project_pos.xy + offset, lineHeight + h, 1.0)\n );\n\n setPickingColor(a_PickingColor);\n}\n";
|
|
19
|
-
class LineModel extends _BaseModel.default {
|
|
20
|
-
constructor(...args) {
|
|
21
|
-
super(...args);
|
|
22
|
-
(0, _defineProperty2.default)(this, "textureEventFlag", false);
|
|
23
|
-
(0, _defineProperty2.default)(this, "texture", this.createTexture2D({
|
|
24
|
-
data: new Uint8Array([0, 0, 0, 0]),
|
|
25
|
-
width: 1,
|
|
26
|
-
height: 1
|
|
27
|
-
}));
|
|
28
|
-
(0, _defineProperty2.default)(this, "updateTexture", () => {
|
|
29
|
-
const {
|
|
30
|
-
createTexture2D
|
|
31
|
-
} = this.rendererService;
|
|
32
|
-
if (this.textures.length === 0) {
|
|
33
|
-
this.textures = [this.texture];
|
|
34
|
-
}
|
|
35
|
-
if (this.texture) {
|
|
36
|
-
this.texture.update({
|
|
37
|
-
data: this.iconService.getCanvas()
|
|
38
|
-
});
|
|
39
|
-
this.layer.render();
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
this.texture = createTexture2D({
|
|
43
|
-
data: this.iconService.getCanvas(),
|
|
44
|
-
mag: _l7Core.gl.NEAREST,
|
|
45
|
-
min: _l7Core.gl.NEAREST,
|
|
46
|
-
premultiplyAlpha: false,
|
|
47
|
-
width: 1024,
|
|
48
|
-
height: this.iconService.canvasHeight || 128
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
get attributeLocation() {
|
|
53
|
-
return Object.assign(super.attributeLocation, {
|
|
54
|
-
MAX: super.attributeLocation.MAX,
|
|
55
|
-
SIZE: 9,
|
|
56
|
-
DISTANCE_INDEX: 10,
|
|
57
|
-
NORMAL: 11,
|
|
58
|
-
UV: 12
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
getCommonUniformsInfo() {
|
|
62
|
-
const {
|
|
63
|
-
sourceColor,
|
|
64
|
-
targetColor,
|
|
65
|
-
textureBlend = 'normal',
|
|
66
|
-
lineType = 'solid',
|
|
67
|
-
dashArray = [10, 5, 0, 0],
|
|
68
|
-
lineTexture = false,
|
|
69
|
-
iconStep = 100,
|
|
70
|
-
vertexHeightScale = 20.0,
|
|
71
|
-
strokeWidth = 0.0,
|
|
72
|
-
raisingHeight = 0,
|
|
73
|
-
heightfixed = false,
|
|
74
|
-
linearDir = _interface.LinearDir.VERTICAL,
|
|
75
|
-
// 默认纵向
|
|
76
|
-
blur = [1, 1, 1, 0]
|
|
77
|
-
} = this.layer.getLayerConfig();
|
|
78
|
-
let u_dash_array = dashArray;
|
|
79
|
-
if (lineType !== 'dash') {
|
|
80
|
-
u_dash_array = [0, 0, 0, 0];
|
|
81
|
-
}
|
|
82
|
-
if (u_dash_array.length === 2) {
|
|
83
|
-
u_dash_array.push(0, 0);
|
|
84
|
-
}
|
|
85
|
-
if (this.rendererService.getDirty() && this.texture) {
|
|
86
|
-
var _this$texture;
|
|
87
|
-
(_this$texture = this.texture) === null || _this$texture === void 0 || _this$texture.bind();
|
|
88
|
-
}
|
|
89
|
-
const {
|
|
90
|
-
animateOption
|
|
91
|
-
} = this.layer.getLayerConfig();
|
|
92
|
-
// 转化渐变色
|
|
93
|
-
let useLinearColor = 0; // 默认不生效
|
|
94
|
-
let sourceColorArr = [0, 0, 0, 0];
|
|
95
|
-
let targetColorArr = [0, 0, 0, 0];
|
|
96
|
-
if (sourceColor && targetColor) {
|
|
97
|
-
sourceColorArr = (0, _l7Utils.rgb2arr)(sourceColor);
|
|
98
|
-
targetColorArr = (0, _l7Utils.rgb2arr)(targetColor);
|
|
99
|
-
useLinearColor = 1;
|
|
100
|
-
}
|
|
101
|
-
const commonOptions = {
|
|
102
|
-
u_animate: this.animateOption2Array(animateOption),
|
|
103
|
-
u_dash_array,
|
|
104
|
-
u_blur: blur,
|
|
105
|
-
u_sourceColor: sourceColorArr,
|
|
106
|
-
u_targetColor: targetColorArr,
|
|
107
|
-
u_textSize: [1024, this.iconService.canvasHeight || 128],
|
|
108
|
-
u_icon_step: iconStep,
|
|
109
|
-
// 是否固定高度
|
|
110
|
-
u_heightfixed: Number(heightfixed),
|
|
111
|
-
// 顶点高度 scale
|
|
112
|
-
u_vertexScale: vertexHeightScale,
|
|
113
|
-
u_raisingHeight: Number(raisingHeight),
|
|
114
|
-
// line border 参数
|
|
115
|
-
u_strokeWidth: strokeWidth,
|
|
116
|
-
u_textureBlend: textureBlend === _interface.TextureBlend.NORMAL ? 0.0 : 1.0,
|
|
117
|
-
u_line_texture: lineTexture ? 1.0 : 0.0,
|
|
118
|
-
// 传入线的标识
|
|
119
|
-
u_linearDir: linearDir === _interface.LinearDir.VERTICAL ? 1.0 : 0.0,
|
|
120
|
-
u_linearColor: useLinearColor,
|
|
121
|
-
u_time: this.layer.getLayerAnimateTime() || 0
|
|
122
|
-
};
|
|
123
|
-
const commonBufferInfo = this.getUniformsBufferInfo(commonOptions);
|
|
124
|
-
return commonBufferInfo;
|
|
125
|
-
}
|
|
126
|
-
// public getAnimateUniforms(): IModelUniform {
|
|
127
|
-
// const { animateOption } = this.layer.getLayerConfig() as ILayerConfig;
|
|
128
|
-
// return {
|
|
129
|
-
// u_animate: this.animateOption2Array(animateOption as IAnimateOption),
|
|
130
|
-
// u_time: this.layer.getLayerAnimateTime(),
|
|
131
|
-
// };
|
|
132
|
-
// }
|
|
133
|
-
initModels() {
|
|
134
|
-
var _this = this;
|
|
135
|
-
return (0, _asyncToGenerator2.default)(function* () {
|
|
136
|
-
_this.initUniformsBuffer();
|
|
137
|
-
// this.updateTexture();
|
|
138
|
-
// this.iconService.on('imageUpdate', this.updateTexture);
|
|
139
|
-
if (!_this.textureEventFlag) {
|
|
140
|
-
_this.textureEventFlag = true;
|
|
141
|
-
_this.updateTexture();
|
|
142
|
-
_this.iconService.on('imageUpdate', _this.updateTexture);
|
|
143
|
-
}
|
|
144
|
-
return _this.buildModels();
|
|
145
|
-
})();
|
|
146
|
-
}
|
|
147
|
-
clearModels() {
|
|
148
|
-
var _this$texture2;
|
|
149
|
-
(_this$texture2 = this.texture) === null || _this$texture2 === void 0 || _this$texture2.destroy();
|
|
150
|
-
this.iconService.off('imageUpdate', this.updateTexture);
|
|
151
|
-
}
|
|
152
|
-
buildModels() {
|
|
153
|
-
var _this2 = this;
|
|
154
|
-
return (0, _asyncToGenerator2.default)(function* () {
|
|
155
|
-
const {
|
|
156
|
-
depth = false
|
|
157
|
-
} = _this2.layer.getLayerConfig();
|
|
158
|
-
const {
|
|
159
|
-
frag,
|
|
160
|
-
vert,
|
|
161
|
-
type
|
|
162
|
-
} = _this2.getShaders();
|
|
163
|
-
_this2.layer.triangulation = _triangulation.LineTriangulation;
|
|
164
|
-
const model = yield _this2.layer.buildLayerModel({
|
|
165
|
-
moduleName: 'line' + type,
|
|
166
|
-
vertexShader: vert,
|
|
167
|
-
fragmentShader: frag,
|
|
168
|
-
triangulation: _triangulation.LineTriangulation,
|
|
169
|
-
defines: _this2.getDefines(),
|
|
170
|
-
inject: _this2.getInject(),
|
|
171
|
-
depth: {
|
|
172
|
-
enable: depth
|
|
173
|
-
}
|
|
174
|
-
});
|
|
175
|
-
return [model];
|
|
176
|
-
})();
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
/**
|
|
180
|
-
* 根据参数获取不同的 shader 代码
|
|
181
|
-
* @returns
|
|
182
|
-
*/
|
|
183
|
-
getShaders() {
|
|
184
|
-
return {
|
|
185
|
-
frag: line_frag,
|
|
186
|
-
vert: line_vert,
|
|
187
|
-
type: ''
|
|
188
|
-
};
|
|
189
|
-
}
|
|
190
|
-
registerBuiltinAttributes() {
|
|
191
|
-
// 注册 Position 属性 64 位地位部分,经纬度数据开启双精度,避免大于 20层级以上出现数据偏移
|
|
192
|
-
this.registerPosition64LowAttribute();
|
|
193
|
-
this.styleAttributeService.registerStyleAttribute({
|
|
194
|
-
name: 'distanceAndIndex',
|
|
195
|
-
type: _l7Core.AttributeType.Attribute,
|
|
196
|
-
descriptor: {
|
|
197
|
-
name: 'a_DistanceAndIndexAndMiter',
|
|
198
|
-
shaderLocation: this.attributeLocation.DISTANCE_INDEX,
|
|
199
|
-
buffer: {
|
|
200
|
-
// give the WebGL driver a hint that this buffer may change
|
|
201
|
-
usage: _l7Core.gl.STATIC_DRAW,
|
|
202
|
-
data: [],
|
|
203
|
-
type: _l7Core.gl.FLOAT
|
|
204
|
-
},
|
|
205
|
-
size: 3,
|
|
206
|
-
update: (feature, featureIdx, vertex, attributeIdx, normal, vertexIndex) => {
|
|
207
|
-
return vertexIndex === undefined ? [vertex[3], 10, vertex[4]] : [vertex[3], vertexIndex, vertex[4]];
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
});
|
|
211
|
-
this.styleAttributeService.registerStyleAttribute({
|
|
212
|
-
name: 'size',
|
|
213
|
-
type: _l7Core.AttributeType.Attribute,
|
|
214
|
-
descriptor: {
|
|
215
|
-
name: 'a_Size',
|
|
216
|
-
shaderLocation: this.attributeLocation.SIZE,
|
|
217
|
-
buffer: {
|
|
218
|
-
// give the WebGL driver a hint that this buffer may change
|
|
219
|
-
usage: _l7Core.gl.DYNAMIC_DRAW,
|
|
220
|
-
data: [],
|
|
221
|
-
type: _l7Core.gl.FLOAT
|
|
222
|
-
},
|
|
223
|
-
size: 2,
|
|
224
|
-
update: feature => {
|
|
225
|
-
const {
|
|
226
|
-
size = 1
|
|
227
|
-
} = feature;
|
|
228
|
-
return Array.isArray(size) ? [size[0], size[1]] : [size, 0];
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
});
|
|
232
|
-
this.styleAttributeService.registerStyleAttribute({
|
|
233
|
-
name: 'normal_total_distance',
|
|
234
|
-
type: _l7Core.AttributeType.Attribute,
|
|
235
|
-
descriptor: {
|
|
236
|
-
name: 'a_Normal_Total_Distance',
|
|
237
|
-
shaderLocation: this.attributeLocation.NORMAL,
|
|
238
|
-
buffer: {
|
|
239
|
-
// give the WebGL driver a hint that this buffer may change
|
|
240
|
-
usage: _l7Core.gl.STATIC_DRAW,
|
|
241
|
-
data: [],
|
|
242
|
-
type: _l7Core.gl.FLOAT
|
|
243
|
-
},
|
|
244
|
-
size: 4,
|
|
245
|
-
update: (feature, featureIdx, vertex, attributeIdx, normal) => {
|
|
246
|
-
return [...normal, vertex[5]];
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
});
|
|
250
|
-
this.styleAttributeService.registerStyleAttribute({
|
|
251
|
-
name: 'uv',
|
|
252
|
-
type: _l7Core.AttributeType.Attribute,
|
|
253
|
-
descriptor: {
|
|
254
|
-
name: 'a_iconMapUV',
|
|
255
|
-
shaderLocation: this.attributeLocation.UV,
|
|
256
|
-
buffer: {
|
|
257
|
-
// give the WebGL driver a hint that this buffer may change
|
|
258
|
-
usage: _l7Core.gl.DYNAMIC_DRAW,
|
|
259
|
-
data: [],
|
|
260
|
-
type: _l7Core.gl.FLOAT
|
|
261
|
-
},
|
|
262
|
-
size: 2,
|
|
263
|
-
update: feature => {
|
|
264
|
-
const iconMap = this.iconService.getIconMap();
|
|
265
|
-
const {
|
|
266
|
-
texture
|
|
267
|
-
} = feature;
|
|
268
|
-
const {
|
|
269
|
-
x,
|
|
270
|
-
y
|
|
271
|
-
} = iconMap[texture] || {
|
|
272
|
-
x: 0,
|
|
273
|
-
y: 0
|
|
274
|
-
};
|
|
275
|
-
return [x, y];
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
});
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
exports.default = LineModel;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { IModel } from '@antv/l7-core';
|
|
2
|
-
import BaseModel from '../../core/BaseModel';
|
|
3
|
-
export default class SimpleLineModel 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
|
-
};
|
|
18
|
-
protected getCommonUniformsInfo(): {
|
|
19
|
-
uniformsArray: number[];
|
|
20
|
-
uniformsLength: number;
|
|
21
|
-
uniformsOption: {
|
|
22
|
-
[key: string]: any;
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
initModels(): Promise<IModel[]>;
|
|
26
|
-
getShaders(): {
|
|
27
|
-
frag: string;
|
|
28
|
-
vert: string;
|
|
29
|
-
type: string;
|
|
30
|
-
};
|
|
31
|
-
buildModels(): Promise<IModel[]>;
|
|
32
|
-
protected registerBuiltinAttributes(): void;
|
|
33
|
-
}
|