@antv/l7-layers 2.9.25 → 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 -122
- 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 -324
- 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 -224
- 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 -148
- 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 -106
- 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 -312
- 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 -13
- package/es/tile/utils.js +0 -131
- 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 -119
- package/lib/Geometry/models/billboard.js +0 -246
- package/lib/Geometry/models/index.js +0 -22
- package/lib/Geometry/models/plane.js +0 -436
- package/lib/Geometry/models/sprite.js +0 -318
- 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 -104
- package/lib/canvas/models/canvas.js +0 -221
- package/lib/canvas/models/index.js +0 -16
- package/lib/citybuliding/building.js +0 -101
- package/lib/citybuliding/models/build.js +0 -203
- package/lib/citybuliding/shaders/build_frag.glsl +0 -117
- package/lib/citybuliding/shaders/build_vert.glsl +0 -54
- package/lib/core/BaseLayer.js +0 -1408
- package/lib/core/BaseModel.js +0 -503
- package/lib/core/interface.js +0 -41
- package/lib/core/schema.js +0 -33
- package/lib/core/shape/Path.js +0 -88
- package/lib/core/shape/extrude.js +0 -180
- package/lib/core/triangulation.js +0 -555
- package/lib/earth/index.js +0 -107
- package/lib/earth/models/atmosphere.js +0 -152
- package/lib/earth/models/base.js +0 -222
- package/lib/earth/models/bloomsphere.js +0 -152
- package/lib/earth/shaders/atmosphere_frag.glsl +0 -17
- package/lib/earth/shaders/atmosphere_vert.glsl +0 -26
- package/lib/earth/shaders/base_frag.glsl +0 -13
- package/lib/earth/shaders/base_vert.glsl +0 -52
- package/lib/earth/shaders/bloomsphere_frag.glsl +0 -15
- package/lib/earth/shaders/bloomsphere_vert.glsl +0 -20
- package/lib/earth/utils.js +0 -136
- package/lib/heatmap/index.js +0 -158
- package/lib/heatmap/models/grid.js +0 -122
- package/lib/heatmap/models/grid3d.js +0 -161
- package/lib/heatmap/models/heatmap.js +0 -487
- package/lib/heatmap/models/hexagon.js +0 -125
- package/lib/heatmap/models/index.js +0 -26
- package/lib/heatmap/shaders/grid_vert.glsl +0 -42
- package/lib/heatmap/shaders/heatmap_3d_frag.glsl +0 -14
- package/lib/heatmap/shaders/heatmap_3d_vert.glsl +0 -46
- package/lib/heatmap/shaders/heatmap_frag.glsl +0 -47
- package/lib/heatmap/shaders/heatmap_framebuffer_frag.glsl +0 -10
- package/lib/heatmap/shaders/heatmap_framebuffer_vert.glsl +0 -35
- package/lib/heatmap/shaders/heatmap_vert.glsl +0 -10
- package/lib/heatmap/shaders/hexagon_3d_frag.glsl +0 -0
- package/lib/heatmap/shaders/hexagon_3d_vert.glsl +0 -64
- package/lib/heatmap/shaders/hexagon_frag.glsl +0 -12
- package/lib/heatmap/shaders/hexagon_vert.glsl +0 -41
- package/lib/heatmap/triangulation.js +0 -45
- package/lib/image/index.js +0 -116
- package/lib/image/models/dataImage.js +0 -240
- package/lib/image/models/image.js +0 -183
- package/lib/image/models/index.js +0 -19
- 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 -266
- package/lib/line/index.js +0 -136
- package/lib/line/models/arc.js +0 -373
- package/lib/line/models/arc_3d.js +0 -353
- package/lib/line/models/earthArc_3d.js +0 -356
- package/lib/line/models/great_circle.js +0 -310
- package/lib/line/models/half.js +0 -299
- package/lib/line/models/index.js +0 -46
- package/lib/line/models/line.js +0 -459
- package/lib/line/models/linearline.js +0 -293
- package/lib/line/models/simpleLine.js +0 -248
- package/lib/line/models/tile.js +0 -368
- package/lib/line/models/wall.js +0 -345
- 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 -95
- package/lib/mask/models/fill.js +0 -137
- package/lib/mask/models/index.js +0 -16
- package/lib/mask/shaders/mask_frag.glsl +0 -7
- package/lib/mask/shaders/mask_vert.glsl +0 -22
- package/lib/plugins/DataMappingPlugin.js +0 -360
- package/lib/plugins/DataSourcePlugin.js +0 -108
- package/lib/plugins/FeatureScalePlugin.js +0 -348
- package/lib/plugins/LayerAnimateStylePlugin.js +0 -64
- package/lib/plugins/LayerModelPlugin.js +0 -82
- package/lib/plugins/LayerStylePlugin.js +0 -50
- package/lib/plugins/LightingPlugin.js +0 -125
- package/lib/plugins/MultiPassRendererPlugin.js +0 -93
- package/lib/plugins/PixelPickingPlugin.js +0 -159
- package/lib/plugins/RegisterStyleAttributePlugin.js +0 -117
- package/lib/plugins/ShaderUniformPlugin.js +0 -120
- package/lib/plugins/UpdateModelPlugin.js +0 -42
- package/lib/plugins/UpdateStyleAttributePlugin.js +0 -98
- package/lib/point/index.js +0 -238
- package/lib/point/models/earthExtrude.js +0 -295
- package/lib/point/models/earthFill.js +0 -293
- package/lib/point/models/extrude.js +0 -315
- package/lib/point/models/fill.js +0 -420
- package/lib/point/models/fillmage.js +0 -383
- package/lib/point/models/image.js +0 -255
- package/lib/point/models/index.js +0 -50
- package/lib/point/models/normal.js +0 -194
- package/lib/point/models/radar.js +0 -314
- package/lib/point/models/simplePoint.js +0 -205
- package/lib/point/models/text.js +0 -637
- package/lib/point/models/tile.js +0 -325
- 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 -78
- package/lib/polygon/index.js +0 -162
- package/lib/polygon/models/extrude.js +0 -322
- package/lib/polygon/models/fill.js +0 -226
- package/lib/polygon/models/index.js +0 -50
- package/lib/polygon/models/ocean.js +0 -252
- package/lib/polygon/models/tile.js +0 -147
- package/lib/polygon/models/water.js +0 -229
- 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 -38
- package/lib/raster/index.js +0 -119
- package/lib/raster/models/index.js +0 -20
- package/lib/raster/models/raster.js +0 -182
- package/lib/raster/raster.js +0 -191
- 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 -5
- package/lib/tile/manager/tileConfigManager.js +0 -133
- package/lib/tile/manager/tileLayerManager.js +0 -330
- package/lib/tile/manager/tilePickerManager.js +0 -201
- package/lib/tile/models/tileModel.js +0 -74
- package/lib/tile/tileFactory/base.js +0 -466
- package/lib/tile/tileFactory/index.js +0 -59
- package/lib/tile/tileFactory/line.js +0 -70
- package/lib/tile/tileFactory/point.js +0 -70
- package/lib/tile/tileFactory/polygon.js +0 -70
- package/lib/tile/tileFactory/raster.js +0 -68
- package/lib/tile/tileFactory/rasterData.js +0 -93
- package/lib/tile/tileFactory/rasterDataLayer.js +0 -100
- package/lib/tile/tileFactory/vectorLayer.js +0 -176
- package/lib/tile/tileLayer/baseTileLayer.js +0 -447
- package/lib/tile/tmsTileLayer.js +0 -117
- package/lib/tile/utils.js +0 -158
- package/lib/utils/blend.js +0 -65
- package/lib/utils/collision-index.js +0 -118
- package/lib/utils/dataMappingStyle.js +0 -151
- package/lib/utils/extrude_polyline.js +0 -653
- package/lib/utils/grid-index.js +0 -188
- package/lib/utils/layerData.js +0 -187
- package/lib/utils/multiPassRender.js +0 -61
- package/lib/utils/polylineNormal.js +0 -230
- package/lib/utils/simpleLine.js +0 -116
- package/lib/utils/symbol-layout.js +0 -308
- package/lib/utils/updateShape.js +0 -27
- package/lib/wind/index.js +0 -113
- package/lib/wind/models/index.js +0 -16
- package/lib/wind/models/utils.js +0 -253
- package/lib/wind/models/wind.js +0 -346
- package/lib/wind/models/windRender.js +0 -373
- package/lib/wind/models/windShader.js +0 -25
- package/lib/wind/shaders/wind_frag.glsl +0 -9
- package/lib/wind/shaders/wind_vert.glsl +0 -17
package/lib/point/models/tile.js
DELETED
|
@@ -1,325 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
|
|
10
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
-
|
|
12
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
|
-
|
|
14
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
15
|
-
|
|
16
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
17
|
-
|
|
18
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
19
|
-
|
|
20
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
21
|
-
|
|
22
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
23
|
-
|
|
24
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
25
|
-
|
|
26
|
-
var _l7Core = require("@antv/l7-core");
|
|
27
|
-
|
|
28
|
-
var _l7Utils = require("@antv/l7-utils");
|
|
29
|
-
|
|
30
|
-
var _BaseModel2 = _interopRequireDefault(require("../../core/BaseModel"));
|
|
31
|
-
|
|
32
|
-
var _triangulation = require("../../core/triangulation");
|
|
33
|
-
|
|
34
|
-
var _l7Maps = require("@antv/l7-maps");
|
|
35
|
-
|
|
36
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
37
|
-
|
|
38
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
39
|
-
|
|
40
|
-
/* babel-plugin-inline-import '../shaders/tile/fill_tile_frag.glsl' */
|
|
41
|
-
var point_tile_frag = "uniform float u_additive;\nvarying mat4 styleMappingMat; // \u4F20\u9012\u4ECE\u7247\u5143\u4E2D\u4F20\u9012\u7684\u6620\u5C04\u6570\u636E\n\nvarying vec4 v_data;\nvarying vec4 v_color;\nvarying float v_radius;\n\n#pragma include \"sdf_2d\"\n#pragma include \"picking\"\n\nvoid main() {\n int shape = int(floor(v_data.w + 0.5));\n\n vec4 textrueStroke = vec4(\n styleMappingMat[1][0],\n styleMappingMat[1][1],\n styleMappingMat[1][2],\n styleMappingMat[1][3]\n );\n\n float opacity = styleMappingMat[0][0];\n float stroke_opacity = styleMappingMat[0][1];\n float strokeWidth = styleMappingMat[0][2];\n vec4 strokeColor = textrueStroke == vec4(0) ? v_color : textrueStroke;\n\n lowp float antialiasblur = v_data.z;\n float r = v_radius / (v_radius + strokeWidth);\n\n float outer_df;\n float inner_df;\n // 'circle', 'triangle', 'square', 'pentagon', 'hexagon', 'octogon', 'hexagram', 'rhombus', 'vesica'\n if (shape == 0) {\n outer_df = sdCircle(v_data.xy, 1.0);\n inner_df = sdCircle(v_data.xy, r);\n } else if (shape == 1) {\n outer_df = sdEquilateralTriangle(1.1 * v_data.xy);\n inner_df = sdEquilateralTriangle(1.1 / r * v_data.xy);\n } else if (shape == 2) {\n outer_df = sdBox(v_data.xy, vec2(1.));\n inner_df = sdBox(v_data.xy, vec2(r));\n } else if (shape == 3) {\n outer_df = sdPentagon(v_data.xy, 0.8);\n inner_df = sdPentagon(v_data.xy, r * 0.8);\n } else if (shape == 4) {\n outer_df = sdHexagon(v_data.xy, 0.8);\n inner_df = sdHexagon(v_data.xy, r * 0.8);\n } else if (shape == 5) {\n outer_df = sdOctogon(v_data.xy, 1.0);\n inner_df = sdOctogon(v_data.xy, r);\n } else if (shape == 6) {\n outer_df = sdHexagram(v_data.xy, 0.52);\n inner_df = sdHexagram(v_data.xy, r * 0.52);\n } else if (shape == 7) {\n outer_df = sdRhombus(v_data.xy, vec2(1.0));\n inner_df = sdRhombus(v_data.xy, vec2(r));\n } else if (shape == 8) {\n outer_df = sdVesica(v_data.xy, 1.1, 0.8);\n inner_df = sdVesica(v_data.xy, r * 1.1, r * 0.8);\n }\n\n\n float opacity_t = smoothstep(0.0, antialiasblur, outer_df);\n\n float color_t = strokeWidth < 0.01 ? 0.0 : smoothstep(\n antialiasblur,\n 0.0,\n inner_df\n );\n\n if(strokeWidth < 0.01) {\n gl_FragColor = vec4(v_color.rgb, v_color.a * opacity);\n } else {\n gl_FragColor = mix(vec4(v_color.rgb, v_color.a * opacity), strokeColor * stroke_opacity, color_t);\n }\n\n if(u_additive > 0.0) {\n gl_FragColor *= opacity_t;\n gl_FragColor = filterColorAlpha(gl_FragColor, gl_FragColor.a);\n } else {\n gl_FragColor.a *= opacity_t;\n gl_FragColor = filterColor(gl_FragColor);\n }\n}\n";
|
|
42
|
-
|
|
43
|
-
/* babel-plugin-inline-import '../shaders/tile/fill_tile_vert.glsl' */
|
|
44
|
-
var point_tile_vert = "attribute vec4 a_Color;\nattribute vec3 a_Position;\nattribute vec3 a_Extrude;\nattribute float a_Size;\nattribute float a_Shape;\n\nvarying mat4 styleMappingMat; // \u7528\u4E8E\u5C06\u5728\u9876\u70B9\u7740\u8272\u5668\u4E2D\u8BA1\u7B97\u597D\u7684\u6837\u5F0F\u503C\u4F20\u9012\u7ED9\u7247\u5143\n\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nuniform float u_isMeter;\n\nuniform vec2 u_tileOrigin;\nuniform float u_coord;\n\nvarying vec4 v_data;\nvarying vec4 v_color;\nvarying float v_radius;\n\nuniform float u_opacity : 1;\nuniform float u_stroke_opacity : 1;\nuniform float u_stroke_width : 2;\nuniform vec4 u_stroke_color : [0.0, 0.0, 0.0, 0.0];\nuniform vec2 u_offsets;\n\nuniform float u_blur : 0.0;\n\n#pragma include \"styleMapping\"\n#pragma include \"styleMappingCalOpacity\"\n#pragma include \"styleMappingCalStrokeOpacity\"\n#pragma include \"styleMappingCalStrokeWidth\"\n\n#pragma include \"projection\"\n#pragma include \"picking\"\n\nvoid main() {\n vec3 extrude = a_Extrude;\n float shape_type = a_Shape;\n float newSize = setPickingSize(a_Size);\n\n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\n styleMappingMat = mat4(\n 0.0, 0.0, 0.0, 0.0, // opacity - strokeOpacity - strokeWidth - empty\n 0.0, 0.0, 0.0, 0.0, // strokeR - strokeG - strokeB - strokeA\n 0.0, 0.0, 0.0, 0.0, // offsets[0] - offsets[1]\n 0.0, 0.0, 0.0, 0.0\n );\n\n float rowCount = u_cellTypeLayout[0][0]; // \u5F53\u524D\u7684\u6570\u636E\u7EB9\u7406\u6709\u51E0\u884C\n float columnCount = u_cellTypeLayout[0][1]; // \u5F53\u770B\u5230\u6570\u636E\u7EB9\u7406\u6709\u51E0\u5217\n float columnWidth = 1.0/columnCount; // \u5217\u5BBD\n float rowHeight = 1.0/rowCount; // \u884C\u9AD8\n float cellCount = calCellCount(); // opacity - strokeOpacity - strokeWidth - stroke - offsets\n float id = a_vertexId; // \u7B2Cn\u4E2A\u9876\u70B9\n float cellCurrentRow = floor(id * cellCount / columnCount) + 1.0; // \u8D77\u59CB\u70B9\u5728\u7B2C\u51E0\u884C\n float cellCurrentColumn = mod(id * cellCount, columnCount) + 1.0; // \u8D77\u59CB\u70B9\u5728\u7B2C\u51E0\u5217\n \n // cell \u56FA\u5B9A\u987A\u5E8F opacity -> strokeOpacity -> strokeWidth -> stroke ... \n // \u6309\u987A\u5E8F\u4ECE cell \u4E2D\u53D6\u503C\u3001\u82E5\u6CA1\u6709\u5219\u81EA\u52A8\u5F80\u4E0B\u53D6\u503C\n float textureOffset = 0.0; // \u5728 cell \u4E2D\u53D6\u503C\u7684\u504F\u79FB\u91CF\n\n vec2 opacityAndOffset = calOpacityAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);\n styleMappingMat[0][0] = opacityAndOffset.r;\n textureOffset = opacityAndOffset.g;\n\n vec2 strokeOpacityAndOffset = calStrokeOpacityAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);\n styleMappingMat[0][1] = strokeOpacityAndOffset.r;\n textureOffset = strokeOpacityAndOffset.g;\n\n vec2 strokeWidthAndOffset = calStrokeWidthAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);\n styleMappingMat[0][2] = strokeWidthAndOffset.r;\n textureOffset = strokeWidthAndOffset.g;\n\n vec4 textrueStroke = vec4(-1.0, -1.0, -1.0, -1.0);\n if(hasStroke()) {\n vec2 valueRPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n styleMappingMat[1][0] = pos2value(valueRPos, columnWidth, rowHeight); // R\n textureOffset += 1.0;\n\n vec2 valueGPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n styleMappingMat[1][1] = pos2value(valueGPos, columnWidth, rowHeight); // G\n textureOffset += 1.0;\n\n vec2 valueBPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n styleMappingMat[1][2] = pos2value(valueBPos, columnWidth, rowHeight); // B\n textureOffset += 1.0;\n\n vec2 valueAPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n styleMappingMat[1][3] = pos2value(valueAPos, columnWidth, rowHeight); // A\n textureOffset += 1.0;\n } else {\n if(u_stroke_color == vec4(0.0)) {\n styleMappingMat[1][0] = v_color.r;\n styleMappingMat[1][1] = v_color.g;\n styleMappingMat[1][2] = v_color.b;\n styleMappingMat[1][3] = v_color.a;\n } else {\n styleMappingMat[1][0] = u_stroke_color.r;\n styleMappingMat[1][1] = u_stroke_color.g;\n styleMappingMat[1][2] = u_stroke_color.b;\n styleMappingMat[1][3] = u_stroke_color.a;\n }\n }\n\n vec2 textrueOffsets = vec2(0.0, 0.0);\n if(hasOffsets()) {\n vec2 valueXPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n textrueOffsets.r = pos2value(valueXPos, columnWidth, rowHeight); // x\n textureOffset += 1.0;\n\n vec2 valueYPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n textrueOffsets.g = pos2value(valueYPos, columnWidth, rowHeight); // x\n textureOffset += 1.0;\n } else {\n textrueOffsets = u_offsets;\n }\n\n // cal style mapping\n\n v_color = a_Color;\n v_radius = newSize;\n\n // anti-alias\n // float antialiased_blur = -max(u_blur, antialiasblur);\n float antialiasblur = -max(2.0 / u_DevicePixelRatio / a_Size, u_blur);\n\n vec2 offset = (extrude.xy * (newSize + u_stroke_width) + textrueOffsets);\n vec3 aPosition = a_Position;\n if(u_isMeter < 1.0) {\n // \u4E0D\u4EE5\u7C73\u4E3A\u5B9E\u9645\u5355\u4F4D\n offset = project_pixel(offset);\n } else {\n // \u4EE5\u7C73\u4E3A\u5B9E\u9645\u5355\u4F4D\n antialiasblur *= pow(19.0 - u_Zoom, 2.0);\n antialiasblur = max(antialiasblur, -0.01);\n // offset *= 0.5;\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n aPosition.xy += offset;\n offset.x = 0.0;\n offset.y = 0.0;\n }\n }\n\n v_data = vec4(extrude.x, extrude.y, antialiasblur,shape_type);\n\n vec4 project_pos = project_position(vec4(aPosition.xy, 0.0, 1.0));\n\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 }\n\nif(u_coord > 0.0) {\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * vec4(project_pos.xy + offset, 0.0, 1.0);\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, 0.0, 1.0));\n }\n} else {\n gl_PointSize = 24.0;\n vec2 pointPos = a_Position.xy;\n vec4 world = vec4(project_mvt_offset_position(vec4(u_tileOrigin, 0.0, 1.0)).xyz, 1.0); // \u74E6\u7247\u8D77\u59CB\u70B9\u7684\u4E16\u754C\u5750\u6807\n\n vec2 pointOffset = pointPos * pow(2.0, u_Zoom); // \u74E6\u7247\u5185\u7684\u70B9\u7684\u504F\u79FB\u5750\u6807\n \n world.xy += offset;\n world.xy += pointOffset;\n\n if (u_CoordinateSystem == COORDINATE_SYSTEM_METER_OFFSET || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n // Needs to be divided with project_uCommonUnitsPerMeter\n world.w *= u_PixelsPerMeter.z;\n }\n\n gl_Position = u_ViewProjectionMatrix * world + u_ViewportCenterProjection;\n}\n\n \n setPickingColor(a_PickingColor);\n\n\n}\n";
|
|
45
|
-
|
|
46
|
-
var FillModel = /*#__PURE__*/function (_BaseModel) {
|
|
47
|
-
(0, _inherits2.default)(FillModel, _BaseModel);
|
|
48
|
-
|
|
49
|
-
var _super = _createSuper(FillModel);
|
|
50
|
-
|
|
51
|
-
function FillModel() {
|
|
52
|
-
var _this;
|
|
53
|
-
|
|
54
|
-
(0, _classCallCheck2.default)(this, FillModel);
|
|
55
|
-
|
|
56
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
57
|
-
args[_key] = arguments[_key];
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
61
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "meter2coord", 1);
|
|
62
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "isMeter", false);
|
|
63
|
-
return _this;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
(0, _createClass2.default)(FillModel, [{
|
|
67
|
-
key: "getUninforms",
|
|
68
|
-
value: function getUninforms() {
|
|
69
|
-
var _ref = this.layer.getLayerConfig(),
|
|
70
|
-
_ref$opacity = _ref.opacity,
|
|
71
|
-
opacity = _ref$opacity === void 0 ? 1 : _ref$opacity,
|
|
72
|
-
_ref$strokeOpacity = _ref.strokeOpacity,
|
|
73
|
-
strokeOpacity = _ref$strokeOpacity === void 0 ? 1 : _ref$strokeOpacity,
|
|
74
|
-
_ref$strokeWidth = _ref.strokeWidth,
|
|
75
|
-
strokeWidth = _ref$strokeWidth === void 0 ? 0 : _ref$strokeWidth,
|
|
76
|
-
_ref$stroke = _ref.stroke,
|
|
77
|
-
stroke = _ref$stroke === void 0 ? 'rgba(0,0,0,0)' : _ref$stroke,
|
|
78
|
-
_ref$offsets = _ref.offsets,
|
|
79
|
-
offsets = _ref$offsets === void 0 ? [0, 0] : _ref$offsets,
|
|
80
|
-
blend = _ref.blend,
|
|
81
|
-
_ref$blur = _ref.blur,
|
|
82
|
-
blur = _ref$blur === void 0 ? 0 : _ref$blur,
|
|
83
|
-
_ref$coord = _ref.coord,
|
|
84
|
-
coord = _ref$coord === void 0 ? 'lnglat' : _ref$coord,
|
|
85
|
-
tileOrigin = _ref.tileOrigin;
|
|
86
|
-
|
|
87
|
-
if (this.dataTextureTest && this.dataTextureNeedUpdate({
|
|
88
|
-
opacity: opacity,
|
|
89
|
-
strokeOpacity: strokeOpacity,
|
|
90
|
-
strokeWidth: strokeWidth,
|
|
91
|
-
stroke: stroke,
|
|
92
|
-
offsets: offsets
|
|
93
|
-
})) {
|
|
94
|
-
// 判断当前的样式中哪些是需要进行数据映射的,哪些是常量,同时计算用于构建数据纹理的一些中间变量
|
|
95
|
-
this.judgeStyleAttributes({
|
|
96
|
-
opacity: opacity,
|
|
97
|
-
strokeOpacity: strokeOpacity,
|
|
98
|
-
strokeWidth: strokeWidth,
|
|
99
|
-
stroke: stroke,
|
|
100
|
-
offsets: offsets
|
|
101
|
-
});
|
|
102
|
-
var encodeData = this.layer.getEncodedData();
|
|
103
|
-
|
|
104
|
-
var _this$calDataFrame = this.calDataFrame(this.cellLength, encodeData, this.cellProperties),
|
|
105
|
-
data = _this$calDataFrame.data,
|
|
106
|
-
width = _this$calDataFrame.width,
|
|
107
|
-
height = _this$calDataFrame.height;
|
|
108
|
-
|
|
109
|
-
this.rowCount = height; // 当前数据纹理有多少行
|
|
110
|
-
|
|
111
|
-
this.dataTexture = this.cellLength > 0 && data.length > 0 ? this.createTexture2D({
|
|
112
|
-
flipY: true,
|
|
113
|
-
data: data,
|
|
114
|
-
format: _l7Core.gl.LUMINANCE,
|
|
115
|
-
type: _l7Core.gl.FLOAT,
|
|
116
|
-
width: width,
|
|
117
|
-
height: height
|
|
118
|
-
}) : this.createTexture2D({
|
|
119
|
-
flipY: true,
|
|
120
|
-
data: [1],
|
|
121
|
-
format: _l7Core.gl.LUMINANCE,
|
|
122
|
-
type: _l7Core.gl.FLOAT,
|
|
123
|
-
width: 1,
|
|
124
|
-
height: 1
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
return {
|
|
129
|
-
u_tileOrigin: tileOrigin || [0, 0],
|
|
130
|
-
u_coord: coord === 'lnglat' ? 1.0 : 0.0,
|
|
131
|
-
u_isMeter: Number(this.isMeter),
|
|
132
|
-
u_blur: blur,
|
|
133
|
-
u_additive: blend === 'additive' ? 1.0 : 0.0,
|
|
134
|
-
u_dataTexture: this.dataTexture,
|
|
135
|
-
// 数据纹理 - 有数据映射的时候纹理中带数据,若没有任何数据映射时纹理是 [1]
|
|
136
|
-
u_cellTypeLayout: this.getCellTypeLayout(),
|
|
137
|
-
u_opacity: Number(opacity),
|
|
138
|
-
u_stroke_opacity: Number(strokeOpacity),
|
|
139
|
-
u_stroke_width: Number(strokeWidth),
|
|
140
|
-
u_stroke_color: this.getStrokeColor(stroke),
|
|
141
|
-
u_offsets: this.isOffsetStatic(offsets) ? offsets : [0, 0]
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
|
-
}, {
|
|
145
|
-
key: "getAttribute",
|
|
146
|
-
value: function getAttribute() {
|
|
147
|
-
return this.styleAttributeService.createAttributesAndIndices(this.layer.getEncodedData(), _triangulation.PointFillTriangulation);
|
|
148
|
-
}
|
|
149
|
-
}, {
|
|
150
|
-
key: "initModels",
|
|
151
|
-
value: function initModels(callbackModel) {
|
|
152
|
-
var _ref2 = this.layer.getLayerConfig(),
|
|
153
|
-
_ref2$unit = _ref2.unit,
|
|
154
|
-
unit = _ref2$unit === void 0 ? 'l7size' : _ref2$unit;
|
|
155
|
-
|
|
156
|
-
var version = this.mapService.version;
|
|
157
|
-
|
|
158
|
-
if (unit === 'meter' && version !== _l7Maps.Version.L7MAP && version !== _l7Maps.Version.GLOBEL) {
|
|
159
|
-
this.isMeter = true;
|
|
160
|
-
this.calMeter2Coord();
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
this.buildModels(callbackModel);
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* 计算等面积点图层(unit meter)笛卡尔坐标标度与世界坐标标度的比例
|
|
167
|
-
* @returns
|
|
168
|
-
*/
|
|
169
|
-
|
|
170
|
-
}, {
|
|
171
|
-
key: "calMeter2Coord",
|
|
172
|
-
value: function calMeter2Coord() {
|
|
173
|
-
var _this$layer$getSource = (0, _slicedToArray2.default)(this.layer.getSource().extent, 4),
|
|
174
|
-
minLng = _this$layer$getSource[0],
|
|
175
|
-
minLat = _this$layer$getSource[1],
|
|
176
|
-
maxLng = _this$layer$getSource[2],
|
|
177
|
-
maxLat = _this$layer$getSource[3];
|
|
178
|
-
|
|
179
|
-
var center = [(minLng + maxLng) / 2, (minLat + maxLat) / 2];
|
|
180
|
-
var version = this.mapService.version;
|
|
181
|
-
|
|
182
|
-
if (version === _l7Maps.Version.MAPBOX && window.mapboxgl.MercatorCoordinate) {
|
|
183
|
-
var coord = window.mapboxgl.MercatorCoordinate.fromLngLat({
|
|
184
|
-
lng: center[0],
|
|
185
|
-
lat: center[1]
|
|
186
|
-
}, 0);
|
|
187
|
-
var offsetInMeters = 1;
|
|
188
|
-
var offsetInMercatorCoordinateUnits = offsetInMeters * coord.meterInMercatorCoordinateUnits();
|
|
189
|
-
var westCoord = new window.mapboxgl.MercatorCoordinate(coord.x - offsetInMercatorCoordinateUnits, coord.y, coord.z);
|
|
190
|
-
var westLnglat = westCoord.toLngLat();
|
|
191
|
-
this.meter2coord = center[0] - westLnglat.lng;
|
|
192
|
-
return;
|
|
193
|
-
} // @ts-ignore
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
var m1 = this.mapService.meterToCoord(center, [minLng, minLat]); // @ts-ignore
|
|
197
|
-
|
|
198
|
-
var m2 = this.mapService.meterToCoord(center, [maxLng === minLng ? maxLng + 0.1 : maxLng, maxLat === minLat ? minLat + 0.1 : maxLat]);
|
|
199
|
-
this.meter2coord = (m1 + m2) / 2;
|
|
200
|
-
|
|
201
|
-
if (!this.meter2coord) {
|
|
202
|
-
// Tip: 兼容单个数据导致的 m1、m2 为 NaN
|
|
203
|
-
this.meter2coord = 7.70681090738883;
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
}, {
|
|
207
|
-
key: "buildModels",
|
|
208
|
-
value: function buildModels(callbackModel) {
|
|
209
|
-
var _ref3 = this.layer.getLayerConfig(),
|
|
210
|
-
_ref3$mask = _ref3.mask,
|
|
211
|
-
mask = _ref3$mask === void 0 ? false : _ref3$mask,
|
|
212
|
-
_ref3$maskInside = _ref3.maskInside,
|
|
213
|
-
maskInside = _ref3$maskInside === void 0 ? true : _ref3$maskInside,
|
|
214
|
-
_ref3$workerEnabled = _ref3.workerEnabled,
|
|
215
|
-
workerEnabled = _ref3$workerEnabled === void 0 ? false : _ref3$workerEnabled;
|
|
216
|
-
|
|
217
|
-
this.layer.triangulation = _triangulation.PointFillTriangulation;
|
|
218
|
-
this.layer.buildLayerModel({
|
|
219
|
-
moduleName: 'pointTile',
|
|
220
|
-
vertexShader: point_tile_vert,
|
|
221
|
-
fragmentShader: point_tile_frag,
|
|
222
|
-
triangulation: _triangulation.PointFillTriangulation,
|
|
223
|
-
depth: {
|
|
224
|
-
enable: false
|
|
225
|
-
},
|
|
226
|
-
cull: {
|
|
227
|
-
enable: true,
|
|
228
|
-
face: (0, _l7Utils.getCullFace)(this.mapService.version)
|
|
229
|
-
},
|
|
230
|
-
blend: this.getBlend(),
|
|
231
|
-
stencil: (0, _l7Utils.getMask)(mask, maskInside),
|
|
232
|
-
workerEnabled: workerEnabled,
|
|
233
|
-
workerOptions: {
|
|
234
|
-
modelType: 'pointTile'
|
|
235
|
-
}
|
|
236
|
-
}).then(function (model) {
|
|
237
|
-
callbackModel([model]);
|
|
238
|
-
}).catch(function (err) {
|
|
239
|
-
console.warn(err);
|
|
240
|
-
callbackModel([]);
|
|
241
|
-
});
|
|
242
|
-
}
|
|
243
|
-
}, {
|
|
244
|
-
key: "clearModels",
|
|
245
|
-
value: function clearModels() {
|
|
246
|
-
var _this$dataTexture;
|
|
247
|
-
|
|
248
|
-
(_this$dataTexture = this.dataTexture) === null || _this$dataTexture === void 0 ? void 0 : _this$dataTexture.destroy();
|
|
249
|
-
} // overwrite baseModel func
|
|
250
|
-
|
|
251
|
-
}, {
|
|
252
|
-
key: "registerBuiltinAttributes",
|
|
253
|
-
value: function registerBuiltinAttributes() {
|
|
254
|
-
var _this2 = this;
|
|
255
|
-
|
|
256
|
-
this.styleAttributeService.registerStyleAttribute({
|
|
257
|
-
name: 'extrude',
|
|
258
|
-
type: _l7Core.AttributeType.Attribute,
|
|
259
|
-
descriptor: {
|
|
260
|
-
name: 'a_Extrude',
|
|
261
|
-
buffer: {
|
|
262
|
-
// give the WebGL driver a hint that this buffer may change
|
|
263
|
-
usage: _l7Core.gl.DYNAMIC_DRAW,
|
|
264
|
-
data: [],
|
|
265
|
-
type: _l7Core.gl.FLOAT
|
|
266
|
-
},
|
|
267
|
-
size: 3,
|
|
268
|
-
update: function update(feature, featureIdx, vertex, attributeIdx) {
|
|
269
|
-
var extrude = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, -1, 0];
|
|
270
|
-
var extrudeIndex = attributeIdx % 4 * 3;
|
|
271
|
-
return [extrude[extrudeIndex], extrude[extrudeIndex + 1], extrude[extrudeIndex + 2]];
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
}); // point layer size;
|
|
275
|
-
|
|
276
|
-
this.styleAttributeService.registerStyleAttribute({
|
|
277
|
-
name: 'size',
|
|
278
|
-
type: _l7Core.AttributeType.Attribute,
|
|
279
|
-
descriptor: {
|
|
280
|
-
name: 'a_Size',
|
|
281
|
-
buffer: {
|
|
282
|
-
// give the WebGL driver a hint that this buffer may change
|
|
283
|
-
usage: _l7Core.gl.DYNAMIC_DRAW,
|
|
284
|
-
data: [],
|
|
285
|
-
type: _l7Core.gl.FLOAT
|
|
286
|
-
},
|
|
287
|
-
size: 1,
|
|
288
|
-
update: function update(feature, featureIdx, vertex, attributeIdx) {
|
|
289
|
-
var _feature$size = feature.size,
|
|
290
|
-
size = _feature$size === void 0 ? 5 : _feature$size; // console.log('featureIdx', featureIdx, feature)
|
|
291
|
-
|
|
292
|
-
return Array.isArray(size) ? [size[0] * _this2.meter2coord] : [size * _this2.meter2coord];
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
}); // point layer size;
|
|
296
|
-
|
|
297
|
-
this.styleAttributeService.registerStyleAttribute({
|
|
298
|
-
name: 'shape',
|
|
299
|
-
type: _l7Core.AttributeType.Attribute,
|
|
300
|
-
descriptor: {
|
|
301
|
-
name: 'a_Shape',
|
|
302
|
-
buffer: {
|
|
303
|
-
// give the WebGL driver a hint that this buffer may change
|
|
304
|
-
usage: _l7Core.gl.DYNAMIC_DRAW,
|
|
305
|
-
data: [],
|
|
306
|
-
type: _l7Core.gl.FLOAT
|
|
307
|
-
},
|
|
308
|
-
size: 1,
|
|
309
|
-
update: function update(feature, featureIdx, vertex, attributeIdx) {
|
|
310
|
-
var _feature$shape = feature.shape,
|
|
311
|
-
shape = _feature$shape === void 0 ? 2 : _feature$shape;
|
|
312
|
-
|
|
313
|
-
var shape2d = _this2.layer.getLayerConfig().shape2d;
|
|
314
|
-
|
|
315
|
-
var shapeIndex = shape2d.indexOf(shape);
|
|
316
|
-
return [shapeIndex];
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
});
|
|
320
|
-
}
|
|
321
|
-
}]);
|
|
322
|
-
return FillModel;
|
|
323
|
-
}(_BaseModel2.default);
|
|
324
|
-
|
|
325
|
-
exports.default = FillModel;
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
uniform float u_additive;
|
|
3
|
-
|
|
4
|
-
varying mat4 styleMappingMat; // 传递从片元中传递的映射数据
|
|
5
|
-
|
|
6
|
-
varying vec4 v_data;
|
|
7
|
-
varying vec4 v_color;
|
|
8
|
-
varying float v_radius;
|
|
9
|
-
uniform float u_time;
|
|
10
|
-
uniform vec4 u_aimate: [ 0, 2., 1.0, 0.2 ];
|
|
11
|
-
|
|
12
|
-
#pragma include "sdf_2d"
|
|
13
|
-
#pragma include "picking"
|
|
14
|
-
|
|
15
|
-
void main() {
|
|
16
|
-
|
|
17
|
-
vec4 textrueStroke = vec4(
|
|
18
|
-
styleMappingMat[1][0],
|
|
19
|
-
styleMappingMat[1][1],
|
|
20
|
-
styleMappingMat[1][2],
|
|
21
|
-
styleMappingMat[1][3]
|
|
22
|
-
);
|
|
23
|
-
|
|
24
|
-
float opacity = styleMappingMat[0][0];
|
|
25
|
-
|
|
26
|
-
lowp float antialiasblur = v_data.z;
|
|
27
|
-
float r = v_radius / (v_radius);
|
|
28
|
-
|
|
29
|
-
float outer_df;
|
|
30
|
-
float inner_df;
|
|
31
|
-
// 'circle', 'triangle', 'square', 'pentagon', 'hexagon', 'octogon', 'hexagram', 'rhombus', 'vesica'
|
|
32
|
-
|
|
33
|
-
outer_df = sdCircle(v_data.xy, 1.0);
|
|
34
|
-
inner_df = sdCircle(v_data.xy, r);
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
float opacity_t = smoothstep(0.0, antialiasblur, outer_df);
|
|
38
|
-
|
|
39
|
-
float color_t = smoothstep(
|
|
40
|
-
antialiasblur,
|
|
41
|
-
0.0,
|
|
42
|
-
inner_df
|
|
43
|
-
);
|
|
44
|
-
float PI = 3.14159;
|
|
45
|
-
float N_RINGS = 3.0;
|
|
46
|
-
float FREQ = 1.0;
|
|
47
|
-
|
|
48
|
-
gl_FragColor = vec4(v_color.rgb, v_color.a * opacity);
|
|
49
|
-
|
|
50
|
-
float d = length(v_data.xy);
|
|
51
|
-
if(d > 0.5) {
|
|
52
|
-
discard;
|
|
53
|
-
}
|
|
54
|
-
float intensity = clamp(cos(d * PI), 0.0, 1.0) * clamp(cos(2.0 * PI * (d * 2.0 * u_aimate.z - u_aimate.y * u_time)), 0.0, 1.0);
|
|
55
|
-
|
|
56
|
-
// TODO: 根据叠加模式选择效果
|
|
57
|
-
if(u_additive > 0.0) {
|
|
58
|
-
gl_FragColor *= intensity;
|
|
59
|
-
// TODO: 优化水波点 blend additive 模式下有的拾取效果
|
|
60
|
-
gl_FragColor = filterColorAlpha(gl_FragColor, gl_FragColor.a);
|
|
61
|
-
} else {
|
|
62
|
-
gl_FragColor = vec4(gl_FragColor.xyz, gl_FragColor.a * intensity);
|
|
63
|
-
gl_FragColor = filterColor(gl_FragColor);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
varying vec4 v_color;
|
|
2
|
-
uniform float u_opacity: 1.0;
|
|
3
|
-
|
|
4
|
-
uniform float u_pickLight: 0.0;
|
|
5
|
-
|
|
6
|
-
#pragma include "picking"
|
|
7
|
-
|
|
8
|
-
varying mat4 styleMappingMat; // 传递从片元中传递的映射数据
|
|
9
|
-
|
|
10
|
-
uniform float u_linearColor: 0;
|
|
11
|
-
uniform vec4 u_sourceColor;
|
|
12
|
-
uniform vec4 u_targetColor;
|
|
13
|
-
|
|
14
|
-
uniform float u_opacitylinear: 0.0;
|
|
15
|
-
uniform float u_opacitylinear_dir: 1.0;
|
|
16
|
-
|
|
17
|
-
void main() {
|
|
18
|
-
float opacity = styleMappingMat[0][0];
|
|
19
|
-
float lightWeight = styleMappingMat[1][3];
|
|
20
|
-
float barLinearZ = styleMappingMat[2][3];
|
|
21
|
-
|
|
22
|
-
// 设置圆柱的底色
|
|
23
|
-
if(u_linearColor == 1.0) { // 使用渐变颜色
|
|
24
|
-
gl_FragColor = mix(u_sourceColor, u_targetColor, barLinearZ);
|
|
25
|
-
gl_FragColor.rgb *= lightWeight;
|
|
26
|
-
} else { // 使用 color 方法传入的颜色
|
|
27
|
-
gl_FragColor = v_color;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// 应用透明度
|
|
31
|
-
gl_FragColor.a *= opacity;
|
|
32
|
-
|
|
33
|
-
// 开启透明度渐变
|
|
34
|
-
if(u_opacitylinear > 0.0) {
|
|
35
|
-
gl_FragColor.a *= u_opacitylinear_dir > 0.0 ? (1.0 - barLinearZ): barLinearZ;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// picking
|
|
39
|
-
if(u_pickLight > 0.0) {
|
|
40
|
-
gl_FragColor = filterColorAlpha(gl_FragColor, lightWeight);
|
|
41
|
-
} else {
|
|
42
|
-
gl_FragColor = filterColor(gl_FragColor);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
precision highp float;
|
|
2
|
-
|
|
3
|
-
#define pi 3.1415926535
|
|
4
|
-
#define ambientRatio 0.5
|
|
5
|
-
#define diffuseRatio 0.3
|
|
6
|
-
#define specularRatio 0.2
|
|
7
|
-
|
|
8
|
-
attribute vec3 a_Position;
|
|
9
|
-
attribute vec3 a_Pos;
|
|
10
|
-
attribute vec4 a_Color;
|
|
11
|
-
attribute vec3 a_Size;
|
|
12
|
-
attribute vec3 a_Normal;
|
|
13
|
-
|
|
14
|
-
uniform float u_heightfixed: 0.0; // 默认不固定
|
|
15
|
-
uniform float u_globel;
|
|
16
|
-
uniform float u_r;
|
|
17
|
-
uniform mat4 u_ModelMatrix;
|
|
18
|
-
uniform mat4 u_Mvp;
|
|
19
|
-
varying vec4 v_color;
|
|
20
|
-
|
|
21
|
-
uniform float u_opacity : 1;
|
|
22
|
-
uniform float u_lightEnable: 1;
|
|
23
|
-
|
|
24
|
-
varying mat4 styleMappingMat; // 用于将在顶点着色器中计算好的样式值传递给片元
|
|
25
|
-
|
|
26
|
-
#pragma include "styleMapping"
|
|
27
|
-
#pragma include "styleMappingCalOpacity"
|
|
28
|
-
|
|
29
|
-
#pragma include "projection"
|
|
30
|
-
#pragma include "light"
|
|
31
|
-
#pragma include "picking"
|
|
32
|
-
|
|
33
|
-
float getYRadian(float x, float z) {
|
|
34
|
-
if(x > 0.0 && z > 0.0) {
|
|
35
|
-
return atan(x/z);
|
|
36
|
-
} else if(x > 0.0 && z <= 0.0){
|
|
37
|
-
return atan(-z/x) + pi/2.0;
|
|
38
|
-
} else if(x <= 0.0 && z <= 0.0) {
|
|
39
|
-
return pi + atan(x/z); //atan(x/z) +
|
|
40
|
-
} else {
|
|
41
|
-
return atan(z/-x) + pi*3.0/2.0;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
float getXRadian(float y, float r) {
|
|
46
|
-
return atan(y/r);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
void main() {
|
|
50
|
-
|
|
51
|
-
// cal style mapping - 数据纹理映射部分的计算
|
|
52
|
-
styleMappingMat = mat4(
|
|
53
|
-
0.0, 0.0, 0.0, 0.0, // opacity - strokeOpacity - strokeWidth - empty
|
|
54
|
-
0.0, 0.0, 0.0, 0.0, // strokeR - strokeG - strokeB - strokeA - lightWeight
|
|
55
|
-
0.0, 0.0, 0.0, 0.0, // offsets[0] - offsets[1] - linearZ(垂直方向 0 - 1 的值)
|
|
56
|
-
0.0, 0.0, 0.0, 0.0
|
|
57
|
-
);
|
|
58
|
-
|
|
59
|
-
float rowCount = u_cellTypeLayout[0][0]; // 当前的数据纹理有几行
|
|
60
|
-
float columnCount = u_cellTypeLayout[0][1]; // 当看到数据纹理有几列
|
|
61
|
-
float columnWidth = 1.0/columnCount; // 列宽
|
|
62
|
-
float rowHeight = 1.0/rowCount; // 行高
|
|
63
|
-
float cellCount = calCellCount(); // opacity - strokeOpacity - strokeWidth - stroke - offsets
|
|
64
|
-
float id = a_vertexId; // 第n个顶点
|
|
65
|
-
float cellCurrentRow = floor(id * cellCount / columnCount) + 1.0; // 起始点在第几行
|
|
66
|
-
float cellCurrentColumn = mod(id * cellCount, columnCount) + 1.0; // 起始点在第几列
|
|
67
|
-
|
|
68
|
-
// cell 固定顺序 opacity -> strokeOpacity -> strokeWidth -> stroke ...
|
|
69
|
-
// 按顺序从 cell 中取值、若没有则自动往下取值
|
|
70
|
-
float textureOffset = 0.0; // 在 cell 中取值的偏移量
|
|
71
|
-
|
|
72
|
-
vec2 opacityAndOffset = calOpacityAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);
|
|
73
|
-
styleMappingMat[0][0] = opacityAndOffset.r;
|
|
74
|
-
textureOffset = opacityAndOffset.g;
|
|
75
|
-
// cal style mapping - 数据纹理映射部分的计算
|
|
76
|
-
vec3 size = a_Size * a_Position;
|
|
77
|
-
|
|
78
|
-
// a_Position.z 是在构建网格的时候传入的标准值 0 - 1,在插值器插值可以获取 0~1 线性渐变的值
|
|
79
|
-
styleMappingMat[2][3] = a_Position.z;
|
|
80
|
-
|
|
81
|
-
vec3 offset = size; // 控制圆柱体的大小 - 从标准单位圆柱体进行偏移
|
|
82
|
-
if(u_heightfixed < 1.0) { // 圆柱体不固定高度
|
|
83
|
-
|
|
84
|
-
if (u_CoordinateSystem == COORDINATE_SYSTEM_P20 || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {
|
|
85
|
-
// P20 坐标系下,为了和 Web 墨卡托坐标系统一,zoom 默认减1
|
|
86
|
-
offset = offset * pow(2.0, (19.0 - u_Zoom));
|
|
87
|
-
}
|
|
88
|
-
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {
|
|
89
|
-
// P20_2 坐标系下,为了和 Web 墨卡托坐标系统一,zoom 默认减3
|
|
90
|
-
offset = offset * pow(2.0, (19.0 - 3.0 - u_Zoom));
|
|
91
|
-
}
|
|
92
|
-
} else {// 圆柱体固定高度 ( 处理 mapbox )
|
|
93
|
-
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
94
|
-
offset *= 4.0/pow(2.0, 21.0 - u_Zoom);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
vec4 project_pos = project_position(vec4(a_Pos.xy, 0., 1.0));
|
|
100
|
-
|
|
101
|
-
// u_r 控制圆柱的生长
|
|
102
|
-
vec4 pos = vec4(project_pos.xy + offset.xy, offset.z * u_r, 1.0);
|
|
103
|
-
|
|
104
|
-
// 圆柱光照效果
|
|
105
|
-
float lightWeight = 1.0;
|
|
106
|
-
if(u_lightEnable > 0.0) { // 取消三元表达式,增强健壮性
|
|
107
|
-
lightWeight = calc_lighting(pos);
|
|
108
|
-
}
|
|
109
|
-
styleMappingMat[1][3] = lightWeight;
|
|
110
|
-
|
|
111
|
-
v_color =vec4(a_Color.rgb * lightWeight, a_Color.w);
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
// 在地球模式下,将原本垂直于 xy 平面的圆柱调整姿态到适应圆的角度
|
|
115
|
-
//旋转矩阵mx,创建绕x轴旋转矩阵
|
|
116
|
-
float r = sqrt(a_Pos.z*a_Pos.z + a_Pos.x*a_Pos.x);
|
|
117
|
-
float xRadian = getXRadian(a_Pos.y, r);
|
|
118
|
-
float xcos = cos(xRadian);//求解旋转角度余弦值
|
|
119
|
-
float xsin = sin(xRadian);//求解旋转角度正弦值
|
|
120
|
-
mat4 mx = mat4(
|
|
121
|
-
1,0,0,0,
|
|
122
|
-
0,xcos,-xsin,0,
|
|
123
|
-
0,xsin,xcos,0,
|
|
124
|
-
0,0,0,1);
|
|
125
|
-
|
|
126
|
-
//旋转矩阵my,创建绕y轴旋转矩阵
|
|
127
|
-
float yRadian = getYRadian(a_Pos.x, a_Pos.z);
|
|
128
|
-
float ycos = cos(yRadian);//求解旋转角度余弦值
|
|
129
|
-
float ysin = sin(yRadian);//求解旋转角度正弦值
|
|
130
|
-
mat4 my = mat4(
|
|
131
|
-
ycos,0,-ysin,0,
|
|
132
|
-
0,1,0,0,
|
|
133
|
-
ysin,0,ycos,0,
|
|
134
|
-
0,0,0,1);
|
|
135
|
-
|
|
136
|
-
gl_Position = u_ViewProjectionMatrix * vec4(( my * mx * vec4(a_Position * a_Size, 1.0)).xyz + a_Pos, 1.0);
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
setPickingColor(a_PickingColor);
|
|
140
|
-
}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
uniform float u_additive;
|
|
2
|
-
|
|
3
|
-
varying mat4 styleMappingMat; // 传递从片元中传递的映射数据
|
|
4
|
-
|
|
5
|
-
varying vec4 v_data;
|
|
6
|
-
varying vec4 v_color;
|
|
7
|
-
varying float v_radius;
|
|
8
|
-
|
|
9
|
-
#pragma include "sdf_2d"
|
|
10
|
-
#pragma include "picking"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
void main() {
|
|
14
|
-
int shape = int(floor(v_data.w + 0.5));
|
|
15
|
-
|
|
16
|
-
vec4 textrueStroke = vec4(
|
|
17
|
-
styleMappingMat[1][0],
|
|
18
|
-
styleMappingMat[1][1],
|
|
19
|
-
styleMappingMat[1][2],
|
|
20
|
-
styleMappingMat[1][3]
|
|
21
|
-
);
|
|
22
|
-
|
|
23
|
-
float opacity = styleMappingMat[0][0];
|
|
24
|
-
float stroke_opacity = styleMappingMat[0][1];
|
|
25
|
-
float strokeWidth = styleMappingMat[0][2];
|
|
26
|
-
vec4 strokeColor = textrueStroke == vec4(0) ? v_color : textrueStroke;
|
|
27
|
-
|
|
28
|
-
lowp float antialiasblur = v_data.z;
|
|
29
|
-
float r = v_radius / (v_radius + strokeWidth);
|
|
30
|
-
|
|
31
|
-
float outer_df;
|
|
32
|
-
float inner_df;
|
|
33
|
-
// 'circle', 'triangle', 'square', 'pentagon', 'hexagon', 'octogon', 'hexagram', 'rhombus', 'vesica'
|
|
34
|
-
if (shape == 0) {
|
|
35
|
-
outer_df = sdCircle(v_data.xy, 1.0);
|
|
36
|
-
inner_df = sdCircle(v_data.xy, r);
|
|
37
|
-
} else if (shape == 1) {
|
|
38
|
-
outer_df = sdEquilateralTriangle(1.1 * v_data.xy);
|
|
39
|
-
inner_df = sdEquilateralTriangle(1.1 / r * v_data.xy);
|
|
40
|
-
} else if (shape == 2) {
|
|
41
|
-
outer_df = sdBox(v_data.xy, vec2(1.));
|
|
42
|
-
inner_df = sdBox(v_data.xy, vec2(r));
|
|
43
|
-
} else if (shape == 3) {
|
|
44
|
-
outer_df = sdPentagon(v_data.xy, 0.8);
|
|
45
|
-
inner_df = sdPentagon(v_data.xy, r * 0.8);
|
|
46
|
-
} else if (shape == 4) {
|
|
47
|
-
outer_df = sdHexagon(v_data.xy, 0.8);
|
|
48
|
-
inner_df = sdHexagon(v_data.xy, r * 0.8);
|
|
49
|
-
} else if (shape == 5) {
|
|
50
|
-
outer_df = sdOctogon(v_data.xy, 1.0);
|
|
51
|
-
inner_df = sdOctogon(v_data.xy, r);
|
|
52
|
-
} else if (shape == 6) {
|
|
53
|
-
outer_df = sdHexagram(v_data.xy, 0.52);
|
|
54
|
-
inner_df = sdHexagram(v_data.xy, r * 0.52);
|
|
55
|
-
} else if (shape == 7) {
|
|
56
|
-
outer_df = sdRhombus(v_data.xy, vec2(1.0));
|
|
57
|
-
inner_df = sdRhombus(v_data.xy, vec2(r));
|
|
58
|
-
} else if (shape == 8) {
|
|
59
|
-
outer_df = sdVesica(v_data.xy, 1.1, 0.8);
|
|
60
|
-
inner_df = sdVesica(v_data.xy, r * 1.1, r * 0.8);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
if(outer_df > antialiasblur + 0.018) discard;
|
|
64
|
-
|
|
65
|
-
float opacity_t = smoothstep(0.0, antialiasblur, outer_df);
|
|
66
|
-
|
|
67
|
-
float color_t = strokeWidth < 0.01 ? 0.0 : smoothstep(
|
|
68
|
-
antialiasblur,
|
|
69
|
-
0.0,
|
|
70
|
-
inner_df
|
|
71
|
-
);
|
|
72
|
-
|
|
73
|
-
if(strokeWidth < 0.01) {
|
|
74
|
-
gl_FragColor = vec4(v_color.rgb, v_color.a * opacity);
|
|
75
|
-
} else {
|
|
76
|
-
gl_FragColor = mix(vec4(v_color.rgb, v_color.a * opacity), strokeColor * stroke_opacity, color_t);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
if(u_additive > 0.0) {
|
|
80
|
-
gl_FragColor *= opacity_t;
|
|
81
|
-
gl_FragColor = filterColorAlpha(gl_FragColor, gl_FragColor.a);
|
|
82
|
-
} else {
|
|
83
|
-
gl_FragColor.a *= opacity_t;
|
|
84
|
-
gl_FragColor = filterColor(gl_FragColor);
|
|
85
|
-
}
|
|
86
|
-
}
|