@antv/l7-layers 2.9.32-alpha.0 → 2.9.32-alpha.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/package.json +6 -6
- package/es/Geometry/index.d.ts +0 -32
- package/es/Geometry/index.js +0 -118
- package/es/Geometry/models/billboard.d.ts +0 -26
- package/es/Geometry/models/billboard.js +0 -228
- 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 -45
- package/es/Geometry/models/plane.js +0 -419
- package/es/Geometry/models/sprite.d.ts +0 -47
- package/es/Geometry/models/sprite.js +0 -301
- package/es/Geometry/shaders/billboard_frag.glsl +0 -13
- package/es/Geometry/shaders/billboard_vert.glsl +0 -50
- package/es/Geometry/shaders/plane_frag.glsl +0 -22
- package/es/Geometry/shaders/plane_vert.glsl +0 -53
- package/es/Geometry/shaders/sprite_frag.glsl +0 -21
- package/es/Geometry/shaders/sprite_vert.glsl +0 -28
- package/es/canvas/index.d.ts +0 -23
- package/es/canvas/index.js +0 -121
- package/es/canvas/models/canvas.d.ts +0 -18
- package/es/canvas/models/canvas.js +0 -212
- package/es/canvas/models/index.d.ts +0 -5
- package/es/canvas/models/index.js +0 -5
- package/es/citybuliding/building.d.ts +0 -17
- package/es/citybuliding/building.js +0 -86
- package/es/citybuliding/models/build.d.ts +0 -22
- package/es/citybuliding/models/build.js +0 -187
- package/es/citybuliding/shaders/build_frag.glsl +0 -117
- package/es/citybuliding/shaders/build_vert.glsl +0 -54
- package/es/core/BaseLayer.d.ts +0 -224
- package/es/core/BaseLayer.js +0 -1413
- package/es/core/BaseModel.d.ts +0 -140
- package/es/core/BaseModel.js +0 -489
- package/es/core/interface.d.ts +0 -221
- package/es/core/interface.js +0 -30
- package/es/core/schema.d.ts +0 -27
- package/es/core/schema.js +0 -25
- package/es/core/shape/Path.d.ts +0 -39
- package/es/core/shape/Path.js +0 -62
- package/es/core/shape/extrude.d.ts +0 -17
- package/es/core/shape/extrude.js +0 -148
- package/es/core/triangulation.d.ts +0 -128
- package/es/core/triangulation.js +0 -553
- package/es/earth/index.d.ts +0 -22
- package/es/earth/index.js +0 -98
- package/es/earth/models/atmosphere.d.ts +0 -9
- package/es/earth/models/atmosphere.js +0 -135
- package/es/earth/models/base.d.ts +0 -16
- package/es/earth/models/base.js +0 -206
- package/es/earth/models/bloomsphere.d.ts +0 -9
- package/es/earth/models/bloomsphere.js +0 -134
- package/es/earth/shaders/atmosphere_frag.glsl +0 -17
- package/es/earth/shaders/atmosphere_vert.glsl +0 -26
- package/es/earth/shaders/base_frag.glsl +0 -13
- package/es/earth/shaders/base_vert.glsl +0 -52
- package/es/earth/shaders/bloomsphere_frag.glsl +0 -15
- package/es/earth/shaders/bloomsphere_vert.glsl +0 -20
- package/es/earth/utils.d.ts +0 -26
- package/es/earth/utils.js +0 -104
- package/es/heatmap/index.d.ts +0 -21
- package/es/heatmap/index.js +0 -141
- package/es/heatmap/models/grid.d.ts +0 -8
- package/es/heatmap/models/grid.js +0 -106
- package/es/heatmap/models/grid3d.d.ts +0 -8
- package/es/heatmap/models/grid3d.js +0 -140
- package/es/heatmap/models/heatmap.d.ts +0 -24
- package/es/heatmap/models/heatmap.js +0 -463
- package/es/heatmap/models/hexagon.d.ts +0 -8
- package/es/heatmap/models/hexagon.js +0 -107
- package/es/heatmap/models/index.d.ts +0 -5
- package/es/heatmap/models/index.js +0 -12
- package/es/heatmap/shaders/grid_vert.glsl +0 -42
- package/es/heatmap/shaders/heatmap_3d_frag.glsl +0 -14
- package/es/heatmap/shaders/heatmap_3d_vert.glsl +0 -46
- package/es/heatmap/shaders/heatmap_frag.glsl +0 -47
- package/es/heatmap/shaders/heatmap_framebuffer_frag.glsl +0 -10
- package/es/heatmap/shaders/heatmap_framebuffer_vert.glsl +0 -35
- package/es/heatmap/shaders/heatmap_vert.glsl +0 -10
- package/es/heatmap/shaders/hexagon_3d_frag.glsl +0 -0
- package/es/heatmap/shaders/hexagon_3d_vert.glsl +0 -64
- package/es/heatmap/shaders/hexagon_frag.glsl +0 -12
- package/es/heatmap/shaders/hexagon_vert.glsl +0 -41
- package/es/heatmap/triangulation.d.ts +0 -5
- package/es/heatmap/triangulation.js +0 -37
- package/es/image/index.d.ts +0 -19
- package/es/image/index.js +0 -104
- package/es/image/models/dataImage.d.ts +0 -22
- package/es/image/models/dataImage.js +0 -200
- package/es/image/models/image.d.ts +0 -19
- package/es/image/models/image.js +0 -164
- package/es/image/models/index.d.ts +0 -5
- package/es/image/models/index.js +0 -9
- package/es/image/models/tileDataImage.d.ts +0 -19
- package/es/image/models/tileDataImage.js +0 -174
- package/es/image/shaders/dataImage_frag.glsl +0 -38
- package/es/image/shaders/image_frag.glsl +0 -9
- package/es/image/shaders/image_vert.glsl +0 -17
- package/es/index.d.ts +0 -17
- package/es/index.js +0 -107
- package/es/line/index.d.ts +0 -43
- package/es/line/index.js +0 -140
- package/es/line/models/arc.d.ts +0 -17
- package/es/line/models/arc.js +0 -356
- package/es/line/models/arc_3d.d.ts +0 -17
- package/es/line/models/arc_3d.js +0 -333
- package/es/line/models/earthArc_3d.d.ts +0 -17
- package/es/line/models/earthArc_3d.js +0 -336
- package/es/line/models/great_circle.d.ts +0 -12
- package/es/line/models/great_circle.js +0 -294
- package/es/line/models/half.d.ts +0 -18
- package/es/line/models/half.js +0 -281
- package/es/line/models/index.d.ts +0 -5
- package/es/line/models/index.js +0 -25
- package/es/line/models/line.d.ts +0 -21
- package/es/line/models/line.js +0 -443
- package/es/line/models/linearline.d.ts +0 -11
- package/es/line/models/linearline.js +0 -275
- package/es/line/models/simpleLine.d.ts +0 -14
- package/es/line/models/simpleLine.js +0 -234
- package/es/line/models/simpleTileLine.d.ts +0 -9
- package/es/line/models/simpleTileLine.js +0 -100
- package/es/line/models/tile.d.ts +0 -8
- package/es/line/models/tile.js +0 -178
- package/es/line/models/wall.d.ts +0 -12
- package/es/line/models/wall.js +0 -293
- package/es/line/shaders/arc_chunks.vert.glsl +0 -21
- package/es/line/shaders/dash/arc_dash_frag.glsl +0 -28
- package/es/line/shaders/dash/arc_dash_vert.glsl +0 -150
- package/es/line/shaders/dash/line_dash_frag.glsl +0 -31
- package/es/line/shaders/dash/line_dash_vert.glsl +0 -93
- package/es/line/shaders/half/line_half_frag.glsl +0 -53
- package/es/line/shaders/half/line_half_vert.glsl +0 -169
- package/es/line/shaders/line_arc2d_vert.glsl +0 -114
- package/es/line/shaders/line_arc_3d_frag.glsl +0 -103
- package/es/line/shaders/line_arc_3d_vert.glsl +0 -206
- package/es/line/shaders/line_arc_frag.glsl +0 -88
- package/es/line/shaders/line_arc_great_circle_frag.glsl +0 -101
- package/es/line/shaders/line_arc_great_circle_vert.glsl +0 -214
- package/es/line/shaders/line_arc_vert.glsl +0 -178
- package/es/line/shaders/line_bezier_vert.glsl +0 -85
- package/es/line/shaders/line_frag.glsl +0 -99
- package/es/line/shaders/line_vert.glsl +0 -192
- package/es/line/shaders/linear/arc3d_linear_frag.glsl +0 -46
- package/es/line/shaders/linear/arc3d_linear_vert.glsl +0 -206
- package/es/line/shaders/linear/arc_linear_frag.glsl +0 -38
- package/es/line/shaders/linear/arc_linear_vert.glsl +0 -138
- package/es/line/shaders/linear/line_linear_frag.glsl +0 -27
- package/es/line/shaders/linearLine/line_linear_frag.glsl +0 -20
- package/es/line/shaders/linearLine/line_linear_vert.glsl +0 -112
- package/es/line/shaders/simple/simpleline_frag.glsl +0 -10
- package/es/line/shaders/simple/simpleline_linear_frag.glsl +0 -11
- package/es/line/shaders/simple/simpleline_vert.glsl +0 -79
- package/es/line/shaders/tile/line_tile_map_vert.glsl +0 -25
- package/es/line/shaders/tile/line_tile_vert.glsl +0 -52
- package/es/line/shaders/tile/simpleline_map_vert.glsl +0 -15
- package/es/line/shaders/tile/simpleline_vert.glsl +0 -21
- package/es/line/shaders/wall/wall_frag.glsl +0 -89
- package/es/line/shaders/wall/wall_vert.glsl +0 -77
- package/es/mask/index.d.ts +0 -27
- package/es/mask/index.js +0 -153
- package/es/mask/models/fill.d.ts +0 -12
- package/es/mask/models/fill.js +0 -124
- 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 -16
- package/es/plugins/DataMappingPlugin.d.ts +0 -19
- package/es/plugins/DataMappingPlugin.js +0 -420
- package/es/plugins/DataSourcePlugin.d.ts +0 -7
- package/es/plugins/DataSourcePlugin.js +0 -84
- package/es/plugins/FeatureScalePlugin.d.ts +0 -24
- package/es/plugins/FeatureScalePlugin.js +0 -340
- package/es/plugins/LayerAnimateStylePlugin.d.ts +0 -5
- package/es/plugins/LayerAnimateStylePlugin.js +0 -29
- package/es/plugins/LayerModelPlugin.d.ts +0 -10
- package/es/plugins/LayerModelPlugin.js +0 -72
- package/es/plugins/LayerStylePlugin.d.ts +0 -8
- package/es/plugins/LayerStylePlugin.js +0 -39
- package/es/plugins/LightingPlugin.d.ts +0 -36
- package/es/plugins/LightingPlugin.js +0 -104
- package/es/plugins/MultiPassRendererPlugin.d.ts +0 -23
- package/es/plugins/MultiPassRendererPlugin.js +0 -65
- package/es/plugins/PixelPickingPlugin.d.ts +0 -8
- package/es/plugins/PixelPickingPlugin.js +0 -126
- package/es/plugins/RegisterStyleAttributePlugin.d.ts +0 -15
- package/es/plugins/RegisterStyleAttributePlugin.js +0 -156
- package/es/plugins/ShaderUniformPlugin.d.ts +0 -17
- package/es/plugins/ShaderUniformPlugin.js +0 -107
- package/es/plugins/UpdateModelPlugin.d.ts +0 -8
- package/es/plugins/UpdateModelPlugin.js +0 -31
- package/es/plugins/UpdateStyleAttributePlugin.d.ts +0 -12
- package/es/plugins/UpdateStyleAttributePlugin.js +0 -83
- package/es/point/index.d.ts +0 -40
- package/es/point/index.js +0 -229
- package/es/point/models/earthExtrude.d.ts +0 -24
- package/es/point/models/earthExtrude.js +0 -274
- package/es/point/models/earthFill.d.ts +0 -11
- package/es/point/models/earthFill.js +0 -258
- package/es/point/models/extrude.d.ts +0 -24
- package/es/point/models/extrude.js +0 -295
- package/es/point/models/fill.d.ts +0 -40
- package/es/point/models/fill.js +0 -403
- package/es/point/models/fillmage.d.ts +0 -25
- package/es/point/models/fillmage.js +0 -366
- package/es/point/models/image.d.ts +0 -11
- package/es/point/models/image.js +0 -239
- package/es/point/models/index.d.ts +0 -5
- package/es/point/models/index.js +0 -30
- package/es/point/models/normal.d.ts +0 -16
- package/es/point/models/normal.js +0 -124
- package/es/point/models/radar.d.ts +0 -24
- package/es/point/models/radar.js +0 -232
- package/es/point/models/simplePoint.d.ts +0 -16
- package/es/point/models/simplePoint.js +0 -179
- package/es/point/models/text.d.ts +0 -57
- package/es/point/models/text.js +0 -619
- package/es/point/models/tile.d.ts +0 -15
- package/es/point/models/tile.js +0 -175
- package/es/point/models/tileText.d.ts +0 -52
- package/es/point/models/tileText.js +0 -509
- package/es/point/shaders/animate/wave_frag.glsl +0 -65
- package/es/point/shaders/earth/extrude_frag.glsl +0 -44
- package/es/point/shaders/earth/extrude_vert.glsl +0 -140
- package/es/point/shaders/earth/fill_frag.glsl +0 -86
- package/es/point/shaders/earth/fill_vert.glsl +0 -125
- package/es/point/shaders/extrude/extrude_frag.glsl +0 -44
- package/es/point/shaders/extrude/extrude_vert.glsl +0 -121
- package/es/point/shaders/fill_frag.glsl +0 -84
- package/es/point/shaders/fill_vert.glsl +0 -188
- package/es/point/shaders/image/fillImage_frag.glsl +0 -20
- package/es/point/shaders/image/fillImage_vert.glsl +0 -116
- package/es/point/shaders/image_frag.glsl +0 -39
- package/es/point/shaders/image_vert.glsl +0 -90
- package/es/point/shaders/normal_frag.glsl +0 -6
- package/es/point/shaders/normal_vert.glsl +0 -24
- package/es/point/shaders/radar/radar_frag.glsl +0 -53
- package/es/point/shaders/radar/radar_vert.glsl +0 -70
- package/es/point/shaders/simplePoint_frag.glsl +0 -53
- package/es/point/shaders/simplePoint_vert.glsl +0 -79
- package/es/point/shaders/text_frag.glsl +0 -48
- package/es/point/shaders/text_vert.glsl +0 -131
- package/es/point/shaders/tile/fill_tile_frag.glsl +0 -76
- package/es/point/shaders/tile/fill_tile_vert.glsl +0 -78
- package/es/point/shaders/tile/text_frag.glsl +0 -33
- package/es/point/shaders/tile/text_map_frag.glsl +0 -31
- package/es/point/shaders/tile/text_map_vert.glsl +0 -38
- package/es/point/shaders/tile/text_vert.glsl +0 -48
- package/es/point/shape/extrude.d.ts +0 -15
- package/es/point/shape/extrude.js +0 -63
- package/es/polygon/index.d.ts +0 -27
- package/es/polygon/index.js +0 -146
- package/es/polygon/models/extrude.d.ts +0 -28
- package/es/polygon/models/extrude.js +0 -302
- package/es/polygon/models/fill.d.ts +0 -17
- package/es/polygon/models/fill.js +0 -210
- package/es/polygon/models/index.d.ts +0 -5
- package/es/polygon/models/index.js +0 -28
- package/es/polygon/models/ocean.d.ts +0 -21
- package/es/polygon/models/ocean.js +0 -202
- package/es/polygon/models/tile.d.ts +0 -12
- package/es/polygon/models/tile.js +0 -101
- package/es/polygon/models/water.d.ts +0 -16
- package/es/polygon/models/water.js +0 -179
- package/es/polygon/shaders/extrude/polygon_extrude_frag.glsl +0 -44
- package/es/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +0 -44
- package/es/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +0 -85
- package/es/polygon/shaders/extrude/polygon_extrude_vert.glsl +0 -90
- package/es/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +0 -48
- package/es/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +0 -93
- package/es/polygon/shaders/polygon_frag.glsl +0 -12
- package/es/polygon/shaders/polygon_linear_frag.glsl +0 -22
- package/es/polygon/shaders/polygon_linear_vert.glsl +0 -74
- package/es/polygon/shaders/polygon_vert.glsl +0 -66
- package/es/polygon/shaders/tile/polygon_tile_map_vert.glsl +0 -16
- package/es/polygon/shaders/tile/polygon_tile_vert.glsl +0 -42
- package/es/polygon/shaders/water/polygon_ocean_frag.glsl +0 -247
- package/es/polygon/shaders/water/polygon_ocean_vert.glsl +0 -21
- package/es/polygon/shaders/water/polygon_water_frag.glsl +0 -71
- package/es/polygon/shaders/water/polygon_water_vert.glsl +0 -26
- package/es/raster/buffers/triangulation.d.ts +0 -6
- package/es/raster/buffers/triangulation.js +0 -25
- package/es/raster/index.d.ts +0 -19
- package/es/raster/index.js +0 -103
- package/es/raster/models/index.d.ts +0 -5
- package/es/raster/models/index.js +0 -8
- package/es/raster/models/raster.d.ts +0 -21
- package/es/raster/models/raster.js +0 -168
- package/es/raster/models/rasterTile.d.ts +0 -18
- package/es/raster/models/rasterTile.js +0 -140
- package/es/raster/raster.d.ts +0 -30
- package/es/raster/raster.js +0 -174
- package/es/raster/shaders/raster_2d_frag.glsl +0 -64
- package/es/raster/shaders/raster_2d_vert.glsl +0 -17
- package/es/raster/shaders/raster_frag.glsl +0 -9
- package/es/raster/shaders/raster_vert.glsl +0 -44
- package/es/shader/minify_frag.glsl +0 -7
- package/es/shader/minify_picking_frag.glsl +0 -10
- package/es/tile/interface.d.ts +0 -29
- package/es/tile/interface.js +0 -1
- package/es/tile/manager/baseMapTileLayerManager.d.ts +0 -7
- package/es/tile/manager/baseMapTileLayerManager.js +0 -119
- package/es/tile/manager/baseTileManager.d.ts +0 -27
- package/es/tile/manager/baseTileManager.js +0 -107
- package/es/tile/manager/tileConfigManager.d.ts +0 -17
- package/es/tile/manager/tileConfigManager.js +0 -121
- package/es/tile/manager/tileLayerManager.d.ts +0 -15
- package/es/tile/manager/tileLayerManager.js +0 -255
- package/es/tile/manager/tilePickerManager.d.ts +0 -21
- package/es/tile/manager/tilePickerManager.js +0 -194
- package/es/tile/models/tileModel.d.ts +0 -10
- package/es/tile/models/tileModel.js +0 -81
- package/es/tile/tileFactory/base.d.ts +0 -44
- package/es/tile/tileFactory/base.js +0 -472
- package/es/tile/tileFactory/index.d.ts +0 -5
- package/es/tile/tileFactory/index.js +0 -34
- package/es/tile/tileFactory/line.d.ts +0 -12
- package/es/tile/tileFactory/line.js +0 -62
- package/es/tile/tileFactory/point.d.ts +0 -12
- package/es/tile/tileFactory/point.js +0 -63
- package/es/tile/tileFactory/polygon.d.ts +0 -12
- package/es/tile/tileFactory/polygon.js +0 -62
- package/es/tile/tileFactory/raster.d.ts +0 -12
- package/es/tile/tileFactory/raster.js +0 -58
- package/es/tile/tileFactory/rasterData.d.ts +0 -12
- package/es/tile/tileFactory/rasterData.js +0 -81
- package/es/tile/tileFactory/rasterDataLayer.d.ts +0 -19
- package/es/tile/tileFactory/rasterDataLayer.js +0 -85
- package/es/tile/tileFactory/test.d.ts +0 -12
- package/es/tile/tileFactory/test.js +0 -105
- package/es/tile/tileFactory/vectorLayer.d.ts +0 -35
- package/es/tile/tileFactory/vectorLayer.js +0 -260
- package/es/tile/tileLayer/baseMapTileLayer.d.ts +0 -30
- package/es/tile/tileLayer/baseMapTileLayer.js +0 -195
- package/es/tile/tileLayer/baseTileLayer.d.ts +0 -48
- package/es/tile/tileLayer/baseTileLayer.js +0 -420
- package/es/tile/tileTest.d.ts +0 -15
- package/es/tile/tileTest.js +0 -62
- package/es/tile/tmsMapTileLayer.d.ts +0 -7
- package/es/tile/tmsMapTileLayer.js +0 -97
- package/es/tile/tmsTileLayer.d.ts +0 -7
- package/es/tile/tmsTileLayer.js +0 -101
- package/es/tile/utils.d.ts +0 -19
- package/es/tile/utils.js +0 -209
- package/es/utils/blend.d.ts +0 -2
- package/es/utils/blend.js +0 -54
- package/es/utils/collision-index.d.ts +0 -47
- package/es/utils/collision-index.js +0 -102
- package/es/utils/dataMappingStyle.d.ts +0 -31
- package/es/utils/dataMappingStyle.js +0 -150
- package/es/utils/extrude_polyline.d.ts +0 -67
- package/es/utils/extrude_polyline.js +0 -611
- package/es/utils/grid-index.d.ts +0 -28
- package/es/utils/grid-index.js +0 -179
- package/es/utils/layerData.d.ts +0 -2
- package/es/utils/layerData.js +0 -176
- package/es/utils/multiPassRender.d.ts +0 -16
- package/es/utils/multiPassRender.js +0 -50
- package/es/utils/polylineNormal.d.ts +0 -9
- package/es/utils/polylineNormal.js +0 -191
- package/es/utils/simpleLine.d.ts +0 -23
- package/es/utils/simpleLine.js +0 -103
- package/es/utils/symbol-layout.d.ts +0 -43
- package/es/utils/symbol-layout.js +0 -299
- package/es/utils/updateShape.d.ts +0 -2
- package/es/utils/updateShape.js +0 -20
- package/es/wind/index.d.ts +0 -20
- package/es/wind/index.js +0 -98
- 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 -226
- package/es/wind/models/wind.d.ts +0 -33
- package/es/wind/models/wind.js +0 -331
- package/es/wind/models/windRender.d.ts +0 -104
- package/es/wind/models/windRender.js +0 -357
- package/es/wind/models/windShader.d.ts +0 -12
- package/es/wind/models/windShader.js +0 -12
- package/es/wind/shaders/wind_frag.glsl +0 -9
- package/es/wind/shaders/wind_vert.glsl +0 -17
- package/lib/Geometry/index.js +0 -130
- package/lib/Geometry/models/billboard.js +0 -242
- package/lib/Geometry/models/index.js +0 -22
- package/lib/Geometry/models/plane.js +0 -434
- package/lib/Geometry/models/sprite.js +0 -315
- package/lib/Geometry/shaders/billboard_frag.glsl +0 -13
- package/lib/Geometry/shaders/billboard_vert.glsl +0 -50
- package/lib/Geometry/shaders/plane_frag.glsl +0 -22
- package/lib/Geometry/shaders/plane_vert.glsl +0 -53
- package/lib/Geometry/shaders/sprite_frag.glsl +0 -21
- package/lib/Geometry/shaders/sprite_vert.glsl +0 -28
- package/lib/canvas/index.js +0 -133
- package/lib/canvas/models/canvas.js +0 -221
- package/lib/canvas/models/index.js +0 -16
- package/lib/citybuliding/building.js +0 -99
- package/lib/citybuliding/models/build.js +0 -202
- package/lib/citybuliding/shaders/build_frag.glsl +0 -117
- package/lib/citybuliding/shaders/build_vert.glsl +0 -54
- package/lib/core/BaseLayer.js +0 -1408
- package/lib/core/BaseModel.js +0 -506
- package/lib/core/interface.js +0 -41
- package/lib/core/schema.js +0 -33
- package/lib/core/shape/Path.js +0 -88
- package/lib/core/shape/extrude.js +0 -180
- package/lib/core/triangulation.js +0 -619
- package/lib/earth/index.js +0 -113
- package/lib/earth/models/atmosphere.js +0 -149
- package/lib/earth/models/base.js +0 -216
- package/lib/earth/models/bloomsphere.js +0 -148
- package/lib/earth/shaders/atmosphere_frag.glsl +0 -17
- package/lib/earth/shaders/atmosphere_vert.glsl +0 -26
- package/lib/earth/shaders/base_frag.glsl +0 -13
- package/lib/earth/shaders/base_vert.glsl +0 -52
- package/lib/earth/shaders/bloomsphere_frag.glsl +0 -15
- package/lib/earth/shaders/bloomsphere_vert.glsl +0 -20
- package/lib/earth/utils.js +0 -136
- package/lib/heatmap/index.js +0 -154
- package/lib/heatmap/models/grid.js +0 -120
- package/lib/heatmap/models/grid3d.js +0 -154
- package/lib/heatmap/models/heatmap.js +0 -486
- package/lib/heatmap/models/hexagon.js +0 -121
- package/lib/heatmap/models/index.js +0 -26
- package/lib/heatmap/shaders/grid_vert.glsl +0 -42
- package/lib/heatmap/shaders/heatmap_3d_frag.glsl +0 -14
- package/lib/heatmap/shaders/heatmap_3d_vert.glsl +0 -46
- package/lib/heatmap/shaders/heatmap_frag.glsl +0 -47
- package/lib/heatmap/shaders/heatmap_framebuffer_frag.glsl +0 -10
- package/lib/heatmap/shaders/heatmap_framebuffer_vert.glsl +0 -35
- package/lib/heatmap/shaders/heatmap_vert.glsl +0 -10
- package/lib/heatmap/shaders/hexagon_3d_frag.glsl +0 -0
- package/lib/heatmap/shaders/hexagon_3d_vert.glsl +0 -64
- package/lib/heatmap/shaders/hexagon_frag.glsl +0 -12
- package/lib/heatmap/shaders/hexagon_vert.glsl +0 -41
- package/lib/heatmap/triangulation.js +0 -44
- package/lib/image/index.js +0 -117
- package/lib/image/models/dataImage.js +0 -215
- package/lib/image/models/image.js +0 -178
- package/lib/image/models/index.js +0 -22
- package/lib/image/models/tileDataImage.js +0 -188
- package/lib/image/shaders/dataImage_frag.glsl +0 -38
- package/lib/image/shaders/image_frag.glsl +0 -9
- package/lib/image/shaders/image_vert.glsl +0 -17
- package/lib/index.js +0 -275
- package/lib/line/index.js +0 -152
- package/lib/line/models/arc.js +0 -373
- package/lib/line/models/arc_3d.js +0 -351
- package/lib/line/models/earthArc_3d.js +0 -354
- package/lib/line/models/great_circle.js +0 -310
- package/lib/line/models/half.js +0 -298
- package/lib/line/models/index.js +0 -46
- package/lib/line/models/line.js +0 -460
- package/lib/line/models/linearline.js +0 -292
- package/lib/line/models/simpleLine.js +0 -249
- package/lib/line/models/simpleTileLine.js +0 -115
- package/lib/line/models/tile.js +0 -194
- package/lib/line/models/wall.js +0 -309
- package/lib/line/shaders/arc_chunks.vert.glsl +0 -21
- package/lib/line/shaders/dash/arc_dash_frag.glsl +0 -28
- package/lib/line/shaders/dash/arc_dash_vert.glsl +0 -150
- package/lib/line/shaders/dash/line_dash_frag.glsl +0 -31
- package/lib/line/shaders/dash/line_dash_vert.glsl +0 -93
- package/lib/line/shaders/half/line_half_frag.glsl +0 -53
- package/lib/line/shaders/half/line_half_vert.glsl +0 -169
- package/lib/line/shaders/line_arc2d_vert.glsl +0 -114
- package/lib/line/shaders/line_arc_3d_frag.glsl +0 -103
- package/lib/line/shaders/line_arc_3d_vert.glsl +0 -206
- package/lib/line/shaders/line_arc_frag.glsl +0 -88
- package/lib/line/shaders/line_arc_great_circle_frag.glsl +0 -101
- package/lib/line/shaders/line_arc_great_circle_vert.glsl +0 -214
- package/lib/line/shaders/line_arc_vert.glsl +0 -178
- package/lib/line/shaders/line_bezier_vert.glsl +0 -85
- package/lib/line/shaders/line_frag.glsl +0 -99
- package/lib/line/shaders/line_vert.glsl +0 -192
- package/lib/line/shaders/linear/arc3d_linear_frag.glsl +0 -46
- package/lib/line/shaders/linear/arc3d_linear_vert.glsl +0 -206
- package/lib/line/shaders/linear/arc_linear_frag.glsl +0 -38
- package/lib/line/shaders/linear/arc_linear_vert.glsl +0 -138
- package/lib/line/shaders/linear/line_linear_frag.glsl +0 -27
- package/lib/line/shaders/linearLine/line_linear_frag.glsl +0 -20
- package/lib/line/shaders/linearLine/line_linear_vert.glsl +0 -112
- package/lib/line/shaders/simple/simpleline_frag.glsl +0 -10
- package/lib/line/shaders/simple/simpleline_linear_frag.glsl +0 -11
- package/lib/line/shaders/simple/simpleline_vert.glsl +0 -79
- package/lib/line/shaders/tile/line_tile_map_vert.glsl +0 -25
- package/lib/line/shaders/tile/line_tile_vert.glsl +0 -52
- package/lib/line/shaders/tile/simpleline_map_vert.glsl +0 -15
- package/lib/line/shaders/tile/simpleline_vert.glsl +0 -21
- package/lib/line/shaders/wall/wall_frag.glsl +0 -89
- package/lib/line/shaders/wall/wall_vert.glsl +0 -77
- package/lib/mask/index.js +0 -168
- package/lib/mask/models/fill.js +0 -141
- package/lib/mask/models/index.js +0 -16
- package/lib/mask/shaders/mask_vert.glsl +0 -16
- package/lib/plugins/DataMappingPlugin.js +0 -434
- package/lib/plugins/DataSourcePlugin.js +0 -97
- package/lib/plugins/FeatureScalePlugin.js +0 -363
- package/lib/plugins/LayerAnimateStylePlugin.js +0 -41
- package/lib/plugins/LayerModelPlugin.js +0 -83
- package/lib/plugins/LayerStylePlugin.js +0 -50
- package/lib/plugins/LightingPlugin.js +0 -119
- package/lib/plugins/MultiPassRendererPlugin.js +0 -77
- package/lib/plugins/PixelPickingPlugin.js +0 -139
- package/lib/plugins/RegisterStyleAttributePlugin.js +0 -168
- package/lib/plugins/ShaderUniformPlugin.js +0 -120
- package/lib/plugins/UpdateModelPlugin.js +0 -42
- package/lib/plugins/UpdateStyleAttributePlugin.js +0 -94
- package/lib/point/index.js +0 -242
- package/lib/point/models/earthExtrude.js +0 -290
- package/lib/point/models/earthFill.js +0 -293
- package/lib/point/models/extrude.js +0 -312
- package/lib/point/models/fill.js +0 -419
- package/lib/point/models/fillmage.js +0 -382
- package/lib/point/models/image.js +0 -255
- package/lib/point/models/index.js +0 -53
- package/lib/point/models/normal.js +0 -141
- package/lib/point/models/radar.js +0 -249
- package/lib/point/models/simplePoint.js +0 -196
- package/lib/point/models/text.js +0 -634
- package/lib/point/models/tile.js +0 -189
- package/lib/point/models/tileText.js +0 -524
- package/lib/point/shaders/animate/wave_frag.glsl +0 -65
- package/lib/point/shaders/earth/extrude_frag.glsl +0 -44
- package/lib/point/shaders/earth/extrude_vert.glsl +0 -140
- package/lib/point/shaders/earth/fill_frag.glsl +0 -86
- package/lib/point/shaders/earth/fill_vert.glsl +0 -125
- package/lib/point/shaders/extrude/extrude_frag.glsl +0 -44
- package/lib/point/shaders/extrude/extrude_vert.glsl +0 -121
- package/lib/point/shaders/fill_frag.glsl +0 -84
- package/lib/point/shaders/fill_vert.glsl +0 -188
- package/lib/point/shaders/image/fillImage_frag.glsl +0 -20
- package/lib/point/shaders/image/fillImage_vert.glsl +0 -116
- package/lib/point/shaders/image_frag.glsl +0 -39
- package/lib/point/shaders/image_vert.glsl +0 -90
- package/lib/point/shaders/normal_frag.glsl +0 -6
- package/lib/point/shaders/normal_vert.glsl +0 -24
- package/lib/point/shaders/radar/radar_frag.glsl +0 -53
- package/lib/point/shaders/radar/radar_vert.glsl +0 -70
- package/lib/point/shaders/simplePoint_frag.glsl +0 -53
- package/lib/point/shaders/simplePoint_vert.glsl +0 -79
- package/lib/point/shaders/text_frag.glsl +0 -48
- package/lib/point/shaders/text_vert.glsl +0 -131
- package/lib/point/shaders/tile/fill_tile_frag.glsl +0 -76
- package/lib/point/shaders/tile/fill_tile_vert.glsl +0 -78
- package/lib/point/shaders/tile/text_frag.glsl +0 -33
- package/lib/point/shaders/tile/text_map_frag.glsl +0 -31
- package/lib/point/shaders/tile/text_map_vert.glsl +0 -38
- package/lib/point/shaders/tile/text_vert.glsl +0 -48
- package/lib/point/shape/extrude.js +0 -78
- package/lib/polygon/index.js +0 -160
- package/lib/polygon/models/extrude.js +0 -318
- package/lib/polygon/models/fill.js +0 -225
- package/lib/polygon/models/index.js +0 -50
- package/lib/polygon/models/ocean.js +0 -219
- package/lib/polygon/models/tile.js +0 -114
- package/lib/polygon/models/water.js +0 -196
- package/lib/polygon/shaders/extrude/polygon_extrude_frag.glsl +0 -44
- package/lib/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +0 -44
- package/lib/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +0 -85
- package/lib/polygon/shaders/extrude/polygon_extrude_vert.glsl +0 -90
- package/lib/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +0 -48
- package/lib/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +0 -93
- package/lib/polygon/shaders/polygon_frag.glsl +0 -12
- package/lib/polygon/shaders/polygon_linear_frag.glsl +0 -22
- package/lib/polygon/shaders/polygon_linear_vert.glsl +0 -74
- package/lib/polygon/shaders/polygon_vert.glsl +0 -66
- package/lib/polygon/shaders/tile/polygon_tile_map_vert.glsl +0 -16
- package/lib/polygon/shaders/tile/polygon_tile_vert.glsl +0 -42
- package/lib/polygon/shaders/water/polygon_ocean_frag.glsl +0 -247
- package/lib/polygon/shaders/water/polygon_ocean_vert.glsl +0 -21
- package/lib/polygon/shaders/water/polygon_water_frag.glsl +0 -71
- package/lib/polygon/shaders/water/polygon_water_vert.glsl +0 -26
- package/lib/raster/buffers/triangulation.js +0 -35
- package/lib/raster/index.js +0 -116
- package/lib/raster/models/index.js +0 -20
- package/lib/raster/models/raster.js +0 -183
- package/lib/raster/models/rasterTile.js +0 -154
- package/lib/raster/raster.js +0 -191
- package/lib/raster/shaders/raster_2d_frag.glsl +0 -64
- package/lib/raster/shaders/raster_2d_vert.glsl +0 -17
- package/lib/raster/shaders/raster_frag.glsl +0 -9
- package/lib/raster/shaders/raster_vert.glsl +0 -44
- package/lib/shader/minify_frag.glsl +0 -7
- package/lib/shader/minify_picking_frag.glsl +0 -10
- package/lib/tile/interface.js +0 -5
- package/lib/tile/manager/baseMapTileLayerManager.js +0 -134
- package/lib/tile/manager/baseTileManager.js +0 -121
- package/lib/tile/manager/tileConfigManager.js +0 -133
- package/lib/tile/manager/tileLayerManager.js +0 -273
- package/lib/tile/manager/tilePickerManager.js +0 -205
- package/lib/tile/models/tileModel.js +0 -94
- package/lib/tile/tileFactory/base.js +0 -496
- package/lib/tile/tileFactory/index.js +0 -66
- package/lib/tile/tileFactory/line.js +0 -73
- package/lib/tile/tileFactory/point.js +0 -74
- package/lib/tile/tileFactory/polygon.js +0 -73
- package/lib/tile/tileFactory/raster.js +0 -71
- package/lib/tile/tileFactory/rasterData.js +0 -94
- package/lib/tile/tileFactory/rasterDataLayer.js +0 -98
- package/lib/tile/tileFactory/test.js +0 -118
- package/lib/tile/tileFactory/vectorLayer.js +0 -275
- package/lib/tile/tileLayer/baseMapTileLayer.js +0 -202
- package/lib/tile/tileLayer/baseTileLayer.js +0 -429
- package/lib/tile/tileTest.js +0 -74
- package/lib/tile/tmsMapTileLayer.js +0 -114
- package/lib/tile/tmsTileLayer.js +0 -118
- package/lib/tile/utils.js +0 -248
- package/lib/utils/blend.js +0 -65
- package/lib/utils/collision-index.js +0 -118
- package/lib/utils/dataMappingStyle.js +0 -154
- package/lib/utils/extrude_polyline.js +0 -653
- package/lib/utils/grid-index.js +0 -188
- package/lib/utils/layerData.js +0 -187
- package/lib/utils/multiPassRender.js +0 -61
- package/lib/utils/polylineNormal.js +0 -230
- package/lib/utils/simpleLine.js +0 -116
- package/lib/utils/symbol-layout.js +0 -308
- package/lib/utils/updateShape.js +0 -27
- package/lib/wind/index.js +0 -111
- package/lib/wind/models/index.js +0 -16
- package/lib/wind/models/utils.js +0 -253
- package/lib/wind/models/wind.js +0 -346
- package/lib/wind/models/windRender.js +0 -373
- package/lib/wind/models/windShader.js +0 -25
- package/lib/wind/shaders/wind_frag.glsl +0 -9
- package/lib/wind/shaders/wind_vert.glsl +0 -17
package/es/line/models/line.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { IModel, IModelUniform, ITexture2D } from '@antv/l7-core';
|
|
2
|
-
import BaseModel from '../../core/BaseModel';
|
|
3
|
-
export default class LineModel extends BaseModel {
|
|
4
|
-
protected texture: ITexture2D;
|
|
5
|
-
getUninforms(): IModelUniform;
|
|
6
|
-
getAnimateUniforms(): IModelUniform;
|
|
7
|
-
initModels(callbackModel: (models: IModel[]) => void): void;
|
|
8
|
-
clearModels(): void;
|
|
9
|
-
buildModels(callbackModel: (models: IModel[]) => void): void;
|
|
10
|
-
/**
|
|
11
|
-
* 根据参数获取不同的 shader 代码
|
|
12
|
-
* @returns
|
|
13
|
-
*/
|
|
14
|
-
getShaders(): {
|
|
15
|
-
frag: string;
|
|
16
|
-
vert: string;
|
|
17
|
-
type: string;
|
|
18
|
-
};
|
|
19
|
-
protected registerBuiltinAttributes(): void;
|
|
20
|
-
private updateTexture;
|
|
21
|
-
}
|
package/es/line/models/line.js
DELETED
|
@@ -1,443 +0,0 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
|
|
9
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
-
|
|
11
|
-
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; } }
|
|
12
|
-
|
|
13
|
-
import { AttributeType, gl } from '@antv/l7-core';
|
|
14
|
-
import { getMask, LineTriangulation, rgb2arr } from '@antv/l7-utils';
|
|
15
|
-
import { isNumber } from 'lodash';
|
|
16
|
-
import BaseModel from "../../core/BaseModel";
|
|
17
|
-
import { LinearDir, TextureBlend } from "../../core/interface"; // import { LineTriangulation } from '../../core/triangulation';
|
|
18
|
-
// dash line shader
|
|
19
|
-
|
|
20
|
-
/* babel-plugin-inline-import '../shaders/dash/line_dash_frag.glsl' */
|
|
21
|
-
var line_dash_frag = "#define LineTypeSolid 0.0\nuniform float u_opacity : 1.0;\n\nvarying vec4 v_color;\n\n// dash\nvarying vec4 v_dash_array;\n\n#pragma include \"picking\"\n\nuniform float u_time;\nuniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ]; // \u63A7\u5236\u8FD0\u52A8\n\nvarying mat4 styleMappingMat;\n// [animate, duration, interval, trailLength],\nvoid main() {\n float opacity = styleMappingMat[0][0];\n float d_distance_ratio = styleMappingMat[3].r; // \u5F53\u524D\u70B9\u4F4D\u8DDD\u79BB\u5360\u7EBF\u603B\u957F\u7684\u6BD4\u4F8B\n gl_FragColor = v_color;\n gl_FragColor.a *= opacity; // \u5168\u5C40\u900F\u660E\u5EA6\n \n float dashLength = mod(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 // \u5B9E\u7EBF\u90E8\u5206\n } else {\n // \u865A\u7EBF\u90E8\u5206\n discard;\n };\n\n gl_FragColor = filterColor(gl_FragColor);\n}\n";
|
|
22
|
-
|
|
23
|
-
/* babel-plugin-inline-import '../shaders/dash/line_dash_vert.glsl' */
|
|
24
|
-
var line_dash_vert = "#define LineTypeSolid 0.0\n#define LineTypeDash 1.0\n#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;\n\nattribute vec2 a_iconMapUV;\n\n// dash line\nattribute float a_Total_Distance;\nattribute vec2 a_DistanceAndIndex;\n\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nuniform vec4 u_dash_array: [10.0, 5., 0, 0];\n\nuniform float u_vertexScale: 1.0;\n\n#pragma include \"projection\"\n#pragma include \"picking\"\n\nvarying vec4 v_color;\nvarying vec4 v_dash_array;\n\nuniform float u_opacity: 1.0;\nvarying mat4 styleMappingMat; // \u7528\u4E8E\u5C06\u5728\u9876\u70B9\u7740\u8272\u5668\u4E2D\u8BA1\u7B97\u597D\u7684\u6837\u5F0F\u503C\u4F20\u9012\u7ED9\u7247\u5143\n\n#pragma include \"styleMapping\"\n#pragma include \"styleMappingCalOpacity\"\n\nvoid main() {\n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\n styleMappingMat = mat4(\n 0.0, 0.0, 0.0, 0.0, // opacity - strokeOpacity - strokeWidth - empty\n 0.0, 0.0, 0.0, 0.0, // strokeR - strokeG - strokeB - strokeA\n 0.0, 0.0, 0.0, 0.0, // offsets[0] - offsets[1]\n 0.0, 0.0, 0.0, 0.0 // distance_ratio/distance/pixelLen/texV\n );\n\n float rowCount = u_cellTypeLayout[0][0]; // \u5F53\u524D\u7684\u6570\u636E\u7EB9\u7406\u6709\u51E0\u884C\n float columnCount = u_cellTypeLayout[0][1]; // \u5F53\u770B\u5230\u6570\u636E\u7EB9\u7406\u6709\u51E0\u5217\n float columnWidth = 1.0/columnCount; // \u5217\u5BBD\n float rowHeight = 1.0/rowCount; // \u884C\u9AD8\n float cellCount = calCellCount(); // opacity - strokeOpacity - strokeWidth - stroke - offsets\n float id = a_vertexId; // \u7B2Cn\u4E2A\u9876\u70B9\n float cellCurrentRow = floor(id * cellCount / columnCount) + 1.0; // \u8D77\u59CB\u70B9\u5728\u7B2C\u51E0\u884C\n float cellCurrentColumn = mod(id * cellCount, columnCount) + 1.0; // \u8D77\u59CB\u70B9\u5728\u7B2C\u51E0\u5217\n \n // cell \u56FA\u5B9A\u987A\u5E8F opacity -> strokeOpacity -> strokeWidth -> stroke ... \n // \u6309\u987A\u5E8F\u4ECE cell \u4E2D\u53D6\u503C\u3001\u82E5\u6CA1\u6709\u5219\u81EA\u52A8\u5F80\u4E0B\u53D6\u503C\n float textureOffset = 0.0; // \u5728 cell \u4E2D\u53D6\u503C\u7684\u504F\u79FB\u91CF\n\n vec2 opacityAndOffset = calOpacityAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);\n styleMappingMat[0][0] = opacityAndOffset.r;\n textureOffset = opacityAndOffset.g;\n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\n\n v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / a_Total_Distance;\n v_color = a_Color;\n\n vec3 size = a_Miter * setPickingSize(a_Size.x) * reverse_offset_normal(a_Normal);\n vec2 offset = project_pixel(size.xy);\n\n // \u8BBE\u7F6E\u6570\u636E\u96C6\u7684\u53C2\u6570\n styleMappingMat[3][0] = a_DistanceAndIndex.x / a_Total_Distance; // \u5F53\u524D\u70B9\u4F4D\u8DDD\u79BB\u5360\u7EBF\u603B\u957F\u7684\u6BD4\u4F8B\n styleMappingMat[3][1] = a_DistanceAndIndex.x; // \u5F53\u524D\u9876\u70B9\u7684\u8DDD\u79BB\n\n vec4 project_pos = project_position(vec4(a_Position.xy, 0, 1.0));\n\n // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, a_Size.y, 1.0));\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(project_pos.xy + offset, project_pixel(a_Size.y), 1.0));\n } else {\n float lineHeight = a_Size.y;\n \n // #define COORDINATE_SYSTEM_P20 5.0\n // #define COORDINATE_SYSTEM_P20_OFFSET 6.0\n // amap1.x\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20 || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {\n // \u4FDD\u6301\u9AD8\u5EA6\u76F8\u5BF9\u4E0D\u53D8\n lineHeight *= pow(2.0, 20.0 - u_Zoom);\n }\n\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, lineHeight, 1.0));\n }\n\n setPickingColor(a_PickingColor);\n}\n"; // basic line shader
|
|
25
|
-
|
|
26
|
-
/* babel-plugin-inline-import '../shaders/line_frag.glsl' */
|
|
27
|
-
var line_frag = "#define Animate 0.0\n#define LineTexture 1.0\nuniform float u_opacity : 1.0;\nuniform float u_textureBlend;\n\nuniform float u_borderWidth: 0.0;\n\nuniform vec3 u_blur;\nuniform vec4 u_borderColor;\nvarying vec4 v_color;\n\n// line texture\nuniform float u_line_texture;\nuniform sampler2D u_texture;\nuniform vec2 u_textSize;\n\nvarying vec2 v_iconMapUV;\n\n#pragma include \"picking\"\n\nuniform float u_time;\nuniform vec4 u_animate: [ 1, 2., 1.0, 0.2 ]; // \u63A7\u5236\u8FD0\u52A8\n\nvarying mat4 styleMappingMat;\n// [animate, duration, interval, trailLength],\nvoid main() {\n float opacity = styleMappingMat[0][0];\n float animateSpeed = 0.0; // \u8FD0\u52A8\u901F\u5EA6\n float d_distance_ratio = styleMappingMat[3].r; // \u5F53\u524D\u70B9\u4F4D\u8DDD\u79BB\u5360\u7EBF\u603B\u957F\u7684\u6BD4\u4F8B\n gl_FragColor = v_color;\n // anti-alias\n // float blur = 1.0 - smoothstep(u_blur, 1., length(v_normal.xy));\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 = styleMappingMat[3].g; // \u5F53\u524D\u9876\u70B9\u7684\u8DDD\u79BB\n float d_texPixelLen = styleMappingMat[3].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 = styleMappingMat[3].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 \n // gl_FragColor = filterColor(gl_FragColor + texture2D(u_texture, vec2(u, v)));\n // gl_FragColor = filterColor(gl_FragColor + texture2D(u_texture, uv));\n vec4 pattern = texture2D(u_texture, uv);\n\n if(u_textureBlend == 0.0) { // normal\n pattern.a = 0.0;\n 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 = pattern;\n }\n } \n\n float v = styleMappingMat[3].a;\n float borderWidth = min(0.5, u_borderWidth);\n // \u7ED8\u5236 border\n if(borderWidth > 0.01) {\n float borderOuterWidth = borderWidth/2.0;\n\n if(v >= 1.0 - borderWidth || v <= borderWidth) {\n if(v > borderWidth) {\n float linear = smoothstep(0.0, 1.0, (v - (1.0 - borderWidth))/borderWidth);\n gl_FragColor.rgb = mix(gl_FragColor.rgb, u_borderColor.rgb, linear);\n } else if(v <= borderWidth) {\n float linear = smoothstep(0.0, 1.0, v/borderWidth);\n gl_FragColor.rgb = mix(u_borderColor.rgb, gl_FragColor.rgb, linear);\n }\n }\n\n if(v < borderOuterWidth) {\n gl_FragColor.a = mix(0.0, gl_FragColor.a, v/borderOuterWidth);\n } else if(v > 1.0 - borderOuterWidth) {\n gl_FragColor.a = mix(gl_FragColor.a, 0.0, (v - (1.0 - borderOuterWidth))/borderOuterWidth);\n }\n }\n\n // blur\n float blurV = styleMappingMat[3][3];\n if(blurV < 0.5) {\n gl_FragColor.a *= mix(u_blur.r, u_blur.g, blurV/0.5);\n } else {\n gl_FragColor.a *= mix(u_blur.g, u_blur.b, (blurV - 0.5)/0.5);\n }\n \n gl_FragColor = filterColor(gl_FragColor);\n}\n";
|
|
28
|
-
|
|
29
|
-
/* babel-plugin-inline-import '../shaders/line_vert.glsl' */
|
|
30
|
-
var line_vert = "\n#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;\n\nattribute vec2 a_iconMapUV;\n\n// dash line\nattribute float a_Total_Distance;\nattribute vec2 a_DistanceAndIndex;\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;\n\nuniform float u_heightfixed: 0.0;\nuniform float u_vertexScale: 1.0;\nuniform float u_raisingHeight: 0.0;\n\n#pragma include \"projection\"\n#pragma include \"picking\"\n\nvarying vec4 v_color;\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;\n\n\nuniform float u_linearColor: 0;\nuniform float u_arrow: 0.0;\nuniform float u_arrowHeight: 3.0;\nuniform float u_arrowWidth: 2.0;\nuniform float u_tailWidth: 1.0;\n\nuniform float u_opacity: 1.0;\nvarying mat4 styleMappingMat; // \u7528\u4E8E\u5C06\u5728\u9876\u70B9\u7740\u8272\u5668\u4E2D\u8BA1\u7B97\u597D\u7684\u6837\u5F0F\u503C\u4F20\u9012\u7ED9\u7247\u5143\n\n#pragma include \"styleMapping\"\n#pragma include \"styleMappingCalOpacity\"\n\nvec2 calculateArrow(vec2 offset) {\n /*\n * \u5728\u652F\u6301\u7BAD\u5934\u7684\u65F6\u5019\uFF0C\u7B2C\u4E8C\u3001\u7B2C\u4E09\u7EC4\u9876\u70B9\u662F\u989D\u5916\u63D2\u5165\u7528\u4E8E\u6784\u5EFA\u9876\u70B9\u7684\n */\n float arrowFlag = -1.0;\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {\n // \u9AD8\u5FB7 2.0 \u7684\u65CB\u8F6C\u89D2\u5EA6\u4E0D\u540C\n arrowFlag = 1.0;\n }\n float pi = arrowFlag * 3.1415926/2.;\n if(a_Miter < 0.) {\n // \u6839\u636E\u7EBF\u7684\u4E24\u4FA7\u504F\u79FB\u4E0D\u540C\u3001\u65CB\u8F6C\u7684\u65B9\u5411\u76F8\u53CD\n pi = -pi;\n }\n highp float angle_sin = sin(pi);\n highp float angle_cos = cos(pi);\n // \u8BA1\u7B97\u5782\u76F4\u4E0E\u7EBF\u65B9\u5411\u7684\u65CB\u8F6C\u77E9\u9635\n mat2 rotation_matrix = mat2(angle_cos, -1.0 * angle_sin, angle_sin, angle_cos);\n float arrowWidth = u_arrowWidth;\n float arrowHeight = u_arrowHeight;\n\n vec2 arrowOffset = vec2(0.0);\n /*\n * a_DistanceAndIndex.y \u7528\u4E8E\u6807\u8BB0\u5F53\u524D\u9876\u70B9\u5C5E\u4E8E\u54EA\u4E00\u7EC4\uFF08\u4E24\u4E2A\u9876\u70B9\u4E00\u7EC4\uFF0C\u6784\u6210\u7EBF\u7684\u5176\u5B9E\u662F\u77E9\u5F62\uFF0C\u6700\u7B80\u9700\u8981\u56DB\u4E2A\u9876\u70B9\u3001\u4E24\u7EC4\u9876\u70B9\u6784\u6210\uFF09\n */\n if(a_DistanceAndIndex.y == 0.0) {\n // \u7BAD\u5934\u5C16\u90E8\n offset = vec2(0.0);\n } else if(a_DistanceAndIndex.y == 1.0) {\n // \u7BAD\u5934\u4E24\u4FA7\n arrowOffset = rotation_matrix*(offset * arrowHeight);\n offset += arrowOffset; // \u6CBF\u7EBF\u504F\u79FB\n offset = offset * arrowWidth; // \u5782\u76F4\u7EBF\u5411\u5916\u504F\u79FB\uFF08\u662F\u6784\u5EFA\u7BAD\u5934\u4E24\u4FA7\u7684\u9876\u70B9\uFF09\n } else if(a_DistanceAndIndex.y == 2.0 || a_DistanceAndIndex.y == 3.0 || a_DistanceAndIndex.y == 4.0) {\n // \u504F\u79FB\u5176\u4F59\u7684\u70B9\u4F4D\uFF08\u5C06\u957F\u5EA6\u8BA9\u4F4D\u7ED9\u7BAD\u5934\uFF09\n arrowOffset = rotation_matrix*(offset * arrowHeight) * arrowWidth;\n offset += arrowOffset;// \u6CBF\u7EBF\u504F\u79FB\n }\n\n return offset;\n}\n\nvoid main() {\n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\n styleMappingMat = mat4(\n 0.0, 0.0, 0.0, 0.0, // opacity - strokeOpacity - strokeWidth - empty\n 0.0, 0.0, 0.0, 0.0, // strokeR - strokeG - strokeB - strokeA\n 0.0, 0.0, 0.0, 0.0, // offsets[0] - offsets[1]\n 0.0, 0.0, 0.0, 0.0 // distance_ratio/distance/pixelLen/texV\n );\n\n float rowCount = u_cellTypeLayout[0][0]; // \u5F53\u524D\u7684\u6570\u636E\u7EB9\u7406\u6709\u51E0\u884C\n float columnCount = u_cellTypeLayout[0][1]; // \u5F53\u770B\u5230\u6570\u636E\u7EB9\u7406\u6709\u51E0\u5217\n float columnWidth = 1.0/columnCount; // \u5217\u5BBD\n float rowHeight = 1.0/rowCount; // \u884C\u9AD8\n float cellCount = calCellCount(); // opacity - strokeOpacity - strokeWidth - stroke - offsets\n float id = a_vertexId; // \u7B2Cn\u4E2A\u9876\u70B9\n float cellCurrentRow = floor(id * cellCount / columnCount) + 1.0; // \u8D77\u59CB\u70B9\u5728\u7B2C\u51E0\u884C\n float cellCurrentColumn = mod(id * cellCount, columnCount) + 1.0; // \u8D77\u59CB\u70B9\u5728\u7B2C\u51E0\u5217\n \n // cell \u56FA\u5B9A\u987A\u5E8F opacity -> strokeOpacity -> strokeWidth -> stroke ... \n // \u6309\u987A\u5E8F\u4ECE cell \u4E2D\u53D6\u503C\u3001\u82E5\u6CA1\u6709\u5219\u81EA\u52A8\u5F80\u4E0B\u53D6\u503C\n float textureOffset = 0.0; // \u5728 cell \u4E2D\u53D6\u503C\u7684\u504F\u79FB\u91CF\n\n vec2 opacityAndOffset = calOpacityAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);\n styleMappingMat[0][0] = opacityAndOffset.r;\n textureOffset = opacityAndOffset.g;\n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\n\n 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 d_texPixelLen = project_float_pixel(u_icon_step);\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {\n d_texPixelLen *= 10.0;\n }\n\n v_color = a_Color;\n\n vec3 size = a_Miter * setPickingSize(a_Size.x) * reverse_offset_normal(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 if(u_arrow > 0.0) {\n // \u8BA1\u7B97\u7BAD\u5934\n offset = calculateArrow(offset);\n\n if(a_DistanceAndIndex.y > 4.0) {\n offset *= mix(1.0, u_tailWidth, currentLinePointRatio);\n }\n }\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 // \u8BBE\u7F6E\u6570\u636E\u96C6\u7684\u53C2\u6570\n styleMappingMat[3][0] = currentLinePointRatio; // \u5F53\u524D\u70B9\u4F4D\u8DDD\u79BB\u5360\u7EBF\u603B\u957F\u7684\u6BD4\u4F8B\n styleMappingMat[3][1] = lineDistance; // \u5F53\u524D\u9876\u70B9\u7684\u8DDD\u79BB\n styleMappingMat[3][2] = d_texPixelLen; // \u8D34\u56FE\u7684\u50CF\u7D20\u957F\u5EA6\uFF0C\u6839\u636E\u5730\u56FE\u5C42\u7EA7\u7F29\u653E\n styleMappingMat[3][3] = texV; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C\n\n vec4 project_pos = project_position(vec4(a_Position.xy, 0, 1.0));\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 if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n lineHeight *= 0.2; // \u4FDD\u6301\u548C amap/mapbox \u4E00\u81F4\u7684\u6548\u679C\n h *= 0.2;\n if(u_heightfixed < 1.0) {\n lineHeight = project_pixel(a_Size.y);\n }\n gl_Position = u_Mvp * (vec4(project_pos.xy + offset, lineHeight + h + u_raisingHeight, 1.0));\n } else {\n // mapbox - amap\n \n // \u517C\u5BB9 mapbox \u5728\u7EBF\u9AD8\u5EA6\u4E0A\u7684\u6548\u679C\u8868\u73B0\u57FA\u672C\u4E00\u81F4\n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\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 } else {\n // amap\n h += u_raisingHeight;\n // lineHeight \u9876\u70B9\u504F\u79FB\u9AD8\u5EA6\n if(u_heightfixed < 1.0) {\n lineHeight *= pow(2.0, 20.0 - u_Zoom);\n }\n }\n\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, lineHeight + h, 1.0));\n }\n\n setPickingColor(a_PickingColor);\n}\n"; // other function shaders
|
|
31
|
-
|
|
32
|
-
/* babel-plugin-inline-import '../shaders/linear/line_linear_frag.glsl' */
|
|
33
|
-
var linear_line_frag = "varying vec4 v_color;\nuniform float u_linearDir: 1.0;\nuniform float u_linearColor: 0;\nuniform vec4 u_sourceColor;\nuniform vec4 u_targetColor;\n\n#pragma include \"picking\"\n\n\nvarying mat4 styleMappingMat;\n\nvoid main() {\n float opacity = styleMappingMat[0][0];\n float linearRadio = styleMappingMat[3][0]; // \u5F53\u524D\u70B9\u4F4D\u8DDD\u79BB\u5360\u7EBF\u603B\u957F\u7684\u6BD4\u4F8B\n if(u_linearDir < 1.0) {\n linearRadio = styleMappingMat[3][3];\n }\n\n if(u_linearColor == 1.0) { // \u4F7F\u7528\u6E10\u53D8\u989C\u8272\n gl_FragColor = mix(u_sourceColor, u_targetColor, linearRadio);\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 gl_FragColor = filterColor(gl_FragColor);\n}\n";
|
|
34
|
-
var lineStyleObj = {
|
|
35
|
-
solid: 0.0,
|
|
36
|
-
dash: 1.0
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
var LineModel = /*#__PURE__*/function (_BaseModel) {
|
|
40
|
-
_inherits(LineModel, _BaseModel);
|
|
41
|
-
|
|
42
|
-
var _super = _createSuper(LineModel);
|
|
43
|
-
|
|
44
|
-
function LineModel() {
|
|
45
|
-
var _this;
|
|
46
|
-
|
|
47
|
-
_classCallCheck(this, LineModel);
|
|
48
|
-
|
|
49
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
50
|
-
args[_key] = arguments[_key];
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
54
|
-
|
|
55
|
-
_defineProperty(_assertThisInitialized(_this), "updateTexture", function () {
|
|
56
|
-
var createTexture2D = _this.rendererService.createTexture2D;
|
|
57
|
-
|
|
58
|
-
if (_this.texture) {
|
|
59
|
-
_this.texture.update({
|
|
60
|
-
data: _this.iconService.getCanvas()
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
_this.layer.render();
|
|
64
|
-
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
_this.texture = createTexture2D({
|
|
69
|
-
data: _this.iconService.getCanvas(),
|
|
70
|
-
mag: gl.NEAREST,
|
|
71
|
-
min: gl.NEAREST,
|
|
72
|
-
premultiplyAlpha: false,
|
|
73
|
-
width: 1024,
|
|
74
|
-
height: _this.iconService.canvasHeight || 128
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
return _this;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
_createClass(LineModel, [{
|
|
82
|
-
key: "getUninforms",
|
|
83
|
-
value: function getUninforms() {
|
|
84
|
-
var _ref = this.layer.getLayerConfig(),
|
|
85
|
-
_ref$opacity = _ref.opacity,
|
|
86
|
-
opacity = _ref$opacity === void 0 ? 1 : _ref$opacity,
|
|
87
|
-
sourceColor = _ref.sourceColor,
|
|
88
|
-
targetColor = _ref.targetColor,
|
|
89
|
-
_ref$textureBlend = _ref.textureBlend,
|
|
90
|
-
textureBlend = _ref$textureBlend === void 0 ? 'normal' : _ref$textureBlend,
|
|
91
|
-
_ref$lineType = _ref.lineType,
|
|
92
|
-
lineType = _ref$lineType === void 0 ? 'solid' : _ref$lineType,
|
|
93
|
-
_ref$dashArray = _ref.dashArray,
|
|
94
|
-
dashArray = _ref$dashArray === void 0 ? [10, 5, 0, 0] : _ref$dashArray,
|
|
95
|
-
_ref$lineTexture = _ref.lineTexture,
|
|
96
|
-
lineTexture = _ref$lineTexture === void 0 ? false : _ref$lineTexture,
|
|
97
|
-
_ref$iconStep = _ref.iconStep,
|
|
98
|
-
iconStep = _ref$iconStep === void 0 ? 100 : _ref$iconStep,
|
|
99
|
-
_ref$vertexHeightScal = _ref.vertexHeightScale,
|
|
100
|
-
vertexHeightScale = _ref$vertexHeightScal === void 0 ? 20.0 : _ref$vertexHeightScal,
|
|
101
|
-
_ref$borderWidth = _ref.borderWidth,
|
|
102
|
-
borderWidth = _ref$borderWidth === void 0 ? 0.0 : _ref$borderWidth,
|
|
103
|
-
_ref$borderColor = _ref.borderColor,
|
|
104
|
-
borderColor = _ref$borderColor === void 0 ? '#ccc' : _ref$borderColor,
|
|
105
|
-
_ref$raisingHeight = _ref.raisingHeight,
|
|
106
|
-
raisingHeight = _ref$raisingHeight === void 0 ? 0 : _ref$raisingHeight,
|
|
107
|
-
_ref$heightfixed = _ref.heightfixed,
|
|
108
|
-
heightfixed = _ref$heightfixed === void 0 ? false : _ref$heightfixed,
|
|
109
|
-
_ref$linearDir = _ref.linearDir,
|
|
110
|
-
linearDir = _ref$linearDir === void 0 ? LinearDir.VERTICAL : _ref$linearDir,
|
|
111
|
-
_ref$blur = _ref.blur,
|
|
112
|
-
blur = _ref$blur === void 0 ? [1, 1, 1] : _ref$blur,
|
|
113
|
-
_ref$arrow = _ref.arrow,
|
|
114
|
-
arrow = _ref$arrow === void 0 ? {
|
|
115
|
-
enable: false,
|
|
116
|
-
arrowWidth: 2,
|
|
117
|
-
arrowHeight: 3,
|
|
118
|
-
tailWidth: 1
|
|
119
|
-
} : _ref$arrow;
|
|
120
|
-
|
|
121
|
-
if (dashArray.length === 2) {
|
|
122
|
-
dashArray.push(0, 0);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
if (this.rendererService.getDirty()) {
|
|
126
|
-
this.texture.bind();
|
|
127
|
-
} // 转化渐变色
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
var useLinearColor = 0; // 默认不生效
|
|
131
|
-
|
|
132
|
-
var sourceColorArr = [0, 0, 0, 0];
|
|
133
|
-
var targetColorArr = [0, 0, 0, 0];
|
|
134
|
-
|
|
135
|
-
if (sourceColor && targetColor) {
|
|
136
|
-
sourceColorArr = rgb2arr(sourceColor);
|
|
137
|
-
targetColorArr = rgb2arr(targetColor);
|
|
138
|
-
useLinearColor = 1;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
if (this.dataTextureTest && this.dataTextureNeedUpdate({
|
|
142
|
-
opacity: opacity
|
|
143
|
-
})) {
|
|
144
|
-
this.judgeStyleAttributes({
|
|
145
|
-
opacity: opacity
|
|
146
|
-
});
|
|
147
|
-
var encodeData = this.layer.getEncodedData();
|
|
148
|
-
|
|
149
|
-
var _this$calDataFrame = this.calDataFrame(this.cellLength, encodeData, this.cellProperties),
|
|
150
|
-
data = _this$calDataFrame.data,
|
|
151
|
-
width = _this$calDataFrame.width,
|
|
152
|
-
height = _this$calDataFrame.height;
|
|
153
|
-
|
|
154
|
-
this.rowCount = height; // 当前数据纹理有多少行
|
|
155
|
-
|
|
156
|
-
this.dataTexture = this.cellLength > 0 && data.length > 0 ? this.createTexture2D({
|
|
157
|
-
flipY: true,
|
|
158
|
-
data: data,
|
|
159
|
-
format: gl.LUMINANCE,
|
|
160
|
-
type: gl.FLOAT,
|
|
161
|
-
width: width,
|
|
162
|
-
height: height
|
|
163
|
-
}) : this.createTexture2D({
|
|
164
|
-
flipY: true,
|
|
165
|
-
data: [1],
|
|
166
|
-
format: gl.LUMINANCE,
|
|
167
|
-
type: gl.FLOAT,
|
|
168
|
-
width: 1,
|
|
169
|
-
height: 1
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
return {
|
|
174
|
-
u_dataTexture: this.dataTexture,
|
|
175
|
-
// 数据纹理 - 有数据映射的时候纹理中带数据,若没有任何数据映射时纹理是 [1]
|
|
176
|
-
u_cellTypeLayout: this.getCellTypeLayout(),
|
|
177
|
-
u_opacity: isNumber(opacity) ? opacity : 1.0,
|
|
178
|
-
u_textureBlend: textureBlend === TextureBlend.NORMAL ? 0.0 : 1.0,
|
|
179
|
-
u_line_type: lineStyleObj[lineType],
|
|
180
|
-
u_dash_array: dashArray,
|
|
181
|
-
u_blur: blur,
|
|
182
|
-
// 纹理支持参数
|
|
183
|
-
u_texture: this.texture,
|
|
184
|
-
// 贴图
|
|
185
|
-
u_line_texture: lineTexture ? 1.0 : 0.0,
|
|
186
|
-
// 传入线的标识
|
|
187
|
-
u_icon_step: iconStep,
|
|
188
|
-
u_textSize: [1024, this.iconService.canvasHeight || 128],
|
|
189
|
-
// line border 参数
|
|
190
|
-
u_borderWidth: borderWidth,
|
|
191
|
-
u_borderColor: rgb2arr(borderColor),
|
|
192
|
-
// 渐变色支持参数
|
|
193
|
-
u_linearDir: linearDir === LinearDir.VERTICAL ? 1.0 : 0.0,
|
|
194
|
-
u_linearColor: useLinearColor,
|
|
195
|
-
u_sourceColor: sourceColorArr,
|
|
196
|
-
u_targetColor: targetColorArr,
|
|
197
|
-
// 是否固定高度
|
|
198
|
-
u_heightfixed: Number(heightfixed),
|
|
199
|
-
// 顶点高度 scale
|
|
200
|
-
u_vertexScale: vertexHeightScale,
|
|
201
|
-
u_raisingHeight: Number(raisingHeight),
|
|
202
|
-
// arrow
|
|
203
|
-
u_arrow: Number(arrow.enable),
|
|
204
|
-
u_arrowHeight: arrow.arrowHeight || 3,
|
|
205
|
-
u_arrowWidth: arrow.arrowWidth || 2,
|
|
206
|
-
u_tailWidth: arrow.tailWidth === undefined ? 1 : arrow.tailWidth
|
|
207
|
-
};
|
|
208
|
-
}
|
|
209
|
-
}, {
|
|
210
|
-
key: "getAnimateUniforms",
|
|
211
|
-
value: function getAnimateUniforms() {
|
|
212
|
-
var _ref2 = this.layer.getLayerConfig(),
|
|
213
|
-
animateOption = _ref2.animateOption;
|
|
214
|
-
|
|
215
|
-
return {
|
|
216
|
-
u_animate: this.animateOption2Array(animateOption),
|
|
217
|
-
u_time: this.layer.getLayerAnimateTime()
|
|
218
|
-
};
|
|
219
|
-
}
|
|
220
|
-
}, {
|
|
221
|
-
key: "initModels",
|
|
222
|
-
value: function initModels(callbackModel) {
|
|
223
|
-
this.updateTexture();
|
|
224
|
-
this.iconService.on('imageUpdate', this.updateTexture);
|
|
225
|
-
this.buildModels(callbackModel);
|
|
226
|
-
}
|
|
227
|
-
}, {
|
|
228
|
-
key: "clearModels",
|
|
229
|
-
value: function clearModels() {
|
|
230
|
-
var _this$texture, _this$dataTexture;
|
|
231
|
-
|
|
232
|
-
(_this$texture = this.texture) === null || _this$texture === void 0 ? void 0 : _this$texture.destroy();
|
|
233
|
-
(_this$dataTexture = this.dataTexture) === null || _this$dataTexture === void 0 ? void 0 : _this$dataTexture.destroy();
|
|
234
|
-
this.iconService.off('imageUpdate', this.updateTexture);
|
|
235
|
-
}
|
|
236
|
-
}, {
|
|
237
|
-
key: "buildModels",
|
|
238
|
-
value: function buildModels(callbackModel) {
|
|
239
|
-
var _ref3 = this.layer.getLayerConfig(),
|
|
240
|
-
_ref3$mask = _ref3.mask,
|
|
241
|
-
mask = _ref3$mask === void 0 ? false : _ref3$mask,
|
|
242
|
-
_ref3$maskInside = _ref3.maskInside,
|
|
243
|
-
maskInside = _ref3$maskInside === void 0 ? true : _ref3$maskInside,
|
|
244
|
-
_ref3$depth = _ref3.depth,
|
|
245
|
-
depth = _ref3$depth === void 0 ? false : _ref3$depth,
|
|
246
|
-
_ref3$workerEnabled = _ref3.workerEnabled,
|
|
247
|
-
workerEnabled = _ref3$workerEnabled === void 0 ? false : _ref3$workerEnabled,
|
|
248
|
-
enablePicking = _ref3.enablePicking;
|
|
249
|
-
|
|
250
|
-
var _this$getShaders = this.getShaders(),
|
|
251
|
-
frag = _this$getShaders.frag,
|
|
252
|
-
vert = _this$getShaders.vert,
|
|
253
|
-
type = _this$getShaders.type; // console.log(frag)
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
this.layer.triangulation = LineTriangulation;
|
|
257
|
-
this.layer.buildLayerModel({
|
|
258
|
-
moduleName: 'line' + type,
|
|
259
|
-
vertexShader: vert,
|
|
260
|
-
fragmentShader: frag,
|
|
261
|
-
triangulation: LineTriangulation,
|
|
262
|
-
depth: {
|
|
263
|
-
enable: depth
|
|
264
|
-
},
|
|
265
|
-
blend: this.getBlend(),
|
|
266
|
-
stencil: getMask(mask, maskInside),
|
|
267
|
-
workerEnabled: workerEnabled,
|
|
268
|
-
workerOptions: {
|
|
269
|
-
modelType: 'line' + type,
|
|
270
|
-
enablePicking: enablePicking,
|
|
271
|
-
iconMap: this.iconService.getIconMap()
|
|
272
|
-
}
|
|
273
|
-
}).then(function (model) {
|
|
274
|
-
callbackModel([model]);
|
|
275
|
-
}).catch(function (err) {
|
|
276
|
-
console.warn(err);
|
|
277
|
-
callbackModel([]);
|
|
278
|
-
});
|
|
279
|
-
}
|
|
280
|
-
/**
|
|
281
|
-
* 根据参数获取不同的 shader 代码
|
|
282
|
-
* @returns
|
|
283
|
-
*/
|
|
284
|
-
|
|
285
|
-
}, {
|
|
286
|
-
key: "getShaders",
|
|
287
|
-
value: function getShaders() {
|
|
288
|
-
var _ref4 = this.layer.getLayerConfig(),
|
|
289
|
-
sourceColor = _ref4.sourceColor,
|
|
290
|
-
targetColor = _ref4.targetColor,
|
|
291
|
-
lineType = _ref4.lineType;
|
|
292
|
-
|
|
293
|
-
if (lineType === 'dash') {
|
|
294
|
-
return {
|
|
295
|
-
frag: line_dash_frag,
|
|
296
|
-
vert: line_dash_vert,
|
|
297
|
-
type: 'Dash'
|
|
298
|
-
};
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
if (sourceColor && targetColor) {
|
|
302
|
-
// 分离 linear 功能
|
|
303
|
-
return {
|
|
304
|
-
frag: linear_line_frag,
|
|
305
|
-
vert: line_vert,
|
|
306
|
-
type: 'Linear'
|
|
307
|
-
};
|
|
308
|
-
} else {
|
|
309
|
-
return {
|
|
310
|
-
frag: line_frag,
|
|
311
|
-
vert: line_vert,
|
|
312
|
-
type: ''
|
|
313
|
-
};
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
}, {
|
|
317
|
-
key: "registerBuiltinAttributes",
|
|
318
|
-
value: function registerBuiltinAttributes() {
|
|
319
|
-
var _this2 = this;
|
|
320
|
-
|
|
321
|
-
this.styleAttributeService.registerStyleAttribute({
|
|
322
|
-
name: 'distanceAndIndex',
|
|
323
|
-
type: AttributeType.Attribute,
|
|
324
|
-
descriptor: {
|
|
325
|
-
name: 'a_DistanceAndIndex',
|
|
326
|
-
buffer: {
|
|
327
|
-
// give the WebGL driver a hint that this buffer may change
|
|
328
|
-
usage: gl.STATIC_DRAW,
|
|
329
|
-
data: [],
|
|
330
|
-
type: gl.FLOAT
|
|
331
|
-
},
|
|
332
|
-
size: 2,
|
|
333
|
-
update: function update(feature, featureIdx, vertex, attributeIdx, normal, vertexIndex) {
|
|
334
|
-
return vertexIndex === undefined ? [vertex[3], 10] : [vertex[3], vertexIndex];
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
});
|
|
338
|
-
this.styleAttributeService.registerStyleAttribute({
|
|
339
|
-
name: 'total_distance',
|
|
340
|
-
type: AttributeType.Attribute,
|
|
341
|
-
descriptor: {
|
|
342
|
-
name: 'a_Total_Distance',
|
|
343
|
-
buffer: {
|
|
344
|
-
// give the WebGL driver a hint that this buffer may change
|
|
345
|
-
usage: gl.STATIC_DRAW,
|
|
346
|
-
data: [],
|
|
347
|
-
type: gl.FLOAT
|
|
348
|
-
},
|
|
349
|
-
size: 1,
|
|
350
|
-
update: function update(feature, featureIdx, vertex) {
|
|
351
|
-
return [vertex[5]];
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
});
|
|
355
|
-
this.styleAttributeService.registerStyleAttribute({
|
|
356
|
-
name: 'size',
|
|
357
|
-
type: AttributeType.Attribute,
|
|
358
|
-
descriptor: {
|
|
359
|
-
name: 'a_Size',
|
|
360
|
-
buffer: {
|
|
361
|
-
// give the WebGL driver a hint that this buffer may change
|
|
362
|
-
usage: gl.DYNAMIC_DRAW,
|
|
363
|
-
data: [],
|
|
364
|
-
type: gl.FLOAT
|
|
365
|
-
},
|
|
366
|
-
size: 2,
|
|
367
|
-
update: function update(feature) {
|
|
368
|
-
var _feature$size = feature.size,
|
|
369
|
-
size = _feature$size === void 0 ? 1 : _feature$size;
|
|
370
|
-
return Array.isArray(size) ? [size[0], size[1]] : [size, 0];
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
}); // point layer size;
|
|
374
|
-
|
|
375
|
-
this.styleAttributeService.registerStyleAttribute({
|
|
376
|
-
name: 'normal',
|
|
377
|
-
type: AttributeType.Attribute,
|
|
378
|
-
descriptor: {
|
|
379
|
-
name: 'a_Normal',
|
|
380
|
-
buffer: {
|
|
381
|
-
// give the WebGL driver a hint that this buffer may change
|
|
382
|
-
usage: gl.STATIC_DRAW,
|
|
383
|
-
data: [],
|
|
384
|
-
type: gl.FLOAT
|
|
385
|
-
},
|
|
386
|
-
size: 3,
|
|
387
|
-
update: function update(feature, featureIdx, vertex, attributeIdx, normal) {
|
|
388
|
-
return normal;
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
});
|
|
392
|
-
this.styleAttributeService.registerStyleAttribute({
|
|
393
|
-
name: 'miter',
|
|
394
|
-
type: AttributeType.Attribute,
|
|
395
|
-
descriptor: {
|
|
396
|
-
name: 'a_Miter',
|
|
397
|
-
buffer: {
|
|
398
|
-
// give the WebGL driver a hint that this buffer may change
|
|
399
|
-
usage: gl.STATIC_DRAW,
|
|
400
|
-
data: [],
|
|
401
|
-
type: gl.FLOAT
|
|
402
|
-
},
|
|
403
|
-
size: 1,
|
|
404
|
-
update: function update(feature, featureIdx, vertex) {
|
|
405
|
-
return [vertex[4]];
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
});
|
|
409
|
-
this.styleAttributeService.registerStyleAttribute({
|
|
410
|
-
name: 'uv',
|
|
411
|
-
type: AttributeType.Attribute,
|
|
412
|
-
descriptor: {
|
|
413
|
-
name: 'a_iconMapUV',
|
|
414
|
-
buffer: {
|
|
415
|
-
// give the WebGL driver a hint that this buffer may change
|
|
416
|
-
usage: gl.DYNAMIC_DRAW,
|
|
417
|
-
data: [],
|
|
418
|
-
type: gl.FLOAT
|
|
419
|
-
},
|
|
420
|
-
size: 2,
|
|
421
|
-
update: function update(feature) {
|
|
422
|
-
var iconMap = _this2.iconService.getIconMap();
|
|
423
|
-
|
|
424
|
-
var texture = feature.texture;
|
|
425
|
-
|
|
426
|
-
var _ref5 = iconMap[texture] || {
|
|
427
|
-
x: 0,
|
|
428
|
-
y: 0
|
|
429
|
-
},
|
|
430
|
-
x = _ref5.x,
|
|
431
|
-
y = _ref5.y;
|
|
432
|
-
|
|
433
|
-
return [x, y];
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
});
|
|
437
|
-
}
|
|
438
|
-
}]);
|
|
439
|
-
|
|
440
|
-
return LineModel;
|
|
441
|
-
}(BaseModel);
|
|
442
|
-
|
|
443
|
-
export { LineModel as default };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { IModel, IModelUniform, ITexture2D } from '@antv/l7-core';
|
|
2
|
-
import BaseModel from '../../core/BaseModel';
|
|
3
|
-
export default class LinearLineModel extends BaseModel {
|
|
4
|
-
protected colorTexture: ITexture2D;
|
|
5
|
-
getUninforms(): IModelUniform;
|
|
6
|
-
initModels(callbackModel: (models: IModel[]) => void): void;
|
|
7
|
-
clearModels(): void;
|
|
8
|
-
buildModels(callbackModel: (models: IModel[]) => void): void;
|
|
9
|
-
protected registerBuiltinAttributes(): void;
|
|
10
|
-
private updateTexture;
|
|
11
|
-
}
|