@antv/l7-layers 2.9.24 → 2.9.26-alpha.0
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 -19
- package/es/Geometry/index.js +0 -106
- package/es/Geometry/models/billboard.d.ts +0 -26
- package/es/Geometry/models/billboard.js +0 -232
- 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 -421
- package/es/Geometry/models/sprite.d.ts +0 -47
- package/es/Geometry/models/sprite.js +0 -304
- 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 -19
- package/es/canvas/index.js +0 -91
- 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 -88
- package/es/citybuliding/models/build.d.ts +0 -22
- package/es/citybuliding/models/build.js +0 -188
- 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 -208
- package/es/core/BaseLayer.js +0 -1409
- package/es/core/BaseModel.d.ts +0 -140
- package/es/core/BaseModel.js +0 -486
- package/es/core/interface.d.ts +0 -201
- 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 -122
- package/es/core/triangulation.js +0 -491
- package/es/earth/index.d.ts +0 -17
- package/es/earth/index.js +0 -91
- package/es/earth/models/atmosphere.d.ts +0 -9
- package/es/earth/models/atmosphere.js +0 -138
- package/es/earth/models/base.d.ts +0 -16
- package/es/earth/models/base.js +0 -212
- package/es/earth/models/bloomsphere.d.ts +0 -9
- package/es/earth/models/bloomsphere.js +0 -138
- 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 -145
- package/es/heatmap/models/grid.d.ts +0 -8
- package/es/heatmap/models/grid.js +0 -108
- package/es/heatmap/models/grid3d.d.ts +0 -8
- package/es/heatmap/models/grid3d.js +0 -147
- package/es/heatmap/models/heatmap.d.ts +0 -24
- package/es/heatmap/models/heatmap.js +0 -464
- package/es/heatmap/models/hexagon.d.ts +0 -8
- package/es/heatmap/models/hexagon.js +0 -111
- 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 -38
- package/es/image/index.d.ts +0 -19
- package/es/image/index.js +0 -103
- package/es/image/models/dataImage.d.ts +0 -22
- package/es/image/models/dataImage.js +0 -225
- package/es/image/models/image.d.ts +0 -19
- package/es/image/models/image.js +0 -169
- package/es/image/models/index.d.ts +0 -5
- package/es/image/models/index.js +0 -7
- 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 -16
- package/es/index.js +0 -106
- package/es/line/index.d.ts +0 -25
- package/es/line/index.js +0 -119
- 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 -335
- package/es/line/models/earthArc_3d.d.ts +0 -17
- package/es/line/models/earthArc_3d.js +0 -338
- 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 -282
- 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 -442
- package/es/line/models/linearline.d.ts +0 -11
- package/es/line/models/linearline.js +0 -276
- package/es/line/models/simpleLine.d.ts +0 -14
- package/es/line/models/simpleLine.js +0 -233
- package/es/line/models/tile.d.ts +0 -11
- package/es/line/models/tile.js +0 -351
- package/es/line/models/wall.d.ts +0 -12
- package/es/line/models/wall.js +0 -329
- 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 -148
- 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 -207
- package/es/line/shaders/line_arc_frag.glsl +0 -89
- package/es/line/shaders/line_arc_great_circle_frag.glsl +0 -101
- package/es/line/shaders/line_arc_great_circle_vert.glsl +0 -215
- package/es/line/shaders/line_arc_vert.glsl +0 -176
- package/es/line/shaders/line_bezier_vert.glsl +0 -85
- package/es/line/shaders/line_frag.glsl +0 -100
- package/es/line/shaders/line_vert.glsl +0 -192
- package/es/line/shaders/linear/arc3d_linear_frag.glsl +0 -47
- package/es/line/shaders/linear/arc3d_linear_vert.glsl +0 -207
- 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_frag.glsl +0 -79
- package/es/line/shaders/tile/line_tile_vert.glsl +0 -210
- package/es/line/shaders/wall_frag.glsl +0 -93
- package/es/line/shaders/wall_vert.glsl +0 -111
- package/es/mask/index.d.ts +0 -18
- package/es/mask/index.js +0 -82
- package/es/mask/models/fill.d.ts +0 -11
- package/es/mask/models/fill.js +0 -121
- package/es/mask/models/index.d.ts +0 -5
- package/es/mask/models/index.js +0 -5
- package/es/mask/shaders/mask_frag.glsl +0 -7
- package/es/mask/shaders/mask_vert.glsl +0 -22
- package/es/plugins/DataMappingPlugin.d.ts +0 -18
- package/es/plugins/DataMappingPlugin.js +0 -345
- package/es/plugins/DataSourcePlugin.d.ts +0 -7
- package/es/plugins/DataSourcePlugin.js +0 -89
- package/es/plugins/FeatureScalePlugin.d.ts +0 -25
- package/es/plugins/FeatureScalePlugin.js +0 -325
- package/es/plugins/LayerAnimateStylePlugin.d.ts +0 -7
- package/es/plugins/LayerAnimateStylePlugin.js +0 -49
- package/es/plugins/LayerModelPlugin.d.ts +0 -10
- package/es/plugins/LayerModelPlugin.js +0 -71
- 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 -110
- package/es/plugins/MultiPassRendererPlugin.d.ts +0 -24
- package/es/plugins/MultiPassRendererPlugin.js +0 -77
- package/es/plugins/PixelPickingPlugin.d.ts +0 -8
- package/es/plugins/PixelPickingPlugin.js +0 -146
- package/es/plugins/RegisterStyleAttributePlugin.d.ts +0 -11
- package/es/plugins/RegisterStyleAttributePlugin.js +0 -105
- 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 -87
- package/es/point/index.d.ts +0 -30
- package/es/point/index.js +0 -222
- package/es/point/models/earthExtrude.d.ts +0 -24
- package/es/point/models/earthExtrude.js +0 -279
- 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 -298
- package/es/point/models/fill.d.ts +0 -40
- package/es/point/models/fill.js +0 -404
- package/es/point/models/fillmage.d.ts +0 -25
- package/es/point/models/fillmage.js +0 -367
- 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 -28
- package/es/point/models/normal.d.ts +0 -17
- package/es/point/models/normal.js +0 -177
- package/es/point/models/radar.d.ts +0 -24
- package/es/point/models/radar.js +0 -297
- package/es/point/models/simplePoint.d.ts +0 -17
- package/es/point/models/simplePoint.js +0 -188
- package/es/point/models/text.d.ts +0 -57
- package/es/point/models/text.js +0 -622
- package/es/point/models/tile.d.ts +0 -22
- package/es/point/models/tile.js +0 -309
- 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 -126
- 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 -189
- 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 -15
- package/es/point/shaders/normal_vert.glsl +0 -79
- package/es/point/shaders/radar/radar_frag.glsl +0 -64
- package/es/point/shaders/radar/radar_vert.glsl +0 -120
- 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 -83
- package/es/point/shaders/tile/fill_tile_vert.glsl +0 -181
- package/es/point/shape/extrude.d.ts +0 -15
- package/es/point/shape/extrude.js +0 -63
- package/es/polygon/index.d.ts +0 -19
- package/es/polygon/index.js +0 -145
- package/es/polygon/models/extrude.d.ts +0 -28
- package/es/polygon/models/extrude.js +0 -306
- package/es/polygon/models/fill.d.ts +0 -17
- package/es/polygon/models/fill.js +0 -211
- 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 -23
- package/es/polygon/models/ocean.js +0 -236
- package/es/polygon/models/tile.d.ts +0 -15
- package/es/polygon/models/tile.js +0 -133
- package/es/polygon/models/water.d.ts +0 -18
- package/es/polygon/models/water.js +0 -213
- 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_frag.glsl +0 -12
- package/es/polygon/shaders/tile/polygon_tile_vert.glsl +0 -82
- package/es/polygon/shaders/water/polygon_ocean_frag.glsl +0 -248
- package/es/polygon/shaders/water/polygon_ocean_vert.glsl +0 -52
- package/es/polygon/shaders/water/polygon_water_frag.glsl +0 -73
- package/es/polygon/shaders/water/polygon_water_vert.glsl +0 -55
- package/es/raster/buffers/triangulation.d.ts +0 -6
- package/es/raster/buffers/triangulation.js +0 -28
- package/es/raster/index.d.ts +0 -19
- package/es/raster/index.js +0 -104
- 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 -167
- package/es/raster/raster.d.ts +0 -30
- package/es/raster/raster.js +0 -174
- package/es/raster/shaders/raster_2d_frag.glsl +0 -28
- package/es/raster/shaders/raster_2d_vert.glsl +0 -18
- package/es/raster/shaders/raster_frag.glsl +0 -9
- package/es/raster/shaders/raster_vert.glsl +0 -44
- package/es/tile/interface.d.ts +0 -28
- package/es/tile/interface.js +0 -1
- 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 -36
- package/es/tile/manager/tileLayerManager.js +0 -311
- package/es/tile/manager/tilePickerManager.d.ts +0 -21
- package/es/tile/manager/tilePickerManager.js +0 -190
- package/es/tile/models/tileModel.d.ts +0 -8
- package/es/tile/models/tileModel.js +0 -62
- package/es/tile/tileFactory/base.d.ts +0 -44
- package/es/tile/tileFactory/base.js +0 -444
- package/es/tile/tileFactory/index.d.ts +0 -5
- package/es/tile/tileFactory/index.js +0 -29
- package/es/tile/tileFactory/line.d.ts +0 -12
- package/es/tile/tileFactory/line.js +0 -59
- package/es/tile/tileFactory/point.d.ts +0 -12
- package/es/tile/tileFactory/point.js +0 -59
- package/es/tile/tileFactory/polygon.d.ts +0 -12
- package/es/tile/tileFactory/polygon.js +0 -59
- package/es/tile/tileFactory/raster.d.ts +0 -12
- package/es/tile/tileFactory/raster.js +0 -55
- package/es/tile/tileFactory/rasterData.d.ts +0 -12
- package/es/tile/tileFactory/rasterData.js +0 -80
- package/es/tile/tileFactory/rasterDataLayer.d.ts +0 -19
- package/es/tile/tileFactory/rasterDataLayer.js +0 -87
- package/es/tile/tileFactory/vectorLayer.d.ts +0 -29
- package/es/tile/tileFactory/vectorLayer.js +0 -161
- package/es/tile/tileLayer/baseTileLayer.d.ts +0 -47
- package/es/tile/tileLayer/baseTileLayer.js +0 -438
- package/es/tile/tmsTileLayer.d.ts +0 -7
- package/es/tile/tmsTileLayer.js +0 -101
- package/es/tile/utils.d.ts +0 -11
- package/es/tile/utils.js +0 -127
- 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 -147
- 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 -100
- 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 -82
- package/lib/Geometry/models/billboard.js +0 -195
- package/lib/Geometry/models/index.js +0 -38
- package/lib/Geometry/models/plane.js +0 -307
- package/lib/Geometry/models/sprite.js +0 -216
- 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 -69
- package/lib/canvas/models/canvas.js +0 -154
- package/lib/canvas/models/index.js +0 -34
- package/lib/citybuliding/building.js +0 -66
- package/lib/citybuliding/models/build.js +0 -157
- package/lib/citybuliding/shaders/build_frag.glsl +0 -117
- package/lib/citybuliding/shaders/build_vert.glsl +0 -54
- package/lib/core/BaseLayer.js +0 -891
- package/lib/core/BaseModel.js +0 -325
- package/lib/core/interface.js +0 -54
- package/lib/core/schema.js +0 -51
- package/lib/core/shape/Path.js +0 -100
- package/lib/core/shape/extrude.js +0 -139
- package/lib/core/triangulation.js +0 -373
- package/lib/earth/index.js +0 -69
- package/lib/earth/models/atmosphere.js +0 -118
- package/lib/earth/models/base.js +0 -162
- package/lib/earth/models/bloomsphere.js +0 -118
- 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 -116
- package/lib/heatmap/index.js +0 -101
- package/lib/heatmap/models/grid.js +0 -95
- package/lib/heatmap/models/grid3d.js +0 -129
- package/lib/heatmap/models/heatmap.js +0 -350
- package/lib/heatmap/models/hexagon.js +0 -96
- package/lib/heatmap/models/index.js +0 -41
- 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 -61
- package/lib/image/index.js +0 -79
- package/lib/image/models/dataImage.js +0 -182
- package/lib/image/models/image.js +0 -136
- package/lib/image/models/index.js +0 -36
- 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 -100
- package/lib/line/index.js +0 -88
- package/lib/line/models/arc.js +0 -258
- package/lib/line/models/arc_3d.js +0 -247
- package/lib/line/models/earthArc_3d.js +0 -248
- package/lib/line/models/great_circle.js +0 -219
- package/lib/line/models/half.js +0 -214
- package/lib/line/models/index.js +0 -54
- package/lib/line/models/line.js +0 -330
- package/lib/line/models/linearline.js +0 -219
- package/lib/line/models/simpleLine.js +0 -184
- package/lib/line/models/tile.js +0 -257
- package/lib/line/models/wall.js +0 -253
- 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 -148
- 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 -207
- package/lib/line/shaders/line_arc_frag.glsl +0 -89
- package/lib/line/shaders/line_arc_great_circle_frag.glsl +0 -101
- package/lib/line/shaders/line_arc_great_circle_vert.glsl +0 -215
- package/lib/line/shaders/line_arc_vert.glsl +0 -176
- package/lib/line/shaders/line_bezier_vert.glsl +0 -85
- package/lib/line/shaders/line_frag.glsl +0 -100
- package/lib/line/shaders/line_vert.glsl +0 -192
- package/lib/line/shaders/linear/arc3d_linear_frag.glsl +0 -47
- package/lib/line/shaders/linear/arc3d_linear_vert.glsl +0 -207
- 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_frag.glsl +0 -79
- package/lib/line/shaders/tile/line_tile_vert.glsl +0 -210
- package/lib/line/shaders/wall_frag.glsl +0 -93
- package/lib/line/shaders/wall_vert.glsl +0 -111
- package/lib/mask/index.js +0 -62
- package/lib/mask/models/fill.js +0 -85
- package/lib/mask/models/index.js +0 -34
- package/lib/mask/shaders/mask_frag.glsl +0 -7
- package/lib/mask/shaders/mask_vert.glsl +0 -22
- package/lib/plugins/DataMappingPlugin.js +0 -242
- package/lib/plugins/DataSourcePlugin.js +0 -93
- package/lib/plugins/FeatureScalePlugin.js +0 -259
- package/lib/plugins/LayerAnimateStylePlugin.js +0 -58
- package/lib/plugins/LayerModelPlugin.js +0 -75
- package/lib/plugins/LayerStylePlugin.js +0 -53
- package/lib/plugins/LightingPlugin.js +0 -113
- package/lib/plugins/MultiPassRendererPlugin.js +0 -67
- package/lib/plugins/PixelPickingPlugin.js +0 -118
- package/lib/plugins/RegisterStyleAttributePlugin.js +0 -117
- package/lib/plugins/ShaderUniformPlugin.js +0 -101
- package/lib/plugins/UpdateModelPlugin.js +0 -49
- package/lib/plugins/UpdateStyleAttributePlugin.js +0 -80
- package/lib/point/index.js +0 -160
- package/lib/point/models/earthExtrude.js +0 -217
- package/lib/point/models/earthFill.js +0 -208
- package/lib/point/models/extrude.js +0 -219
- package/lib/point/models/fill.js +0 -289
- package/lib/point/models/fillmage.js +0 -274
- package/lib/point/models/image.js +0 -182
- package/lib/point/models/index.js +0 -56
- package/lib/point/models/normal.js +0 -145
- package/lib/point/models/radar.js +0 -221
- package/lib/point/models/simplePoint.js +0 -153
- package/lib/point/models/text.js +0 -414
- package/lib/point/models/tile.js +0 -234
- 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 -126
- 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 -189
- 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 -15
- package/lib/point/shaders/normal_vert.glsl +0 -79
- package/lib/point/shaders/radar/radar_frag.glsl +0 -64
- package/lib/point/shaders/radar/radar_vert.glsl +0 -120
- 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 -83
- package/lib/point/shaders/tile/fill_tile_vert.glsl +0 -181
- package/lib/point/shape/extrude.js +0 -74
- package/lib/polygon/index.js +0 -108
- package/lib/polygon/models/extrude.js +0 -234
- package/lib/polygon/models/fill.js +0 -164
- package/lib/polygon/models/index.js +0 -56
- package/lib/polygon/models/ocean.js +0 -181
- package/lib/polygon/models/tile.js +0 -103
- package/lib/polygon/models/water.js +0 -160
- 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_frag.glsl +0 -12
- package/lib/polygon/shaders/tile/polygon_tile_vert.glsl +0 -82
- package/lib/polygon/shaders/water/polygon_ocean_frag.glsl +0 -248
- package/lib/polygon/shaders/water/polygon_ocean_vert.glsl +0 -52
- package/lib/polygon/shaders/water/polygon_water_frag.glsl +0 -73
- package/lib/polygon/shaders/water/polygon_water_vert.glsl +0 -55
- package/lib/raster/buffers/triangulation.js +0 -51
- package/lib/raster/index.js +0 -78
- package/lib/raster/models/index.js +0 -37
- package/lib/raster/models/raster.js +0 -139
- package/lib/raster/raster.js +0 -136
- package/lib/raster/shaders/raster_2d_frag.glsl +0 -28
- package/lib/raster/shaders/raster_2d_vert.glsl +0 -18
- package/lib/raster/shaders/raster_frag.glsl +0 -9
- package/lib/raster/shaders/raster_vert.glsl +0 -44
- package/lib/tile/interface.js +0 -17
- package/lib/tile/manager/tileConfigManager.js +0 -94
- package/lib/tile/manager/tileLayerManager.js +0 -245
- package/lib/tile/manager/tilePickerManager.js +0 -132
- package/lib/tile/models/tileModel.js +0 -55
- package/lib/tile/tileFactory/base.js +0 -343
- package/lib/tile/tileFactory/index.js +0 -57
- package/lib/tile/tileFactory/line.js +0 -55
- package/lib/tile/tileFactory/point.js +0 -55
- package/lib/tile/tileFactory/polygon.js +0 -55
- package/lib/tile/tileFactory/raster.js +0 -56
- package/lib/tile/tileFactory/rasterData.js +0 -81
- package/lib/tile/tileFactory/rasterDataLayer.js +0 -65
- package/lib/tile/tileFactory/vectorLayer.js +0 -117
- package/lib/tile/tileLayer/baseTileLayer.js +0 -248
- package/lib/tile/tmsTileLayer.js +0 -74
- package/lib/tile/utils.js +0 -132
- package/lib/utils/blend.js +0 -85
- package/lib/utils/collision-index.js +0 -75
- package/lib/utils/dataMappingStyle.js +0 -106
- package/lib/utils/extrude_polyline.js +0 -451
- package/lib/utils/grid-index.js +0 -136
- package/lib/utils/layerData.js +0 -156
- package/lib/utils/multiPassRender.js +0 -53
- package/lib/utils/polylineNormal.js +0 -178
- package/lib/utils/simpleLine.js +0 -101
- package/lib/utils/symbol-layout.js +0 -205
- package/lib/utils/updateShape.js +0 -53
- package/lib/wind/index.js +0 -75
- package/lib/wind/models/index.js +0 -34
- package/lib/wind/models/utils.js +0 -214
- package/lib/wind/models/wind.js +0 -237
- package/lib/wind/models/windRender.js +0 -262
- package/lib/wind/models/windShader.js +0 -183
- package/lib/wind/shaders/wind_frag.glsl +0 -9
- package/lib/wind/shaders/wind_vert.glsl +0 -17
package/lib/utils/layerData.js
DELETED
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
-
|
|
22
|
-
// src/utils/layerData.ts
|
|
23
|
-
var layerData_exports = {};
|
|
24
|
-
__export(layerData_exports, {
|
|
25
|
-
calculateData: () => calculateData
|
|
26
|
-
});
|
|
27
|
-
module.exports = __toCommonJS(layerData_exports);
|
|
28
|
-
var import_l7_maps = require("@antv/l7-maps");
|
|
29
|
-
var import_l7_source = __toESM(require("@antv/l7-source"));
|
|
30
|
-
var import_l7_utils = require("@antv/l7-utils");
|
|
31
|
-
function getArrowPoints(p1, p2) {
|
|
32
|
-
const dir = [p2[0] - p1[0], p2[1] - p1[1]];
|
|
33
|
-
const normalizeDir = (0, import_l7_utils.normalize)(dir);
|
|
34
|
-
const arrowPoint = [
|
|
35
|
-
p1[0] + normalizeDir[0] * 1e-4,
|
|
36
|
-
p1[1] + normalizeDir[1] * 1e-4
|
|
37
|
-
];
|
|
38
|
-
return arrowPoint;
|
|
39
|
-
}
|
|
40
|
-
function adjustData2Amap2Coordinates(mappedData, mapService) {
|
|
41
|
-
if (mappedData.length > 0 && mapService.version === import_l7_maps.Version["GAODE2.x"]) {
|
|
42
|
-
if (typeof mappedData[0].coordinates[0] === "number") {
|
|
43
|
-
mappedData.filter((d) => !d.originCoordinates).map((d) => {
|
|
44
|
-
d.version = import_l7_maps.Version["GAODE2.x"];
|
|
45
|
-
d.originCoordinates = cloneDeep(d.coordinates);
|
|
46
|
-
d.coordinates = this.mapService.lngLatToCoord(d.coordinates);
|
|
47
|
-
});
|
|
48
|
-
} else {
|
|
49
|
-
mappedData.filter((d) => !d.originCoordinates).map((d) => {
|
|
50
|
-
d.version = import_l7_maps.Version["GAODE2.x"];
|
|
51
|
-
d.originCoordinates = cloneDeep(d.coordinates);
|
|
52
|
-
d.coordinates = this.mapService.lngLatToCoords(d.coordinates);
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
function adjustData2SimpleCoordinates(mappedData, mapService) {
|
|
58
|
-
if (mappedData.length > 0 && mapService.version === import_l7_maps.Version.SIMPLE) {
|
|
59
|
-
mappedData.map((d) => {
|
|
60
|
-
if (!d.simpleCoordinate) {
|
|
61
|
-
d.coordinates = unProjectCoordinates(d.coordinates, mapService);
|
|
62
|
-
d.simpleCoordinate = true;
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
function unProjectCoordinates(coordinates, mapService) {
|
|
68
|
-
if (typeof coordinates[0] === "number") {
|
|
69
|
-
return mapService.simpleMapCoord.unproject(coordinates);
|
|
70
|
-
}
|
|
71
|
-
if (coordinates[0] && coordinates[0][0] instanceof Array) {
|
|
72
|
-
const coords = [];
|
|
73
|
-
coordinates.map((coord) => {
|
|
74
|
-
const c1 = [];
|
|
75
|
-
coord.map((co) => {
|
|
76
|
-
c1.push(mapService.simpleMapCoord.unproject(co));
|
|
77
|
-
});
|
|
78
|
-
coords.push(c1);
|
|
79
|
-
});
|
|
80
|
-
return coords;
|
|
81
|
-
} else {
|
|
82
|
-
const coords = [];
|
|
83
|
-
coordinates.map((coord) => {
|
|
84
|
-
coords.push(mapService.simpleMapCoord.unproject(coord));
|
|
85
|
-
});
|
|
86
|
-
return coords;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
function applyAttributeMapping(attribute, record, minimumColor) {
|
|
90
|
-
var _a;
|
|
91
|
-
if (!attribute.scale) {
|
|
92
|
-
return [];
|
|
93
|
-
}
|
|
94
|
-
const scalers = ((_a = attribute == null ? void 0 : attribute.scale) == null ? void 0 : _a.scalers) || [];
|
|
95
|
-
const params = [];
|
|
96
|
-
scalers.forEach(({ field }) => {
|
|
97
|
-
var _a2;
|
|
98
|
-
if (record.hasOwnProperty(field) || ((_a2 = attribute.scale) == null ? void 0 : _a2.type) === "variable") {
|
|
99
|
-
params.push(record[field]);
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
const mappingResult = attribute.mapping ? attribute.mapping(params) : [];
|
|
103
|
-
if (attribute.name === "color" && !(0, import_l7_utils.isColor)(mappingResult[0])) {
|
|
104
|
-
return [minimumColor];
|
|
105
|
-
}
|
|
106
|
-
return mappingResult;
|
|
107
|
-
}
|
|
108
|
-
function mapping(attributes, data, fontService, mapService, minimumColor, layer) {
|
|
109
|
-
const {
|
|
110
|
-
arrow = {
|
|
111
|
-
enable: false
|
|
112
|
-
}
|
|
113
|
-
} = layer == null ? void 0 : layer.getLayerConfig();
|
|
114
|
-
const mappedData = data.map((record) => {
|
|
115
|
-
const encodeRecord = {
|
|
116
|
-
id: record._id,
|
|
117
|
-
coordinates: record.coordinates
|
|
118
|
-
};
|
|
119
|
-
attributes.filter((attribute) => attribute.scale !== void 0).forEach((attribute) => {
|
|
120
|
-
let values = applyAttributeMapping(attribute, record, minimumColor);
|
|
121
|
-
attribute.needRemapping = false;
|
|
122
|
-
if (attribute.name === "color") {
|
|
123
|
-
values = values.map((c) => {
|
|
124
|
-
return (0, import_l7_utils.rgb2arr)(c);
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
encodeRecord[attribute.name] = Array.isArray(values) && values.length === 1 ? values[0] : values;
|
|
128
|
-
if (attribute.name === "shape") {
|
|
129
|
-
encodeRecord.shape = fontService.getIconFontKey(encodeRecord[attribute.name]);
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
|
-
if (encodeRecord.shape === "line" && arrow.enable) {
|
|
133
|
-
const coords = encodeRecord.coordinates;
|
|
134
|
-
const arrowPoint = getArrowPoints(coords[0], coords[1]);
|
|
135
|
-
encodeRecord.coordinates.splice(1, 0, arrowPoint, arrowPoint);
|
|
136
|
-
}
|
|
137
|
-
return encodeRecord;
|
|
138
|
-
});
|
|
139
|
-
adjustData2Amap2Coordinates(mappedData, mapService);
|
|
140
|
-
adjustData2SimpleCoordinates(mappedData, mapService);
|
|
141
|
-
return mappedData;
|
|
142
|
-
}
|
|
143
|
-
function calculateData(layer, fontService, mapService, styleAttributeService, data, options) {
|
|
144
|
-
const source = new import_l7_source.default(data, options);
|
|
145
|
-
const bottomColor = layer.getBottomColor();
|
|
146
|
-
const attributes = styleAttributeService.getLayerStyleAttributes() || [];
|
|
147
|
-
const { dataArray } = source.data;
|
|
148
|
-
const filterData = dataArray;
|
|
149
|
-
const mappedEncodeData = mapping(attributes, filterData, fontService, mapService, bottomColor, layer);
|
|
150
|
-
source.destroy();
|
|
151
|
-
return mappedEncodeData;
|
|
152
|
-
}
|
|
153
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
154
|
-
0 && (module.exports = {
|
|
155
|
-
calculateData
|
|
156
|
-
});
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
|
|
19
|
-
// src/utils/multiPassRender.ts
|
|
20
|
-
var multiPassRender_exports = {};
|
|
21
|
-
__export(multiPassRender_exports, {
|
|
22
|
-
createMultiPassRenderer: () => createMultiPassRenderer,
|
|
23
|
-
normalizePasses: () => normalizePasses
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(multiPassRender_exports);
|
|
26
|
-
function normalizePasses(passes) {
|
|
27
|
-
return passes.map((pass) => {
|
|
28
|
-
if (typeof pass === "string") {
|
|
29
|
-
pass = [pass, {}];
|
|
30
|
-
}
|
|
31
|
-
return pass;
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
function createMultiPassRenderer(layer, passes, postProcessingPassFactory, normalPassFactory) {
|
|
35
|
-
const multiPassRenderer = layer.multiPassRenderer;
|
|
36
|
-
const { enablePicking, enableTAA } = layer.getLayerConfig();
|
|
37
|
-
if (enableTAA) {
|
|
38
|
-
multiPassRenderer.add(normalPassFactory("taa"));
|
|
39
|
-
} else {
|
|
40
|
-
multiPassRenderer.add(normalPassFactory("render"));
|
|
41
|
-
}
|
|
42
|
-
normalizePasses(passes).forEach((pass) => {
|
|
43
|
-
const [passName, initializationOptions] = pass;
|
|
44
|
-
multiPassRenderer.add(postProcessingPassFactory(passName), initializationOptions);
|
|
45
|
-
});
|
|
46
|
-
multiPassRenderer.add(postProcessingPassFactory("copy"));
|
|
47
|
-
return multiPassRenderer;
|
|
48
|
-
}
|
|
49
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
50
|
-
0 && (module.exports = {
|
|
51
|
-
createMultiPassRenderer,
|
|
52
|
-
normalizePasses
|
|
53
|
-
});
|
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
|
|
19
|
-
// src/utils/polylineNormal.ts
|
|
20
|
-
var polylineNormal_exports = {};
|
|
21
|
-
__export(polylineNormal_exports, {
|
|
22
|
-
computeMiter: () => computeMiter,
|
|
23
|
-
computeNormal: () => computeNormal,
|
|
24
|
-
default: () => polylineNormal_default,
|
|
25
|
-
direction: () => direction
|
|
26
|
-
});
|
|
27
|
-
module.exports = __toCommonJS(polylineNormal_exports);
|
|
28
|
-
var import_l7_utils = require("@antv/l7-utils");
|
|
29
|
-
var import_gl_matrix = require("gl-matrix");
|
|
30
|
-
function computeMiter(tangent, miter, lineA, lineB, halfThick) {
|
|
31
|
-
import_gl_matrix.vec2.add(tangent, lineA, lineB);
|
|
32
|
-
import_gl_matrix.vec2.normalize(tangent, tangent);
|
|
33
|
-
miter = import_gl_matrix.vec2.fromValues(-tangent[1], tangent[0]);
|
|
34
|
-
const tmp = import_gl_matrix.vec2.fromValues(-lineA[1], lineA[0]);
|
|
35
|
-
return halfThick / import_gl_matrix.vec2.dot(miter, tmp);
|
|
36
|
-
}
|
|
37
|
-
function computeNormal(out, dir) {
|
|
38
|
-
return import_gl_matrix.vec2.set(out, -dir[1], dir[0]);
|
|
39
|
-
}
|
|
40
|
-
function direction(out, a, b) {
|
|
41
|
-
import_gl_matrix.vec2.sub(out, a, b);
|
|
42
|
-
import_gl_matrix.vec2.normalize(out, out);
|
|
43
|
-
return out;
|
|
44
|
-
}
|
|
45
|
-
function extrusions(positions, out, miters, point, normal, scale) {
|
|
46
|
-
addNext(out, miters, normal, -scale);
|
|
47
|
-
addNext(out, miters, normal, scale);
|
|
48
|
-
positions.push(point[0], point[1], 0);
|
|
49
|
-
positions.push(point[0], point[1], 0);
|
|
50
|
-
}
|
|
51
|
-
function addNext(out, miters, normal, length) {
|
|
52
|
-
out.push(normal[0], normal[1], 0);
|
|
53
|
-
miters.push(length);
|
|
54
|
-
}
|
|
55
|
-
function lineSegmentDistance(b1, a1) {
|
|
56
|
-
const dx = a1[0] - b1[0];
|
|
57
|
-
const dy = a1[1] - b1[1];
|
|
58
|
-
return Math.sqrt(dx * dx + dy * dy);
|
|
59
|
-
}
|
|
60
|
-
function isPointEqual(a, b) {
|
|
61
|
-
return a[0] === b[0] && a[1] === b[1];
|
|
62
|
-
}
|
|
63
|
-
function polylineNormal_default(points, closed, indexOffset, isDash = true) {
|
|
64
|
-
const lineA = import_gl_matrix.vec2.fromValues(0, 0);
|
|
65
|
-
const lineB = import_gl_matrix.vec2.fromValues(0, 0);
|
|
66
|
-
const tangent = import_gl_matrix.vec2.fromValues(0, 0);
|
|
67
|
-
const miter = import_gl_matrix.vec2.create();
|
|
68
|
-
let started = false;
|
|
69
|
-
let lineNormal = null;
|
|
70
|
-
const tmp = import_gl_matrix.vec2.create();
|
|
71
|
-
let count = indexOffset || 0;
|
|
72
|
-
const miterLimit = 4;
|
|
73
|
-
const out = [];
|
|
74
|
-
const attrPos = [];
|
|
75
|
-
const attrIndex = [];
|
|
76
|
-
const miters = [];
|
|
77
|
-
const attrDistance = [0, 0];
|
|
78
|
-
if (closed) {
|
|
79
|
-
points = points.slice();
|
|
80
|
-
points.push(points[0]);
|
|
81
|
-
}
|
|
82
|
-
const total = points.length;
|
|
83
|
-
for (let i = 1; i < total; i++) {
|
|
84
|
-
const index = count;
|
|
85
|
-
const last = import_gl_matrix.vec2.fromValues(points[i - 1][0], points[i - 1][1]);
|
|
86
|
-
const cur = import_gl_matrix.vec2.fromValues(points[i][0], points[i][1]);
|
|
87
|
-
let next = i < points.length - 1 ? import_gl_matrix.vec2.fromValues(points[i + 1][0], points[i + 1][1]) : null;
|
|
88
|
-
if (isPointEqual(last, cur)) {
|
|
89
|
-
continue;
|
|
90
|
-
}
|
|
91
|
-
if (next) {
|
|
92
|
-
let nextIndex = i + 1;
|
|
93
|
-
while (next && isPointEqual(cur, next)) {
|
|
94
|
-
next = nextIndex < points.length - 1 ? import_gl_matrix.vec2.fromValues(points[++nextIndex][0], points[nextIndex][1]) : null;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
let d = 0;
|
|
98
|
-
const flatCur = (0, import_l7_utils.aProjectFlat)([cur[0], cur[1]]);
|
|
99
|
-
const flatLast = (0, import_l7_utils.aProjectFlat)([last[0], last[1]]);
|
|
100
|
-
if (isDash) {
|
|
101
|
-
const lineDistance = lineSegmentDistance(flatCur, flatLast);
|
|
102
|
-
d = lineDistance + attrDistance[attrDistance.length - 1];
|
|
103
|
-
}
|
|
104
|
-
direction(lineA, flatCur, flatLast);
|
|
105
|
-
if (!lineNormal) {
|
|
106
|
-
lineNormal = import_gl_matrix.vec2.create();
|
|
107
|
-
computeNormal(lineNormal, lineA);
|
|
108
|
-
}
|
|
109
|
-
if (!started) {
|
|
110
|
-
started = true;
|
|
111
|
-
extrusions(attrPos, out, miters, last, lineNormal, 1);
|
|
112
|
-
}
|
|
113
|
-
attrIndex.push(index + 0, index + 2, index + 1);
|
|
114
|
-
if (!next) {
|
|
115
|
-
computeNormal(lineNormal, lineA);
|
|
116
|
-
extrusions(attrPos, out, miters, cur, lineNormal, 1);
|
|
117
|
-
attrDistance.push(d, d);
|
|
118
|
-
attrIndex.push(index + 1, index + 2, index + 3);
|
|
119
|
-
count += 2;
|
|
120
|
-
} else {
|
|
121
|
-
const flatNext = (0, import_l7_utils.aProjectFlat)([next[0], next[1]]);
|
|
122
|
-
direction(lineB, flatNext, flatCur);
|
|
123
|
-
let miterLen = computeMiter(tangent, import_gl_matrix.vec2.fromValues(miter[0], miter[1]), lineA, lineB, 1);
|
|
124
|
-
const flip = import_gl_matrix.vec2.dot(tangent, lineNormal) < 0 ? -1 : 1;
|
|
125
|
-
const bevel = Math.abs(miterLen) > miterLimit;
|
|
126
|
-
if (Math.abs(miterLen) > 1e3) {
|
|
127
|
-
extrusions(attrPos, out, miters, cur, lineNormal, 1);
|
|
128
|
-
attrIndex.push(index + 1, index + 2, index + 3);
|
|
129
|
-
attrIndex.push(index + 2, index + 4, index + 3);
|
|
130
|
-
computeNormal(tmp, lineB);
|
|
131
|
-
import_gl_matrix.vec2.copy(lineNormal, tmp);
|
|
132
|
-
extrusions(attrPos, out, miters, cur, lineNormal, 1);
|
|
133
|
-
attrDistance.push(d, d, d, d);
|
|
134
|
-
count += 4;
|
|
135
|
-
continue;
|
|
136
|
-
}
|
|
137
|
-
if (bevel) {
|
|
138
|
-
miterLen = miterLimit;
|
|
139
|
-
extrusions(attrPos, out, miters, cur, lineNormal, 1);
|
|
140
|
-
attrIndex.push(index + 1, index + 2, index + 3);
|
|
141
|
-
attrIndex.push(...flip === 1 ? [index + 2, index + 4, index + 5] : [index + 4, index + 5, index + 3]);
|
|
142
|
-
computeNormal(tmp, lineB);
|
|
143
|
-
import_gl_matrix.vec2.copy(lineNormal, tmp);
|
|
144
|
-
extrusions(attrPos, out, miters, cur, lineNormal, 1);
|
|
145
|
-
attrDistance.push(d, d, d, d);
|
|
146
|
-
count += 4;
|
|
147
|
-
} else {
|
|
148
|
-
extrusions(attrPos, out, miters, cur, lineNormal, 1);
|
|
149
|
-
attrIndex.push(index + 1, index + 2, index + 3);
|
|
150
|
-
addNext(out, miters, lineNormal, miterLen * -flip);
|
|
151
|
-
attrPos.push(cur[0], cur[1], 0);
|
|
152
|
-
attrIndex.push(index + 2, index + 4, index + 3);
|
|
153
|
-
attrIndex.push(index + 4, index + 5, index + 6);
|
|
154
|
-
computeNormal(tmp, lineB);
|
|
155
|
-
import_gl_matrix.vec2.copy(lineNormal, tmp);
|
|
156
|
-
extrusions(attrPos, out, miters, cur, lineNormal, 1);
|
|
157
|
-
attrDistance.push(d, d, d, d, d);
|
|
158
|
-
count += 5;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
const pickData = [];
|
|
163
|
-
for (let i = 0; i < miters.length; i++) {
|
|
164
|
-
const totalDistance = attrDistance[attrDistance.length - 1];
|
|
165
|
-
pickData.push(attrPos[i * 3], attrPos[i * 3 + 1], attrPos[i * 3 + 2], attrDistance[i], miters[i], totalDistance);
|
|
166
|
-
}
|
|
167
|
-
return {
|
|
168
|
-
normals: out,
|
|
169
|
-
attrIndex,
|
|
170
|
-
attrPos: pickData
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
174
|
-
0 && (module.exports = {
|
|
175
|
-
computeMiter,
|
|
176
|
-
computeNormal,
|
|
177
|
-
direction
|
|
178
|
-
});
|
package/lib/utils/simpleLine.js
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
|
|
19
|
-
// src/utils/simpleLine.ts
|
|
20
|
-
var simpleLine_exports = {};
|
|
21
|
-
__export(simpleLine_exports, {
|
|
22
|
-
default: () => ExtrudePolyline,
|
|
23
|
-
direction: () => direction
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(simpleLine_exports);
|
|
26
|
-
var import_l7_utils = require("@antv/l7-utils");
|
|
27
|
-
var import_gl_matrix = require("gl-matrix");
|
|
28
|
-
var lineA = import_gl_matrix.vec2.create();
|
|
29
|
-
function direction(out, a, b) {
|
|
30
|
-
import_gl_matrix.vec2.sub(out, a, b);
|
|
31
|
-
import_gl_matrix.vec2.normalize(out, out);
|
|
32
|
-
return out;
|
|
33
|
-
}
|
|
34
|
-
var ExtrudePolyline = class {
|
|
35
|
-
constructor() {
|
|
36
|
-
this.started = false;
|
|
37
|
-
this.totalDistance = 0;
|
|
38
|
-
this.currentIndex = 0;
|
|
39
|
-
this.complex = {
|
|
40
|
-
positions: [],
|
|
41
|
-
indices: [],
|
|
42
|
-
startIndex: 0,
|
|
43
|
-
indexes: []
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
simpleExtrude(points) {
|
|
47
|
-
const complex = this.complex;
|
|
48
|
-
if (points.length <= 1) {
|
|
49
|
-
return complex;
|
|
50
|
-
}
|
|
51
|
-
this.started = false;
|
|
52
|
-
this.totalDistance = 0;
|
|
53
|
-
const total = points.length;
|
|
54
|
-
let count = complex.startIndex;
|
|
55
|
-
for (let i = 1; i < total; i++) {
|
|
56
|
-
const last = points[i - 1];
|
|
57
|
-
const cur = points[i];
|
|
58
|
-
const amt = this.simpleSegment(complex, count, last, cur);
|
|
59
|
-
count += amt;
|
|
60
|
-
}
|
|
61
|
-
for (let i = 0; i < complex.positions.length / 6; i++) {
|
|
62
|
-
complex.positions[i * 6 + 5] = this.totalDistance;
|
|
63
|
-
}
|
|
64
|
-
return complex;
|
|
65
|
-
}
|
|
66
|
-
simpleSegment(complex, index, last, cur) {
|
|
67
|
-
let count = 0;
|
|
68
|
-
const indices = complex.indices;
|
|
69
|
-
const positions = complex.positions;
|
|
70
|
-
const flatCur = (0, import_l7_utils.aProjectFlat)([cur[0], cur[1]]);
|
|
71
|
-
const flatLast = (0, import_l7_utils.aProjectFlat)([last[0], last[1]]);
|
|
72
|
-
direction(lineA, flatCur, flatLast);
|
|
73
|
-
const segmentDistance = this.lineSegmentDistance(flatCur, flatLast);
|
|
74
|
-
this.totalDistance += segmentDistance;
|
|
75
|
-
if (!this.started) {
|
|
76
|
-
this.started = true;
|
|
77
|
-
this.extrusions(positions, last, this.totalDistance - segmentDistance);
|
|
78
|
-
}
|
|
79
|
-
this.extrusions(positions, cur, this.totalDistance);
|
|
80
|
-
indices.push(index + 0, index + 1, index + 2);
|
|
81
|
-
indices.push(index + 2, index + 1, index + 3);
|
|
82
|
-
count += 2;
|
|
83
|
-
return count;
|
|
84
|
-
}
|
|
85
|
-
extrusions(positions, point, distanceRadio) {
|
|
86
|
-
positions.push(point[0], point[1], point[2] | 0, distanceRadio, 0, point[2] | 0);
|
|
87
|
-
this.complex.indexes.push(this.currentIndex);
|
|
88
|
-
positions.push(point[0], point[1], point[2] | 0, distanceRadio, 0, point[2] | 0);
|
|
89
|
-
this.complex.indexes.push(this.currentIndex);
|
|
90
|
-
this.currentIndex++;
|
|
91
|
-
}
|
|
92
|
-
lineSegmentDistance(b1, a1) {
|
|
93
|
-
const dx = a1[0] - b1[0];
|
|
94
|
-
const dy = a1[1] - b1[1];
|
|
95
|
-
return Math.sqrt(dx * dx + dy * dy);
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
99
|
-
0 && (module.exports = {
|
|
100
|
-
direction
|
|
101
|
-
});
|
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
|
|
19
|
-
// src/utils/symbol-layout.ts
|
|
20
|
-
var symbol_layout_exports = {};
|
|
21
|
-
__export(symbol_layout_exports, {
|
|
22
|
-
getGlyphQuads: () => getGlyphQuads,
|
|
23
|
-
shapeText: () => shapeText
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(symbol_layout_exports);
|
|
26
|
-
function getAnchorAlignment(anchor) {
|
|
27
|
-
let horizontalAlign = 0.5;
|
|
28
|
-
let verticalAlign = 0.5;
|
|
29
|
-
switch (anchor) {
|
|
30
|
-
case "right":
|
|
31
|
-
case "top-right":
|
|
32
|
-
case "bottom-right":
|
|
33
|
-
horizontalAlign = 1;
|
|
34
|
-
break;
|
|
35
|
-
case "left":
|
|
36
|
-
case "top-left":
|
|
37
|
-
case "bottom-left":
|
|
38
|
-
horizontalAlign = 0;
|
|
39
|
-
break;
|
|
40
|
-
default:
|
|
41
|
-
horizontalAlign = 0.5;
|
|
42
|
-
}
|
|
43
|
-
switch (anchor) {
|
|
44
|
-
case "bottom":
|
|
45
|
-
case "bottom-right":
|
|
46
|
-
case "bottom-left":
|
|
47
|
-
verticalAlign = 1;
|
|
48
|
-
break;
|
|
49
|
-
case "top":
|
|
50
|
-
case "top-right":
|
|
51
|
-
case "top-left":
|
|
52
|
-
verticalAlign = 0;
|
|
53
|
-
break;
|
|
54
|
-
default:
|
|
55
|
-
verticalAlign = 0.5;
|
|
56
|
-
}
|
|
57
|
-
return { horizontalAlign, verticalAlign };
|
|
58
|
-
}
|
|
59
|
-
function justifyLine(positionedGlyphs, glyphMap, start, end, justify) {
|
|
60
|
-
if (!justify) {
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
const lastPositionedGlyph = positionedGlyphs[end];
|
|
64
|
-
const glyph = lastPositionedGlyph.glyph;
|
|
65
|
-
if (glyph) {
|
|
66
|
-
const lastAdvance = glyphMap[glyph].advance * lastPositionedGlyph.scale;
|
|
67
|
-
const lineIndent = (positionedGlyphs[end].x + lastAdvance) * justify;
|
|
68
|
-
for (let j = start; j <= end; j++) {
|
|
69
|
-
positionedGlyphs[j].x -= lineIndent;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
function align(positionedGlyphs, justify, horizontalAlign, verticalAlign, maxLineLength, lineHeight, lineCount) {
|
|
74
|
-
const shiftX = (justify - horizontalAlign) * maxLineLength;
|
|
75
|
-
const shiftY = (-verticalAlign * lineCount + 0.5) * lineHeight;
|
|
76
|
-
for (const glyphs of positionedGlyphs) {
|
|
77
|
-
glyphs.x += shiftX;
|
|
78
|
-
glyphs.y += shiftY;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
function shapeLines(shaping, glyphMap, lines, lineHeight, textAnchor, textJustify, spacing) {
|
|
82
|
-
const yOffset = -8;
|
|
83
|
-
let x = 0;
|
|
84
|
-
let y = yOffset;
|
|
85
|
-
let maxLineLength = 0;
|
|
86
|
-
const positionedGlyphs = shaping.positionedGlyphs;
|
|
87
|
-
const justify = textJustify === "right" ? 1 : textJustify === "left" ? 0 : 0.5;
|
|
88
|
-
const lineStartIndex = positionedGlyphs.length;
|
|
89
|
-
lines.forEach((line) => {
|
|
90
|
-
line.split("").forEach((char) => {
|
|
91
|
-
const glyph = glyphMap[char];
|
|
92
|
-
const baselineOffset = 0;
|
|
93
|
-
if (glyph) {
|
|
94
|
-
positionedGlyphs.push({
|
|
95
|
-
glyph: char,
|
|
96
|
-
x,
|
|
97
|
-
y: y + baselineOffset,
|
|
98
|
-
vertical: false,
|
|
99
|
-
scale: 1,
|
|
100
|
-
metrics: glyph
|
|
101
|
-
});
|
|
102
|
-
x += glyph.advance + spacing;
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
if (positionedGlyphs.length !== lineStartIndex) {
|
|
106
|
-
const lineLength = x - spacing;
|
|
107
|
-
maxLineLength = Math.max(lineLength, maxLineLength);
|
|
108
|
-
justifyLine(positionedGlyphs, glyphMap, lineStartIndex, positionedGlyphs.length - 1, justify);
|
|
109
|
-
}
|
|
110
|
-
x = 0;
|
|
111
|
-
y -= lineHeight + 5;
|
|
112
|
-
});
|
|
113
|
-
const { horizontalAlign, verticalAlign } = getAnchorAlignment(textAnchor);
|
|
114
|
-
align(positionedGlyphs, justify, horizontalAlign, verticalAlign, maxLineLength, lineHeight, lines.length);
|
|
115
|
-
const height = y - yOffset;
|
|
116
|
-
shaping.top += -verticalAlign * height;
|
|
117
|
-
shaping.bottom = shaping.top - height;
|
|
118
|
-
shaping.left += -horizontalAlign * maxLineLength;
|
|
119
|
-
shaping.right = shaping.left + maxLineLength;
|
|
120
|
-
}
|
|
121
|
-
function shapeIconFont(shaping, glyphMap, iconfonts, lineHeight, textAnchor, textJustify, spacing) {
|
|
122
|
-
const yOffset = -8;
|
|
123
|
-
let x = 0;
|
|
124
|
-
let y = yOffset;
|
|
125
|
-
let maxLineLength = 0;
|
|
126
|
-
const positionedGlyphs = shaping.positionedGlyphs;
|
|
127
|
-
const justify = textJustify === "right" ? 1 : textJustify === "left" ? 0 : 0.5;
|
|
128
|
-
const lineStartIndex = positionedGlyphs.length;
|
|
129
|
-
iconfonts.forEach((iconfont) => {
|
|
130
|
-
const glyph = glyphMap[iconfont];
|
|
131
|
-
const baselineOffset = 0;
|
|
132
|
-
if (glyph) {
|
|
133
|
-
positionedGlyphs.push({
|
|
134
|
-
glyph: iconfont,
|
|
135
|
-
x: glyph.advance / 2,
|
|
136
|
-
y: y + baselineOffset,
|
|
137
|
-
vertical: false,
|
|
138
|
-
scale: 1,
|
|
139
|
-
metrics: glyph
|
|
140
|
-
});
|
|
141
|
-
x += glyph.advance + spacing;
|
|
142
|
-
}
|
|
143
|
-
if (positionedGlyphs.length !== lineStartIndex) {
|
|
144
|
-
const lineLength = x - spacing;
|
|
145
|
-
maxLineLength = Math.max(lineLength, maxLineLength);
|
|
146
|
-
justifyLine(positionedGlyphs, glyphMap, lineStartIndex, positionedGlyphs.length - 1, justify);
|
|
147
|
-
}
|
|
148
|
-
x = 0;
|
|
149
|
-
y -= lineHeight + 5;
|
|
150
|
-
});
|
|
151
|
-
const { horizontalAlign, verticalAlign } = getAnchorAlignment(textAnchor);
|
|
152
|
-
align(positionedGlyphs, justify, horizontalAlign, verticalAlign, maxLineLength, lineHeight, iconfonts.length);
|
|
153
|
-
const height = y - yOffset;
|
|
154
|
-
shaping.top += -verticalAlign * height;
|
|
155
|
-
shaping.bottom = shaping.top - height;
|
|
156
|
-
shaping.left += -horizontalAlign * maxLineLength;
|
|
157
|
-
shaping.right = shaping.left + maxLineLength;
|
|
158
|
-
}
|
|
159
|
-
function shapeText(text, glyphs, lineHeight, textAnchor, textJustify, spacing, translate = [0, 0], isIconFont) {
|
|
160
|
-
const lines = text.split("\n");
|
|
161
|
-
const positionedGlyphs = [];
|
|
162
|
-
const shaping = {
|
|
163
|
-
positionedGlyphs,
|
|
164
|
-
top: translate[1],
|
|
165
|
-
bottom: translate[1],
|
|
166
|
-
left: translate[0],
|
|
167
|
-
right: translate[0],
|
|
168
|
-
lineCount: lines.length,
|
|
169
|
-
text
|
|
170
|
-
};
|
|
171
|
-
isIconFont ? shapeIconFont(shaping, glyphs, lines, lineHeight, textAnchor, textJustify, spacing) : shapeLines(shaping, glyphs, lines, lineHeight, textAnchor, textJustify, spacing);
|
|
172
|
-
if (!positionedGlyphs.length) {
|
|
173
|
-
return false;
|
|
174
|
-
}
|
|
175
|
-
return shaping;
|
|
176
|
-
}
|
|
177
|
-
function getGlyphQuads(shaping, textOffset = [0, 0], alongLine) {
|
|
178
|
-
const { positionedGlyphs = [] } = shaping;
|
|
179
|
-
const quads = [];
|
|
180
|
-
for (const positionedGlyph of positionedGlyphs) {
|
|
181
|
-
const rect = positionedGlyph.metrics;
|
|
182
|
-
const rectBuffer = 4;
|
|
183
|
-
const halfAdvance = rect.advance * positionedGlyph.scale / 2;
|
|
184
|
-
const glyphOffset = alongLine ? [positionedGlyph.x + halfAdvance, positionedGlyph.y] : [0, 0];
|
|
185
|
-
const builtInOffset = alongLine ? [0, 0] : [
|
|
186
|
-
positionedGlyph.x + halfAdvance + textOffset[0],
|
|
187
|
-
positionedGlyph.y + textOffset[1]
|
|
188
|
-
];
|
|
189
|
-
const x1 = (0 - rectBuffer) * positionedGlyph.scale - halfAdvance + builtInOffset[0];
|
|
190
|
-
const y1 = (0 - rectBuffer) * positionedGlyph.scale + builtInOffset[1];
|
|
191
|
-
const x2 = x1 + rect.width * positionedGlyph.scale;
|
|
192
|
-
const y2 = y1 + rect.height * positionedGlyph.scale;
|
|
193
|
-
const tl = { x: x1, y: y1 };
|
|
194
|
-
const tr = { x: x2, y: y1 };
|
|
195
|
-
const bl = { x: x1, y: y2 };
|
|
196
|
-
const br = { x: x2, y: y2 };
|
|
197
|
-
quads.push({ tl, tr, bl, br, tex: rect, glyphOffset });
|
|
198
|
-
}
|
|
199
|
-
return quads;
|
|
200
|
-
}
|
|
201
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
202
|
-
0 && (module.exports = {
|
|
203
|
-
getGlyphQuads,
|
|
204
|
-
shapeText
|
|
205
|
-
});
|