@antv/l7-layers 2.9.24 → 2.9.26-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +6 -6
- package/es/Geometry/index.d.ts +0 -19
- package/es/Geometry/index.js +0 -106
- package/es/Geometry/models/billboard.d.ts +0 -26
- package/es/Geometry/models/billboard.js +0 -232
- package/es/Geometry/models/index.d.ts +0 -5
- package/es/Geometry/models/index.js +0 -9
- package/es/Geometry/models/plane.d.ts +0 -45
- package/es/Geometry/models/plane.js +0 -421
- package/es/Geometry/models/sprite.d.ts +0 -47
- package/es/Geometry/models/sprite.js +0 -304
- package/es/Geometry/shaders/billboard_frag.glsl +0 -13
- package/es/Geometry/shaders/billboard_vert.glsl +0 -50
- package/es/Geometry/shaders/plane_frag.glsl +0 -22
- package/es/Geometry/shaders/plane_vert.glsl +0 -53
- package/es/Geometry/shaders/sprite_frag.glsl +0 -21
- package/es/Geometry/shaders/sprite_vert.glsl +0 -28
- package/es/canvas/index.d.ts +0 -19
- package/es/canvas/index.js +0 -91
- package/es/canvas/models/canvas.d.ts +0 -18
- package/es/canvas/models/canvas.js +0 -212
- package/es/canvas/models/index.d.ts +0 -5
- package/es/canvas/models/index.js +0 -5
- package/es/citybuliding/building.d.ts +0 -17
- package/es/citybuliding/building.js +0 -88
- package/es/citybuliding/models/build.d.ts +0 -22
- package/es/citybuliding/models/build.js +0 -188
- package/es/citybuliding/shaders/build_frag.glsl +0 -117
- package/es/citybuliding/shaders/build_vert.glsl +0 -54
- package/es/core/BaseLayer.d.ts +0 -208
- package/es/core/BaseLayer.js +0 -1409
- package/es/core/BaseModel.d.ts +0 -140
- package/es/core/BaseModel.js +0 -486
- package/es/core/interface.d.ts +0 -201
- package/es/core/interface.js +0 -30
- package/es/core/schema.d.ts +0 -27
- package/es/core/schema.js +0 -25
- package/es/core/shape/Path.d.ts +0 -39
- package/es/core/shape/Path.js +0 -62
- package/es/core/shape/extrude.d.ts +0 -17
- package/es/core/shape/extrude.js +0 -148
- package/es/core/triangulation.d.ts +0 -122
- package/es/core/triangulation.js +0 -491
- package/es/earth/index.d.ts +0 -17
- package/es/earth/index.js +0 -91
- package/es/earth/models/atmosphere.d.ts +0 -9
- package/es/earth/models/atmosphere.js +0 -138
- package/es/earth/models/base.d.ts +0 -16
- package/es/earth/models/base.js +0 -212
- package/es/earth/models/bloomsphere.d.ts +0 -9
- package/es/earth/models/bloomsphere.js +0 -138
- package/es/earth/shaders/atmosphere_frag.glsl +0 -17
- package/es/earth/shaders/atmosphere_vert.glsl +0 -26
- package/es/earth/shaders/base_frag.glsl +0 -13
- package/es/earth/shaders/base_vert.glsl +0 -52
- package/es/earth/shaders/bloomsphere_frag.glsl +0 -15
- package/es/earth/shaders/bloomsphere_vert.glsl +0 -20
- package/es/earth/utils.d.ts +0 -26
- package/es/earth/utils.js +0 -104
- package/es/heatmap/index.d.ts +0 -21
- package/es/heatmap/index.js +0 -145
- package/es/heatmap/models/grid.d.ts +0 -8
- package/es/heatmap/models/grid.js +0 -108
- package/es/heatmap/models/grid3d.d.ts +0 -8
- package/es/heatmap/models/grid3d.js +0 -147
- package/es/heatmap/models/heatmap.d.ts +0 -24
- package/es/heatmap/models/heatmap.js +0 -464
- package/es/heatmap/models/hexagon.d.ts +0 -8
- package/es/heatmap/models/hexagon.js +0 -111
- package/es/heatmap/models/index.d.ts +0 -5
- package/es/heatmap/models/index.js +0 -12
- package/es/heatmap/shaders/grid_vert.glsl +0 -42
- package/es/heatmap/shaders/heatmap_3d_frag.glsl +0 -14
- package/es/heatmap/shaders/heatmap_3d_vert.glsl +0 -46
- package/es/heatmap/shaders/heatmap_frag.glsl +0 -47
- package/es/heatmap/shaders/heatmap_framebuffer_frag.glsl +0 -10
- package/es/heatmap/shaders/heatmap_framebuffer_vert.glsl +0 -35
- package/es/heatmap/shaders/heatmap_vert.glsl +0 -10
- package/es/heatmap/shaders/hexagon_3d_frag.glsl +0 -0
- package/es/heatmap/shaders/hexagon_3d_vert.glsl +0 -64
- package/es/heatmap/shaders/hexagon_frag.glsl +0 -12
- package/es/heatmap/shaders/hexagon_vert.glsl +0 -41
- package/es/heatmap/triangulation.d.ts +0 -5
- package/es/heatmap/triangulation.js +0 -38
- package/es/image/index.d.ts +0 -19
- package/es/image/index.js +0 -103
- package/es/image/models/dataImage.d.ts +0 -22
- package/es/image/models/dataImage.js +0 -225
- package/es/image/models/image.d.ts +0 -19
- package/es/image/models/image.js +0 -169
- package/es/image/models/index.d.ts +0 -5
- package/es/image/models/index.js +0 -7
- package/es/image/shaders/dataImage_frag.glsl +0 -38
- package/es/image/shaders/image_frag.glsl +0 -9
- package/es/image/shaders/image_vert.glsl +0 -17
- package/es/index.d.ts +0 -16
- package/es/index.js +0 -106
- package/es/line/index.d.ts +0 -25
- package/es/line/index.js +0 -119
- package/es/line/models/arc.d.ts +0 -17
- package/es/line/models/arc.js +0 -356
- package/es/line/models/arc_3d.d.ts +0 -17
- package/es/line/models/arc_3d.js +0 -335
- package/es/line/models/earthArc_3d.d.ts +0 -17
- package/es/line/models/earthArc_3d.js +0 -338
- package/es/line/models/great_circle.d.ts +0 -12
- package/es/line/models/great_circle.js +0 -294
- package/es/line/models/half.d.ts +0 -18
- package/es/line/models/half.js +0 -282
- package/es/line/models/index.d.ts +0 -5
- package/es/line/models/index.js +0 -25
- package/es/line/models/line.d.ts +0 -21
- package/es/line/models/line.js +0 -442
- package/es/line/models/linearline.d.ts +0 -11
- package/es/line/models/linearline.js +0 -276
- package/es/line/models/simpleLine.d.ts +0 -14
- package/es/line/models/simpleLine.js +0 -233
- package/es/line/models/tile.d.ts +0 -11
- package/es/line/models/tile.js +0 -351
- package/es/line/models/wall.d.ts +0 -12
- package/es/line/models/wall.js +0 -329
- package/es/line/shaders/arc_chunks.vert.glsl +0 -21
- package/es/line/shaders/dash/arc_dash_frag.glsl +0 -28
- package/es/line/shaders/dash/arc_dash_vert.glsl +0 -148
- package/es/line/shaders/dash/line_dash_frag.glsl +0 -31
- package/es/line/shaders/dash/line_dash_vert.glsl +0 -93
- package/es/line/shaders/half/line_half_frag.glsl +0 -53
- package/es/line/shaders/half/line_half_vert.glsl +0 -169
- package/es/line/shaders/line_arc2d_vert.glsl +0 -114
- package/es/line/shaders/line_arc_3d_frag.glsl +0 -103
- package/es/line/shaders/line_arc_3d_vert.glsl +0 -207
- package/es/line/shaders/line_arc_frag.glsl +0 -89
- package/es/line/shaders/line_arc_great_circle_frag.glsl +0 -101
- package/es/line/shaders/line_arc_great_circle_vert.glsl +0 -215
- package/es/line/shaders/line_arc_vert.glsl +0 -176
- package/es/line/shaders/line_bezier_vert.glsl +0 -85
- package/es/line/shaders/line_frag.glsl +0 -100
- package/es/line/shaders/line_vert.glsl +0 -192
- package/es/line/shaders/linear/arc3d_linear_frag.glsl +0 -47
- package/es/line/shaders/linear/arc3d_linear_vert.glsl +0 -207
- package/es/line/shaders/linear/arc_linear_frag.glsl +0 -38
- package/es/line/shaders/linear/arc_linear_vert.glsl +0 -138
- package/es/line/shaders/linear/line_linear_frag.glsl +0 -27
- package/es/line/shaders/linearLine/line_linear_frag.glsl +0 -20
- package/es/line/shaders/linearLine/line_linear_vert.glsl +0 -112
- package/es/line/shaders/simple/simpleline_frag.glsl +0 -10
- package/es/line/shaders/simple/simpleline_linear_frag.glsl +0 -11
- package/es/line/shaders/simple/simpleline_vert.glsl +0 -79
- package/es/line/shaders/tile/line_tile_frag.glsl +0 -79
- package/es/line/shaders/tile/line_tile_vert.glsl +0 -210
- package/es/line/shaders/wall_frag.glsl +0 -93
- package/es/line/shaders/wall_vert.glsl +0 -111
- package/es/mask/index.d.ts +0 -18
- package/es/mask/index.js +0 -82
- package/es/mask/models/fill.d.ts +0 -11
- package/es/mask/models/fill.js +0 -121
- package/es/mask/models/index.d.ts +0 -5
- package/es/mask/models/index.js +0 -5
- package/es/mask/shaders/mask_frag.glsl +0 -7
- package/es/mask/shaders/mask_vert.glsl +0 -22
- package/es/plugins/DataMappingPlugin.d.ts +0 -18
- package/es/plugins/DataMappingPlugin.js +0 -345
- package/es/plugins/DataSourcePlugin.d.ts +0 -7
- package/es/plugins/DataSourcePlugin.js +0 -89
- package/es/plugins/FeatureScalePlugin.d.ts +0 -25
- package/es/plugins/FeatureScalePlugin.js +0 -325
- package/es/plugins/LayerAnimateStylePlugin.d.ts +0 -7
- package/es/plugins/LayerAnimateStylePlugin.js +0 -49
- package/es/plugins/LayerModelPlugin.d.ts +0 -10
- package/es/plugins/LayerModelPlugin.js +0 -71
- package/es/plugins/LayerStylePlugin.d.ts +0 -8
- package/es/plugins/LayerStylePlugin.js +0 -39
- package/es/plugins/LightingPlugin.d.ts +0 -36
- package/es/plugins/LightingPlugin.js +0 -110
- package/es/plugins/MultiPassRendererPlugin.d.ts +0 -24
- package/es/plugins/MultiPassRendererPlugin.js +0 -77
- package/es/plugins/PixelPickingPlugin.d.ts +0 -8
- package/es/plugins/PixelPickingPlugin.js +0 -146
- package/es/plugins/RegisterStyleAttributePlugin.d.ts +0 -11
- package/es/plugins/RegisterStyleAttributePlugin.js +0 -105
- package/es/plugins/ShaderUniformPlugin.d.ts +0 -17
- package/es/plugins/ShaderUniformPlugin.js +0 -107
- package/es/plugins/UpdateModelPlugin.d.ts +0 -8
- package/es/plugins/UpdateModelPlugin.js +0 -31
- package/es/plugins/UpdateStyleAttributePlugin.d.ts +0 -12
- package/es/plugins/UpdateStyleAttributePlugin.js +0 -87
- package/es/point/index.d.ts +0 -30
- package/es/point/index.js +0 -222
- package/es/point/models/earthExtrude.d.ts +0 -24
- package/es/point/models/earthExtrude.js +0 -279
- package/es/point/models/earthFill.d.ts +0 -11
- package/es/point/models/earthFill.js +0 -258
- package/es/point/models/extrude.d.ts +0 -24
- package/es/point/models/extrude.js +0 -298
- package/es/point/models/fill.d.ts +0 -40
- package/es/point/models/fill.js +0 -404
- package/es/point/models/fillmage.d.ts +0 -25
- package/es/point/models/fillmage.js +0 -367
- package/es/point/models/image.d.ts +0 -11
- package/es/point/models/image.js +0 -239
- package/es/point/models/index.d.ts +0 -5
- package/es/point/models/index.js +0 -28
- package/es/point/models/normal.d.ts +0 -17
- package/es/point/models/normal.js +0 -177
- package/es/point/models/radar.d.ts +0 -24
- package/es/point/models/radar.js +0 -297
- package/es/point/models/simplePoint.d.ts +0 -17
- package/es/point/models/simplePoint.js +0 -188
- package/es/point/models/text.d.ts +0 -57
- package/es/point/models/text.js +0 -622
- package/es/point/models/tile.d.ts +0 -22
- package/es/point/models/tile.js +0 -309
- package/es/point/shaders/animate/wave_frag.glsl +0 -65
- package/es/point/shaders/earth/extrude_frag.glsl +0 -44
- package/es/point/shaders/earth/extrude_vert.glsl +0 -140
- package/es/point/shaders/earth/fill_frag.glsl +0 -86
- package/es/point/shaders/earth/fill_vert.glsl +0 -126
- package/es/point/shaders/extrude/extrude_frag.glsl +0 -44
- package/es/point/shaders/extrude/extrude_vert.glsl +0 -121
- package/es/point/shaders/fill_frag.glsl +0 -84
- package/es/point/shaders/fill_vert.glsl +0 -189
- package/es/point/shaders/image/fillImage_frag.glsl +0 -20
- package/es/point/shaders/image/fillImage_vert.glsl +0 -116
- package/es/point/shaders/image_frag.glsl +0 -39
- package/es/point/shaders/image_vert.glsl +0 -90
- package/es/point/shaders/normal_frag.glsl +0 -15
- package/es/point/shaders/normal_vert.glsl +0 -79
- package/es/point/shaders/radar/radar_frag.glsl +0 -64
- package/es/point/shaders/radar/radar_vert.glsl +0 -120
- package/es/point/shaders/simplePoint_frag.glsl +0 -53
- package/es/point/shaders/simplePoint_vert.glsl +0 -79
- package/es/point/shaders/text_frag.glsl +0 -48
- package/es/point/shaders/text_vert.glsl +0 -131
- package/es/point/shaders/tile/fill_tile_frag.glsl +0 -83
- package/es/point/shaders/tile/fill_tile_vert.glsl +0 -181
- package/es/point/shape/extrude.d.ts +0 -15
- package/es/point/shape/extrude.js +0 -63
- package/es/polygon/index.d.ts +0 -19
- package/es/polygon/index.js +0 -145
- package/es/polygon/models/extrude.d.ts +0 -28
- package/es/polygon/models/extrude.js +0 -306
- package/es/polygon/models/fill.d.ts +0 -17
- package/es/polygon/models/fill.js +0 -211
- package/es/polygon/models/index.d.ts +0 -5
- package/es/polygon/models/index.js +0 -28
- package/es/polygon/models/ocean.d.ts +0 -23
- package/es/polygon/models/ocean.js +0 -236
- package/es/polygon/models/tile.d.ts +0 -15
- package/es/polygon/models/tile.js +0 -133
- package/es/polygon/models/water.d.ts +0 -18
- package/es/polygon/models/water.js +0 -213
- package/es/polygon/shaders/extrude/polygon_extrude_frag.glsl +0 -44
- package/es/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +0 -44
- package/es/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +0 -85
- package/es/polygon/shaders/extrude/polygon_extrude_vert.glsl +0 -90
- package/es/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +0 -48
- package/es/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +0 -93
- package/es/polygon/shaders/polygon_frag.glsl +0 -12
- package/es/polygon/shaders/polygon_linear_frag.glsl +0 -22
- package/es/polygon/shaders/polygon_linear_vert.glsl +0 -74
- package/es/polygon/shaders/polygon_vert.glsl +0 -66
- package/es/polygon/shaders/tile/polygon_tile_frag.glsl +0 -12
- package/es/polygon/shaders/tile/polygon_tile_vert.glsl +0 -82
- package/es/polygon/shaders/water/polygon_ocean_frag.glsl +0 -248
- package/es/polygon/shaders/water/polygon_ocean_vert.glsl +0 -52
- package/es/polygon/shaders/water/polygon_water_frag.glsl +0 -73
- package/es/polygon/shaders/water/polygon_water_vert.glsl +0 -55
- package/es/raster/buffers/triangulation.d.ts +0 -6
- package/es/raster/buffers/triangulation.js +0 -28
- package/es/raster/index.d.ts +0 -19
- package/es/raster/index.js +0 -104
- package/es/raster/models/index.d.ts +0 -5
- package/es/raster/models/index.js +0 -8
- package/es/raster/models/raster.d.ts +0 -21
- package/es/raster/models/raster.js +0 -167
- package/es/raster/raster.d.ts +0 -30
- package/es/raster/raster.js +0 -174
- package/es/raster/shaders/raster_2d_frag.glsl +0 -28
- package/es/raster/shaders/raster_2d_vert.glsl +0 -18
- package/es/raster/shaders/raster_frag.glsl +0 -9
- package/es/raster/shaders/raster_vert.glsl +0 -44
- package/es/tile/interface.d.ts +0 -28
- package/es/tile/interface.js +0 -1
- package/es/tile/manager/tileConfigManager.d.ts +0 -17
- package/es/tile/manager/tileConfigManager.js +0 -121
- package/es/tile/manager/tileLayerManager.d.ts +0 -36
- package/es/tile/manager/tileLayerManager.js +0 -311
- package/es/tile/manager/tilePickerManager.d.ts +0 -21
- package/es/tile/manager/tilePickerManager.js +0 -190
- package/es/tile/models/tileModel.d.ts +0 -8
- package/es/tile/models/tileModel.js +0 -62
- package/es/tile/tileFactory/base.d.ts +0 -44
- package/es/tile/tileFactory/base.js +0 -444
- package/es/tile/tileFactory/index.d.ts +0 -5
- package/es/tile/tileFactory/index.js +0 -29
- package/es/tile/tileFactory/line.d.ts +0 -12
- package/es/tile/tileFactory/line.js +0 -59
- package/es/tile/tileFactory/point.d.ts +0 -12
- package/es/tile/tileFactory/point.js +0 -59
- package/es/tile/tileFactory/polygon.d.ts +0 -12
- package/es/tile/tileFactory/polygon.js +0 -59
- package/es/tile/tileFactory/raster.d.ts +0 -12
- package/es/tile/tileFactory/raster.js +0 -55
- package/es/tile/tileFactory/rasterData.d.ts +0 -12
- package/es/tile/tileFactory/rasterData.js +0 -80
- package/es/tile/tileFactory/rasterDataLayer.d.ts +0 -19
- package/es/tile/tileFactory/rasterDataLayer.js +0 -87
- package/es/tile/tileFactory/vectorLayer.d.ts +0 -29
- package/es/tile/tileFactory/vectorLayer.js +0 -161
- package/es/tile/tileLayer/baseTileLayer.d.ts +0 -47
- package/es/tile/tileLayer/baseTileLayer.js +0 -438
- package/es/tile/tmsTileLayer.d.ts +0 -7
- package/es/tile/tmsTileLayer.js +0 -101
- package/es/tile/utils.d.ts +0 -11
- package/es/tile/utils.js +0 -127
- package/es/utils/blend.d.ts +0 -2
- package/es/utils/blend.js +0 -54
- package/es/utils/collision-index.d.ts +0 -47
- package/es/utils/collision-index.js +0 -102
- package/es/utils/dataMappingStyle.d.ts +0 -31
- package/es/utils/dataMappingStyle.js +0 -147
- package/es/utils/extrude_polyline.d.ts +0 -67
- package/es/utils/extrude_polyline.js +0 -611
- package/es/utils/grid-index.d.ts +0 -28
- package/es/utils/grid-index.js +0 -179
- package/es/utils/layerData.d.ts +0 -2
- package/es/utils/layerData.js +0 -176
- package/es/utils/multiPassRender.d.ts +0 -16
- package/es/utils/multiPassRender.js +0 -50
- package/es/utils/polylineNormal.d.ts +0 -9
- package/es/utils/polylineNormal.js +0 -191
- package/es/utils/simpleLine.d.ts +0 -23
- package/es/utils/simpleLine.js +0 -103
- package/es/utils/symbol-layout.d.ts +0 -43
- package/es/utils/symbol-layout.js +0 -299
- package/es/utils/updateShape.d.ts +0 -2
- package/es/utils/updateShape.js +0 -20
- package/es/wind/index.d.ts +0 -20
- package/es/wind/index.js +0 -100
- package/es/wind/models/index.d.ts +0 -5
- package/es/wind/models/index.js +0 -5
- package/es/wind/models/utils.d.ts +0 -19
- package/es/wind/models/utils.js +0 -226
- package/es/wind/models/wind.d.ts +0 -33
- package/es/wind/models/wind.js +0 -331
- package/es/wind/models/windRender.d.ts +0 -104
- package/es/wind/models/windRender.js +0 -357
- package/es/wind/models/windShader.d.ts +0 -12
- package/es/wind/models/windShader.js +0 -12
- package/es/wind/shaders/wind_frag.glsl +0 -9
- package/es/wind/shaders/wind_vert.glsl +0 -17
- package/lib/Geometry/index.js +0 -82
- package/lib/Geometry/models/billboard.js +0 -195
- package/lib/Geometry/models/index.js +0 -38
- package/lib/Geometry/models/plane.js +0 -307
- package/lib/Geometry/models/sprite.js +0 -216
- package/lib/Geometry/shaders/billboard_frag.glsl +0 -13
- package/lib/Geometry/shaders/billboard_vert.glsl +0 -50
- package/lib/Geometry/shaders/plane_frag.glsl +0 -22
- package/lib/Geometry/shaders/plane_vert.glsl +0 -53
- package/lib/Geometry/shaders/sprite_frag.glsl +0 -21
- package/lib/Geometry/shaders/sprite_vert.glsl +0 -28
- package/lib/canvas/index.js +0 -69
- package/lib/canvas/models/canvas.js +0 -154
- package/lib/canvas/models/index.js +0 -34
- package/lib/citybuliding/building.js +0 -66
- package/lib/citybuliding/models/build.js +0 -157
- package/lib/citybuliding/shaders/build_frag.glsl +0 -117
- package/lib/citybuliding/shaders/build_vert.glsl +0 -54
- package/lib/core/BaseLayer.js +0 -891
- package/lib/core/BaseModel.js +0 -325
- package/lib/core/interface.js +0 -54
- package/lib/core/schema.js +0 -51
- package/lib/core/shape/Path.js +0 -100
- package/lib/core/shape/extrude.js +0 -139
- package/lib/core/triangulation.js +0 -373
- package/lib/earth/index.js +0 -69
- package/lib/earth/models/atmosphere.js +0 -118
- package/lib/earth/models/base.js +0 -162
- package/lib/earth/models/bloomsphere.js +0 -118
- package/lib/earth/shaders/atmosphere_frag.glsl +0 -17
- package/lib/earth/shaders/atmosphere_vert.glsl +0 -26
- package/lib/earth/shaders/base_frag.glsl +0 -13
- package/lib/earth/shaders/base_vert.glsl +0 -52
- package/lib/earth/shaders/bloomsphere_frag.glsl +0 -15
- package/lib/earth/shaders/bloomsphere_vert.glsl +0 -20
- package/lib/earth/utils.js +0 -116
- package/lib/heatmap/index.js +0 -101
- package/lib/heatmap/models/grid.js +0 -95
- package/lib/heatmap/models/grid3d.js +0 -129
- package/lib/heatmap/models/heatmap.js +0 -350
- package/lib/heatmap/models/hexagon.js +0 -96
- package/lib/heatmap/models/index.js +0 -41
- package/lib/heatmap/shaders/grid_vert.glsl +0 -42
- package/lib/heatmap/shaders/heatmap_3d_frag.glsl +0 -14
- package/lib/heatmap/shaders/heatmap_3d_vert.glsl +0 -46
- package/lib/heatmap/shaders/heatmap_frag.glsl +0 -47
- package/lib/heatmap/shaders/heatmap_framebuffer_frag.glsl +0 -10
- package/lib/heatmap/shaders/heatmap_framebuffer_vert.glsl +0 -35
- package/lib/heatmap/shaders/heatmap_vert.glsl +0 -10
- package/lib/heatmap/shaders/hexagon_3d_frag.glsl +0 -0
- package/lib/heatmap/shaders/hexagon_3d_vert.glsl +0 -64
- package/lib/heatmap/shaders/hexagon_frag.glsl +0 -12
- package/lib/heatmap/shaders/hexagon_vert.glsl +0 -41
- package/lib/heatmap/triangulation.js +0 -61
- package/lib/image/index.js +0 -79
- package/lib/image/models/dataImage.js +0 -182
- package/lib/image/models/image.js +0 -136
- package/lib/image/models/index.js +0 -36
- package/lib/image/shaders/dataImage_frag.glsl +0 -38
- package/lib/image/shaders/image_frag.glsl +0 -9
- package/lib/image/shaders/image_vert.glsl +0 -17
- package/lib/index.js +0 -100
- package/lib/line/index.js +0 -88
- package/lib/line/models/arc.js +0 -258
- package/lib/line/models/arc_3d.js +0 -247
- package/lib/line/models/earthArc_3d.js +0 -248
- package/lib/line/models/great_circle.js +0 -219
- package/lib/line/models/half.js +0 -214
- package/lib/line/models/index.js +0 -54
- package/lib/line/models/line.js +0 -330
- package/lib/line/models/linearline.js +0 -219
- package/lib/line/models/simpleLine.js +0 -184
- package/lib/line/models/tile.js +0 -257
- package/lib/line/models/wall.js +0 -253
- package/lib/line/shaders/arc_chunks.vert.glsl +0 -21
- package/lib/line/shaders/dash/arc_dash_frag.glsl +0 -28
- package/lib/line/shaders/dash/arc_dash_vert.glsl +0 -148
- package/lib/line/shaders/dash/line_dash_frag.glsl +0 -31
- package/lib/line/shaders/dash/line_dash_vert.glsl +0 -93
- package/lib/line/shaders/half/line_half_frag.glsl +0 -53
- package/lib/line/shaders/half/line_half_vert.glsl +0 -169
- package/lib/line/shaders/line_arc2d_vert.glsl +0 -114
- package/lib/line/shaders/line_arc_3d_frag.glsl +0 -103
- package/lib/line/shaders/line_arc_3d_vert.glsl +0 -207
- package/lib/line/shaders/line_arc_frag.glsl +0 -89
- package/lib/line/shaders/line_arc_great_circle_frag.glsl +0 -101
- package/lib/line/shaders/line_arc_great_circle_vert.glsl +0 -215
- package/lib/line/shaders/line_arc_vert.glsl +0 -176
- package/lib/line/shaders/line_bezier_vert.glsl +0 -85
- package/lib/line/shaders/line_frag.glsl +0 -100
- package/lib/line/shaders/line_vert.glsl +0 -192
- package/lib/line/shaders/linear/arc3d_linear_frag.glsl +0 -47
- package/lib/line/shaders/linear/arc3d_linear_vert.glsl +0 -207
- package/lib/line/shaders/linear/arc_linear_frag.glsl +0 -38
- package/lib/line/shaders/linear/arc_linear_vert.glsl +0 -138
- package/lib/line/shaders/linear/line_linear_frag.glsl +0 -27
- package/lib/line/shaders/linearLine/line_linear_frag.glsl +0 -20
- package/lib/line/shaders/linearLine/line_linear_vert.glsl +0 -112
- package/lib/line/shaders/simple/simpleline_frag.glsl +0 -10
- package/lib/line/shaders/simple/simpleline_linear_frag.glsl +0 -11
- package/lib/line/shaders/simple/simpleline_vert.glsl +0 -79
- package/lib/line/shaders/tile/line_tile_frag.glsl +0 -79
- package/lib/line/shaders/tile/line_tile_vert.glsl +0 -210
- package/lib/line/shaders/wall_frag.glsl +0 -93
- package/lib/line/shaders/wall_vert.glsl +0 -111
- package/lib/mask/index.js +0 -62
- package/lib/mask/models/fill.js +0 -85
- package/lib/mask/models/index.js +0 -34
- package/lib/mask/shaders/mask_frag.glsl +0 -7
- package/lib/mask/shaders/mask_vert.glsl +0 -22
- package/lib/plugins/DataMappingPlugin.js +0 -242
- package/lib/plugins/DataSourcePlugin.js +0 -93
- package/lib/plugins/FeatureScalePlugin.js +0 -259
- package/lib/plugins/LayerAnimateStylePlugin.js +0 -58
- package/lib/plugins/LayerModelPlugin.js +0 -75
- package/lib/plugins/LayerStylePlugin.js +0 -53
- package/lib/plugins/LightingPlugin.js +0 -113
- package/lib/plugins/MultiPassRendererPlugin.js +0 -67
- package/lib/plugins/PixelPickingPlugin.js +0 -118
- package/lib/plugins/RegisterStyleAttributePlugin.js +0 -117
- package/lib/plugins/ShaderUniformPlugin.js +0 -101
- package/lib/plugins/UpdateModelPlugin.js +0 -49
- package/lib/plugins/UpdateStyleAttributePlugin.js +0 -80
- package/lib/point/index.js +0 -160
- package/lib/point/models/earthExtrude.js +0 -217
- package/lib/point/models/earthFill.js +0 -208
- package/lib/point/models/extrude.js +0 -219
- package/lib/point/models/fill.js +0 -289
- package/lib/point/models/fillmage.js +0 -274
- package/lib/point/models/image.js +0 -182
- package/lib/point/models/index.js +0 -56
- package/lib/point/models/normal.js +0 -145
- package/lib/point/models/radar.js +0 -221
- package/lib/point/models/simplePoint.js +0 -153
- package/lib/point/models/text.js +0 -414
- package/lib/point/models/tile.js +0 -234
- package/lib/point/shaders/animate/wave_frag.glsl +0 -65
- package/lib/point/shaders/earth/extrude_frag.glsl +0 -44
- package/lib/point/shaders/earth/extrude_vert.glsl +0 -140
- package/lib/point/shaders/earth/fill_frag.glsl +0 -86
- package/lib/point/shaders/earth/fill_vert.glsl +0 -126
- package/lib/point/shaders/extrude/extrude_frag.glsl +0 -44
- package/lib/point/shaders/extrude/extrude_vert.glsl +0 -121
- package/lib/point/shaders/fill_frag.glsl +0 -84
- package/lib/point/shaders/fill_vert.glsl +0 -189
- package/lib/point/shaders/image/fillImage_frag.glsl +0 -20
- package/lib/point/shaders/image/fillImage_vert.glsl +0 -116
- package/lib/point/shaders/image_frag.glsl +0 -39
- package/lib/point/shaders/image_vert.glsl +0 -90
- package/lib/point/shaders/normal_frag.glsl +0 -15
- package/lib/point/shaders/normal_vert.glsl +0 -79
- package/lib/point/shaders/radar/radar_frag.glsl +0 -64
- package/lib/point/shaders/radar/radar_vert.glsl +0 -120
- package/lib/point/shaders/simplePoint_frag.glsl +0 -53
- package/lib/point/shaders/simplePoint_vert.glsl +0 -79
- package/lib/point/shaders/text_frag.glsl +0 -48
- package/lib/point/shaders/text_vert.glsl +0 -131
- package/lib/point/shaders/tile/fill_tile_frag.glsl +0 -83
- package/lib/point/shaders/tile/fill_tile_vert.glsl +0 -181
- package/lib/point/shape/extrude.js +0 -74
- package/lib/polygon/index.js +0 -108
- package/lib/polygon/models/extrude.js +0 -234
- package/lib/polygon/models/fill.js +0 -164
- package/lib/polygon/models/index.js +0 -56
- package/lib/polygon/models/ocean.js +0 -181
- package/lib/polygon/models/tile.js +0 -103
- package/lib/polygon/models/water.js +0 -160
- package/lib/polygon/shaders/extrude/polygon_extrude_frag.glsl +0 -44
- package/lib/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +0 -44
- package/lib/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +0 -85
- package/lib/polygon/shaders/extrude/polygon_extrude_vert.glsl +0 -90
- package/lib/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +0 -48
- package/lib/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +0 -93
- package/lib/polygon/shaders/polygon_frag.glsl +0 -12
- package/lib/polygon/shaders/polygon_linear_frag.glsl +0 -22
- package/lib/polygon/shaders/polygon_linear_vert.glsl +0 -74
- package/lib/polygon/shaders/polygon_vert.glsl +0 -66
- package/lib/polygon/shaders/tile/polygon_tile_frag.glsl +0 -12
- package/lib/polygon/shaders/tile/polygon_tile_vert.glsl +0 -82
- package/lib/polygon/shaders/water/polygon_ocean_frag.glsl +0 -248
- package/lib/polygon/shaders/water/polygon_ocean_vert.glsl +0 -52
- package/lib/polygon/shaders/water/polygon_water_frag.glsl +0 -73
- package/lib/polygon/shaders/water/polygon_water_vert.glsl +0 -55
- package/lib/raster/buffers/triangulation.js +0 -51
- package/lib/raster/index.js +0 -78
- package/lib/raster/models/index.js +0 -37
- package/lib/raster/models/raster.js +0 -139
- package/lib/raster/raster.js +0 -136
- package/lib/raster/shaders/raster_2d_frag.glsl +0 -28
- package/lib/raster/shaders/raster_2d_vert.glsl +0 -18
- package/lib/raster/shaders/raster_frag.glsl +0 -9
- package/lib/raster/shaders/raster_vert.glsl +0 -44
- package/lib/tile/interface.js +0 -17
- package/lib/tile/manager/tileConfigManager.js +0 -94
- package/lib/tile/manager/tileLayerManager.js +0 -245
- package/lib/tile/manager/tilePickerManager.js +0 -132
- package/lib/tile/models/tileModel.js +0 -55
- package/lib/tile/tileFactory/base.js +0 -343
- package/lib/tile/tileFactory/index.js +0 -57
- package/lib/tile/tileFactory/line.js +0 -55
- package/lib/tile/tileFactory/point.js +0 -55
- package/lib/tile/tileFactory/polygon.js +0 -55
- package/lib/tile/tileFactory/raster.js +0 -56
- package/lib/tile/tileFactory/rasterData.js +0 -81
- package/lib/tile/tileFactory/rasterDataLayer.js +0 -65
- package/lib/tile/tileFactory/vectorLayer.js +0 -117
- package/lib/tile/tileLayer/baseTileLayer.js +0 -248
- package/lib/tile/tmsTileLayer.js +0 -74
- package/lib/tile/utils.js +0 -132
- package/lib/utils/blend.js +0 -85
- package/lib/utils/collision-index.js +0 -75
- package/lib/utils/dataMappingStyle.js +0 -106
- package/lib/utils/extrude_polyline.js +0 -451
- package/lib/utils/grid-index.js +0 -136
- package/lib/utils/layerData.js +0 -156
- package/lib/utils/multiPassRender.js +0 -53
- package/lib/utils/polylineNormal.js +0 -178
- package/lib/utils/simpleLine.js +0 -101
- package/lib/utils/symbol-layout.js +0 -205
- package/lib/utils/updateShape.js +0 -53
- package/lib/wind/index.js +0 -75
- package/lib/wind/models/index.js +0 -34
- package/lib/wind/models/utils.js +0 -214
- package/lib/wind/models/wind.js +0 -237
- package/lib/wind/models/windRender.js +0 -262
- package/lib/wind/models/windShader.js +0 -183
- package/lib/wind/shaders/wind_frag.glsl +0 -9
- package/lib/wind/shaders/wind_vert.glsl +0 -17
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
#define SDF_PX 8.0
|
|
2
|
-
#define EDGE_GAMMA 0.105
|
|
3
|
-
#define FONT_SIZE 48.0
|
|
4
|
-
uniform sampler2D u_sdf_map;
|
|
5
|
-
uniform float u_gamma_scale : 0.5;
|
|
6
|
-
// uniform float u_font_size : 24.0;
|
|
7
|
-
uniform float u_opacity : 1.0;
|
|
8
|
-
uniform vec4 u_stroke_color : [0, 0, 0, 1];
|
|
9
|
-
uniform float u_stroke_width : 2.0;
|
|
10
|
-
uniform float u_halo_blur : 0.5;
|
|
11
|
-
uniform float u_DevicePixelRatio;
|
|
12
|
-
|
|
13
|
-
varying vec4 v_color;
|
|
14
|
-
varying vec2 v_uv;
|
|
15
|
-
varying float v_gamma_scale;
|
|
16
|
-
varying float v_fontScale;
|
|
17
|
-
|
|
18
|
-
varying mat4 styleMappingMat; // 传递从片元中传递的映射数据
|
|
19
|
-
|
|
20
|
-
#pragma include "picking"
|
|
21
|
-
void main() {
|
|
22
|
-
// get style data mapping
|
|
23
|
-
float opacity = styleMappingMat[0][0];
|
|
24
|
-
float strokeWidth = styleMappingMat[0][2];
|
|
25
|
-
vec4 textrueStroke = vec4(
|
|
26
|
-
styleMappingMat[1][0],
|
|
27
|
-
styleMappingMat[1][1],
|
|
28
|
-
styleMappingMat[1][2],
|
|
29
|
-
styleMappingMat[1][3]
|
|
30
|
-
);
|
|
31
|
-
|
|
32
|
-
// get sdf from atlas
|
|
33
|
-
float dist = texture2D(u_sdf_map, v_uv).a;
|
|
34
|
-
|
|
35
|
-
// float fontScale = u_font_size / FONT_SIZE;
|
|
36
|
-
|
|
37
|
-
// lowp float buff = (6.0 - u_stroke_width / v_fontScale) / SDF_PX;
|
|
38
|
-
lowp float buff = (6.0 - strokeWidth / v_fontScale) / SDF_PX;
|
|
39
|
-
highp float gamma = (u_halo_blur * 1.19 / SDF_PX + EDGE_GAMMA) / (v_fontScale * u_gamma_scale) / 1.0;
|
|
40
|
-
|
|
41
|
-
highp float gamma_scaled = gamma * v_gamma_scale;
|
|
42
|
-
|
|
43
|
-
highp float alpha = smoothstep(buff - gamma_scaled, buff + gamma_scaled, dist);
|
|
44
|
-
// gl_FragColor = mix(vec4(v_color.rgb, v_color.a * u_opacity), vec4(u_stroke_color.rgb, u_stroke_color.a * u_opacity), smoothstep(0., 0.5, 1. - dist));
|
|
45
|
-
gl_FragColor = mix(vec4(v_color.rgb, v_color.a * opacity), vec4(textrueStroke.rgb, textrueStroke.a * opacity), smoothstep(0., 0.5, 1. - dist));
|
|
46
|
-
gl_FragColor.a= gl_FragColor.a * alpha;
|
|
47
|
-
gl_FragColor = filterColor(gl_FragColor);
|
|
48
|
-
}
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
#define SDF_PX 8.0
|
|
2
|
-
#define EDGE_GAMMA 0.105
|
|
3
|
-
#define FONT_SIZE 24.0
|
|
4
|
-
attribute vec3 a_Position;
|
|
5
|
-
attribute vec2 a_tex;
|
|
6
|
-
attribute vec2 a_textOffsets;
|
|
7
|
-
attribute vec4 a_Color;
|
|
8
|
-
attribute float a_Size;
|
|
9
|
-
attribute float a_Rotate;
|
|
10
|
-
|
|
11
|
-
uniform vec2 u_sdf_map_size;
|
|
12
|
-
uniform mat4 u_ModelMatrix;
|
|
13
|
-
uniform mat4 u_Mvp;
|
|
14
|
-
uniform float u_raisingHeight: 0.0;
|
|
15
|
-
|
|
16
|
-
varying vec2 v_uv;
|
|
17
|
-
varying float v_gamma_scale;
|
|
18
|
-
varying vec4 v_color;
|
|
19
|
-
varying float v_fontScale;
|
|
20
|
-
|
|
21
|
-
varying mat4 styleMappingMat; // 用于将在顶点着色器中计算好的样式值传递给片元
|
|
22
|
-
|
|
23
|
-
uniform float u_opacity : 1;
|
|
24
|
-
uniform float u_stroke_width : 2;
|
|
25
|
-
uniform vec4 u_stroke_color : [0.0, 0.0, 0.0, 0.0];
|
|
26
|
-
|
|
27
|
-
#pragma include "styleMapping"
|
|
28
|
-
#pragma include "styleMappingCalOpacity"
|
|
29
|
-
#pragma include "styleMappingCalStrokeWidth"
|
|
30
|
-
|
|
31
|
-
#pragma include "projection"
|
|
32
|
-
#pragma include "picking"
|
|
33
|
-
|
|
34
|
-
void main() {
|
|
35
|
-
// cal style mapping - 数据纹理映射部分的计算
|
|
36
|
-
styleMappingMat = mat4(
|
|
37
|
-
0.0, 0.0, 0.0, 0.0, // opacity - strokeOpacity - strokeWidth - empty
|
|
38
|
-
0.0, 0.0, 0.0, 0.0, // strokeR - strokeG - strokeB - strokeA
|
|
39
|
-
0.0, 0.0, 0.0, 0.0, // offsets[0] - offsets[1]
|
|
40
|
-
0.0, 0.0, 0.0, 0.0
|
|
41
|
-
);
|
|
42
|
-
|
|
43
|
-
float rowCount = u_cellTypeLayout[0][0]; // 当前的数据纹理有几行
|
|
44
|
-
float columnCount = u_cellTypeLayout[0][1]; // 当看到数据纹理有几列
|
|
45
|
-
float columnWidth = 1.0/columnCount; // 列宽
|
|
46
|
-
float rowHeight = 1.0/rowCount; // 行高
|
|
47
|
-
float cellCount = calCellCount(); // opacity - strokeOpacity - strokeWidth - stroke - offsets
|
|
48
|
-
float id = a_vertexId; // 第n个顶点
|
|
49
|
-
float cellCurrentRow = floor(id * cellCount / columnCount) + 1.0; // 起始点在第几行
|
|
50
|
-
float cellCurrentColumn = mod(id * cellCount, columnCount) + 1.0; // 起始点在第几列
|
|
51
|
-
|
|
52
|
-
// cell 固定顺序 opacity -> strokeOpacity -> strokeWidth -> stroke ...
|
|
53
|
-
// 按顺序从 cell 中取值、若没有则自动往下取值
|
|
54
|
-
float textureOffset = 0.0; // 在 cell 中取值的偏移量
|
|
55
|
-
|
|
56
|
-
vec2 opacityAndOffset = calOpacityAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);
|
|
57
|
-
styleMappingMat[0][0] = opacityAndOffset.r;
|
|
58
|
-
textureOffset = opacityAndOffset.g;
|
|
59
|
-
|
|
60
|
-
vec2 strokeWidthAndOffset = calStrokeWidthAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);
|
|
61
|
-
styleMappingMat[0][2] = strokeWidthAndOffset.r;
|
|
62
|
-
textureOffset = strokeWidthAndOffset.g;
|
|
63
|
-
|
|
64
|
-
vec4 textrueStroke = vec4(-1.0, -1.0, -1.0, -1.0);
|
|
65
|
-
if(hasStroke()) {
|
|
66
|
-
vec2 valueRPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);
|
|
67
|
-
styleMappingMat[1][0] = pos2value(valueRPos, columnWidth, rowHeight); // R
|
|
68
|
-
textureOffset += 1.0;
|
|
69
|
-
|
|
70
|
-
vec2 valueGPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);
|
|
71
|
-
styleMappingMat[1][1] = pos2value(valueGPos, columnWidth, rowHeight); // G
|
|
72
|
-
textureOffset += 1.0;
|
|
73
|
-
|
|
74
|
-
vec2 valueBPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);
|
|
75
|
-
styleMappingMat[1][2] = pos2value(valueBPos, columnWidth, rowHeight); // B
|
|
76
|
-
textureOffset += 1.0;
|
|
77
|
-
|
|
78
|
-
vec2 valueAPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);
|
|
79
|
-
styleMappingMat[1][3] = pos2value(valueAPos, columnWidth, rowHeight); // A
|
|
80
|
-
textureOffset += 1.0;
|
|
81
|
-
} else {
|
|
82
|
-
if(u_stroke_color == vec4(0.0)) {
|
|
83
|
-
styleMappingMat[1][0] = v_color.r;
|
|
84
|
-
styleMappingMat[1][1] = v_color.g;
|
|
85
|
-
styleMappingMat[1][2] = v_color.b;
|
|
86
|
-
styleMappingMat[1][3] = v_color.a;
|
|
87
|
-
} else {
|
|
88
|
-
styleMappingMat[1][0] = u_stroke_color.r;
|
|
89
|
-
styleMappingMat[1][1] = u_stroke_color.g;
|
|
90
|
-
styleMappingMat[1][2] = u_stroke_color.b;
|
|
91
|
-
styleMappingMat[1][3] = u_stroke_color.a;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
// cal style mapping - 数据纹理映射部分的计算
|
|
96
|
-
|
|
97
|
-
v_color = a_Color;
|
|
98
|
-
v_uv = a_tex / u_sdf_map_size;
|
|
99
|
-
|
|
100
|
-
// 文本缩放比例
|
|
101
|
-
float fontScale = a_Size / FONT_SIZE;
|
|
102
|
-
v_fontScale = fontScale;
|
|
103
|
-
|
|
104
|
-
vec4 project_pos = project_position(vec4(a_Position, 1.0));
|
|
105
|
-
// vec4 projected_position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));
|
|
106
|
-
|
|
107
|
-
highp float angle_sin = sin(a_Rotate);
|
|
108
|
-
highp float angle_cos = cos(a_Rotate);
|
|
109
|
-
mat2 rotation_matrix = mat2(angle_cos, -1.0 * angle_sin, angle_sin, angle_cos);
|
|
110
|
-
|
|
111
|
-
// gl_Position = vec4(projected_position.xy / projected_position.w + rotation_matrix * a_textOffsets * fontScale / u_ViewportSize * 2.0 * u_DevicePixelRatio, 0.0, 1.0);
|
|
112
|
-
|
|
113
|
-
float raiseHeight = u_raisingHeight;
|
|
114
|
-
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
115
|
-
float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);
|
|
116
|
-
raiseHeight = u_raisingHeight * mapboxZoomScale;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
vec4 projected_position;
|
|
120
|
-
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
|
|
121
|
-
projected_position = u_Mvp * (vec4(a_Position.xyz + vec3(0.0, 0.0, raiseHeight), 1.0));
|
|
122
|
-
} else { // else
|
|
123
|
-
projected_position = project_common_position_to_clipspace(vec4(project_pos.xyz + vec3(0.0, 0.0, raiseHeight), 1.0));
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
gl_Position = vec4(
|
|
127
|
-
projected_position.xy / projected_position.w + rotation_matrix * a_textOffsets * fontScale / u_ViewportSize * 2.0 * u_DevicePixelRatio, 0.0, 1.0);
|
|
128
|
-
v_gamma_scale = gl_Position.w;
|
|
129
|
-
setPickingColor(a_PickingColor);
|
|
130
|
-
|
|
131
|
-
}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
uniform float u_additive;
|
|
2
|
-
varying mat4 styleMappingMat; // 传递从片元中传递的映射数据
|
|
3
|
-
|
|
4
|
-
varying vec4 v_data;
|
|
5
|
-
varying vec4 v_color;
|
|
6
|
-
varying float v_radius;
|
|
7
|
-
|
|
8
|
-
#pragma include "sdf_2d"
|
|
9
|
-
#pragma include "picking"
|
|
10
|
-
|
|
11
|
-
void main() {
|
|
12
|
-
int shape = int(floor(v_data.w + 0.5));
|
|
13
|
-
|
|
14
|
-
vec4 textrueStroke = vec4(
|
|
15
|
-
styleMappingMat[1][0],
|
|
16
|
-
styleMappingMat[1][1],
|
|
17
|
-
styleMappingMat[1][2],
|
|
18
|
-
styleMappingMat[1][3]
|
|
19
|
-
);
|
|
20
|
-
|
|
21
|
-
float opacity = styleMappingMat[0][0];
|
|
22
|
-
float stroke_opacity = styleMappingMat[0][1];
|
|
23
|
-
float strokeWidth = styleMappingMat[0][2];
|
|
24
|
-
vec4 strokeColor = textrueStroke == vec4(0) ? v_color : textrueStroke;
|
|
25
|
-
|
|
26
|
-
lowp float antialiasblur = v_data.z;
|
|
27
|
-
float r = v_radius / (v_radius + strokeWidth);
|
|
28
|
-
|
|
29
|
-
float outer_df;
|
|
30
|
-
float inner_df;
|
|
31
|
-
// 'circle', 'triangle', 'square', 'pentagon', 'hexagon', 'octogon', 'hexagram', 'rhombus', 'vesica'
|
|
32
|
-
if (shape == 0) {
|
|
33
|
-
outer_df = sdCircle(v_data.xy, 1.0);
|
|
34
|
-
inner_df = sdCircle(v_data.xy, r);
|
|
35
|
-
} else if (shape == 1) {
|
|
36
|
-
outer_df = sdEquilateralTriangle(1.1 * v_data.xy);
|
|
37
|
-
inner_df = sdEquilateralTriangle(1.1 / r * v_data.xy);
|
|
38
|
-
} else if (shape == 2) {
|
|
39
|
-
outer_df = sdBox(v_data.xy, vec2(1.));
|
|
40
|
-
inner_df = sdBox(v_data.xy, vec2(r));
|
|
41
|
-
} else if (shape == 3) {
|
|
42
|
-
outer_df = sdPentagon(v_data.xy, 0.8);
|
|
43
|
-
inner_df = sdPentagon(v_data.xy, r * 0.8);
|
|
44
|
-
} else if (shape == 4) {
|
|
45
|
-
outer_df = sdHexagon(v_data.xy, 0.8);
|
|
46
|
-
inner_df = sdHexagon(v_data.xy, r * 0.8);
|
|
47
|
-
} else if (shape == 5) {
|
|
48
|
-
outer_df = sdOctogon(v_data.xy, 1.0);
|
|
49
|
-
inner_df = sdOctogon(v_data.xy, r);
|
|
50
|
-
} else if (shape == 6) {
|
|
51
|
-
outer_df = sdHexagram(v_data.xy, 0.52);
|
|
52
|
-
inner_df = sdHexagram(v_data.xy, r * 0.52);
|
|
53
|
-
} else if (shape == 7) {
|
|
54
|
-
outer_df = sdRhombus(v_data.xy, vec2(1.0));
|
|
55
|
-
inner_df = sdRhombus(v_data.xy, vec2(r));
|
|
56
|
-
} else if (shape == 8) {
|
|
57
|
-
outer_df = sdVesica(v_data.xy, 1.1, 0.8);
|
|
58
|
-
inner_df = sdVesica(v_data.xy, r * 1.1, r * 0.8);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
float opacity_t = smoothstep(0.0, antialiasblur, outer_df);
|
|
63
|
-
|
|
64
|
-
float color_t = strokeWidth < 0.01 ? 0.0 : smoothstep(
|
|
65
|
-
antialiasblur,
|
|
66
|
-
0.0,
|
|
67
|
-
inner_df
|
|
68
|
-
);
|
|
69
|
-
|
|
70
|
-
if(strokeWidth < 0.01) {
|
|
71
|
-
gl_FragColor = vec4(v_color.rgb, v_color.a * opacity);
|
|
72
|
-
} else {
|
|
73
|
-
gl_FragColor = mix(vec4(v_color.rgb, v_color.a * opacity), strokeColor * stroke_opacity, color_t);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
if(u_additive > 0.0) {
|
|
77
|
-
gl_FragColor *= opacity_t;
|
|
78
|
-
gl_FragColor = filterColorAlpha(gl_FragColor, gl_FragColor.a);
|
|
79
|
-
} else {
|
|
80
|
-
gl_FragColor.a *= opacity_t;
|
|
81
|
-
gl_FragColor = filterColor(gl_FragColor);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
attribute vec4 a_Color;
|
|
2
|
-
attribute vec3 a_Position;
|
|
3
|
-
attribute vec3 a_Extrude;
|
|
4
|
-
attribute float a_Size;
|
|
5
|
-
attribute float a_Shape;
|
|
6
|
-
|
|
7
|
-
varying mat4 styleMappingMat; // 用于将在顶点着色器中计算好的样式值传递给片元
|
|
8
|
-
|
|
9
|
-
uniform mat4 u_ModelMatrix;
|
|
10
|
-
uniform mat4 u_Mvp;
|
|
11
|
-
uniform float u_isMeter;
|
|
12
|
-
|
|
13
|
-
uniform vec2 u_tileOrigin;
|
|
14
|
-
uniform float u_coord;
|
|
15
|
-
|
|
16
|
-
varying vec4 v_data;
|
|
17
|
-
varying vec4 v_color;
|
|
18
|
-
varying float v_radius;
|
|
19
|
-
|
|
20
|
-
uniform float u_opacity : 1;
|
|
21
|
-
uniform float u_stroke_opacity : 1;
|
|
22
|
-
uniform float u_stroke_width : 2;
|
|
23
|
-
uniform vec4 u_stroke_color : [0.0, 0.0, 0.0, 0.0];
|
|
24
|
-
uniform vec2 u_offsets;
|
|
25
|
-
|
|
26
|
-
uniform float u_blur : 0.0;
|
|
27
|
-
|
|
28
|
-
#pragma include "styleMapping"
|
|
29
|
-
#pragma include "styleMappingCalOpacity"
|
|
30
|
-
#pragma include "styleMappingCalStrokeOpacity"
|
|
31
|
-
#pragma include "styleMappingCalStrokeWidth"
|
|
32
|
-
|
|
33
|
-
#pragma include "projection"
|
|
34
|
-
#pragma include "picking"
|
|
35
|
-
|
|
36
|
-
void main() {
|
|
37
|
-
vec3 extrude = a_Extrude;
|
|
38
|
-
float shape_type = a_Shape;
|
|
39
|
-
float newSize = setPickingSize(a_Size);
|
|
40
|
-
|
|
41
|
-
// cal style mapping - 数据纹理映射部分的计算
|
|
42
|
-
styleMappingMat = mat4(
|
|
43
|
-
0.0, 0.0, 0.0, 0.0, // opacity - strokeOpacity - strokeWidth - empty
|
|
44
|
-
0.0, 0.0, 0.0, 0.0, // strokeR - strokeG - strokeB - strokeA
|
|
45
|
-
0.0, 0.0, 0.0, 0.0, // offsets[0] - offsets[1]
|
|
46
|
-
0.0, 0.0, 0.0, 0.0
|
|
47
|
-
);
|
|
48
|
-
|
|
49
|
-
float rowCount = u_cellTypeLayout[0][0]; // 当前的数据纹理有几行
|
|
50
|
-
float columnCount = u_cellTypeLayout[0][1]; // 当看到数据纹理有几列
|
|
51
|
-
float columnWidth = 1.0/columnCount; // 列宽
|
|
52
|
-
float rowHeight = 1.0/rowCount; // 行高
|
|
53
|
-
float cellCount = calCellCount(); // opacity - strokeOpacity - strokeWidth - stroke - offsets
|
|
54
|
-
float id = a_vertexId; // 第n个顶点
|
|
55
|
-
float cellCurrentRow = floor(id * cellCount / columnCount) + 1.0; // 起始点在第几行
|
|
56
|
-
float cellCurrentColumn = mod(id * cellCount, columnCount) + 1.0; // 起始点在第几列
|
|
57
|
-
|
|
58
|
-
// cell 固定顺序 opacity -> strokeOpacity -> strokeWidth -> stroke ...
|
|
59
|
-
// 按顺序从 cell 中取值、若没有则自动往下取值
|
|
60
|
-
float textureOffset = 0.0; // 在 cell 中取值的偏移量
|
|
61
|
-
|
|
62
|
-
vec2 opacityAndOffset = calOpacityAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);
|
|
63
|
-
styleMappingMat[0][0] = opacityAndOffset.r;
|
|
64
|
-
textureOffset = opacityAndOffset.g;
|
|
65
|
-
|
|
66
|
-
vec2 strokeOpacityAndOffset = calStrokeOpacityAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);
|
|
67
|
-
styleMappingMat[0][1] = strokeOpacityAndOffset.r;
|
|
68
|
-
textureOffset = strokeOpacityAndOffset.g;
|
|
69
|
-
|
|
70
|
-
vec2 strokeWidthAndOffset = calStrokeWidthAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);
|
|
71
|
-
styleMappingMat[0][2] = strokeWidthAndOffset.r;
|
|
72
|
-
textureOffset = strokeWidthAndOffset.g;
|
|
73
|
-
|
|
74
|
-
vec4 textrueStroke = vec4(-1.0, -1.0, -1.0, -1.0);
|
|
75
|
-
if(hasStroke()) {
|
|
76
|
-
vec2 valueRPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);
|
|
77
|
-
styleMappingMat[1][0] = pos2value(valueRPos, columnWidth, rowHeight); // R
|
|
78
|
-
textureOffset += 1.0;
|
|
79
|
-
|
|
80
|
-
vec2 valueGPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);
|
|
81
|
-
styleMappingMat[1][1] = pos2value(valueGPos, columnWidth, rowHeight); // G
|
|
82
|
-
textureOffset += 1.0;
|
|
83
|
-
|
|
84
|
-
vec2 valueBPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);
|
|
85
|
-
styleMappingMat[1][2] = pos2value(valueBPos, columnWidth, rowHeight); // B
|
|
86
|
-
textureOffset += 1.0;
|
|
87
|
-
|
|
88
|
-
vec2 valueAPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);
|
|
89
|
-
styleMappingMat[1][3] = pos2value(valueAPos, columnWidth, rowHeight); // A
|
|
90
|
-
textureOffset += 1.0;
|
|
91
|
-
} else {
|
|
92
|
-
if(u_stroke_color == vec4(0.0)) {
|
|
93
|
-
styleMappingMat[1][0] = v_color.r;
|
|
94
|
-
styleMappingMat[1][1] = v_color.g;
|
|
95
|
-
styleMappingMat[1][2] = v_color.b;
|
|
96
|
-
styleMappingMat[1][3] = v_color.a;
|
|
97
|
-
} else {
|
|
98
|
-
styleMappingMat[1][0] = u_stroke_color.r;
|
|
99
|
-
styleMappingMat[1][1] = u_stroke_color.g;
|
|
100
|
-
styleMappingMat[1][2] = u_stroke_color.b;
|
|
101
|
-
styleMappingMat[1][3] = u_stroke_color.a;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
vec2 textrueOffsets = vec2(0.0, 0.0);
|
|
106
|
-
if(hasOffsets()) {
|
|
107
|
-
vec2 valueXPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);
|
|
108
|
-
textrueOffsets.r = pos2value(valueXPos, columnWidth, rowHeight); // x
|
|
109
|
-
textureOffset += 1.0;
|
|
110
|
-
|
|
111
|
-
vec2 valueYPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);
|
|
112
|
-
textrueOffsets.g = pos2value(valueYPos, columnWidth, rowHeight); // x
|
|
113
|
-
textureOffset += 1.0;
|
|
114
|
-
} else {
|
|
115
|
-
textrueOffsets = u_offsets;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
// cal style mapping
|
|
119
|
-
|
|
120
|
-
v_color = a_Color;
|
|
121
|
-
v_radius = newSize;
|
|
122
|
-
|
|
123
|
-
// anti-alias
|
|
124
|
-
// float antialiased_blur = -max(u_blur, antialiasblur);
|
|
125
|
-
float antialiasblur = -max(2.0 / u_DevicePixelRatio / a_Size, u_blur);
|
|
126
|
-
|
|
127
|
-
vec2 offset = (extrude.xy * (newSize + u_stroke_width) + textrueOffsets);
|
|
128
|
-
vec3 aPosition = a_Position;
|
|
129
|
-
if(u_isMeter < 1.0) {
|
|
130
|
-
// 不以米为实际单位
|
|
131
|
-
offset = project_pixel(offset);
|
|
132
|
-
} else {
|
|
133
|
-
// 以米为实际单位
|
|
134
|
-
antialiasblur *= pow(19.0 - u_Zoom, 2.0);
|
|
135
|
-
antialiasblur = max(antialiasblur, -0.01);
|
|
136
|
-
// offset *= 0.5;
|
|
137
|
-
|
|
138
|
-
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
139
|
-
aPosition.xy += offset;
|
|
140
|
-
offset.x = 0.0;
|
|
141
|
-
offset.y = 0.0;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
v_data = vec4(extrude.x, extrude.y, antialiasblur,shape_type);
|
|
146
|
-
|
|
147
|
-
vec4 project_pos = project_position(vec4(aPosition.xy, 0.0, 1.0));
|
|
148
|
-
|
|
149
|
-
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
150
|
-
float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
if(u_coord > 0.0) {
|
|
154
|
-
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
|
|
155
|
-
gl_Position = u_Mvp * vec4(project_pos.xy + offset, 0.0, 1.0);
|
|
156
|
-
} else {
|
|
157
|
-
gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, 0.0, 1.0));
|
|
158
|
-
}
|
|
159
|
-
} else {
|
|
160
|
-
gl_PointSize = 24.0;
|
|
161
|
-
vec2 pointPos = a_Position.xy;
|
|
162
|
-
vec4 world = vec4(project_mvt_offset_position(vec4(u_tileOrigin, 0.0, 1.0)).xyz, 1.0); // 瓦片起始点的世界坐标
|
|
163
|
-
|
|
164
|
-
vec2 pointOffset = pointPos * pow(2.0, u_Zoom); // 瓦片内的点的偏移坐标
|
|
165
|
-
|
|
166
|
-
world.xy += offset;
|
|
167
|
-
world.xy += pointOffset;
|
|
168
|
-
|
|
169
|
-
if (u_CoordinateSystem == COORDINATE_SYSTEM_METER_OFFSET || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
170
|
-
// Needs to be divided with project_uCommonUnitsPerMeter
|
|
171
|
-
world.w *= u_PixelsPerMeter.z;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
gl_Position = u_ViewProjectionMatrix * world + u_ViewportCenterProjection;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
setPickingColor(a_PickingColor);
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { IPath } from '../../core/shape/Path';
|
|
2
|
-
export interface IExtrudeGeomety {
|
|
3
|
-
positions: number[];
|
|
4
|
-
index: number[];
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* 拉伸多边形顶点,返回拉伸后的顶点信息
|
|
8
|
-
* @param paths 路径数据组
|
|
9
|
-
* @param extrude 是否拉伸
|
|
10
|
-
*/
|
|
11
|
-
export default function extrudePolygon(path: IPath[]): IExtrudeGeomety;
|
|
12
|
-
export declare function fillPolygon(points: IPath[]): {
|
|
13
|
-
positions: number[];
|
|
14
|
-
index: number[];
|
|
15
|
-
};
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
-
import earcut from 'earcut';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* 拉伸多边形顶点,返回拉伸后的顶点信息
|
|
6
|
-
* @param paths 路径数据组
|
|
7
|
-
* @param extrude 是否拉伸
|
|
8
|
-
*/
|
|
9
|
-
export default function extrudePolygon(path) {
|
|
10
|
-
var p1 = path[0][0];
|
|
11
|
-
var p2 = path[0][path[0].length - 1];
|
|
12
|
-
|
|
13
|
-
if (p1[0] === p2[0] && p1[1] === p2[1]) {
|
|
14
|
-
path[0] = path[0].slice(0, path[0].length - 1);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
var n = path[0].length;
|
|
18
|
-
var flattengeo = earcut.flatten(path);
|
|
19
|
-
var positions = [];
|
|
20
|
-
var indexArray = [];
|
|
21
|
-
var normals = []; // 设置顶部z值
|
|
22
|
-
|
|
23
|
-
for (var j = 0; j < flattengeo.vertices.length / 3; j++) {
|
|
24
|
-
flattengeo.vertices[j * 3 + 2] = 1;
|
|
25
|
-
normals.push(0, 0, 1);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
positions.push.apply(positions, _toConsumableArray(flattengeo.vertices));
|
|
29
|
-
var triangles = earcut(flattengeo.vertices, flattengeo.holes, flattengeo.dimensions);
|
|
30
|
-
indexArray.push.apply(indexArray, _toConsumableArray(triangles));
|
|
31
|
-
|
|
32
|
-
var _loop = function _loop(i) {
|
|
33
|
-
var prePoint = flattengeo.vertices.slice(i * 3, i * 3 + 3);
|
|
34
|
-
var nextPoint = flattengeo.vertices.slice(i * 3 + 3, i * 3 + 6);
|
|
35
|
-
|
|
36
|
-
if (nextPoint.length === 0) {
|
|
37
|
-
nextPoint = flattengeo.vertices.slice(0, 3);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
var indexOffset = positions.length / 3;
|
|
41
|
-
positions.push(prePoint[0], prePoint[1], 1, nextPoint[0], nextPoint[1], 1, prePoint[0], prePoint[1], 0, nextPoint[0], nextPoint[1], 0);
|
|
42
|
-
indexArray.push.apply(indexArray, _toConsumableArray([1, 2, 0, 3, 2, 1].map(function (v) {
|
|
43
|
-
return v + indexOffset;
|
|
44
|
-
})));
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
for (var i = 0; i < n; i++) {
|
|
48
|
-
_loop(i);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
return {
|
|
52
|
-
positions: positions,
|
|
53
|
-
index: indexArray
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
export function fillPolygon(points) {
|
|
57
|
-
var flattengeo = earcut.flatten(points);
|
|
58
|
-
var triangles = earcut(flattengeo.vertices, flattengeo.holes, flattengeo.dimensions);
|
|
59
|
-
return {
|
|
60
|
-
positions: flattengeo.vertices,
|
|
61
|
-
index: triangles
|
|
62
|
-
};
|
|
63
|
-
}
|
package/es/polygon/index.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import BaseLayer from '../core/BaseLayer';
|
|
2
|
-
import { IPolygonLayerStyleOptions } from '../core/interface';
|
|
3
|
-
import { PolygonModelType } from './models/';
|
|
4
|
-
export default class PolygonLayer extends BaseLayer<IPolygonLayerStyleOptions> {
|
|
5
|
-
type: string;
|
|
6
|
-
buildModels(): void;
|
|
7
|
-
rebuildModels(): void;
|
|
8
|
-
protected getConfigSchema(): {
|
|
9
|
-
properties: {
|
|
10
|
-
opacity: {
|
|
11
|
-
type: string;
|
|
12
|
-
minimum: number;
|
|
13
|
-
maximum: number;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
protected getModelType(): PolygonModelType;
|
|
18
|
-
protected getPointModelType(): PolygonModelType;
|
|
19
|
-
}
|
package/es/polygon/index.js
DELETED
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
|
|
9
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
-
|
|
11
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
12
|
-
|
|
13
|
-
import BaseLayer from "../core/BaseLayer";
|
|
14
|
-
import PolygonModels from "./models/";
|
|
15
|
-
|
|
16
|
-
var PolygonLayer = /*#__PURE__*/function (_BaseLayer) {
|
|
17
|
-
_inherits(PolygonLayer, _BaseLayer);
|
|
18
|
-
|
|
19
|
-
var _super = _createSuper(PolygonLayer);
|
|
20
|
-
|
|
21
|
-
function PolygonLayer() {
|
|
22
|
-
var _this;
|
|
23
|
-
|
|
24
|
-
_classCallCheck(this, PolygonLayer);
|
|
25
|
-
|
|
26
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
27
|
-
args[_key] = arguments[_key];
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
31
|
-
|
|
32
|
-
_defineProperty(_assertThisInitialized(_this), "type", 'PolygonLayer');
|
|
33
|
-
|
|
34
|
-
return _this;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
_createClass(PolygonLayer, [{
|
|
38
|
-
key: "buildModels",
|
|
39
|
-
value: function buildModels() {
|
|
40
|
-
var _this2 = this;
|
|
41
|
-
|
|
42
|
-
var shape = this.getModelType();
|
|
43
|
-
this.layerModel = new PolygonModels[shape](this);
|
|
44
|
-
this.layerModel.initModels(function (models) {
|
|
45
|
-
_this2.models = models;
|
|
46
|
-
|
|
47
|
-
_this2.renderLayers();
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
}, {
|
|
51
|
-
key: "rebuildModels",
|
|
52
|
-
value: function rebuildModels() {
|
|
53
|
-
var _this3 = this;
|
|
54
|
-
|
|
55
|
-
this.layerModel.buildModels(function (models) {
|
|
56
|
-
return _this3.models = models;
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
}, {
|
|
60
|
-
key: "getConfigSchema",
|
|
61
|
-
value: function getConfigSchema() {
|
|
62
|
-
return {
|
|
63
|
-
properties: {
|
|
64
|
-
opacity: {
|
|
65
|
-
type: 'number',
|
|
66
|
-
minimum: 0,
|
|
67
|
-
maximum: 1
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
}, {
|
|
73
|
-
key: "getModelType",
|
|
74
|
-
value: function getModelType() {
|
|
75
|
-
var _shapeAttribute$scale;
|
|
76
|
-
|
|
77
|
-
if (this.layerSource.parser.type === 'mvt') {
|
|
78
|
-
return 'vectorpolygon';
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
var shapeAttribute = this.styleAttributeService.getLayerStyleAttribute('shape');
|
|
82
|
-
var shape = shapeAttribute === null || shapeAttribute === void 0 ? void 0 : (_shapeAttribute$scale = shapeAttribute.scale) === null || _shapeAttribute$scale === void 0 ? void 0 : _shapeAttribute$scale.field;
|
|
83
|
-
|
|
84
|
-
if (shape === 'fill') {
|
|
85
|
-
return 'fill';
|
|
86
|
-
} else if (shape === 'extrude') {
|
|
87
|
-
return 'extrude';
|
|
88
|
-
} else if (shape === 'water') {
|
|
89
|
-
return 'water';
|
|
90
|
-
} else if (shape === 'ocean') {
|
|
91
|
-
return 'ocean';
|
|
92
|
-
} else if (shape === 'line') {
|
|
93
|
-
return 'line';
|
|
94
|
-
} else if (shape === 'tile') {
|
|
95
|
-
return 'tile';
|
|
96
|
-
} else {
|
|
97
|
-
return this.getPointModelType();
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}, {
|
|
101
|
-
key: "getPointModelType",
|
|
102
|
-
value: function getPointModelType() {
|
|
103
|
-
// pointlayer
|
|
104
|
-
// 2D、 3d、 shape、image、text、normal、
|
|
105
|
-
var layerData = this.getEncodedData();
|
|
106
|
-
|
|
107
|
-
var _this$getLayerConfig = this.getLayerConfig(),
|
|
108
|
-
shape2d = _this$getLayerConfig.shape2d,
|
|
109
|
-
shape3d = _this$getLayerConfig.shape3d;
|
|
110
|
-
|
|
111
|
-
var iconMap = this.iconService.getIconMap();
|
|
112
|
-
var item = layerData.find(function (fe) {
|
|
113
|
-
return fe.hasOwnProperty('shape');
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
if (!item) {
|
|
117
|
-
return 'fill';
|
|
118
|
-
} else {
|
|
119
|
-
var shape = item.shape;
|
|
120
|
-
|
|
121
|
-
if (shape === 'dot') {
|
|
122
|
-
return 'point_normal';
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
if ((shape2d === null || shape2d === void 0 ? void 0 : shape2d.indexOf(shape)) !== -1) {
|
|
126
|
-
return 'point_fill';
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
if ((shape3d === null || shape3d === void 0 ? void 0 : shape3d.indexOf(shape)) !== -1) {
|
|
130
|
-
return 'point_extrude';
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
if (iconMap.hasOwnProperty(shape)) {
|
|
134
|
-
return 'point_image';
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
return 'text';
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}]);
|
|
141
|
-
|
|
142
|
-
return PolygonLayer;
|
|
143
|
-
}(BaseLayer);
|
|
144
|
-
|
|
145
|
-
export { PolygonLayer as default };
|