@antv/l7-layers 2.16.1 → 2.16.2
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/Geometry/index.js +9 -31
- package/es/Geometry/models/billboard.js +51 -89
- package/es/Geometry/models/plane.js +81 -143
- package/es/Geometry/models/sprite.js +60 -118
- package/es/canvas/index.js +10 -33
- package/es/canvas/models/canvas.js +41 -97
- package/es/citybuliding/building.js +8 -27
- package/es/citybuliding/models/build.js +57 -82
- package/es/core/BaseLayer.d.ts +3 -0
- package/es/core/BaseLayer.js +360 -528
- package/es/core/BaseModel.d.ts +9 -71
- package/es/core/BaseModel.js +118 -429
- package/es/core/CommonStyleAttribute.d.ts +2 -0
- package/es/core/CommonStyleAttribute.js +66 -0
- package/es/core/LayerPickService.js +21 -32
- package/es/core/TextureService.js +0 -13
- package/es/core/interface.d.ts +13 -3
- package/es/core/interface.js +17 -24
- package/es/core/shape/Path.js +13 -20
- package/es/core/shape/extrude.js +27 -36
- package/es/core/triangulation.d.ts +12 -0
- package/es/core/triangulation.js +124 -114
- package/es/earth/index.js +9 -33
- package/es/earth/models/atmosphere.js +30 -54
- package/es/earth/models/base.js +47 -85
- package/es/earth/models/bloomsphere.js +30 -54
- package/es/earth/utils.js +9 -13
- package/es/heatmap/index.js +10 -40
- package/es/heatmap/models/grid.js +29 -53
- package/es/heatmap/models/grid3d.js +29 -53
- package/es/heatmap/models/heatmap.d.ts +1 -0
- package/es/heatmap/models/heatmap.js +99 -150
- package/es/heatmap/models/hexagon.js +29 -53
- package/es/heatmap/shaders/grid_vert.glsl +2 -2
- package/es/heatmap/shaders/hexagon_3d_vert.glsl +2 -2
- package/es/heatmap/shaders/hexagon_vert.glsl +2 -2
- package/es/heatmap/triangulation.js +0 -4
- package/es/image/index.js +9 -28
- package/es/image/models/image.js +66 -100
- package/es/index.js +9 -17
- package/es/line/index.d.ts +1 -0
- package/es/line/index.js +12 -36
- package/es/line/models/arc.js +72 -160
- package/es/line/models/arc_3d.js +67 -148
- package/es/line/models/earthArc_3d.js +66 -148
- package/es/line/models/{half.d.ts → flow.d.ts} +1 -11
- package/es/line/models/flow.js +167 -0
- package/es/line/models/great_circle.js +57 -135
- package/es/line/models/index.d.ts +1 -1
- package/es/line/models/index.js +3 -3
- package/es/line/models/line.js +98 -186
- package/es/line/models/linearline.js +46 -115
- package/es/line/models/simpleLine.d.ts +0 -1
- package/es/line/models/simpleLine.js +42 -114
- package/es/line/models/wall.js +52 -92
- package/es/line/shaders/dash/arc_dash_frag.glsl +3 -6
- package/es/line/shaders/dash/arc_dash_vert.glsl +6 -46
- package/es/line/shaders/dash/line_dash_frag.glsl +4 -7
- package/es/line/shaders/dash/line_dash_vert.glsl +3 -33
- package/es/line/shaders/flow/flow_line_frag.glsl +13 -0
- package/es/line/shaders/flow/flow_line_vert.glsl +83 -0
- package/es/line/shaders/line_arc_3d_frag.glsl +6 -6
- package/es/line/shaders/line_arc_3d_vert.glsl +4 -34
- package/es/line/shaders/line_arc_frag.glsl +7 -11
- package/es/line/shaders/line_arc_great_circle_frag.glsl +5 -6
- package/es/line/shaders/line_arc_great_circle_vert.glsl +4 -32
- package/es/line/shaders/line_arc_vert.glsl +9 -45
- package/es/line/shaders/line_frag.glsl +15 -17
- package/es/line/shaders/line_vert.glsl +3 -34
- package/es/line/shaders/linear/arc3d_linear_frag.glsl +5 -19
- package/es/line/shaders/linear/arc3d_linear_vert.glsl +9 -48
- package/es/line/shaders/linear/arc_linear_frag.glsl +2 -30
- package/es/line/shaders/linear/arc_linear_vert.glsl +9 -45
- package/es/line/shaders/linear/line_linear_frag.glsl +5 -6
- package/es/line/shaders/linearLine/line_linear_frag.glsl +2 -14
- package/es/line/shaders/linearLine/line_linear_vert.glsl +14 -32
- package/es/line/shaders/simple/simpleline_frag.glsl +1 -5
- package/es/line/shaders/simple/simpleline_linear_frag.glsl +2 -6
- package/es/line/shaders/simple/simpleline_vert.glsl +7 -33
- package/es/mask/index.js +9 -28
- package/es/mask/models/fill.js +29 -54
- package/es/plugins/DataMappingPlugin.js +90 -141
- package/es/plugins/DataSourcePlugin.js +45 -68
- package/es/plugins/FeatureScalePlugin.js +67 -122
- package/es/plugins/LayerAnimateStylePlugin.js +0 -5
- package/es/plugins/LayerMaskPlugin.js +3 -11
- package/es/plugins/LayerModelPlugin.js +79 -104
- package/es/plugins/LayerStylePlugin.js +3 -9
- package/es/plugins/LightingPlugin.js +12 -18
- package/es/plugins/MultiPassRendererPlugin.js +11 -16
- package/es/plugins/PixelPickingPlugin.js +12 -21
- package/es/plugins/RegisterStyleAttributePlugin.js +5 -12
- package/es/plugins/ShaderUniformPlugin.js +15 -29
- package/es/plugins/UpdateModelPlugin.js +0 -5
- package/es/plugins/UpdateStyleAttributePlugin.js +5 -11
- package/es/point/index.d.ts +1 -0
- package/es/point/index.js +27 -77
- package/es/point/models/earthExtrude.d.ts +0 -3
- package/es/point/models/earthExtrude.js +60 -139
- package/es/point/models/earthFill.d.ts +0 -1
- package/es/point/models/earthFill.js +59 -140
- package/es/point/models/extrude.d.ts +0 -3
- package/es/point/models/extrude.js +60 -140
- package/es/point/models/fill.d.ts +0 -1
- package/es/point/models/fill.js +67 -158
- package/es/point/models/fillmage.js +66 -147
- package/es/point/models/image.js +52 -126
- package/es/point/models/index.js +2 -2
- package/es/point/models/normal.js +32 -56
- package/es/point/models/radar.d.ts +0 -1
- package/es/point/models/radar.js +42 -75
- package/es/point/models/simplePoint.d.ts +0 -1
- package/es/point/models/simplePoint.js +46 -115
- package/es/point/models/text.js +211 -344
- package/es/point/shaders/animate/wave_frag.glsl +1 -11
- package/es/point/shaders/earth/extrude_frag.glsl +5 -17
- package/es/point/shaders/earth/extrude_vert.glsl +14 -29
- package/es/point/shaders/earth/fill_frag.glsl +5 -14
- package/es/point/shaders/earth/fill_vert.glsl +1 -75
- package/es/point/shaders/extrude/extrude_frag.glsl +3 -29
- package/es/point/shaders/extrude/extrude_vert.glsl +27 -35
- package/es/point/shaders/fill_frag.glsl +9 -20
- package/es/point/shaders/fill_vert.glsl +16 -101
- package/es/point/shaders/image/fillImage_frag.glsl +2 -5
- package/es/point/shaders/image/fillImage_vert.glsl +4 -47
- package/es/point/shaders/image_frag.glsl +1 -5
- package/es/point/shaders/image_vert.glsl +1 -44
- package/es/point/shaders/normal_frag.glsl +0 -2
- package/es/point/shaders/normal_vert.glsl +2 -1
- package/es/point/shaders/radar/radar_vert.glsl +2 -2
- package/es/point/shaders/simplePoint_frag.glsl +0 -7
- package/es/point/shaders/simplePoint_vert.glsl +3 -45
- package/es/point/shaders/text_frag.glsl +6 -19
- package/es/point/shaders/text_vert.glsl +5 -66
- package/es/point/shape/extrude.js +4 -13
- package/es/polygon/index.d.ts +1 -0
- package/es/polygon/index.js +12 -40
- package/es/polygon/models/extrude.d.ts +0 -3
- package/es/polygon/models/extrude.js +122 -162
- package/es/polygon/models/fill.d.ts +0 -4
- package/es/polygon/models/fill.js +57 -130
- package/es/polygon/models/index.js +3 -2
- package/es/polygon/models/ocean.js +42 -76
- package/es/polygon/models/water.js +37 -71
- package/es/polygon/shaders/extrude/polygon_extrude_frag.glsl +2 -23
- package/es/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +7 -5
- package/es/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +7 -32
- package/es/polygon/shaders/extrude/polygon_extrude_vert.glsl +33 -38
- package/es/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +12 -9
- package/es/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +16 -44
- package/es/polygon/shaders/polygon_frag.glsl +0 -5
- package/es/polygon/shaders/polygon_linear_frag.glsl +0 -8
- package/es/polygon/shaders/polygon_linear_vert.glsl +0 -32
- package/es/polygon/shaders/polygon_vert.glsl +1 -27
- package/es/raster/buffers/triangulation.js +2 -4
- package/es/raster/index.js +9 -32
- package/es/raster/models/raster.js +80 -116
- package/es/raster/models/rasterRgb.js +84 -127
- package/es/raster/models/rasterTerrainRgb.js +56 -84
- package/es/tile/interaction/getRasterData.js +14 -20
- package/es/tile/interaction/utils.js +7 -9
- package/es/tile/manager/base.js +63 -96
- package/es/tile/service/TileLayerService.js +33 -55
- package/es/tile/service/TilePickService.js +26 -40
- package/es/tile/service/TileSourceService.js +3 -7
- package/es/tile/tileFactory/DebugTile.js +29 -46
- package/es/tile/tileFactory/ImageTile.js +20 -38
- package/es/tile/tileFactory/MaskTile.js +22 -43
- package/es/tile/tileFactory/RasterRGBTile.js +22 -42
- package/es/tile/tileFactory/RasterTerrainRGBTile.js +20 -38
- package/es/tile/tileFactory/RasterTile.js +30 -53
- package/es/tile/tileFactory/Tile.js +63 -97
- package/es/tile/tileFactory/VectorTile.js +41 -68
- package/es/tile/tileFactory/index.js +0 -11
- package/es/tile/tileFactory/layers/TileDebugLayer.js +6 -27
- package/es/tile/tileFactory/util.js +0 -3
- package/es/tile/tileLayer/BaseLayer.js +105 -146
- package/es/tile/utils.js +1 -1
- package/es/utils/blend.js +0 -2
- package/es/utils/collision-index.js +9 -16
- package/es/utils/extrude_polyline.js +101 -149
- package/es/utils/grid-index.js +2 -27
- package/es/utils/identityScale.js +0 -8
- package/es/utils/layerData.js +32 -46
- package/es/utils/multiPassRender.js +11 -13
- package/es/utils/polylineNormal.js +31 -37
- package/es/utils/simpleLine.js +2 -16
- package/es/utils/stencil.js +2 -3
- package/es/utils/symbol-layout.js +27 -53
- package/es/wind/index.js +9 -29
- package/es/wind/models/utils.js +26 -51
- package/es/wind/models/wind.js +101 -147
- package/es/wind/models/windRender.js +53 -66
- package/lib/Geometry/index.js +9 -38
- package/lib/Geometry/models/billboard.js +51 -97
- package/lib/Geometry/models/index.js +0 -5
- package/lib/Geometry/models/plane.js +79 -151
- package/lib/Geometry/models/sprite.js +60 -127
- package/lib/canvas/index.js +10 -40
- package/lib/canvas/models/canvas.js +41 -101
- package/lib/canvas/models/index.js +0 -3
- package/lib/citybuliding/building.js +8 -35
- package/lib/citybuliding/models/build.js +57 -92
- package/lib/core/BaseLayer.js +358 -520
- package/lib/core/BaseModel.js +117 -441
- package/lib/core/CommonStyleAttribute.js +72 -0
- package/lib/core/LayerPickService.js +21 -37
- package/lib/core/TextureService.js +0 -16
- package/lib/core/interface.js +21 -31
- package/lib/core/schema.js +0 -1
- package/lib/core/shape/Path.js +14 -31
- package/lib/core/shape/extrude.js +27 -59
- package/lib/core/triangulation.js +125 -153
- package/lib/earth/index.js +9 -43
- package/lib/earth/models/atmosphere.js +30 -63
- package/lib/earth/models/base.js +47 -90
- package/lib/earth/models/bloomsphere.js +30 -63
- package/lib/earth/utils.js +7 -31
- package/lib/heatmap/index.js +10 -48
- package/lib/heatmap/models/grid.js +29 -61
- package/lib/heatmap/models/grid3d.js +29 -61
- package/lib/heatmap/models/heatmap.js +99 -166
- package/lib/heatmap/models/hexagon.js +29 -61
- package/lib/heatmap/models/index.js +0 -6
- package/lib/heatmap/shaders/grid_vert.glsl +2 -2
- package/lib/heatmap/shaders/hexagon_3d_vert.glsl +2 -2
- package/lib/heatmap/shaders/hexagon_vert.glsl +2 -2
- package/lib/heatmap/triangulation.js +0 -5
- package/lib/image/index.js +9 -36
- package/lib/image/models/image.js +66 -109
- package/lib/image/models/index.js +0 -3
- package/lib/index.js +7 -61
- package/lib/line/index.js +12 -42
- package/lib/line/models/arc.js +70 -170
- package/lib/line/models/arc_3d.js +65 -159
- package/lib/line/models/earthArc_3d.js +64 -159
- package/lib/line/models/flow.js +174 -0
- package/lib/line/models/great_circle.js +57 -146
- package/lib/line/models/index.js +3 -14
- package/lib/line/models/line.js +96 -194
- package/lib/line/models/linearline.js +46 -127
- package/lib/line/models/simpleLine.js +42 -124
- package/lib/line/models/wall.js +52 -103
- package/lib/line/shaders/dash/arc_dash_frag.glsl +3 -6
- package/lib/line/shaders/dash/arc_dash_vert.glsl +6 -46
- package/lib/line/shaders/dash/line_dash_frag.glsl +4 -7
- package/lib/line/shaders/dash/line_dash_vert.glsl +3 -33
- package/lib/line/shaders/flow/flow_line_frag.glsl +13 -0
- package/lib/line/shaders/flow/flow_line_vert.glsl +83 -0
- package/lib/line/shaders/line_arc_3d_frag.glsl +6 -6
- package/lib/line/shaders/line_arc_3d_vert.glsl +4 -34
- package/lib/line/shaders/line_arc_frag.glsl +7 -11
- package/lib/line/shaders/line_arc_great_circle_frag.glsl +5 -6
- package/lib/line/shaders/line_arc_great_circle_vert.glsl +4 -32
- package/lib/line/shaders/line_arc_vert.glsl +9 -45
- package/lib/line/shaders/line_frag.glsl +15 -17
- package/lib/line/shaders/line_vert.glsl +3 -34
- package/lib/line/shaders/linear/arc3d_linear_frag.glsl +5 -19
- package/lib/line/shaders/linear/arc3d_linear_vert.glsl +9 -48
- package/lib/line/shaders/linear/arc_linear_frag.glsl +2 -30
- package/lib/line/shaders/linear/arc_linear_vert.glsl +9 -45
- package/lib/line/shaders/linear/line_linear_frag.glsl +5 -6
- package/lib/line/shaders/linearLine/line_linear_frag.glsl +2 -14
- package/lib/line/shaders/linearLine/line_linear_vert.glsl +14 -32
- package/lib/line/shaders/simple/simpleline_frag.glsl +1 -5
- package/lib/line/shaders/simple/simpleline_linear_frag.glsl +2 -6
- package/lib/line/shaders/simple/simpleline_vert.glsl +7 -33
- package/lib/mask/index.js +9 -36
- package/lib/mask/models/fill.js +29 -63
- package/lib/mask/models/index.js +0 -3
- package/lib/plugins/DataMappingPlugin.js +90 -152
- package/lib/plugins/DataSourcePlugin.js +45 -76
- package/lib/plugins/FeatureScalePlugin.js +67 -138
- package/lib/plugins/LayerAnimateStylePlugin.js +0 -10
- package/lib/plugins/LayerMaskPlugin.js +4 -17
- package/lib/plugins/LayerModelPlugin.js +80 -113
- package/lib/plugins/LayerStylePlugin.js +4 -14
- package/lib/plugins/LightingPlugin.js +12 -25
- package/lib/plugins/MultiPassRendererPlugin.js +11 -22
- package/lib/plugins/PixelPickingPlugin.js +12 -27
- package/lib/plugins/RegisterStyleAttributePlugin.js +5 -19
- package/lib/plugins/ShaderUniformPlugin.js +15 -36
- package/lib/plugins/UpdateModelPlugin.js +1 -10
- package/lib/plugins/UpdateStyleAttributePlugin.js +5 -16
- package/lib/point/index.js +27 -83
- package/lib/point/models/earthExtrude.js +60 -150
- package/lib/point/models/earthFill.js +59 -170
- package/lib/point/models/extrude.js +60 -150
- package/lib/point/models/fill.js +65 -167
- package/lib/point/models/fillmage.js +64 -155
- package/lib/point/models/image.js +52 -136
- package/lib/point/models/index.js +1 -12
- package/lib/point/models/normal.js +32 -66
- package/lib/point/models/radar.js +42 -85
- package/lib/point/models/simplePoint.js +46 -125
- package/lib/point/models/text.js +209 -350
- package/lib/point/shaders/animate/wave_frag.glsl +1 -11
- package/lib/point/shaders/earth/extrude_frag.glsl +5 -17
- package/lib/point/shaders/earth/extrude_vert.glsl +14 -29
- package/lib/point/shaders/earth/fill_frag.glsl +5 -14
- package/lib/point/shaders/earth/fill_vert.glsl +1 -75
- package/lib/point/shaders/extrude/extrude_frag.glsl +3 -29
- package/lib/point/shaders/extrude/extrude_vert.glsl +27 -35
- package/lib/point/shaders/fill_frag.glsl +9 -20
- package/lib/point/shaders/fill_vert.glsl +16 -101
- package/lib/point/shaders/image/fillImage_frag.glsl +2 -5
- package/lib/point/shaders/image/fillImage_vert.glsl +4 -47
- package/lib/point/shaders/image_frag.glsl +1 -5
- package/lib/point/shaders/image_vert.glsl +1 -44
- package/lib/point/shaders/normal_frag.glsl +0 -2
- package/lib/point/shaders/normal_vert.glsl +2 -1
- package/lib/point/shaders/radar/radar_vert.glsl +2 -2
- package/lib/point/shaders/simplePoint_frag.glsl +0 -7
- package/lib/point/shaders/simplePoint_vert.glsl +3 -45
- package/lib/point/shaders/text_frag.glsl +6 -19
- package/lib/point/shaders/text_vert.glsl +5 -66
- package/lib/point/shape/extrude.js +4 -20
- package/lib/polygon/index.js +12 -48
- package/lib/polygon/models/extrude.js +122 -173
- package/lib/polygon/models/fill.js +57 -140
- package/lib/polygon/models/index.js +2 -14
- package/lib/polygon/models/ocean.js +42 -88
- package/lib/polygon/models/water.js +37 -82
- package/lib/polygon/shaders/extrude/polygon_extrude_frag.glsl +2 -23
- package/lib/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +7 -5
- package/lib/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +7 -32
- package/lib/polygon/shaders/extrude/polygon_extrude_vert.glsl +33 -38
- package/lib/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +12 -9
- package/lib/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +16 -44
- package/lib/polygon/shaders/polygon_frag.glsl +0 -5
- package/lib/polygon/shaders/polygon_linear_frag.glsl +0 -8
- package/lib/polygon/shaders/polygon_linear_vert.glsl +0 -32
- package/lib/polygon/shaders/polygon_vert.glsl +1 -27
- package/lib/raster/buffers/triangulation.js +3 -7
- package/lib/raster/index.js +9 -40
- package/lib/raster/models/index.js +0 -5
- package/lib/raster/models/raster.js +80 -125
- package/lib/raster/models/rasterRgb.js +84 -139
- package/lib/raster/models/rasterTerrainRgb.js +56 -93
- package/lib/tile/interaction/getRasterData.js +14 -25
- package/lib/tile/interaction/utils.js +7 -19
- package/lib/tile/manager/base.js +63 -104
- package/lib/tile/service/TileLayerService.js +33 -60
- package/lib/tile/service/TilePickService.js +26 -48
- package/lib/tile/service/TileSourceService.js +2 -16
- package/lib/tile/style/utils.js +0 -3
- package/lib/tile/tileFactory/DebugTile.js +29 -54
- package/lib/tile/tileFactory/ImageTile.js +20 -46
- package/lib/tile/tileFactory/MaskTile.js +22 -51
- package/lib/tile/tileFactory/RasterRGBTile.js +22 -50
- package/lib/tile/tileFactory/RasterTerrainRGBTile.js +20 -46
- package/lib/tile/tileFactory/RasterTile.js +30 -63
- package/lib/tile/tileFactory/Tile.js +63 -102
- package/lib/tile/tileFactory/VectorTile.js +41 -76
- package/lib/tile/tileFactory/index.js +0 -25
- package/lib/tile/tileFactory/layers/TileDebugLayer.js +6 -32
- package/lib/tile/tileFactory/util.js +0 -9
- package/lib/tile/tileLayer/BaseLayer.js +105 -153
- package/lib/tile/utils.js +1 -5
- package/lib/utils/blend.js +0 -5
- package/lib/utils/collision-index.js +9 -25
- package/lib/utils/extrude_polyline.js +101 -181
- package/lib/utils/grid-index.js +2 -28
- package/lib/utils/identityScale.js +0 -9
- package/lib/utils/layerData.js +32 -51
- package/lib/utils/multiPassRender.js +11 -16
- package/lib/utils/polylineNormal.js +31 -66
- package/lib/utils/simpleLine.js +2 -21
- package/lib/utils/stencil.js +0 -4
- package/lib/utils/symbol-layout.js +27 -55
- package/lib/wind/index.js +9 -37
- package/lib/wind/models/index.js +0 -3
- package/lib/wind/models/utils.js +26 -62
- package/lib/wind/models/wind.js +101 -157
- package/lib/wind/models/windRender.js +53 -71
- package/lib/wind/models/windShader.js +0 -1
- package/package.json +7 -7
- package/es/line/models/half.js +0 -298
- package/es/line/shaders/half/line_half_frag.glsl +0 -53
- package/es/line/shaders/half/line_half_vert.glsl +0 -169
- package/es/utils/dataMappingStyle.d.ts +0 -31
- package/es/utils/dataMappingStyle.js +0 -147
- package/lib/line/models/half.js +0 -315
- package/lib/line/shaders/half/line_half_frag.glsl +0 -53
- package/lib/line/shaders/half/line_half_vert.glsl +0 -169
- package/lib/utils/dataMappingStyle.js +0 -151
package/lib/line/models/wall.js
CHANGED
|
@@ -1,78 +1,49 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
11
|
-
|
|
12
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
13
|
-
|
|
14
10
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
15
|
-
|
|
16
11
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
17
|
-
|
|
18
12
|
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
19
|
-
|
|
20
13
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
21
|
-
|
|
22
14
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
23
|
-
|
|
24
15
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
25
|
-
|
|
26
16
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
27
|
-
|
|
28
17
|
var _l7Core = require("@antv/l7-core");
|
|
29
|
-
|
|
30
18
|
var _l7Utils = require("@antv/l7-utils");
|
|
31
|
-
|
|
32
19
|
var _lodash = require("lodash");
|
|
33
|
-
|
|
34
20
|
var _BaseModel2 = _interopRequireDefault(require("../../core/BaseModel"));
|
|
35
|
-
|
|
36
21
|
var _triangulation = require("../../core/triangulation");
|
|
37
|
-
|
|
38
22
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
39
|
-
|
|
40
23
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
41
|
-
|
|
42
24
|
/* babel-plugin-inline-import '../shaders/wall/wall_frag.glsl' */
|
|
43
25
|
var line_frag = "#define Animate 0.0\n#define LineTexture 1.0\n\n// line texture\nuniform float u_line_texture;\nuniform sampler2D u_texture;\nuniform vec2 u_textSize;\nuniform float u_linearColor: 0;\nuniform vec4 u_sourceColor;\nuniform vec4 u_targetColor;\nuniform float u_opacity : 1.0;\nuniform float u_textureBlend;\nuniform float u_iconStepCount;\nuniform float u_time;\nuniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ]; // \u63A7\u5236\u8FD0\u52A8\n\nvarying vec2 v_iconMapUV;\nvarying float v_blur;\nvarying float v_radio;\nvarying vec4 v_color;\nvarying vec4 v_dataset;\n\n#pragma include \"picking\"\n\nvoid main() {\n float opacity = u_opacity;\n float animateSpeed = 0.0; // \u8FD0\u52A8\u901F\u5EA6\n float d_distance_ratio = v_dataset.r; // \u5F53\u524D\u70B9\u4F4D\u8DDD\u79BB\u5360\u7EBF\u603B\u957F\u7684\u6BD4\u4F8B\n float v = v_dataset.a;\n\n if(u_linearColor == 1.0) { // \u4F7F\u7528\u6E10\u53D8\u989C\u8272\n gl_FragColor = mix(u_sourceColor, u_targetColor, v);\n } else { // \u4F7F\u7528 color \u65B9\u6CD5\u4F20\u5165\u7684\u989C\u8272\n gl_FragColor = v_color;\n }\n\n gl_FragColor.a *= opacity; // \u5168\u5C40\u900F\u660E\u5EA6\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 gl_FragColor.a *= alpha;\n }\n\n if(u_line_texture == LineTexture) { // while load texture\n float aDistance = v_dataset.g; // \u5F53\u524D\u9876\u70B9\u7684\u8DDD\u79BB\n float d_texPixelLen = v_dataset.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_dataset.a; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C\n\n // \u8BA1\u7B97\u7EB9\u7406\u95F4\u9694 start\n float flag = 0.0;\n if(u > 1.0/u_iconStepCount) {\n flag = 1.0;\n }\n u = fract(u*u_iconStepCount);\n // \u8BA1\u7B97\u7EB9\u7406\u95F4\u9694 end\n\n vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.;\n vec4 pattern = texture2D(u_texture, uv);\n\n // Tip: \u5224\u65AD\u7EB9\u7406\u95F4\u9694\n if(flag > 0.0) {\n pattern = vec4(0.0);\n }\n\n if(u_textureBlend == 0.0) { // normal\n pattern.a = 0.0;\n gl_FragColor = filterColor(gl_FragColor + pattern);\n } else { // replace\n pattern.a *= opacity;\n if(gl_FragColor.a <= 0.0) {\n pattern.a = 0.0;\n }\n gl_FragColor = filterColor(pattern);\n }\n }\n \n\n // blur - AA\n if(v < v_blur) {\n gl_FragColor.a = mix(0.0, gl_FragColor.a, v/v_blur);\n } else if(v > 1.0 - v_blur) {\n gl_FragColor.a = mix(gl_FragColor.a, 0.0, (v - (1.0 - v_blur))/v_blur);\n }\n\n gl_FragColor = filterColor(gl_FragColor);\n}\n";
|
|
44
|
-
|
|
45
26
|
/* babel-plugin-inline-import '../shaders/wall/wall_vert.glsl' */
|
|
46
27
|
var line_vert = "#define Animate 0.0\n\nattribute float a_Miter;\nattribute vec4 a_Color;\nattribute vec2 a_Size;\nattribute vec3 a_Normal;\nattribute vec3 a_Position;\nattribute vec2 a_iconMapUV;\nattribute float a_Total_Distance;\nattribute float a_Distance;\n\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nuniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];\nuniform float u_icon_step: 100;\nuniform float u_heightfixed;\nuniform float u_linearColor: 0;\n\n#pragma include \"projection\"\n#pragma include \"light\"\n#pragma include \"picking\"\n\n// texV \u7EBF\u56FE\u5C42 - \u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\uFF08\u7EBF\u7684\u5BBD\u5EA6\u65B9\u5411\uFF09\nvarying vec2 v_iconMapUV;\nvarying vec4 v_color;\nvarying float v_blur;\nvarying float v_radio;\nvarying vec4 v_dataset;\n\nvoid main() {\n\n\n float d_distance_ratio; // \u5F53\u524D\u70B9\u4F4D\u8DDD\u79BB\u5360\u7EBF\u603B\u957F\u7684\u6BD4\u4F8B\n float d_texPixelLen; // \u8D34\u56FE\u7684\u50CF\u7D20\u957F\u5EA6\uFF0C\u6839\u636E\u5730\u56FE\u5C42\u7EA7\u7F29\u653E\n\n v_iconMapUV = a_iconMapUV;\n if(u_heightfixed < 1.0) { // \u9AD8\u5EA6\u968F zoom \u8C03\u6574\n d_texPixelLen = project_pixel(u_icon_step);\n } else {\n d_texPixelLen = u_icon_step;\n }\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {\n d_texPixelLen *= 10.0;\n }\n\n if(u_animate.x == Animate || u_linearColor == 1.0) {\n d_distance_ratio = a_Distance / a_Total_Distance;\n }\n\n float miter = (a_Miter + 1.0)/2.0;\n // \u8BBE\u7F6E\u6570\u636E\u96C6\u7684\u53C2\u6570\n v_dataset[0] = d_distance_ratio; // \u5F53\u524D\u70B9\u4F4D\u8DDD\u79BB\u5360\u7EBF\u603B\u957F\u7684\u6BD4\u4F8B\n v_dataset[1] = a_Distance; // \u5F53\u524D\u9876\u70B9\u7684\u8DDD\u79BB\n v_dataset[2] = d_texPixelLen; // \u8D34\u56FE\u7684\u50CF\u7D20\u957F\u5EA6\uFF0C\u6839\u636E\u5730\u56FE\u5C42\u7EA7\u7F29\u653E\n v_dataset[3] = miter; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C 0 - 1\n\n vec4 project_pos = project_position(vec4(a_Position.xy, 0, 1.0));\n\n float originSize = a_Size.x; // \u56FA\u5B9A\u9AD8\u5EA6\n if(u_heightfixed < 1.0) { // \u9AD8\u5EA6\u968F zoom \u8C03\u6574\n originSize = project_float_pixel(a_Size.x);\n }\n\n float wallHeight = originSize * miter;\n float lightWeight = calc_lighting(vec4(project_pos.xy, wallHeight, 1.0));\n\n v_blur = min(project_float_pixel(2.0) / originSize, 0.05);\n v_color = vec4(a_Color.rgb * lightWeight, a_Color.w);\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(project_pos.xy, wallHeight, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy, wallHeight, 1.0));\n }\n\n setPickingColor(a_PickingColor);\n}\n";
|
|
47
|
-
|
|
48
28
|
var LineWallModel = /*#__PURE__*/function (_BaseModel) {
|
|
49
29
|
(0, _inherits2.default)(LineWallModel, _BaseModel);
|
|
50
|
-
|
|
51
30
|
var _super = _createSuper(LineWallModel);
|
|
52
|
-
|
|
53
31
|
function LineWallModel() {
|
|
54
32
|
var _this;
|
|
55
|
-
|
|
56
33
|
(0, _classCallCheck2.default)(this, LineWallModel);
|
|
57
|
-
|
|
58
34
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
59
35
|
args[_key] = arguments[_key];
|
|
60
36
|
}
|
|
61
|
-
|
|
62
37
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
63
38
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "updateTexture", function () {
|
|
64
39
|
var createTexture2D = _this.rendererService.createTexture2D;
|
|
65
|
-
|
|
66
40
|
if (_this.texture) {
|
|
67
41
|
_this.texture.update({
|
|
68
42
|
data: _this.iconService.getCanvas()
|
|
69
43
|
});
|
|
70
|
-
|
|
71
44
|
_this.layer.render();
|
|
72
|
-
|
|
73
45
|
return;
|
|
74
46
|
}
|
|
75
|
-
|
|
76
47
|
_this.texture = createTexture2D({
|
|
77
48
|
data: _this.iconService.getCanvas(),
|
|
78
49
|
mag: _l7Core.gl.NEAREST,
|
|
@@ -84,42 +55,37 @@ var LineWallModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
84
55
|
});
|
|
85
56
|
return _this;
|
|
86
57
|
}
|
|
87
|
-
|
|
88
58
|
(0, _createClass2.default)(LineWallModel, [{
|
|
89
59
|
key: "getUninforms",
|
|
90
60
|
value: function getUninforms() {
|
|
91
61
|
var _ref = this.layer.getLayerConfig(),
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
62
|
+
_ref$opacity = _ref.opacity,
|
|
63
|
+
opacity = _ref$opacity === void 0 ? 1 : _ref$opacity,
|
|
64
|
+
sourceColor = _ref.sourceColor,
|
|
65
|
+
targetColor = _ref.targetColor,
|
|
66
|
+
_ref$textureBlend = _ref.textureBlend,
|
|
67
|
+
textureBlend = _ref$textureBlend === void 0 ? 'normal' : _ref$textureBlend,
|
|
68
|
+
_ref$heightfixed = _ref.heightfixed,
|
|
69
|
+
heightfixed = _ref$heightfixed === void 0 ? false : _ref$heightfixed,
|
|
70
|
+
_ref$lineTexture = _ref.lineTexture,
|
|
71
|
+
lineTexture = _ref$lineTexture === void 0 ? false : _ref$lineTexture,
|
|
72
|
+
_ref$iconStep = _ref.iconStep,
|
|
73
|
+
iconStep = _ref$iconStep === void 0 ? 100 : _ref$iconStep,
|
|
74
|
+
_ref$iconStepCount = _ref.iconStepCount,
|
|
75
|
+
iconStepCount = _ref$iconStepCount === void 0 ? 1 : _ref$iconStepCount;
|
|
107
76
|
if (this.rendererService.getDirty()) {
|
|
108
77
|
this.texture.bind();
|
|
109
|
-
}
|
|
110
|
-
|
|
78
|
+
}
|
|
111
79
|
|
|
80
|
+
// 转化渐变色
|
|
112
81
|
var useLinearColor = 0; // 默认不生效
|
|
113
|
-
|
|
114
82
|
var sourceColorArr = [0, 0, 0, 0];
|
|
115
83
|
var targetColorArr = [0, 0, 0, 0];
|
|
116
|
-
|
|
117
84
|
if (sourceColor && targetColor) {
|
|
118
85
|
sourceColorArr = (0, _l7Utils.rgb2arr)(sourceColor);
|
|
119
86
|
targetColorArr = (0, _l7Utils.rgb2arr)(targetColor);
|
|
120
87
|
useLinearColor = 1;
|
|
121
88
|
}
|
|
122
|
-
|
|
123
89
|
return {
|
|
124
90
|
u_heightfixed: Number(heightfixed),
|
|
125
91
|
u_opacity: (0, _lodash.isNumber)(opacity) ? opacity : 1.0,
|
|
@@ -142,8 +108,7 @@ var LineWallModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
142
108
|
key: "getAnimateUniforms",
|
|
143
109
|
value: function getAnimateUniforms() {
|
|
144
110
|
var _ref2 = this.layer.getLayerConfig(),
|
|
145
|
-
|
|
146
|
-
|
|
111
|
+
animateOption = _ref2.animateOption;
|
|
147
112
|
return {
|
|
148
113
|
u_animate: this.animateOption2Array(animateOption),
|
|
149
114
|
u_time: this.layer.getLayerAnimateTime()
|
|
@@ -154,32 +119,26 @@ var LineWallModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
154
119
|
value: function () {
|
|
155
120
|
var _initModels = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
156
121
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
157
|
-
while (1) {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
case "end":
|
|
166
|
-
return _context.stop();
|
|
167
|
-
}
|
|
122
|
+
while (1) switch (_context.prev = _context.next) {
|
|
123
|
+
case 0:
|
|
124
|
+
this.updateTexture();
|
|
125
|
+
this.iconService.on('imageUpdate', this.updateTexture);
|
|
126
|
+
return _context.abrupt("return", this.buildModels());
|
|
127
|
+
case 3:
|
|
128
|
+
case "end":
|
|
129
|
+
return _context.stop();
|
|
168
130
|
}
|
|
169
131
|
}, _callee, this);
|
|
170
132
|
}));
|
|
171
|
-
|
|
172
133
|
function initModels() {
|
|
173
134
|
return _initModels.apply(this, arguments);
|
|
174
135
|
}
|
|
175
|
-
|
|
176
136
|
return initModels;
|
|
177
137
|
}()
|
|
178
138
|
}, {
|
|
179
139
|
key: "clearModels",
|
|
180
140
|
value: function clearModels() {
|
|
181
141
|
var _this$texture;
|
|
182
|
-
|
|
183
142
|
(_this$texture = this.texture) === null || _this$texture === void 0 ? void 0 : _this$texture.destroy();
|
|
184
143
|
this.iconService.off('imageUpdate', this.updateTexture);
|
|
185
144
|
}
|
|
@@ -189,44 +148,37 @@ var LineWallModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
189
148
|
var _buildModels = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
190
149
|
var model;
|
|
191
150
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
192
|
-
while (1) {
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
case 4:
|
|
212
|
-
case "end":
|
|
213
|
-
return _context2.stop();
|
|
214
|
-
}
|
|
151
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
152
|
+
case 0:
|
|
153
|
+
_context2.next = 2;
|
|
154
|
+
return this.layer.buildLayerModel({
|
|
155
|
+
moduleName: 'lineWall',
|
|
156
|
+
vertexShader: line_vert,
|
|
157
|
+
fragmentShader: line_frag,
|
|
158
|
+
triangulation: _triangulation.LineTriangulation,
|
|
159
|
+
depth: {
|
|
160
|
+
enable: false
|
|
161
|
+
},
|
|
162
|
+
blend: this.getBlend()
|
|
163
|
+
});
|
|
164
|
+
case 2:
|
|
165
|
+
model = _context2.sent;
|
|
166
|
+
return _context2.abrupt("return", [model]);
|
|
167
|
+
case 4:
|
|
168
|
+
case "end":
|
|
169
|
+
return _context2.stop();
|
|
215
170
|
}
|
|
216
171
|
}, _callee2, this);
|
|
217
172
|
}));
|
|
218
|
-
|
|
219
173
|
function buildModels() {
|
|
220
174
|
return _buildModels.apply(this, arguments);
|
|
221
175
|
}
|
|
222
|
-
|
|
223
176
|
return buildModels;
|
|
224
177
|
}()
|
|
225
178
|
}, {
|
|
226
179
|
key: "registerBuiltinAttributes",
|
|
227
180
|
value: function registerBuiltinAttributes() {
|
|
228
181
|
var _this2 = this;
|
|
229
|
-
|
|
230
182
|
this.styleAttributeService.registerStyleAttribute({
|
|
231
183
|
name: 'distance',
|
|
232
184
|
type: _l7Core.AttributeType.Attribute,
|
|
@@ -275,12 +227,13 @@ var LineWallModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
275
227
|
size: 2,
|
|
276
228
|
update: function update(feature) {
|
|
277
229
|
var _feature$size = feature.size,
|
|
278
|
-
|
|
230
|
+
size = _feature$size === void 0 ? 1 : _feature$size;
|
|
279
231
|
return Array.isArray(size) ? [size[0], size[1]] : [size, 0];
|
|
280
232
|
}
|
|
281
233
|
}
|
|
282
|
-
});
|
|
234
|
+
});
|
|
283
235
|
|
|
236
|
+
// point layer size;
|
|
284
237
|
this.styleAttributeService.registerStyleAttribute({
|
|
285
238
|
name: 'normal',
|
|
286
239
|
type: _l7Core.AttributeType.Attribute,
|
|
@@ -330,16 +283,13 @@ var LineWallModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
330
283
|
size: 2,
|
|
331
284
|
update: function update(feature) {
|
|
332
285
|
var iconMap = _this2.iconService.getIconMap();
|
|
333
|
-
|
|
334
286
|
var texture = feature.texture;
|
|
335
|
-
|
|
336
287
|
var _ref3 = iconMap[texture] || {
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
288
|
+
x: 0,
|
|
289
|
+
y: 0
|
|
290
|
+
},
|
|
291
|
+
x = _ref3.x,
|
|
292
|
+
y = _ref3.y;
|
|
343
293
|
return [x, y];
|
|
344
294
|
}
|
|
345
295
|
}
|
|
@@ -348,5 +298,4 @@ var LineWallModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
348
298
|
}]);
|
|
349
299
|
return LineWallModel;
|
|
350
300
|
}(_BaseModel2.default);
|
|
351
|
-
|
|
352
301
|
exports.default = LineWallModel;
|
|
@@ -3,22 +3,19 @@ uniform float u_opacity;
|
|
|
3
3
|
|
|
4
4
|
varying vec4 v_dash_array;
|
|
5
5
|
varying vec4 v_color;
|
|
6
|
+
varying float v_distance_ratio;
|
|
6
7
|
|
|
7
8
|
uniform float segmentNumber;
|
|
8
9
|
|
|
9
|
-
varying mat4 styleMappingMat; // 传递从片元中传递的映射数据
|
|
10
10
|
|
|
11
11
|
#pragma include "picking"
|
|
12
12
|
|
|
13
13
|
void main() {
|
|
14
|
-
float opacity = styleMappingMat[0][0];
|
|
15
|
-
float d_distance_ratio = styleMappingMat[3].b; // 当前顶点在弧线中所处的分段比例
|
|
16
|
-
|
|
17
14
|
gl_FragColor = v_color;
|
|
18
|
-
|
|
15
|
+
|
|
19
16
|
|
|
20
17
|
float flag = 0.;
|
|
21
|
-
float dashLength = mod(
|
|
18
|
+
float dashLength = mod(v_distance_ratio, v_dash_array.x + v_dash_array.y + v_dash_array.z + v_dash_array.w);
|
|
22
19
|
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)) {
|
|
23
20
|
flag = 1.;
|
|
24
21
|
};
|
|
@@ -12,15 +12,11 @@ varying vec4 v_color;
|
|
|
12
12
|
uniform vec4 u_dash_array: [10.0, 5., 0, 0];
|
|
13
13
|
uniform float u_lineDir: 1.0;
|
|
14
14
|
varying vec4 v_dash_array;
|
|
15
|
+
varying float v_distance_ratio;
|
|
15
16
|
|
|
16
17
|
uniform float u_thetaOffset: 0.314;
|
|
17
18
|
|
|
18
19
|
uniform float u_opacity: 1.0;
|
|
19
|
-
varying mat4 styleMappingMat; // 用于将在顶点着色器中计算好的样式值传递给片元
|
|
20
|
-
|
|
21
|
-
#pragma include "styleMapping"
|
|
22
|
-
#pragma include "styleMappingCalOpacity"
|
|
23
|
-
#pragma include "styleMappingCalThetaOffset"
|
|
24
20
|
|
|
25
21
|
#pragma include "projection"
|
|
26
22
|
#pragma include "project"
|
|
@@ -76,38 +72,7 @@ vec2 getNormal(vec2 line_clipspace, float offset_direction) {
|
|
|
76
72
|
}
|
|
77
73
|
|
|
78
74
|
void main() {
|
|
79
|
-
v_color = a_Color;
|
|
80
|
-
|
|
81
|
-
// cal style mapping - 数据纹理映射部分的计算
|
|
82
|
-
styleMappingMat = mat4(
|
|
83
|
-
0.0, 0.0, 0.0, 0.0, // opacity - strokeOpacity - strokeWidth - empty
|
|
84
|
-
0.0, 0.0, 0.0, 0.0, // strokeR - strokeG - strokeB - strokeA
|
|
85
|
-
0.0, 0.0, 0.0, 0.0, // offsets[0] - offsets[1]
|
|
86
|
-
0.0, 0.0, 0.0, 0.0 // dataset 数据集
|
|
87
|
-
);
|
|
88
|
-
|
|
89
|
-
float rowCount = u_cellTypeLayout[0][0]; // 当前的数据纹理有几行
|
|
90
|
-
float columnCount = u_cellTypeLayout[0][1]; // 当看到数据纹理有几列
|
|
91
|
-
float columnWidth = 1.0/columnCount; // 列宽
|
|
92
|
-
float rowHeight = 1.0/rowCount; // 行高
|
|
93
|
-
float cellCount = calCellCount(); // opacity - strokeOpacity - strokeWidth - stroke - offsets
|
|
94
|
-
float id = a_vertexId; // 第n个顶点
|
|
95
|
-
float cellCurrentRow = floor(id * cellCount / columnCount) + 1.0; // 起始点在第几行
|
|
96
|
-
float cellCurrentColumn = mod(id * cellCount, columnCount) + 1.0; // 起始点在第几列
|
|
97
|
-
|
|
98
|
-
// cell 固定顺序 opacity -> strokeOpacity -> strokeWidth -> stroke -> thetaOffset...
|
|
99
|
-
// 按顺序从 cell 中取值、若没有则自动往下取值
|
|
100
|
-
float textureOffset = 0.0; // 在 cell 中取值的偏移量
|
|
101
|
-
|
|
102
|
-
vec2 opacityAndOffset = calOpacityAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);
|
|
103
|
-
styleMappingMat[0][0] = opacityAndOffset.r;
|
|
104
|
-
textureOffset = opacityAndOffset.g;
|
|
105
|
-
|
|
106
|
-
vec2 thetaOffsetAndOffset = calThetaOffsetAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);
|
|
107
|
-
styleMappingMat[0][1] = thetaOffsetAndOffset.r;
|
|
108
|
-
textureOffset = thetaOffsetAndOffset.g;
|
|
109
|
-
// cal style mapping - 数据纹理映射部分的计算
|
|
110
|
-
|
|
75
|
+
v_color = vec4(a_Color.xyz, a_Color.w * u_opacity);
|
|
111
76
|
|
|
112
77
|
vec2 source = a_Instance.rg; // 起始点
|
|
113
78
|
vec2 target = a_Instance.ba; // 终点
|
|
@@ -127,20 +92,15 @@ void main() {
|
|
|
127
92
|
float total_Distance = pixelDistance(s, t) / 2.0 * PI;
|
|
128
93
|
v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / total_Distance;
|
|
129
94
|
|
|
130
|
-
|
|
95
|
+
v_distance_ratio = segmentIndex / segmentNumber;
|
|
131
96
|
|
|
132
|
-
|
|
133
|
-
vec4
|
|
134
|
-
|
|
135
|
-
// v_normal = getNormal((next.xy - curr.xy) * indexDir, a_Position.y);
|
|
136
|
-
//unProjCustomCoord
|
|
97
|
+
vec4 curr = project_position(vec4(interpolate(source, target, segmentRatio, u_thetaOffset), 0.0, 1.0));
|
|
98
|
+
vec4 next = project_position(vec4(interpolate(source, target, nextSegmentRatio, u_thetaOffset), 0.0, 1.0));
|
|
99
|
+
|
|
137
100
|
|
|
138
101
|
vec2 offset = project_pixel(getExtrusionOffset((next.xy - curr.xy) * indexDir, a_Position.y));
|
|
139
|
-
|
|
140
102
|
|
|
141
|
-
// gl_Position = project_common_position_to_clipspace(vec4(curr.xy + offset, 0, 1.0));
|
|
142
103
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
|
|
143
|
-
// gl_Position = u_Mvp * (vec4(curr.xy + offset, 0, 1.0));
|
|
144
104
|
gl_Position = u_Mvp * (vec4(curr.xy + offset, 0, 1.0));
|
|
145
105
|
} else {
|
|
146
106
|
gl_Position = project_common_position_to_clipspace(vec4(curr.xy + offset, 0, 1.0));
|
|
@@ -1,25 +1,22 @@
|
|
|
1
1
|
#define LineTypeSolid 0.0
|
|
2
|
-
uniform float u_opacity : 1.0;
|
|
3
|
-
|
|
4
2
|
varying vec4 v_color;
|
|
5
3
|
|
|
6
4
|
// dash
|
|
7
5
|
varying vec4 v_dash_array;
|
|
6
|
+
varying float v_d_distance_ratio;
|
|
8
7
|
|
|
9
8
|
#pragma include "picking"
|
|
10
9
|
|
|
11
10
|
uniform float u_time;
|
|
12
11
|
uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ]; // 控制运动
|
|
13
12
|
|
|
14
|
-
varying mat4 styleMappingMat;
|
|
15
13
|
// [animate, duration, interval, trailLength],
|
|
16
14
|
void main() {
|
|
17
|
-
|
|
18
|
-
float d_distance_ratio = styleMappingMat[3].r; // 当前点位距离占线总长的比例
|
|
15
|
+
|
|
19
16
|
gl_FragColor = v_color;
|
|
20
|
-
|
|
17
|
+
|
|
21
18
|
|
|
22
|
-
float dashLength = mod(
|
|
19
|
+
float dashLength = mod(v_d_distance_ratio, v_dash_array.x + v_dash_array.y + v_dash_array.z + v_dash_array.w);
|
|
23
20
|
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)) {
|
|
24
21
|
// 实线部分
|
|
25
22
|
} else {
|
|
@@ -25,49 +25,19 @@ uniform float u_vertexScale: 1.0;
|
|
|
25
25
|
|
|
26
26
|
varying vec4 v_color;
|
|
27
27
|
varying vec4 v_dash_array;
|
|
28
|
+
varying float v_d_distance_ratio;
|
|
28
29
|
|
|
29
30
|
uniform float u_opacity: 1.0;
|
|
30
|
-
varying mat4 styleMappingMat; // 用于将在顶点着色器中计算好的样式值传递给片元
|
|
31
|
-
|
|
32
|
-
#pragma include "styleMapping"
|
|
33
|
-
#pragma include "styleMappingCalOpacity"
|
|
34
31
|
|
|
35
32
|
void main() {
|
|
36
|
-
// cal style mapping - 数据纹理映射部分的计算
|
|
37
|
-
styleMappingMat = mat4(
|
|
38
|
-
0.0, 0.0, 0.0, 0.0, // opacity - strokeOpacity - strokeWidth - empty
|
|
39
|
-
0.0, 0.0, 0.0, 0.0, // strokeR - strokeG - strokeB - strokeA
|
|
40
|
-
0.0, 0.0, 0.0, 0.0, // offsets[0] - offsets[1]
|
|
41
|
-
0.0, 0.0, 0.0, 0.0 // distance_ratio/distance/pixelLen/texV
|
|
42
|
-
);
|
|
43
|
-
|
|
44
|
-
float rowCount = u_cellTypeLayout[0][0]; // 当前的数据纹理有几行
|
|
45
|
-
float columnCount = u_cellTypeLayout[0][1]; // 当看到数据纹理有几列
|
|
46
|
-
float columnWidth = 1.0/columnCount; // 列宽
|
|
47
|
-
float rowHeight = 1.0/rowCount; // 行高
|
|
48
|
-
float cellCount = calCellCount(); // opacity - strokeOpacity - strokeWidth - stroke - offsets
|
|
49
|
-
float id = a_vertexId; // 第n个顶点
|
|
50
|
-
float cellCurrentRow = floor(id * cellCount / columnCount) + 1.0; // 起始点在第几行
|
|
51
|
-
float cellCurrentColumn = mod(id * cellCount, columnCount) + 1.0; // 起始点在第几列
|
|
52
|
-
|
|
53
|
-
// cell 固定顺序 opacity -> strokeOpacity -> strokeWidth -> stroke ...
|
|
54
|
-
// 按顺序从 cell 中取值、若没有则自动往下取值
|
|
55
|
-
float textureOffset = 0.0; // 在 cell 中取值的偏移量
|
|
56
|
-
|
|
57
|
-
vec2 opacityAndOffset = calOpacityAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);
|
|
58
|
-
styleMappingMat[0][0] = opacityAndOffset.r;
|
|
59
|
-
textureOffset = opacityAndOffset.g;
|
|
60
|
-
// cal style mapping - 数据纹理映射部分的计算
|
|
61
33
|
|
|
62
34
|
v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / a_Total_Distance;
|
|
63
|
-
v_color = a_Color;
|
|
35
|
+
v_color = vec4(a_Color.xyz, a_Color.w * u_opacity);
|
|
64
36
|
|
|
65
37
|
vec3 size = a_Miter * setPickingSize(a_Size.x) * reverse_offset_normal(a_Normal);
|
|
66
38
|
vec2 offset = project_pixel(size.xy);
|
|
39
|
+
v_d_distance_ratio = a_DistanceAndIndex.x / a_Total_Distance;
|
|
67
40
|
|
|
68
|
-
// 设置数据集的参数
|
|
69
|
-
styleMappingMat[3][0] = a_DistanceAndIndex.x / a_Total_Distance; // 当前点位距离占线总长的比例
|
|
70
|
-
styleMappingMat[3][1] = a_DistanceAndIndex.x; // 当前顶点的距离
|
|
71
41
|
|
|
72
42
|
vec4 project_pos = project_position(vec4(a_Position.xy, 0, 1.0));
|
|
73
43
|
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
attribute vec4 a_Color;
|
|
2
|
+
attribute vec2 a_Size;
|
|
3
|
+
attribute vec4 a_Instance;
|
|
4
|
+
attribute vec3 a_Normal;
|
|
5
|
+
attribute vec3 a_Position;
|
|
6
|
+
|
|
7
|
+
uniform mat4 u_ModelMatrix;
|
|
8
|
+
uniform mat4 u_Mvp;
|
|
9
|
+
|
|
10
|
+
#pragma include "projection"
|
|
11
|
+
#pragma include "picking"
|
|
12
|
+
varying vec4 v_color;
|
|
13
|
+
uniform float u_gap_width: 1.0;
|
|
14
|
+
uniform float u_stroke_width: 1.0;
|
|
15
|
+
uniform float u_stroke_opacity: 1.0;
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
void main() {
|
|
19
|
+
|
|
20
|
+
// #ifdef USE_ATTRIBUTE_OPACITY
|
|
21
|
+
// float opacity = a_Opacity;
|
|
22
|
+
// #else
|
|
23
|
+
// float opacity = u_opacity;
|
|
24
|
+
// #endif
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
// #ifdef USE_ATTRIBUTE_OFFSETS
|
|
28
|
+
// vec2 offsets = a_Offsets;
|
|
29
|
+
// #else
|
|
30
|
+
// vec2 offsets = u_offsets;
|
|
31
|
+
// #endif
|
|
32
|
+
|
|
33
|
+
// float opacity = u_opacity;
|
|
34
|
+
// 透明度计算
|
|
35
|
+
vec2 source = a_Instance.rg; // 起始点
|
|
36
|
+
vec2 target = a_Instance.ba; // 终点
|
|
37
|
+
vec2 flowlineDir = normalize(target - source);
|
|
38
|
+
vec2 perpendicularDir = vec2(-flowlineDir.y, flowlineDir.x);
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
vec2 position = mix(source, target, a_Position.x);
|
|
42
|
+
|
|
43
|
+
float lengthCommon = length(target - source);
|
|
44
|
+
vec2 offsetDistances = a_Size.x * project_pixel(a_Position.yz);
|
|
45
|
+
vec2 limitedOffsetDistances = clamp(
|
|
46
|
+
offsetDistances,
|
|
47
|
+
-lengthCommon*.8, lengthCommon*.8
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
float startOffsetCommon = project_pixel(offsets[0]);
|
|
51
|
+
float endOffsetCommon = project_pixel(offsets[1]);
|
|
52
|
+
float endpointOffset = mix(
|
|
53
|
+
clamp(startOffsetCommon, 0.0, lengthCommon*.2),
|
|
54
|
+
-clamp(endOffsetCommon, 0.0, lengthCommon*.2),
|
|
55
|
+
a_Position.x
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
vec2 normalsCommon = u_stroke_width * project_pixel(a_Normal.xy);
|
|
59
|
+
|
|
60
|
+
float gapCommon = project_pixel(u_gap_width);
|
|
61
|
+
vec3 offsetCommon = vec3(
|
|
62
|
+
flowlineDir * (limitedOffsetDistances[1] + normalsCommon.y + endpointOffset * 1.05) -
|
|
63
|
+
perpendicularDir * (limitedOffsetDistances[0] + gapCommon + normalsCommon.x),
|
|
64
|
+
0.0
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
vec4 project_pos = project_position(vec4(position.xy, 0, 1.0));
|
|
69
|
+
|
|
70
|
+
vec4 fillColor = vec4(a_Color.rgb, a_Color.a * opacity);
|
|
71
|
+
v_color = mix(fillColor, vec4(u_stroke.xyz, u_stroke.w * fillColor.w * u_stroke_opacity), a_Normal.z);
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
|
|
75
|
+
gl_Position = u_Mvp * vec4(project_pos.xy + offsetCommon.xy, 0., 1.0);
|
|
76
|
+
} else {
|
|
77
|
+
gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offsetCommon.xy, 0., 1.0));
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
setPickingColor(a_PickingColor);
|
|
83
|
+
}
|
|
@@ -3,33 +3,33 @@
|
|
|
3
3
|
#define Animate 0.0
|
|
4
4
|
#define LineTexture 1.0
|
|
5
5
|
|
|
6
|
-
uniform float u_opacity;
|
|
7
6
|
uniform float u_textureBlend;
|
|
8
7
|
uniform float u_blur : 0.9;
|
|
9
8
|
uniform float u_line_type: 0.0;
|
|
10
9
|
// varying vec2 v_normal;
|
|
11
10
|
varying vec4 v_dash_array;
|
|
12
11
|
varying vec4 v_color;
|
|
12
|
+
varying vec4 v_line_data;
|
|
13
13
|
|
|
14
14
|
uniform float u_line_texture: 0.0;
|
|
15
15
|
uniform sampler2D u_texture;
|
|
16
16
|
uniform vec2 u_textSize;
|
|
17
17
|
varying float v_segmentIndex;
|
|
18
18
|
uniform float segmentNumber;
|
|
19
|
+
uniform float u_opacity;
|
|
19
20
|
|
|
20
21
|
varying vec2 v_iconMapUV;
|
|
21
22
|
|
|
22
23
|
uniform float u_time;
|
|
23
24
|
uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
24
25
|
|
|
25
|
-
varying mat4 styleMappingMat;
|
|
26
26
|
|
|
27
27
|
#pragma include "picking"
|
|
28
28
|
|
|
29
29
|
void main() {
|
|
30
|
-
float opacity =
|
|
30
|
+
float opacity = u_opacity;
|
|
31
31
|
float animateSpeed = 0.0; // 运动速度
|
|
32
|
-
float d_distance_ratio =
|
|
32
|
+
float d_distance_ratio = v_line_data.g; // 当前点位距离占线总长的比例
|
|
33
33
|
gl_FragColor = v_color;
|
|
34
34
|
|
|
35
35
|
gl_FragColor.a *= opacity;
|
|
@@ -61,7 +61,7 @@ void main() {
|
|
|
61
61
|
if(u_line_texture == LineTexture && u_line_type != LineTypeDash) { // while load texture
|
|
62
62
|
// float arcRadio = smoothstep( 0.0, 1.0, (v_segmentIndex / segmentNumber));
|
|
63
63
|
float arcRadio = v_segmentIndex / (segmentNumber - 1.0);
|
|
64
|
-
float count =
|
|
64
|
+
float count = v_line_data.b; // // 贴图在弧线上重复的数量
|
|
65
65
|
|
|
66
66
|
float time = 0.0;
|
|
67
67
|
if(u_animate.x == Animate) {
|
|
@@ -71,7 +71,7 @@ void main() {
|
|
|
71
71
|
|
|
72
72
|
float u = fract(redioCount - time);
|
|
73
73
|
|
|
74
|
-
float v =
|
|
74
|
+
float v = v_line_data.a; // 线图层贴图部分的 v 坐标值
|
|
75
75
|
vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.;
|
|
76
76
|
vec4 pattern = texture2D(u_texture, uv);
|
|
77
77
|
|