@antv/l7-layers 2.25.5 → 2.25.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +6 -6
- package/es/canvas/index.d.ts +0 -18
- package/es/canvas/index.js +0 -70
- package/es/canvas/models/canvas.d.ts +0 -23
- package/es/canvas/models/canvas.js +0 -141
- package/es/canvas/models/constants.d.ts +0 -2
- package/es/canvas/models/constants.js +0 -6
- package/es/canvas/models/index.d.ts +0 -2
- package/es/canvas/models/index.js +0 -2
- package/es/citybuilding/building.d.ts +0 -7
- package/es/citybuilding/building.js +0 -25
- package/es/citybuilding/models/build.d.ts +0 -33
- package/es/citybuilding/models/build.js +0 -160
- package/es/citybuilding/shaders/build_frag.glsl +0 -123
- package/es/citybuilding/shaders/build_vert.glsl +0 -58
- package/es/core/BaseLayer.d.ts +0 -265
- package/es/core/BaseLayer.js +0 -1310
- package/es/core/BaseModel.d.ts +0 -95
- package/es/core/BaseModel.js +0 -367
- package/es/core/CommonStyleAttribute.d.ts +0 -16
- package/es/core/CommonStyleAttribute.js +0 -114
- package/es/core/LayerPickService.d.ts +0 -12
- package/es/core/LayerPickService.js +0 -102
- package/es/core/TextureService.d.ts +0 -15
- package/es/core/TextureService.js +0 -65
- package/es/core/constant.d.ts +0 -6
- package/es/core/constant.js +0 -19
- package/es/core/interface.d.ts +0 -284
- package/es/core/interface.js +0 -32
- package/es/core/line_trangluation.d.ts +0 -19
- package/es/core/line_trangluation.js +0 -86
- package/es/core/schema.d.ts +0 -27
- package/es/core/schema.js +0 -25
- package/es/core/shape/Path.d.ts +0 -40
- package/es/core/shape/Path.js +0 -69
- package/es/core/shape/arrow.d.ts +0 -25
- package/es/core/shape/arrow.js +0 -144
- package/es/core/shape/extrude.d.ts +0 -17
- package/es/core/shape/extrude.js +0 -133
- package/es/core/triangulation.d.ts +0 -136
- package/es/core/triangulation.js +0 -601
- package/es/core/utils.d.ts +0 -5
- package/es/core/utils.js +0 -36
- package/es/earth/index.d.ts +0 -22
- package/es/earth/index.js +0 -54
- package/es/earth/models/atmosphere.d.ts +0 -30
- package/es/earth/models/atmosphere.js +0 -116
- package/es/earth/models/base.d.ts +0 -37
- package/es/earth/models/base.js +0 -172
- package/es/earth/models/bloomsphere.d.ts +0 -30
- package/es/earth/models/bloomsphere.js +0 -115
- package/es/earth/shaders/atmosphere/atmosphere_frag.glsl +0 -17
- package/es/earth/shaders/atmosphere/atmosphere_vert.glsl +0 -24
- package/es/earth/shaders/base/base_frag.glsl +0 -11
- package/es/earth/shaders/base/base_vert.glsl +0 -52
- package/es/earth/shaders/bloomshpere/bloomsphere_frag.glsl +0 -15
- package/es/earth/shaders/bloomshpere/bloomsphere_vert.glsl +0 -20
- package/es/earth/utils.d.ts +0 -26
- package/es/earth/utils.js +0 -99
- package/es/geometry/index.d.ts +0 -22
- package/es/geometry/index.js +0 -53
- package/es/geometry/models/billboard.d.ts +0 -39
- package/es/geometry/models/billboard.js +0 -175
- package/es/geometry/models/index.d.ts +0 -5
- package/es/geometry/models/index.js +0 -9
- package/es/geometry/models/plane.d.ts +0 -58
- package/es/geometry/models/plane.js +0 -308
- package/es/geometry/models/sprite.d.ts +0 -48
- package/es/geometry/models/sprite.js +0 -225
- package/es/geometry/shaders/billboard_frag.glsl +0 -18
- package/es/geometry/shaders/billboard_vert.glsl +0 -43
- package/es/geometry/shaders/plane_frag.glsl +0 -23
- package/es/geometry/shaders/plane_vert.glsl +0 -31
- package/es/geometry/shaders/sprite_frag.glsl +0 -23
- package/es/geometry/shaders/sprite_vert.glsl +0 -21
- package/es/heatmap/index.d.ts +0 -13
- package/es/heatmap/index.js +0 -87
- package/es/heatmap/models/grid.d.ts +0 -29
- package/es/heatmap/models/grid.js +0 -83
- package/es/heatmap/models/grid3d.d.ts +0 -31
- package/es/heatmap/models/grid3d.js +0 -122
- package/es/heatmap/models/heatmap.d.ts +0 -46
- package/es/heatmap/models/heatmap.js +0 -447
- package/es/heatmap/models/hexagon.d.ts +0 -29
- package/es/heatmap/models/hexagon.js +0 -83
- package/es/heatmap/models/index.d.ts +0 -5
- package/es/heatmap/models/index.js +0 -12
- package/es/heatmap/shaders/grid/grid_frag.glsl +0 -9
- package/es/heatmap/shaders/grid/grid_vert.glsl +0 -30
- package/es/heatmap/shaders/grid3d/grid_3d_frag.glsl +0 -17
- package/es/heatmap/shaders/grid3d/grid_3d_vert.glsl +0 -34
- package/es/heatmap/shaders/heatmap/heatmap_3d_frag.glsl +0 -23
- package/es/heatmap/shaders/heatmap/heatmap_3d_vert.glsl +0 -59
- package/es/heatmap/shaders/heatmap/heatmap_frag.glsl +0 -40
- package/es/heatmap/shaders/heatmap/heatmap_framebuffer_frag.glsl +0 -17
- package/es/heatmap/shaders/heatmap/heatmap_framebuffer_vert.glsl +0 -36
- package/es/heatmap/shaders/heatmap/heatmap_vert.glsl +0 -21
- package/es/heatmap/shaders/hexagon/hexagon_frag.glsl +0 -8
- package/es/heatmap/shaders/hexagon/hexagon_vert.glsl +0 -30
- package/es/heatmap/triangulation.d.ts +0 -5
- package/es/heatmap/triangulation.js +0 -33
- package/es/image/index.d.ts +0 -9
- package/es/image/index.js +0 -28
- package/es/image/models/image.d.ts +0 -31
- package/es/image/models/image.js +0 -113
- package/es/image/models/index.d.ts +0 -5
- package/es/image/models/index.js +0 -5
- package/es/image/shaders/dataImage_frag.glsl +0 -32
- package/es/image/shaders/image_frag.glsl +0 -38
- package/es/image/shaders/image_vert.glsl +0 -20
- package/es/index.d.ts +0 -18
- package/es/index.js +0 -18
- package/es/line/index.d.ts +0 -36
- package/es/line/index.js +0 -90
- package/es/line/models/arc.d.ts +0 -40
- package/es/line/models/arc.js +0 -279
- package/es/line/models/arc_3d.d.ts +0 -40
- package/es/line/models/arc_3d.js +0 -269
- package/es/line/models/flow.d.ts +0 -31
- package/es/line/models/flow.js +0 -140
- package/es/line/models/great_circle.d.ts +0 -34
- package/es/line/models/great_circle.js +0 -240
- package/es/line/models/index.d.ts +0 -5
- package/es/line/models/index.js +0 -18
- package/es/line/models/line.d.ts +0 -44
- package/es/line/models/line.js +0 -273
- package/es/line/models/simple_line.d.ts +0 -33
- package/es/line/models/simple_line.js +0 -118
- package/es/line/models/wall.d.ts +0 -34
- package/es/line/models/wall.js +0 -223
- package/es/line/shaders/arc/line_arc_frag.glsl +0 -92
- package/es/line/shaders/arc/line_arc_vert.glsl +0 -156
- package/es/line/shaders/arc3d/line_arc_3d_frag.glsl +0 -108
- package/es/line/shaders/arc3d/line_arc_3d_vert.glsl +0 -177
- package/es/line/shaders/flow/flow_line_frag.glsl +0 -13
- package/es/line/shaders/flow/flow_line_vert.glsl +0 -76
- package/es/line/shaders/greatCircle/line_arc_great_circle_frag.glsl +0 -99
- package/es/line/shaders/greatCircle/line_arc_great_circle_vert.glsl +0 -165
- package/es/line/shaders/line/line_frag.glsl +0 -122
- package/es/line/shaders/line/line_vert.glsl +0 -101
- package/es/line/shaders/simple/simpleline_frag.glsl +0 -30
- package/es/line/shaders/simple/simpleline_vert.glsl +0 -45
- package/es/line/shaders/wall/wall_frag.glsl +0 -94
- package/es/line/shaders/wall/wall_vert.glsl +0 -90
- package/es/mask/index.d.ts +0 -16
- package/es/mask/index.js +0 -21
- package/es/mask/models/fill.d.ts +0 -18
- package/es/mask/models/fill.js +0 -61
- package/es/mask/models/index.d.ts +0 -5
- package/es/mask/models/index.js +0 -5
- package/es/mask/shaders/mask_vert.glsl +0 -14
- package/es/plugins/DataMappingPlugin.d.ts +0 -12
- package/es/plugins/DataMappingPlugin.js +0 -226
- package/es/plugins/DataSourcePlugin.d.ts +0 -6
- package/es/plugins/DataSourcePlugin.js +0 -75
- package/es/plugins/FeatureScalePlugin.d.ts +0 -20
- package/es/plugins/FeatureScalePlugin.js +0 -295
- package/es/plugins/LayerAnimateStylePlugin.d.ts +0 -4
- package/es/plugins/LayerAnimateStylePlugin.js +0 -14
- package/es/plugins/LayerMaskPlugin.d.ts +0 -7
- package/es/plugins/LayerMaskPlugin.js +0 -19
- package/es/plugins/LayerModelPlugin.d.ts +0 -10
- package/es/plugins/LayerModelPlugin.js +0 -60
- package/es/plugins/LayerStylePlugin.d.ts +0 -7
- package/es/plugins/LayerStylePlugin.js +0 -18
- package/es/plugins/LightingPlugin.d.ts +0 -35
- package/es/plugins/LightingPlugin.js +0 -84
- package/es/plugins/MultiPassRendererPlugin.d.ts +0 -22
- package/es/plugins/MultiPassRendererPlugin.js +0 -52
- package/es/plugins/PixelPickingPlugin.d.ts +0 -11
- package/es/plugins/PixelPickingPlugin.js +0 -146
- package/es/plugins/RegisterStyleAttributePlugin.d.ts +0 -10
- package/es/plugins/RegisterStyleAttributePlugin.js +0 -72
- package/es/plugins/ShaderUniformPlugin.d.ts +0 -17
- package/es/plugins/ShaderUniformPlugin.js +0 -196
- package/es/plugins/UpdateModelPlugin.d.ts +0 -7
- package/es/plugins/UpdateModelPlugin.js +0 -20
- package/es/plugins/UpdateStyleAttributePlugin.d.ts +0 -9
- package/es/plugins/UpdateStyleAttributePlugin.js +0 -54
- package/es/plugins/index.d.ts +0 -15
- package/es/plugins/index.js +0 -18
- package/es/point/index.d.ts +0 -35
- package/es/point/index.js +0 -153
- package/es/point/models/billboard_point.d.ts +0 -35
- package/es/point/models/billboard_point.js +0 -95
- package/es/point/models/earthExtrude.d.ts +0 -32
- package/es/point/models/earthExtrude.js +0 -199
- package/es/point/models/earthFill.d.ts +0 -31
- package/es/point/models/earthFill.js +0 -158
- package/es/point/models/extrude.d.ts +0 -32
- package/es/point/models/extrude.js +0 -195
- package/es/point/models/fill.d.ts +0 -47
- package/es/point/models/fill.js +0 -180
- package/es/point/models/fillImage.d.ts +0 -42
- package/es/point/models/fillImage.js +0 -189
- package/es/point/models/image.d.ts +0 -48
- package/es/point/models/image.js +0 -293
- package/es/point/models/index.d.ts +0 -5
- package/es/point/models/index.js +0 -24
- package/es/point/models/normal.d.ts +0 -36
- package/es/point/models/normal.js +0 -89
- package/es/point/models/radar.d.ts +0 -37
- package/es/point/models/radar.js +0 -115
- package/es/point/models/text.d.ts +0 -85
- package/es/point/models/text.js +0 -503
- package/es/point/shaders/billboard/billboard_point_frag.glsl +0 -48
- package/es/point/shaders/billboard/billboard_point_vert.glsl +0 -33
- package/es/point/shaders/earthExtrude/earthExtrude_frag.glsl +0 -36
- package/es/point/shaders/earthExtrude/earthExtrude_vert.glsl +0 -118
- package/es/point/shaders/earthFill/earthFill_frag.glsl +0 -79
- package/es/point/shaders/earthFill/earthFill_vert.glsl +0 -46
- package/es/point/shaders/extrude/extrude_frag.glsl +0 -29
- package/es/point/shaders/extrude/extrude_vert.glsl +0 -95
- package/es/point/shaders/fill/fill_frag.glsl +0 -97
- package/es/point/shaders/fill/fill_vert.glsl +0 -79
- package/es/point/shaders/fillImage/fillImage_frag.glsl +0 -23
- package/es/point/shaders/fillImage/fillImage_vert.glsl +0 -46
- package/es/point/shaders/image/image_frag.glsl +0 -45
- package/es/point/shaders/image/image_vert.glsl +0 -47
- package/es/point/shaders/normal/normal_frag.glsl +0 -5
- package/es/point/shaders/normal/normal_vert.glsl +0 -22
- package/es/point/shaders/radar/radar_frag.glsl +0 -52
- package/es/point/shaders/radar/radar_vert.glsl +0 -53
- package/es/point/shaders/text/text_frag.glsl +0 -47
- package/es/point/shaders/text/text_vert.glsl +0 -65
- package/es/point/shape/extrude.d.ts +0 -15
- package/es/point/shape/extrude.js +0 -48
- package/es/polygon/index.d.ts +0 -18
- package/es/polygon/index.js +0 -71
- package/es/polygon/models/extrude.d.ts +0 -41
- package/es/polygon/models/extrude.js +0 -248
- package/es/polygon/models/extrusion.d.ts +0 -40
- package/es/polygon/models/extrusion.js +0 -137
- package/es/polygon/models/fill.d.ts +0 -32
- package/es/polygon/models/fill.js +0 -127
- package/es/polygon/models/index.d.ts +0 -5
- package/es/polygon/models/index.js +0 -26
- package/es/polygon/models/ocean.d.ts +0 -37
- package/es/polygon/models/ocean.js +0 -172
- package/es/polygon/models/water.d.ts +0 -35
- package/es/polygon/models/water.js +0 -150
- package/es/polygon/shaders/extrude/polygon_extrude_frag.glsl +0 -24
- package/es/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +0 -49
- package/es/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +0 -53
- package/es/polygon/shaders/extrude/polygon_extrude_vert.glsl +0 -74
- package/es/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +0 -55
- package/es/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +0 -54
- package/es/polygon/shaders/extrusion/polygon_extrusion_frag.glsl +0 -8
- package/es/polygon/shaders/extrusion/polygon_extrusion_vert.glsl +0 -24
- package/es/polygon/shaders/fill/fill_frag.glsl +0 -8
- package/es/polygon/shaders/fill/fill_linear_frag.glsl +0 -23
- package/es/polygon/shaders/fill/fill_linear_vert.glsl +0 -36
- package/es/polygon/shaders/fill/fill_vert.glsl +0 -35
- package/es/polygon/shaders/ocean/ocean_frag.glsl +0 -277
- package/es/polygon/shaders/ocean/ocean_vert.glsl +0 -21
- package/es/polygon/shaders/water/polygon_water_frag.glsl +0 -78
- package/es/polygon/shaders/water/polygon_water_vert.glsl +0 -22
- package/es/raster/buffers/triangulation.d.ts +0 -6
- package/es/raster/buffers/triangulation.js +0 -25
- package/es/raster/index.d.ts +0 -11
- package/es/raster/index.js +0 -55
- package/es/raster/models/index.d.ts +0 -5
- package/es/raster/models/index.js +0 -10
- package/es/raster/models/raster.d.ts +0 -35
- package/es/raster/models/raster.js +0 -156
- package/es/raster/models/rasterRgb.d.ts +0 -35
- package/es/raster/models/rasterRgb.js +0 -158
- package/es/raster/models/rasterTerrainRgb.d.ts +0 -30
- package/es/raster/models/rasterTerrainRgb.js +0 -118
- package/es/raster/shaders/raster/raster_2d_frag.glsl +0 -37
- package/es/raster/shaders/raster/raster_2d_vert.glsl +0 -21
- package/es/raster/shaders/rgb/raster_rgb_frag.glsl +0 -30
- package/es/raster/shaders/rgb/raster_rgb_vert.glsl +0 -21
- package/es/raster/shaders/terrain/terrain_rgb_frag.glsl +0 -40
- package/es/raster/shaders/terrain/terrain_rgb_vert.glsl +0 -19
- package/es/shader/minify_frag.glsl +0 -11
- package/es/shader/minify_picking_frag.glsl +0 -10
- package/es/tile/core/BaseLayer.d.ts +0 -50
- package/es/tile/core/BaseLayer.js +0 -256
- package/es/tile/core/TileDebugLayer.d.ts +0 -15
- package/es/tile/core/TileDebugLayer.js +0 -23
- package/es/tile/interaction/getFeatureData.d.ts +0 -0
- package/es/tile/interaction/getFeatureData.js +0 -0
- package/es/tile/interaction/getRasterData.d.ts +0 -4
- package/es/tile/interaction/getRasterData.js +0 -45
- package/es/tile/interaction/utils.d.ts +0 -11
- package/es/tile/interaction/utils.js +0 -69
- package/es/tile/interface.d.ts +0 -29
- package/es/tile/interface.js +0 -1
- package/es/tile/service/TileLayerService.d.ts +0 -58
- package/es/tile/service/TileLayerService.js +0 -195
- package/es/tile/service/TilePickService.d.ts +0 -26
- package/es/tile/service/TilePickService.js +0 -126
- package/es/tile/service/TileSourceService.d.ts +0 -7
- package/es/tile/service/TileSourceService.js +0 -26
- package/es/tile/tile/DebugTile.d.ts +0 -16
- package/es/tile/tile/DebugTile.js +0 -47
- package/es/tile/tile/ImageTile.d.ts +0 -14
- package/es/tile/tile/ImageTile.js +0 -39
- package/es/tile/tile/MaskTile.d.ts +0 -18
- package/es/tile/tile/MaskTile.js +0 -54
- package/es/tile/tile/RasterRGBTile.d.ts +0 -11
- package/es/tile/tile/RasterRGBTile.js +0 -47
- package/es/tile/tile/RasterTerrainRGBTile.d.ts +0 -14
- package/es/tile/tile/RasterTerrainRGBTile.js +0 -39
- package/es/tile/tile/RasterTile.d.ts +0 -18
- package/es/tile/tile/RasterTile.js +0 -81
- package/es/tile/tile/Tile.d.ts +0 -112
- package/es/tile/tile/Tile.js +0 -166
- package/es/tile/tile/VectorTile.d.ts +0 -26
- package/es/tile/tile/VectorTile.js +0 -87
- package/es/tile/tile/index.d.ts +0 -12
- package/es/tile/tile/index.js +0 -44
- package/es/tile/tile/util.d.ts +0 -5
- package/es/tile/tile/util.js +0 -18
- package/es/tile/utils/constants.d.ts +0 -1
- package/es/tile/utils/constants.js +0 -8
- package/es/tile/utils/utils.d.ts +0 -8
- package/es/tile/utils/utils.js +0 -11
- package/es/utils/blend.d.ts +0 -2
- package/es/utils/blend.js +0 -57
- package/es/utils/collision-index.d.ts +0 -47
- package/es/utils/collision-index.js +0 -87
- package/es/utils/extrude_polyline.d.ts +0 -53
- package/es/utils/extrude_polyline.js +0 -319
- package/es/utils/grid-index.d.ts +0 -28
- package/es/utils/grid-index.js +0 -128
- package/es/utils/identityScale.d.ts +0 -8
- package/es/utils/identityScale.js +0 -26
- package/es/utils/load-image.d.ts +0 -1
- package/es/utils/load-image.js +0 -22
- package/es/utils/multiPassRender.d.ts +0 -16
- package/es/utils/multiPassRender.js +0 -37
- package/es/utils/polylineNormal.d.ts +0 -9
- package/es/utils/polylineNormal.js +0 -182
- package/es/utils/rampcolor_legend.d.ts +0 -6
- package/es/utils/rampcolor_legend.js +0 -12
- package/es/utils/scale.d.ts +0 -87
- package/es/utils/scale.js +0 -595
- package/es/utils/simpleLine.d.ts +0 -23
- package/es/utils/simpleLine.js +0 -76
- package/es/utils/stencil.d.ts +0 -7
- package/es/utils/stencil.js +0 -49
- package/es/utils/symbol-layout.d.ts +0 -43
- package/es/utils/symbol-layout.js +0 -251
- package/es/wind/index.d.ts +0 -11
- package/es/wind/index.js +0 -34
- package/es/wind/models/index.d.ts +0 -5
- package/es/wind/models/index.js +0 -5
- package/es/wind/models/utils.d.ts +0 -19
- package/es/wind/models/utils.js +0 -213
- package/es/wind/models/wind.d.ts +0 -38
- package/es/wind/models/wind.js +0 -240
- package/es/wind/models/windRender.d.ts +0 -104
- package/es/wind/models/windRender.js +0 -333
- package/es/wind/models/windShader.d.ts +0 -12
- package/es/wind/models/windShader.js +0 -151
- package/es/wind/shaders/wind_frag.glsl +0 -9
- package/es/wind/shaders/wind_vert.glsl +0 -14
- package/lib/canvas/index.d.ts +0 -18
- package/lib/canvas/index.js +0 -79
- package/lib/canvas/models/canvas.d.ts +0 -23
- package/lib/canvas/models/canvas.js +0 -149
- package/lib/canvas/models/constants.d.ts +0 -2
- package/lib/canvas/models/constants.js +0 -12
- package/lib/canvas/models/index.d.ts +0 -2
- package/lib/canvas/models/index.js +0 -27
- package/lib/citybuilding/building.d.ts +0 -7
- package/lib/citybuilding/building.js +0 -33
- package/lib/citybuilding/models/build.d.ts +0 -33
- package/lib/citybuilding/models/build.js +0 -168
- package/lib/citybuilding/shaders/build_frag.glsl +0 -123
- package/lib/citybuilding/shaders/build_vert.glsl +0 -58
- package/lib/core/BaseLayer.d.ts +0 -265
- package/lib/core/BaseLayer.js +0 -1317
- package/lib/core/BaseModel.d.ts +0 -95
- package/lib/core/BaseModel.js +0 -375
- package/lib/core/CommonStyleAttribute.d.ts +0 -16
- package/lib/core/CommonStyleAttribute.js +0 -120
- package/lib/core/LayerPickService.d.ts +0 -12
- package/lib/core/LayerPickService.js +0 -110
- package/lib/core/TextureService.d.ts +0 -15
- package/lib/core/TextureService.js +0 -73
- package/lib/core/constant.d.ts +0 -6
- package/lib/core/constant.js +0 -25
- package/lib/core/interface.d.ts +0 -284
- package/lib/core/interface.js +0 -34
- package/lib/core/line_trangluation.d.ts +0 -19
- package/lib/core/line_trangluation.js +0 -94
- package/lib/core/schema.d.ts +0 -27
- package/lib/core/schema.js +0 -31
- package/lib/core/shape/Path.d.ts +0 -40
- package/lib/core/shape/Path.js +0 -81
- package/lib/core/shape/arrow.d.ts +0 -25
- package/lib/core/shape/arrow.js +0 -158
- package/lib/core/shape/extrude.d.ts +0 -17
- package/lib/core/shape/extrude.js +0 -142
- package/lib/core/triangulation.d.ts +0 -136
- package/lib/core/triangulation.js +0 -628
- package/lib/core/utils.d.ts +0 -5
- package/lib/core/utils.js +0 -44
- package/lib/earth/index.d.ts +0 -22
- package/lib/earth/index.js +0 -62
- package/lib/earth/models/atmosphere.d.ts +0 -30
- package/lib/earth/models/atmosphere.js +0 -124
- package/lib/earth/models/base.d.ts +0 -37
- package/lib/earth/models/base.js +0 -180
- package/lib/earth/models/bloomsphere.d.ts +0 -30
- package/lib/earth/models/bloomsphere.js +0 -123
- package/lib/earth/shaders/atmosphere/atmosphere_frag.glsl +0 -17
- package/lib/earth/shaders/atmosphere/atmosphere_vert.glsl +0 -24
- package/lib/earth/shaders/base/base_frag.glsl +0 -11
- package/lib/earth/shaders/base/base_vert.glsl +0 -52
- package/lib/earth/shaders/bloomshpere/bloomsphere_frag.glsl +0 -15
- package/lib/earth/shaders/bloomshpere/bloomsphere_vert.glsl +0 -20
- package/lib/earth/utils.d.ts +0 -26
- package/lib/earth/utils.js +0 -107
- package/lib/geometry/index.d.ts +0 -22
- package/lib/geometry/index.js +0 -61
- package/lib/geometry/models/billboard.d.ts +0 -39
- package/lib/geometry/models/billboard.js +0 -183
- package/lib/geometry/models/index.d.ts +0 -5
- package/lib/geometry/models/index.js +0 -16
- package/lib/geometry/models/plane.d.ts +0 -58
- package/lib/geometry/models/plane.js +0 -316
- package/lib/geometry/models/sprite.d.ts +0 -48
- package/lib/geometry/models/sprite.js +0 -233
- package/lib/geometry/shaders/billboard_frag.glsl +0 -18
- package/lib/geometry/shaders/billboard_vert.glsl +0 -43
- package/lib/geometry/shaders/plane_frag.glsl +0 -23
- package/lib/geometry/shaders/plane_vert.glsl +0 -31
- package/lib/geometry/shaders/sprite_frag.glsl +0 -23
- package/lib/geometry/shaders/sprite_vert.glsl +0 -21
- package/lib/heatmap/index.d.ts +0 -13
- package/lib/heatmap/index.js +0 -95
- package/lib/heatmap/models/grid.d.ts +0 -29
- package/lib/heatmap/models/grid.js +0 -91
- package/lib/heatmap/models/grid3d.d.ts +0 -31
- package/lib/heatmap/models/grid3d.js +0 -130
- package/lib/heatmap/models/heatmap.d.ts +0 -46
- package/lib/heatmap/models/heatmap.js +0 -455
- package/lib/heatmap/models/hexagon.d.ts +0 -29
- package/lib/heatmap/models/hexagon.js +0 -91
- package/lib/heatmap/models/index.d.ts +0 -5
- package/lib/heatmap/models/index.js +0 -19
- package/lib/heatmap/shaders/grid/grid_frag.glsl +0 -9
- package/lib/heatmap/shaders/grid/grid_vert.glsl +0 -30
- package/lib/heatmap/shaders/grid3d/grid_3d_frag.glsl +0 -17
- package/lib/heatmap/shaders/grid3d/grid_3d_vert.glsl +0 -34
- package/lib/heatmap/shaders/heatmap/heatmap_3d_frag.glsl +0 -23
- package/lib/heatmap/shaders/heatmap/heatmap_3d_vert.glsl +0 -59
- package/lib/heatmap/shaders/heatmap/heatmap_frag.glsl +0 -40
- package/lib/heatmap/shaders/heatmap/heatmap_framebuffer_frag.glsl +0 -17
- package/lib/heatmap/shaders/heatmap/heatmap_framebuffer_vert.glsl +0 -36
- package/lib/heatmap/shaders/heatmap/heatmap_vert.glsl +0 -21
- package/lib/heatmap/shaders/hexagon/hexagon_frag.glsl +0 -8
- package/lib/heatmap/shaders/hexagon/hexagon_vert.glsl +0 -30
- package/lib/heatmap/triangulation.d.ts +0 -5
- package/lib/heatmap/triangulation.js +0 -39
- package/lib/image/index.d.ts +0 -9
- package/lib/image/index.js +0 -36
- package/lib/image/models/image.d.ts +0 -31
- package/lib/image/models/image.js +0 -121
- package/lib/image/models/index.d.ts +0 -5
- package/lib/image/models/index.js +0 -12
- package/lib/image/shaders/dataImage_frag.glsl +0 -32
- package/lib/image/shaders/image_frag.glsl +0 -38
- package/lib/image/shaders/image_vert.glsl +0 -20
- package/lib/index.d.ts +0 -18
- package/lib/index.js +0 -148
- package/lib/line/index.d.ts +0 -36
- package/lib/line/index.js +0 -98
- package/lib/line/models/arc.d.ts +0 -40
- package/lib/line/models/arc.js +0 -287
- package/lib/line/models/arc_3d.d.ts +0 -40
- package/lib/line/models/arc_3d.js +0 -277
- package/lib/line/models/flow.d.ts +0 -31
- package/lib/line/models/flow.js +0 -148
- package/lib/line/models/great_circle.d.ts +0 -34
- package/lib/line/models/great_circle.js +0 -248
- package/lib/line/models/index.d.ts +0 -5
- package/lib/line/models/index.js +0 -25
- package/lib/line/models/line.d.ts +0 -44
- package/lib/line/models/line.js +0 -281
- package/lib/line/models/simple_line.d.ts +0 -33
- package/lib/line/models/simple_line.js +0 -126
- package/lib/line/models/wall.d.ts +0 -34
- package/lib/line/models/wall.js +0 -231
- package/lib/line/shaders/arc/line_arc_frag.glsl +0 -92
- package/lib/line/shaders/arc/line_arc_vert.glsl +0 -156
- package/lib/line/shaders/arc3d/line_arc_3d_frag.glsl +0 -108
- package/lib/line/shaders/arc3d/line_arc_3d_vert.glsl +0 -177
- package/lib/line/shaders/flow/flow_line_frag.glsl +0 -13
- package/lib/line/shaders/flow/flow_line_vert.glsl +0 -76
- package/lib/line/shaders/greatCircle/line_arc_great_circle_frag.glsl +0 -99
- package/lib/line/shaders/greatCircle/line_arc_great_circle_vert.glsl +0 -165
- package/lib/line/shaders/line/line_frag.glsl +0 -122
- package/lib/line/shaders/line/line_vert.glsl +0 -101
- package/lib/line/shaders/simple/simpleline_frag.glsl +0 -30
- package/lib/line/shaders/simple/simpleline_vert.glsl +0 -45
- package/lib/line/shaders/wall/wall_frag.glsl +0 -94
- package/lib/line/shaders/wall/wall_vert.glsl +0 -90
- package/lib/mask/index.d.ts +0 -16
- package/lib/mask/index.js +0 -29
- package/lib/mask/models/fill.d.ts +0 -18
- package/lib/mask/models/fill.js +0 -69
- package/lib/mask/models/index.d.ts +0 -5
- package/lib/mask/models/index.js +0 -12
- package/lib/mask/shaders/mask_vert.glsl +0 -14
- package/lib/plugins/DataMappingPlugin.d.ts +0 -12
- package/lib/plugins/DataMappingPlugin.js +0 -234
- package/lib/plugins/DataSourcePlugin.d.ts +0 -6
- package/lib/plugins/DataSourcePlugin.js +0 -83
- package/lib/plugins/FeatureScalePlugin.d.ts +0 -20
- package/lib/plugins/FeatureScalePlugin.js +0 -303
- package/lib/plugins/LayerAnimateStylePlugin.d.ts +0 -4
- package/lib/plugins/LayerAnimateStylePlugin.js +0 -22
- package/lib/plugins/LayerMaskPlugin.d.ts +0 -7
- package/lib/plugins/LayerMaskPlugin.js +0 -26
- package/lib/plugins/LayerModelPlugin.d.ts +0 -10
- package/lib/plugins/LayerModelPlugin.js +0 -68
- package/lib/plugins/LayerStylePlugin.d.ts +0 -7
- package/lib/plugins/LayerStylePlugin.js +0 -25
- package/lib/plugins/LightingPlugin.d.ts +0 -35
- package/lib/plugins/LightingPlugin.js +0 -93
- package/lib/plugins/MultiPassRendererPlugin.d.ts +0 -22
- package/lib/plugins/MultiPassRendererPlugin.js +0 -59
- package/lib/plugins/PixelPickingPlugin.d.ts +0 -11
- package/lib/plugins/PixelPickingPlugin.js +0 -154
- package/lib/plugins/RegisterStyleAttributePlugin.d.ts +0 -10
- package/lib/plugins/RegisterStyleAttributePlugin.js +0 -78
- package/lib/plugins/ShaderUniformPlugin.d.ts +0 -17
- package/lib/plugins/ShaderUniformPlugin.js +0 -203
- package/lib/plugins/UpdateModelPlugin.d.ts +0 -7
- package/lib/plugins/UpdateModelPlugin.js +0 -27
- package/lib/plugins/UpdateStyleAttributePlugin.d.ts +0 -9
- package/lib/plugins/UpdateStyleAttributePlugin.js +0 -61
- package/lib/plugins/index.d.ts +0 -15
- package/lib/plugins/index.js +0 -26
- package/lib/point/index.d.ts +0 -35
- package/lib/point/index.js +0 -161
- package/lib/point/models/billboard_point.d.ts +0 -35
- package/lib/point/models/billboard_point.js +0 -104
- package/lib/point/models/earthExtrude.d.ts +0 -32
- package/lib/point/models/earthExtrude.js +0 -207
- package/lib/point/models/earthFill.d.ts +0 -31
- package/lib/point/models/earthFill.js +0 -166
- package/lib/point/models/extrude.d.ts +0 -32
- package/lib/point/models/extrude.js +0 -203
- package/lib/point/models/fill.d.ts +0 -47
- package/lib/point/models/fill.js +0 -188
- package/lib/point/models/fillImage.d.ts +0 -42
- package/lib/point/models/fillImage.js +0 -197
- package/lib/point/models/image.d.ts +0 -48
- package/lib/point/models/image.js +0 -301
- package/lib/point/models/index.d.ts +0 -5
- package/lib/point/models/index.js +0 -32
- package/lib/point/models/normal.d.ts +0 -36
- package/lib/point/models/normal.js +0 -98
- package/lib/point/models/radar.d.ts +0 -37
- package/lib/point/models/radar.js +0 -123
- package/lib/point/models/text.d.ts +0 -85
- package/lib/point/models/text.js +0 -512
- package/lib/point/shaders/billboard/billboard_point_frag.glsl +0 -48
- package/lib/point/shaders/billboard/billboard_point_vert.glsl +0 -33
- package/lib/point/shaders/earthExtrude/earthExtrude_frag.glsl +0 -36
- package/lib/point/shaders/earthExtrude/earthExtrude_vert.glsl +0 -118
- package/lib/point/shaders/earthFill/earthFill_frag.glsl +0 -79
- package/lib/point/shaders/earthFill/earthFill_vert.glsl +0 -46
- package/lib/point/shaders/extrude/extrude_frag.glsl +0 -29
- package/lib/point/shaders/extrude/extrude_vert.glsl +0 -95
- package/lib/point/shaders/fill/fill_frag.glsl +0 -97
- package/lib/point/shaders/fill/fill_vert.glsl +0 -79
- package/lib/point/shaders/fillImage/fillImage_frag.glsl +0 -23
- package/lib/point/shaders/fillImage/fillImage_vert.glsl +0 -46
- package/lib/point/shaders/image/image_frag.glsl +0 -45
- package/lib/point/shaders/image/image_vert.glsl +0 -47
- package/lib/point/shaders/normal/normal_frag.glsl +0 -5
- package/lib/point/shaders/normal/normal_vert.glsl +0 -22
- package/lib/point/shaders/radar/radar_frag.glsl +0 -52
- package/lib/point/shaders/radar/radar_vert.glsl +0 -53
- package/lib/point/shaders/text/text_frag.glsl +0 -47
- package/lib/point/shaders/text/text_vert.glsl +0 -65
- package/lib/point/shape/extrude.d.ts +0 -15
- package/lib/point/shape/extrude.js +0 -56
- package/lib/polygon/index.d.ts +0 -18
- package/lib/polygon/index.js +0 -79
- package/lib/polygon/models/extrude.d.ts +0 -41
- package/lib/polygon/models/extrude.js +0 -256
- package/lib/polygon/models/extrusion.d.ts +0 -40
- package/lib/polygon/models/extrusion.js +0 -145
- package/lib/polygon/models/fill.d.ts +0 -32
- package/lib/polygon/models/fill.js +0 -135
- package/lib/polygon/models/index.d.ts +0 -5
- package/lib/polygon/models/index.js +0 -33
- package/lib/polygon/models/ocean.d.ts +0 -37
- package/lib/polygon/models/ocean.js +0 -180
- package/lib/polygon/models/water.d.ts +0 -35
- package/lib/polygon/models/water.js +0 -158
- package/lib/polygon/shaders/extrude/polygon_extrude_frag.glsl +0 -24
- package/lib/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +0 -49
- package/lib/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +0 -53
- package/lib/polygon/shaders/extrude/polygon_extrude_vert.glsl +0 -74
- package/lib/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +0 -55
- package/lib/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +0 -54
- package/lib/polygon/shaders/extrusion/polygon_extrusion_frag.glsl +0 -8
- package/lib/polygon/shaders/extrusion/polygon_extrusion_vert.glsl +0 -24
- package/lib/polygon/shaders/fill/fill_frag.glsl +0 -8
- package/lib/polygon/shaders/fill/fill_linear_frag.glsl +0 -23
- package/lib/polygon/shaders/fill/fill_linear_vert.glsl +0 -36
- package/lib/polygon/shaders/fill/fill_vert.glsl +0 -35
- package/lib/polygon/shaders/ocean/ocean_frag.glsl +0 -277
- package/lib/polygon/shaders/ocean/ocean_vert.glsl +0 -21
- package/lib/polygon/shaders/water/polygon_water_frag.glsl +0 -78
- package/lib/polygon/shaders/water/polygon_water_vert.glsl +0 -22
- package/lib/raster/buffers/triangulation.d.ts +0 -6
- package/lib/raster/buffers/triangulation.js +0 -33
- package/lib/raster/index.d.ts +0 -11
- package/lib/raster/index.js +0 -63
- package/lib/raster/models/index.d.ts +0 -5
- package/lib/raster/models/index.js +0 -17
- package/lib/raster/models/raster.d.ts +0 -35
- package/lib/raster/models/raster.js +0 -164
- package/lib/raster/models/rasterRgb.d.ts +0 -35
- package/lib/raster/models/rasterRgb.js +0 -166
- package/lib/raster/models/rasterTerrainRgb.d.ts +0 -30
- package/lib/raster/models/rasterTerrainRgb.js +0 -126
- package/lib/raster/shaders/raster/raster_2d_frag.glsl +0 -37
- package/lib/raster/shaders/raster/raster_2d_vert.glsl +0 -21
- package/lib/raster/shaders/rgb/raster_rgb_frag.glsl +0 -30
- package/lib/raster/shaders/rgb/raster_rgb_vert.glsl +0 -21
- package/lib/raster/shaders/terrain/terrain_rgb_frag.glsl +0 -40
- package/lib/raster/shaders/terrain/terrain_rgb_vert.glsl +0 -19
- package/lib/shader/minify_frag.glsl +0 -11
- package/lib/shader/minify_picking_frag.glsl +0 -10
- package/lib/tile/core/BaseLayer.d.ts +0 -50
- package/lib/tile/core/BaseLayer.js +0 -264
- package/lib/tile/core/TileDebugLayer.d.ts +0 -15
- package/lib/tile/core/TileDebugLayer.js +0 -31
- package/lib/tile/interaction/getFeatureData.d.ts +0 -0
- package/lib/tile/interaction/getFeatureData.js +0 -1
- package/lib/tile/interaction/getRasterData.d.ts +0 -4
- package/lib/tile/interaction/getRasterData.js +0 -52
- package/lib/tile/interaction/utils.d.ts +0 -11
- package/lib/tile/interaction/utils.js +0 -81
- package/lib/tile/interface.d.ts +0 -29
- package/lib/tile/interface.js +0 -5
- package/lib/tile/service/TileLayerService.d.ts +0 -58
- package/lib/tile/service/TileLayerService.js +0 -203
- package/lib/tile/service/TilePickService.d.ts +0 -26
- package/lib/tile/service/TilePickService.js +0 -134
- package/lib/tile/service/TileSourceService.d.ts +0 -7
- package/lib/tile/service/TileSourceService.js +0 -35
- package/lib/tile/tile/DebugTile.d.ts +0 -16
- package/lib/tile/tile/DebugTile.js +0 -55
- package/lib/tile/tile/ImageTile.d.ts +0 -14
- package/lib/tile/tile/ImageTile.js +0 -47
- package/lib/tile/tile/MaskTile.d.ts +0 -18
- package/lib/tile/tile/MaskTile.js +0 -62
- package/lib/tile/tile/RasterRGBTile.d.ts +0 -11
- package/lib/tile/tile/RasterRGBTile.js +0 -55
- package/lib/tile/tile/RasterTerrainRGBTile.d.ts +0 -14
- package/lib/tile/tile/RasterTerrainRGBTile.js +0 -47
- package/lib/tile/tile/RasterTile.d.ts +0 -18
- package/lib/tile/tile/RasterTile.js +0 -89
- package/lib/tile/tile/Tile.d.ts +0 -112
- package/lib/tile/tile/Tile.js +0 -174
- package/lib/tile/tile/VectorTile.d.ts +0 -26
- package/lib/tile/tile/VectorTile.js +0 -95
- package/lib/tile/tile/index.d.ts +0 -12
- package/lib/tile/tile/index.js +0 -76
- package/lib/tile/tile/util.d.ts +0 -5
- package/lib/tile/tile/util.js +0 -26
- package/lib/tile/utils/constants.d.ts +0 -1
- package/lib/tile/utils/constants.js +0 -14
- package/lib/tile/utils/utils.d.ts +0 -8
- package/lib/tile/utils/utils.js +0 -18
- package/lib/utils/blend.d.ts +0 -2
- package/lib/utils/blend.js +0 -63
- package/lib/utils/collision-index.d.ts +0 -47
- package/lib/utils/collision-index.js +0 -96
- package/lib/utils/extrude_polyline.d.ts +0 -53
- package/lib/utils/extrude_polyline.js +0 -331
- package/lib/utils/grid-index.d.ts +0 -28
- package/lib/utils/grid-index.js +0 -135
- package/lib/utils/identityScale.d.ts +0 -8
- package/lib/utils/identityScale.js +0 -32
- package/lib/utils/load-image.d.ts +0 -1
- package/lib/utils/load-image.js +0 -29
- package/lib/utils/multiPassRender.d.ts +0 -16
- package/lib/utils/multiPassRender.js +0 -44
- package/lib/utils/polylineNormal.d.ts +0 -9
- package/lib/utils/polylineNormal.js +0 -191
- package/lib/utils/rampcolor_legend.d.ts +0 -6
- package/lib/utils/rampcolor_legend.js +0 -18
- package/lib/utils/scale.d.ts +0 -87
- package/lib/utils/scale.js +0 -610
- package/lib/utils/simpleLine.d.ts +0 -23
- package/lib/utils/simpleLine.js +0 -85
- package/lib/utils/stencil.d.ts +0 -7
- package/lib/utils/stencil.js +0 -56
- package/lib/utils/symbol-layout.d.ts +0 -43
- package/lib/utils/symbol-layout.js +0 -258
- package/lib/wind/index.d.ts +0 -11
- package/lib/wind/index.js +0 -42
- package/lib/wind/models/index.d.ts +0 -5
- package/lib/wind/models/index.js +0 -12
- package/lib/wind/models/utils.d.ts +0 -19
- package/lib/wind/models/utils.js +0 -229
- package/lib/wind/models/wind.d.ts +0 -38
- package/lib/wind/models/wind.js +0 -248
- package/lib/wind/models/windRender.d.ts +0 -104
- package/lib/wind/models/windRender.js +0 -343
- package/lib/wind/models/windShader.d.ts +0 -12
- package/lib/wind/models/windShader.js +0 -157
- package/lib/wind/shaders/wind_frag.glsl +0 -9
- package/lib/wind/shaders/wind_vert.glsl +0 -14
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import type { IEncodeFeature, IModel, IModelUniform } from '@antv/l7-core';
|
|
2
|
-
import BaseModel from '../../core/BaseModel';
|
|
3
|
-
import type { IGlyphQuad } from '../../utils/symbol-layout';
|
|
4
|
-
export declare function TextTrianglation(feature: IEncodeFeature): {
|
|
5
|
-
vertices: number[];
|
|
6
|
-
indices: number[];
|
|
7
|
-
size: number;
|
|
8
|
-
};
|
|
9
|
-
export default class TextModel extends BaseModel {
|
|
10
|
-
protected get attributeLocation(): {
|
|
11
|
-
readonly POSITION: 0;
|
|
12
|
-
readonly POSITION_64LOW: 1;
|
|
13
|
-
readonly COLOR: 2;
|
|
14
|
-
readonly PICKING_COLOR: 3;
|
|
15
|
-
readonly STROKE: 4;
|
|
16
|
-
readonly OPACITY: 5;
|
|
17
|
-
readonly OFFSETS: 6;
|
|
18
|
-
readonly ROTATION: 7;
|
|
19
|
-
readonly MAX: 8;
|
|
20
|
-
} & Record<string, number> & {
|
|
21
|
-
MAX: 8;
|
|
22
|
-
SIZE: number;
|
|
23
|
-
TEXT_OFFSETS: number;
|
|
24
|
-
UV: number;
|
|
25
|
-
};
|
|
26
|
-
glyphInfo: IEncodeFeature[];
|
|
27
|
-
glyphInfoMap: {
|
|
28
|
-
[key: string]: {
|
|
29
|
-
shaping: any;
|
|
30
|
-
glyphQuads: IGlyphQuad[];
|
|
31
|
-
centroid: number[];
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
private rawEncodeData;
|
|
35
|
-
private texture;
|
|
36
|
-
private currentZoom;
|
|
37
|
-
private extent;
|
|
38
|
-
private textureHeight;
|
|
39
|
-
private textCount;
|
|
40
|
-
private preTextStyle;
|
|
41
|
-
getUninforms(): IModelUniform;
|
|
42
|
-
protected getCommonUniformsInfo(): {
|
|
43
|
-
uniformsArray: number[];
|
|
44
|
-
uniformsLength: number;
|
|
45
|
-
uniformsOption: {
|
|
46
|
-
[key: string]: any;
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
initModels(): Promise<IModel[]>;
|
|
50
|
-
buildModels(): Promise<IModel[]>;
|
|
51
|
-
needUpdate(): Promise<boolean>;
|
|
52
|
-
clearModels(): void;
|
|
53
|
-
protected registerBuiltinAttributes(): void;
|
|
54
|
-
private bindEvent;
|
|
55
|
-
private mapping;
|
|
56
|
-
private textExtent;
|
|
57
|
-
/**
|
|
58
|
-
* 生成文字纹理(生成文字纹理字典)
|
|
59
|
-
*/
|
|
60
|
-
private initTextFont;
|
|
61
|
-
/**
|
|
62
|
-
* 生成 iconfont 纹理字典
|
|
63
|
-
*/
|
|
64
|
-
private initIconFontTex;
|
|
65
|
-
private getTextStyle;
|
|
66
|
-
/**
|
|
67
|
-
* 生成文字布局(对照文字纹理字典提取对应文字的位置很好信息)
|
|
68
|
-
*/
|
|
69
|
-
private generateGlyphLayout;
|
|
70
|
-
private getFontServiceMapping;
|
|
71
|
-
private getFontServiceCanvas;
|
|
72
|
-
/**
|
|
73
|
-
* 文字避让 depend on originCentorid
|
|
74
|
-
*/
|
|
75
|
-
private filterGlyphs;
|
|
76
|
-
/**
|
|
77
|
-
* 初始化文字布局
|
|
78
|
-
*/
|
|
79
|
-
private initGlyph;
|
|
80
|
-
/**
|
|
81
|
-
* 更新文字纹理
|
|
82
|
-
*/
|
|
83
|
-
private updateTexture;
|
|
84
|
-
private reBuildModel;
|
|
85
|
-
}
|
package/lib/point/models/text.js
DELETED
|
@@ -1,512 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.TextTrianglation = TextTrianglation;
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
10
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
11
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
12
|
-
var _l7Core = require("@antv/l7-core");
|
|
13
|
-
var _l7Utils = require("@antv/l7-utils");
|
|
14
|
-
var _BaseModel = _interopRequireDefault(require("../../core/BaseModel"));
|
|
15
|
-
var _collisionIndex = _interopRequireDefault(require("../../utils/collision-index"));
|
|
16
|
-
var _symbolLayout = require("../../utils/symbol-layout");
|
|
17
|
-
/* babel-plugin-inline-import '../shaders/text/text_frag.glsl' */
|
|
18
|
-
const textFrag = "#define SDF_PX 8.0\n#define EDGE_GAMMA 0.105\n#define FONT_SIZE 48.0\n\nuniform sampler2D u_sdf_map;\nlayout(std140) uniform commonUniforms {\n vec4 u_stroke_color : [0.0, 0.0, 0.0, 0.0];\n vec2 u_sdf_map_size;\n float u_raisingHeight: 0.0;\n float u_stroke_width : 2;\n float u_gamma_scale : 0.5;\n float u_halo_blur : 0.5;\n};\n\nin vec2 v_uv;\nin float v_gamma_scale;\nin vec4 v_color;\nin vec4 v_stroke_color;\nin float v_fontScale;\n\nout vec4 outputColor;\n\n#pragma include \"picking\"\nvoid main() {\n // get style data mapping\n\n // get sdf from atlas\n float dist = texture(SAMPLER_2D(u_sdf_map), v_uv).a;\n\n lowp float buff = (6.0 - u_stroke_width / v_fontScale) / SDF_PX;\n highp float gamma = (u_halo_blur * 1.19 / SDF_PX + EDGE_GAMMA) / (v_fontScale * u_gamma_scale) / 1.0;\n\n highp float gamma_scaled = gamma * v_gamma_scale;\n\n highp float alpha = smoothstep(buff - gamma_scaled, buff + gamma_scaled, dist);\n\n outputColor = mix(v_color, v_stroke_color, smoothstep(0., 0.5, 1.- dist));\n\n outputColor.a *= alpha;\n // \u4F5C\u4E3A mask \u6A21\u677F\u65F6\u9700\u8981\u4E22\u5F03\u900F\u660E\u7684\u50CF\u7D20\n if (outputColor.a < 0.01) {\n discard;\n }\n outputColor = filterColor(outputColor);\n}\n";
|
|
19
|
-
/* babel-plugin-inline-import '../shaders/text/text_vert.glsl' */
|
|
20
|
-
const textVert = "#define SDF_PX 8.0\n#define EDGE_GAMMA 0.105\n#define FONT_SIZE 24.0\n\nlayout(location = ATTRIBUTE_LOCATION_POSITION) in vec3 a_Position;\nlayout(location = ATTRIBUTE_LOCATION_POSITION_64LOW) in vec2 a_Position64Low;\nlayout(location = ATTRIBUTE_LOCATION_COLOR) in vec4 a_Color;\nlayout(location = ATTRIBUTE_LOCATION_SIZE) in float a_Size;\nlayout(location = ATTRIBUTE_LOCATION_TEXT_OFFSETS) in vec2 a_textOffsets;\nlayout(location = ATTRIBUTE_LOCATION_UV) in vec2 a_tex;\n\nlayout(std140) uniform commonUniforms {\n vec4 u_stroke_color : [0.0, 0.0, 0.0, 0.0];\n vec2 u_sdf_map_size;\n float u_raisingHeight: 0.0;\n float u_stroke_width : 2;\n float u_gamma_scale : 0.5;\n float u_halo_blur : 0.5;\n};\n\nout vec2 v_uv;\nout float v_gamma_scale;\nout vec4 v_color;\nout vec4 v_stroke_color;\nout float v_fontScale;\n\n#pragma include \"projection\"\n#pragma include \"picking\"\n#pragma include \"rotation_2d\"\n\nvoid main() {\n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\n\n v_uv = a_tex / u_sdf_map_size;\n\n\n\n v_color = vec4(a_Color.xyz, a_Color.w * opacity);\n v_stroke_color = vec4(u_stroke_color.xyz, u_stroke_color.w * opacity);\n\n // \u6587\u672C\u7F29\u653E\u6BD4\u4F8B\n float fontScale = a_Size / FONT_SIZE;\n v_fontScale = fontScale;\n\n vec4 project_pos = project_position(vec4(a_Position, 1.0), a_Position64Low);\n // vec4 projected_position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n\n vec2 offset = rotate_matrix(a_textOffsets,rotation);\n\n // gl_Position = vec4(projected_position.xy / projected_position.w + rotation_matrix * a_textOffsets * fontScale / u_ViewportSize * 2.0 * u_DevicePixelRatio, 0.0, 1.0);\n\n float raiseHeight = u_raisingHeight;\n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);\n raiseHeight = u_raisingHeight * mapboxZoomScale;\n }\n\n vec4 projected_position = project_common_position_to_clipspace(vec4(project_pos.xyz + vec3(0.0, 0.0, raiseHeight), 1.0));\n\n gl_Position = vec4(\n projected_position.xy / projected_position.w + offset * fontScale / u_ViewportSize * 2.0 * u_DevicePixelRatio, 0.0, 1.0);\n v_gamma_scale = gl_Position.w;\n setPickingColor(a_PickingColor);\n\n}\n";
|
|
21
|
-
const {
|
|
22
|
-
isEqual
|
|
23
|
-
} = _l7Utils.lodashUtil;
|
|
24
|
-
function TextTrianglation(feature) {
|
|
25
|
-
// @ts-ignore
|
|
26
|
-
const that = this;
|
|
27
|
-
const id = feature.id;
|
|
28
|
-
const vertices = [];
|
|
29
|
-
const indices = [];
|
|
30
|
-
if (!that.glyphInfoMap || !that.glyphInfoMap[id]) {
|
|
31
|
-
return {
|
|
32
|
-
vertices: [],
|
|
33
|
-
// [ x, y, z, tex.x,tex.y, offset.x. offset.y]
|
|
34
|
-
indices: [],
|
|
35
|
-
size: 7
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
const centroid = that.glyphInfoMap[id].centroid; // 计算中心点
|
|
39
|
-
const coord = centroid.length === 2 ? [centroid[0], centroid[1], 0] : centroid;
|
|
40
|
-
that.glyphInfoMap[id].glyphQuads.forEach((quad, index) => {
|
|
41
|
-
vertices.push(...coord, quad.tex.x, quad.tex.y + quad.tex.height, quad.tl.x, quad.tl.y, ...coord, quad.tex.x + quad.tex.width, quad.tex.y + quad.tex.height, quad.tr.x, quad.tr.y, ...coord, quad.tex.x + quad.tex.width, quad.tex.y, quad.br.x, quad.br.y, ...coord, quad.tex.x, quad.tex.y, quad.bl.x, quad.bl.y);
|
|
42
|
-
indices.push(0 + index * 4, 1 + index * 4, 2 + index * 4, 2 + index * 4, 3 + index * 4, 0 + index * 4);
|
|
43
|
-
});
|
|
44
|
-
return {
|
|
45
|
-
vertices,
|
|
46
|
-
// [ x, y, z, tex.x,tex.y, offset.x. offset.y]
|
|
47
|
-
indices,
|
|
48
|
-
size: 7
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
class TextModel extends _BaseModel.default {
|
|
52
|
-
constructor(...args) {
|
|
53
|
-
var _this;
|
|
54
|
-
super(...args);
|
|
55
|
-
_this = this;
|
|
56
|
-
(0, _defineProperty2.default)(this, "glyphInfo", void 0);
|
|
57
|
-
(0, _defineProperty2.default)(this, "glyphInfoMap", {});
|
|
58
|
-
(0, _defineProperty2.default)(this, "rawEncodeData", void 0);
|
|
59
|
-
(0, _defineProperty2.default)(this, "texture", void 0);
|
|
60
|
-
(0, _defineProperty2.default)(this, "currentZoom", -1);
|
|
61
|
-
(0, _defineProperty2.default)(this, "extent", void 0);
|
|
62
|
-
(0, _defineProperty2.default)(this, "textureHeight", 0);
|
|
63
|
-
(0, _defineProperty2.default)(this, "textCount", 0);
|
|
64
|
-
(0, _defineProperty2.default)(this, "preTextStyle", {});
|
|
65
|
-
(0, _defineProperty2.default)(this, "mapping", /*#__PURE__*/(0, _asyncToGenerator2.default)(function* () {
|
|
66
|
-
_this.initGlyph(); //
|
|
67
|
-
_this.updateTexture();
|
|
68
|
-
yield _this.reBuildModel();
|
|
69
|
-
}));
|
|
70
|
-
}
|
|
71
|
-
get attributeLocation() {
|
|
72
|
-
return Object.assign(super.attributeLocation, {
|
|
73
|
-
MAX: super.attributeLocation.MAX,
|
|
74
|
-
SIZE: 9,
|
|
75
|
-
TEXT_OFFSETS: 10,
|
|
76
|
-
UV: 11
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
getUninforms() {
|
|
80
|
-
const commoninfo = this.getCommonUniformsInfo();
|
|
81
|
-
const attributeInfo = this.getUniformsBufferInfo(this.getStyleAttribute());
|
|
82
|
-
this.updateStyleUnifoms();
|
|
83
|
-
return (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, commoninfo.uniformsOption), attributeInfo.uniformsOption), {
|
|
84
|
-
u_sdf_map: this.textures[0]
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
getCommonUniformsInfo() {
|
|
88
|
-
const {
|
|
89
|
-
stroke = '#fff',
|
|
90
|
-
strokeWidth = 0,
|
|
91
|
-
halo = 0.5,
|
|
92
|
-
gamma = 2.0,
|
|
93
|
-
raisingHeight = 0
|
|
94
|
-
} = this.layer.getLayerConfig();
|
|
95
|
-
const mapping = this.getFontServiceMapping();
|
|
96
|
-
const canvas = this.getFontServiceCanvas();
|
|
97
|
-
if (mapping && Object.keys(mapping).length !== this.textCount && canvas) {
|
|
98
|
-
this.updateTexture();
|
|
99
|
-
this.textCount = Object.keys(mapping).length;
|
|
100
|
-
}
|
|
101
|
-
this.preTextStyle = this.getTextStyle();
|
|
102
|
-
const commonOptions = {
|
|
103
|
-
u_stroke_color: (0, _l7Utils.rgb2arr)(stroke),
|
|
104
|
-
u_sdf_map_size: [(canvas === null || canvas === void 0 ? void 0 : canvas.width) || 1, (canvas === null || canvas === void 0 ? void 0 : canvas.height) || 1],
|
|
105
|
-
u_raisingHeight: Number(raisingHeight),
|
|
106
|
-
u_stroke_width: strokeWidth,
|
|
107
|
-
u_gamma_scale: gamma,
|
|
108
|
-
u_halo_blur: halo
|
|
109
|
-
};
|
|
110
|
-
const commonBufferInfo = this.getUniformsBufferInfo(commonOptions);
|
|
111
|
-
return commonBufferInfo;
|
|
112
|
-
}
|
|
113
|
-
initModels() {
|
|
114
|
-
var _this2 = this;
|
|
115
|
-
return (0, _asyncToGenerator2.default)(function* () {
|
|
116
|
-
// 绑定事件
|
|
117
|
-
_this2.bindEvent();
|
|
118
|
-
_this2.extent = _this2.textExtent();
|
|
119
|
-
_this2.rawEncodeData = _this2.layer.getEncodedData();
|
|
120
|
-
_this2.preTextStyle = _this2.getTextStyle();
|
|
121
|
-
_this2.initUniformsBuffer();
|
|
122
|
-
return _this2.buildModels();
|
|
123
|
-
})();
|
|
124
|
-
}
|
|
125
|
-
buildModels() {
|
|
126
|
-
var _this3 = this;
|
|
127
|
-
return (0, _asyncToGenerator2.default)(function* () {
|
|
128
|
-
const {
|
|
129
|
-
textAllowOverlap = false
|
|
130
|
-
} = _this3.layer.getLayerConfig();
|
|
131
|
-
|
|
132
|
-
// this.mapping(); 重复调用
|
|
133
|
-
_this3.initGlyph(); //
|
|
134
|
-
_this3.updateTexture();
|
|
135
|
-
if (!textAllowOverlap) {
|
|
136
|
-
_this3.filterGlyphs();
|
|
137
|
-
}
|
|
138
|
-
const model = yield _this3.layer.buildLayerModel({
|
|
139
|
-
moduleName: 'pointText',
|
|
140
|
-
vertexShader: textVert,
|
|
141
|
-
fragmentShader: textFrag,
|
|
142
|
-
defines: _this3.getDefines(),
|
|
143
|
-
inject: _this3.getInject(),
|
|
144
|
-
triangulation: TextTrianglation.bind(_this3),
|
|
145
|
-
depth: {
|
|
146
|
-
enable: false
|
|
147
|
-
}
|
|
148
|
-
});
|
|
149
|
-
return [model];
|
|
150
|
-
})();
|
|
151
|
-
}
|
|
152
|
-
// 需要更新的场景
|
|
153
|
-
// 1. 文本偏移量发生改变
|
|
154
|
-
// 2. 文本锚点发生改变
|
|
155
|
-
// 3. 文本允许重叠发生改变
|
|
156
|
-
// 4. 文本字体发生改变
|
|
157
|
-
// 5. 文本字体粗细发生改变
|
|
158
|
-
needUpdate() {
|
|
159
|
-
var _this4 = this;
|
|
160
|
-
return (0, _asyncToGenerator2.default)(function* () {
|
|
161
|
-
const {
|
|
162
|
-
textAllowOverlap = false,
|
|
163
|
-
textAnchor = 'center',
|
|
164
|
-
textOffset,
|
|
165
|
-
padding,
|
|
166
|
-
fontFamily,
|
|
167
|
-
fontWeight
|
|
168
|
-
} = _this4.getTextStyle();
|
|
169
|
-
if (!isEqual(padding, _this4.preTextStyle.padding) || !isEqual(textOffset, _this4.preTextStyle.textOffset) || !isEqual(textAnchor, _this4.preTextStyle.textAnchor) || !isEqual(fontFamily, _this4.preTextStyle.fontFamily) || !isEqual(fontWeight, _this4.preTextStyle.fontWeight)) {
|
|
170
|
-
yield _this4.mapping();
|
|
171
|
-
return true;
|
|
172
|
-
}
|
|
173
|
-
if (textAllowOverlap) {
|
|
174
|
-
// 小于不做避让
|
|
175
|
-
return false;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
// textAllowOverlap 发生改变
|
|
179
|
-
const zoom = _this4.mapService.getZoom();
|
|
180
|
-
const extent = _this4.mapService.getBounds();
|
|
181
|
-
const flag = (0, _l7Utils.boundsContains)(_this4.extent, extent);
|
|
182
|
-
// 文本不能压盖则进行过滤
|
|
183
|
-
if (Math.abs(_this4.currentZoom - zoom) > 0.5 || !flag || textAllowOverlap !== _this4.preTextStyle.textAllowOverlap) {
|
|
184
|
-
// TODO this.mapping 数据未变化,避让
|
|
185
|
-
yield _this4.reBuildModel();
|
|
186
|
-
return true;
|
|
187
|
-
}
|
|
188
|
-
return false;
|
|
189
|
-
})();
|
|
190
|
-
}
|
|
191
|
-
clearModels() {
|
|
192
|
-
var _this$texture;
|
|
193
|
-
(_this$texture = this.texture) === null || _this$texture === void 0 || _this$texture.destroy();
|
|
194
|
-
// TODO this.mapping
|
|
195
|
-
this.layer.off('remapping', this.mapping);
|
|
196
|
-
}
|
|
197
|
-
registerBuiltinAttributes() {
|
|
198
|
-
// 注册 Position 属性 64 位地位部分,经纬度数据开启双精度,避免大于 20层级以上出现数据偏移
|
|
199
|
-
this.registerPosition64LowAttribute();
|
|
200
|
-
this.styleAttributeService.registerStyleAttribute({
|
|
201
|
-
name: 'textOffsets',
|
|
202
|
-
type: _l7Core.AttributeType.Attribute,
|
|
203
|
-
descriptor: {
|
|
204
|
-
shaderLocation: this.attributeLocation.TEXT_OFFSETS,
|
|
205
|
-
name: 'a_textOffsets',
|
|
206
|
-
// 文字偏移量
|
|
207
|
-
buffer: {
|
|
208
|
-
// give the WebGL driver a hint that this buffer may change
|
|
209
|
-
usage: _l7Core.gl.STATIC_DRAW,
|
|
210
|
-
data: [],
|
|
211
|
-
type: _l7Core.gl.FLOAT
|
|
212
|
-
},
|
|
213
|
-
size: 2,
|
|
214
|
-
update: (feature, featureIdx, vertex) => {
|
|
215
|
-
return [vertex[5], vertex[6]];
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
});
|
|
219
|
-
this.styleAttributeService.registerStyleAttribute({
|
|
220
|
-
name: 'textUv',
|
|
221
|
-
type: _l7Core.AttributeType.Attribute,
|
|
222
|
-
descriptor: {
|
|
223
|
-
name: 'a_tex',
|
|
224
|
-
shaderLocation: this.attributeLocation.UV,
|
|
225
|
-
buffer: {
|
|
226
|
-
usage: _l7Core.gl.DYNAMIC_DRAW,
|
|
227
|
-
data: [],
|
|
228
|
-
type: _l7Core.gl.FLOAT
|
|
229
|
-
},
|
|
230
|
-
size: 2,
|
|
231
|
-
update: (feature, featureIdx, vertex) => {
|
|
232
|
-
return [vertex[3], vertex[4]];
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
});
|
|
236
|
-
|
|
237
|
-
// point layer size;
|
|
238
|
-
this.styleAttributeService.registerStyleAttribute({
|
|
239
|
-
name: 'size',
|
|
240
|
-
type: _l7Core.AttributeType.Attribute,
|
|
241
|
-
descriptor: {
|
|
242
|
-
name: 'a_Size',
|
|
243
|
-
shaderLocation: this.attributeLocation.SIZE,
|
|
244
|
-
buffer: {
|
|
245
|
-
// give the WebGL driver a hint that this buffer may change
|
|
246
|
-
usage: _l7Core.gl.DYNAMIC_DRAW,
|
|
247
|
-
data: [],
|
|
248
|
-
type: _l7Core.gl.FLOAT
|
|
249
|
-
},
|
|
250
|
-
size: 1,
|
|
251
|
-
update: feature => {
|
|
252
|
-
const {
|
|
253
|
-
size = 12
|
|
254
|
-
} = feature;
|
|
255
|
-
return Array.isArray(size) ? [size[0]] : [size];
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
});
|
|
259
|
-
}
|
|
260
|
-
bindEvent() {
|
|
261
|
-
if (!this.layer.isTileLayer) {
|
|
262
|
-
// 重新绑定
|
|
263
|
-
this.layer.on('remapping', this.mapping);
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
textExtent() {
|
|
267
|
-
const bounds = this.mapService.getBounds();
|
|
268
|
-
return (0, _l7Utils.padBounds)(bounds, 0.5);
|
|
269
|
-
}
|
|
270
|
-
/**
|
|
271
|
-
* 生成文字纹理(生成文字纹理字典)
|
|
272
|
-
*/
|
|
273
|
-
initTextFont() {
|
|
274
|
-
const {
|
|
275
|
-
fontWeight,
|
|
276
|
-
fontFamily
|
|
277
|
-
} = this.getTextStyle();
|
|
278
|
-
const data = this.rawEncodeData;
|
|
279
|
-
const characterSet = [];
|
|
280
|
-
data.forEach(item => {
|
|
281
|
-
let {
|
|
282
|
-
shape = ''
|
|
283
|
-
} = item;
|
|
284
|
-
shape = shape.toString();
|
|
285
|
-
for (const char of shape) {
|
|
286
|
-
// 去重
|
|
287
|
-
if (characterSet.indexOf(char) === -1) {
|
|
288
|
-
characterSet.push(char);
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
});
|
|
292
|
-
this.fontService.setFontOptions({
|
|
293
|
-
characterSet,
|
|
294
|
-
fontWeight,
|
|
295
|
-
fontFamily,
|
|
296
|
-
iconfont: false
|
|
297
|
-
});
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
/**
|
|
301
|
-
* 生成 iconfont 纹理字典
|
|
302
|
-
*/
|
|
303
|
-
initIconFontTex() {
|
|
304
|
-
const {
|
|
305
|
-
fontWeight,
|
|
306
|
-
fontFamily
|
|
307
|
-
} = this.getTextStyle();
|
|
308
|
-
const data = this.rawEncodeData;
|
|
309
|
-
const characterSet = [];
|
|
310
|
-
data.forEach(item => {
|
|
311
|
-
let {
|
|
312
|
-
shape = ''
|
|
313
|
-
} = item;
|
|
314
|
-
shape = `${shape}`;
|
|
315
|
-
if (characterSet.indexOf(shape) === -1) {
|
|
316
|
-
characterSet.push(shape);
|
|
317
|
-
}
|
|
318
|
-
});
|
|
319
|
-
this.fontService.setFontOptions({
|
|
320
|
-
characterSet,
|
|
321
|
-
fontWeight,
|
|
322
|
-
fontFamily,
|
|
323
|
-
iconfont: true
|
|
324
|
-
});
|
|
325
|
-
}
|
|
326
|
-
getTextStyle() {
|
|
327
|
-
const {
|
|
328
|
-
fontWeight = '400',
|
|
329
|
-
fontFamily = 'sans-serif',
|
|
330
|
-
textAllowOverlap = false,
|
|
331
|
-
padding = [0, 0],
|
|
332
|
-
textAnchor = 'center',
|
|
333
|
-
textOffset = [0, 0],
|
|
334
|
-
opacity = 1,
|
|
335
|
-
strokeOpacity = 1,
|
|
336
|
-
strokeWidth = 0,
|
|
337
|
-
stroke = '#000'
|
|
338
|
-
} = this.layer.getLayerConfig();
|
|
339
|
-
return {
|
|
340
|
-
fontWeight,
|
|
341
|
-
fontFamily,
|
|
342
|
-
textAllowOverlap,
|
|
343
|
-
padding,
|
|
344
|
-
textAnchor,
|
|
345
|
-
textOffset,
|
|
346
|
-
opacity,
|
|
347
|
-
strokeOpacity,
|
|
348
|
-
strokeWidth,
|
|
349
|
-
stroke
|
|
350
|
-
};
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
/**
|
|
354
|
-
* 生成文字布局(对照文字纹理字典提取对应文字的位置很好信息)
|
|
355
|
-
*/
|
|
356
|
-
generateGlyphLayout(iconfont) {
|
|
357
|
-
const mapping = this.getFontServiceMapping();
|
|
358
|
-
const {
|
|
359
|
-
spacing = 2,
|
|
360
|
-
textAnchor = 'center',
|
|
361
|
-
textOffset
|
|
362
|
-
} = this.layer.getLayerConfig();
|
|
363
|
-
const data = this.rawEncodeData;
|
|
364
|
-
this.glyphInfo = data.map(feature => {
|
|
365
|
-
const {
|
|
366
|
-
shape = '',
|
|
367
|
-
id,
|
|
368
|
-
size = 1
|
|
369
|
-
} = feature;
|
|
370
|
-
const offset = feature.textOffset ? feature.textOffset : textOffset || [0, 0];
|
|
371
|
-
const anchor = feature.textAnchor ? feature.textAnchor : textAnchor || 'center';
|
|
372
|
-
const shaping = (0, _symbolLayout.shapeText)(shape.toString(), mapping,
|
|
373
|
-
// @ts-ignore
|
|
374
|
-
size, anchor, 'left', spacing, offset,
|
|
375
|
-
//
|
|
376
|
-
iconfont);
|
|
377
|
-
const glyphQuads = (0, _symbolLayout.getGlyphQuads)(shaping, offset, false);
|
|
378
|
-
feature.shaping = shaping;
|
|
379
|
-
feature.glyphQuads = glyphQuads;
|
|
380
|
-
// feature.centroid = calculteCentroid(coordinates);
|
|
381
|
-
|
|
382
|
-
feature.centroid = (0, _l7Utils.calculateCentroid)(feature.coordinates);
|
|
383
|
-
this.glyphInfoMap[id] = {
|
|
384
|
-
shaping,
|
|
385
|
-
glyphQuads,
|
|
386
|
-
centroid: (0, _l7Utils.calculateCentroid)(feature.coordinates)
|
|
387
|
-
};
|
|
388
|
-
return feature;
|
|
389
|
-
});
|
|
390
|
-
}
|
|
391
|
-
getFontServiceMapping() {
|
|
392
|
-
const {
|
|
393
|
-
fontWeight = '400',
|
|
394
|
-
fontFamily = 'sans-serif'
|
|
395
|
-
} = this.layer.getLayerConfig();
|
|
396
|
-
return this.fontService.getMappingByKey(`${fontFamily}_${fontWeight}`);
|
|
397
|
-
}
|
|
398
|
-
getFontServiceCanvas() {
|
|
399
|
-
const {
|
|
400
|
-
fontWeight = '400',
|
|
401
|
-
fontFamily = 'sans-serif'
|
|
402
|
-
} = this.layer.getLayerConfig();
|
|
403
|
-
// 更新文字布局
|
|
404
|
-
return this.fontService.getCanvasByKey(`${fontFamily}_${fontWeight}`);
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
/**
|
|
408
|
-
* 文字避让 depend on originCentorid
|
|
409
|
-
*/
|
|
410
|
-
filterGlyphs() {
|
|
411
|
-
const {
|
|
412
|
-
padding = [0, 0],
|
|
413
|
-
textAllowOverlap = false
|
|
414
|
-
} = this.layer.getLayerConfig();
|
|
415
|
-
if (textAllowOverlap) {
|
|
416
|
-
// 如果允许文本覆盖
|
|
417
|
-
return;
|
|
418
|
-
}
|
|
419
|
-
this.glyphInfoMap = {};
|
|
420
|
-
this.currentZoom = this.mapService.getZoom();
|
|
421
|
-
this.extent = this.textExtent();
|
|
422
|
-
const {
|
|
423
|
-
width,
|
|
424
|
-
height
|
|
425
|
-
} = this.rendererService.getViewportSize();
|
|
426
|
-
const collisionIndex = new _collisionIndex.default(width, height);
|
|
427
|
-
const filterData = this.glyphInfo.filter(feature => {
|
|
428
|
-
const {
|
|
429
|
-
shaping,
|
|
430
|
-
id = 0
|
|
431
|
-
} = feature;
|
|
432
|
-
const centroid = feature.centroid;
|
|
433
|
-
const size = feature.size;
|
|
434
|
-
const fontScale = size / 16;
|
|
435
|
-
const pixels = this.mapService.lngLatToContainer(centroid);
|
|
436
|
-
const {
|
|
437
|
-
box
|
|
438
|
-
} = collisionIndex.placeCollisionBox({
|
|
439
|
-
x1: shaping.left * fontScale - padding[0],
|
|
440
|
-
x2: shaping.right * fontScale + padding[0],
|
|
441
|
-
y1: shaping.top * fontScale - padding[1],
|
|
442
|
-
y2: shaping.bottom * fontScale + padding[1],
|
|
443
|
-
anchorPointX: pixels.x,
|
|
444
|
-
anchorPointY: pixels.y
|
|
445
|
-
});
|
|
446
|
-
if (box && box.length) {
|
|
447
|
-
collisionIndex.insertCollisionBox(box, id);
|
|
448
|
-
return true;
|
|
449
|
-
} else {
|
|
450
|
-
return false;
|
|
451
|
-
}
|
|
452
|
-
});
|
|
453
|
-
filterData.forEach(item => {
|
|
454
|
-
// @ts-ignore
|
|
455
|
-
this.glyphInfoMap[item.id] = item;
|
|
456
|
-
});
|
|
457
|
-
// this.layer.setEncodedData(filterData);
|
|
458
|
-
}
|
|
459
|
-
/**
|
|
460
|
-
* 初始化文字布局
|
|
461
|
-
*/
|
|
462
|
-
initGlyph() {
|
|
463
|
-
const {
|
|
464
|
-
iconfont = false
|
|
465
|
-
} = this.layer.getLayerConfig();
|
|
466
|
-
// 1.生成文字纹理(或是生成 iconfont)
|
|
467
|
-
iconfont ? this.initIconFontTex() : this.initTextFont();
|
|
468
|
-
// 2.生成文字布局
|
|
469
|
-
this.generateGlyphLayout(iconfont);
|
|
470
|
-
}
|
|
471
|
-
/**
|
|
472
|
-
* 更新文字纹理
|
|
473
|
-
*/
|
|
474
|
-
updateTexture() {
|
|
475
|
-
const {
|
|
476
|
-
createTexture2D
|
|
477
|
-
} = this.rendererService;
|
|
478
|
-
const canvas = this.getFontServiceCanvas();
|
|
479
|
-
this.textureHeight = canvas.height;
|
|
480
|
-
if (this.texture) {
|
|
481
|
-
this.texture.destroy();
|
|
482
|
-
}
|
|
483
|
-
this.texture = createTexture2D({
|
|
484
|
-
data: canvas,
|
|
485
|
-
mag: _l7Core.gl.LINEAR,
|
|
486
|
-
min: _l7Core.gl.LINEAR,
|
|
487
|
-
width: canvas.width,
|
|
488
|
-
height: canvas.height
|
|
489
|
-
});
|
|
490
|
-
this.textures = [this.texture];
|
|
491
|
-
}
|
|
492
|
-
reBuildModel() {
|
|
493
|
-
var _this5 = this;
|
|
494
|
-
return (0, _asyncToGenerator2.default)(function* () {
|
|
495
|
-
_this5.filterGlyphs();
|
|
496
|
-
const model = yield _this5.layer.buildLayerModel({
|
|
497
|
-
moduleName: 'pointText',
|
|
498
|
-
vertexShader: textVert,
|
|
499
|
-
fragmentShader: textFrag,
|
|
500
|
-
triangulation: TextTrianglation.bind(_this5),
|
|
501
|
-
defines: _this5.getDefines(),
|
|
502
|
-
inject: _this5.getInject(),
|
|
503
|
-
depth: {
|
|
504
|
-
enable: false
|
|
505
|
-
}
|
|
506
|
-
});
|
|
507
|
-
// TODO 渲染流程待修改
|
|
508
|
-
_this5.layer.models = [model];
|
|
509
|
-
})();
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
exports.default = TextModel;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
layout(std140) uniform commonUniorm {
|
|
2
|
-
vec4 u_stroke_color;
|
|
3
|
-
float u_additive;
|
|
4
|
-
float u_stroke_opacity;
|
|
5
|
-
float u_stroke_width;
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
in vec4 v_color;
|
|
9
|
-
in float v_blur;
|
|
10
|
-
in float v_innerRadius;
|
|
11
|
-
|
|
12
|
-
out vec4 outputColor;
|
|
13
|
-
|
|
14
|
-
#pragma include "picking"
|
|
15
|
-
void main() {
|
|
16
|
-
vec2 center = vec2(0.5);
|
|
17
|
-
|
|
18
|
-
// Tip: 片元到中心点的距离 0 - 1
|
|
19
|
-
float fragmengTocenter = distance(center, gl_PointCoord) * 2.0;
|
|
20
|
-
// Tip: 片元的剪切成圆形
|
|
21
|
-
float circleClipOpacity = 1.0 - smoothstep(v_blur, 1.0, fragmengTocenter);
|
|
22
|
-
|
|
23
|
-
if (v_innerRadius < 0.99) {
|
|
24
|
-
// 当存在 stroke 且 stroke > 0.01
|
|
25
|
-
float blurWidth = (1.0 - v_blur) / 2.0;
|
|
26
|
-
vec4 stroke = vec4(u_stroke_color.rgb, u_stroke_opacity);
|
|
27
|
-
if (fragmengTocenter > v_innerRadius + blurWidth) {
|
|
28
|
-
outputColor = stroke;
|
|
29
|
-
} else if (fragmengTocenter > v_innerRadius - blurWidth) {
|
|
30
|
-
float mixR = (fragmengTocenter - (v_innerRadius - blurWidth)) / (blurWidth * 2.0);
|
|
31
|
-
outputColor = mix(v_color, stroke, mixR);
|
|
32
|
-
} else {
|
|
33
|
-
outputColor = v_color;
|
|
34
|
-
}
|
|
35
|
-
} else {
|
|
36
|
-
// 当不存在 stroke 或 stroke <= 0.01
|
|
37
|
-
outputColor = v_color;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
outputColor = filterColor(outputColor);
|
|
41
|
-
|
|
42
|
-
if (u_additive > 0.0) {
|
|
43
|
-
outputColor *= circleClipOpacity;
|
|
44
|
-
} else {
|
|
45
|
-
outputColor.a *= circleClipOpacity;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
layout(location = ATTRIBUTE_LOCATION_POSITION) in vec3 a_Position;
|
|
3
|
-
layout(location = ATTRIBUTE_LOCATION_POSITION_64LOW) in vec2 a_Position64Low;
|
|
4
|
-
layout(location = ATTRIBUTE_LOCATION_COLOR) in vec4 a_Color;
|
|
5
|
-
layout(location = ATTRIBUTE_LOCATION_SIZE) in float a_Size;
|
|
6
|
-
|
|
7
|
-
layout(std140) uniform commonUniorm {
|
|
8
|
-
vec4 u_stroke_color;
|
|
9
|
-
float u_additive;
|
|
10
|
-
float u_stroke_opacity;
|
|
11
|
-
float u_stroke_width;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
out vec4 v_color;
|
|
15
|
-
out float v_blur;
|
|
16
|
-
out float v_innerRadius;
|
|
17
|
-
|
|
18
|
-
#pragma include "projection"
|
|
19
|
-
#pragma include "picking"
|
|
20
|
-
#pragma include "project"
|
|
21
|
-
void main() {
|
|
22
|
-
v_color = vec4(a_Color.xyz, a_Color.w * opacity);
|
|
23
|
-
v_blur = 1.0 - max(2.0 / a_Size, 0.05);
|
|
24
|
-
v_innerRadius = max((a_Size - u_stroke_width) / a_Size, 0.0);
|
|
25
|
-
|
|
26
|
-
vec2 offset = project_pixel(u_offsets);
|
|
27
|
-
|
|
28
|
-
vec4 project_pos = project_position(vec4(a_Position, 1.0), a_Position64Low);
|
|
29
|
-
gl_Position = project_common_position_to_clipspace(vec4(vec2(project_pos.xy+offset),project_pos.z,project_pos.w));
|
|
30
|
-
|
|
31
|
-
gl_PointSize = a_Size * 2.0 * u_DevicePixelRatio;
|
|
32
|
-
setPickingColor(a_PickingColor);
|
|
33
|
-
}
|