@antv/l7-layers 2.9.37-alpha.2 → 2.9.37-alpha.3
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/es/Geometry/index.d.ts +23 -0
- package/es/Geometry/index.js +105 -0
- package/es/Geometry/models/billboard.d.ts +17 -0
- package/es/Geometry/models/billboard.js +215 -0
- package/es/Geometry/models/index.d.ts +5 -0
- package/es/Geometry/models/index.js +9 -0
- package/es/Geometry/models/plane.d.ts +36 -0
- package/es/Geometry/models/plane.js +406 -0
- package/es/Geometry/models/sprite.d.ts +38 -0
- package/es/Geometry/models/sprite.js +288 -0
- package/es/Geometry/shaders/billboard_frag.glsl +13 -0
- package/es/Geometry/shaders/billboard_vert.glsl +50 -0
- package/es/Geometry/shaders/plane_frag.glsl +22 -0
- package/es/Geometry/shaders/plane_vert.glsl +53 -0
- package/es/Geometry/shaders/sprite_frag.glsl +21 -0
- package/es/Geometry/shaders/sprite_vert.glsl +28 -0
- package/es/canvas/index.d.ts +14 -0
- package/es/canvas/index.js +108 -0
- package/es/canvas/models/canvas.d.ts +18 -0
- package/es/canvas/models/canvas.js +212 -0
- package/es/canvas/models/index.d.ts +5 -0
- package/es/canvas/models/index.js +5 -0
- package/es/citybuliding/building.d.ts +8 -0
- package/es/citybuliding/building.js +73 -0
- package/es/citybuliding/models/build.d.ts +22 -0
- package/es/citybuliding/models/build.js +187 -0
- package/es/citybuliding/shaders/build_frag.glsl +117 -0
- package/es/citybuliding/shaders/build_vert.glsl +54 -0
- package/es/core/BaseLayer.d.ts +225 -0
- package/es/core/BaseLayer.js +1439 -0
- package/es/core/BaseModel.d.ts +140 -0
- package/es/core/BaseModel.js +490 -0
- package/es/core/interface.d.ts +225 -0
- package/es/core/interface.js +30 -0
- package/es/core/schema.d.ts +27 -0
- package/es/core/schema.js +25 -0
- package/es/core/shape/Path.d.ts +39 -0
- package/es/core/shape/Path.js +62 -0
- package/es/core/shape/extrude.d.ts +17 -0
- package/es/core/shape/extrude.js +148 -0
- package/es/core/triangulation.d.ts +130 -0
- package/es/core/triangulation.js +552 -0
- package/es/earth/index.d.ts +22 -0
- package/es/earth/index.js +98 -0
- package/es/earth/models/atmosphere.d.ts +9 -0
- package/es/earth/models/atmosphere.js +135 -0
- package/es/earth/models/base.d.ts +16 -0
- package/es/earth/models/base.js +206 -0
- package/es/earth/models/bloomsphere.d.ts +9 -0
- package/es/earth/models/bloomsphere.js +134 -0
- package/es/earth/shaders/atmosphere_frag.glsl +17 -0
- package/es/earth/shaders/atmosphere_vert.glsl +26 -0
- package/es/earth/shaders/base_frag.glsl +13 -0
- package/es/earth/shaders/base_vert.glsl +52 -0
- package/es/earth/shaders/bloomsphere_frag.glsl +15 -0
- package/es/earth/shaders/bloomsphere_vert.glsl +20 -0
- package/es/earth/utils.d.ts +26 -0
- package/es/earth/utils.js +104 -0
- package/es/glsl.d.ts +5 -0
- package/es/heatmap/index.d.ts +12 -0
- package/es/heatmap/index.js +128 -0
- package/es/heatmap/models/grid.d.ts +8 -0
- package/es/heatmap/models/grid.js +106 -0
- package/es/heatmap/models/grid3d.d.ts +8 -0
- package/es/heatmap/models/grid3d.js +140 -0
- package/es/heatmap/models/heatmap.d.ts +24 -0
- package/es/heatmap/models/heatmap.js +461 -0
- package/es/heatmap/models/hexagon.d.ts +8 -0
- package/es/heatmap/models/hexagon.js +107 -0
- package/es/heatmap/models/index.d.ts +5 -0
- package/es/heatmap/models/index.js +12 -0
- package/es/heatmap/shaders/grid_vert.glsl +42 -0
- package/es/heatmap/shaders/heatmap_3d_frag.glsl +14 -0
- package/es/heatmap/shaders/heatmap_3d_vert.glsl +46 -0
- package/es/heatmap/shaders/heatmap_frag.glsl +47 -0
- package/es/heatmap/shaders/heatmap_framebuffer_frag.glsl +10 -0
- package/es/heatmap/shaders/heatmap_framebuffer_vert.glsl +35 -0
- package/es/heatmap/shaders/heatmap_vert.glsl +10 -0
- package/es/heatmap/shaders/hexagon_3d_frag.glsl +0 -0
- package/es/heatmap/shaders/hexagon_3d_vert.glsl +64 -0
- package/es/heatmap/shaders/hexagon_frag.glsl +12 -0
- package/es/heatmap/shaders/hexagon_vert.glsl +41 -0
- package/es/heatmap/triangulation.d.ts +5 -0
- package/es/heatmap/triangulation.js +37 -0
- package/es/image/index.d.ts +10 -0
- package/es/image/index.js +91 -0
- package/es/image/models/dataImage.d.ts +13 -0
- package/es/image/models/dataImage.js +186 -0
- package/es/image/models/image.d.ts +10 -0
- package/es/image/models/image.js +150 -0
- package/es/image/models/index.d.ts +5 -0
- package/es/image/models/index.js +9 -0
- package/es/image/models/tileDataImage.d.ts +10 -0
- package/es/image/models/tileDataImage.js +160 -0
- package/es/image/shaders/dataImage_frag.glsl +38 -0
- package/es/image/shaders/image_frag.glsl +9 -0
- package/es/image/shaders/image_vert.glsl +17 -0
- package/es/index.d.ts +17 -0
- package/es/index.js +107 -0
- package/es/line/index.d.ts +34 -0
- package/es/line/index.js +127 -0
- package/es/line/models/arc.d.ts +17 -0
- package/es/line/models/arc.js +356 -0
- package/es/line/models/arc_3d.d.ts +17 -0
- package/es/line/models/arc_3d.js +333 -0
- package/es/line/models/earthArc_3d.d.ts +17 -0
- package/es/line/models/earthArc_3d.js +336 -0
- package/es/line/models/great_circle.d.ts +12 -0
- package/es/line/models/great_circle.js +294 -0
- package/es/line/models/half.d.ts +18 -0
- package/es/line/models/half.js +281 -0
- package/es/line/models/index.d.ts +5 -0
- package/es/line/models/index.js +25 -0
- package/es/line/models/line.d.ts +21 -0
- package/es/line/models/line.js +443 -0
- package/es/line/models/linearline.d.ts +11 -0
- package/es/line/models/linearline.js +275 -0
- package/es/line/models/simpleLine.d.ts +14 -0
- package/es/line/models/simpleLine.js +234 -0
- package/es/line/models/simpleTileLine.d.ts +9 -0
- package/es/line/models/simpleTileLine.js +100 -0
- package/es/line/models/tile.d.ts +8 -0
- package/es/line/models/tile.js +178 -0
- package/es/line/models/wall.d.ts +12 -0
- package/es/line/models/wall.js +293 -0
- package/es/line/shaders/arc_chunks.vert.glsl +21 -0
- package/es/line/shaders/dash/arc_dash_frag.glsl +28 -0
- package/es/line/shaders/dash/arc_dash_vert.glsl +150 -0
- package/es/line/shaders/dash/line_dash_frag.glsl +31 -0
- package/es/line/shaders/dash/line_dash_vert.glsl +93 -0
- package/es/line/shaders/half/line_half_frag.glsl +53 -0
- package/es/line/shaders/half/line_half_vert.glsl +169 -0
- package/es/line/shaders/line_arc2d_vert.glsl +114 -0
- package/es/line/shaders/line_arc_3d_frag.glsl +103 -0
- package/es/line/shaders/line_arc_3d_vert.glsl +206 -0
- package/es/line/shaders/line_arc_frag.glsl +88 -0
- package/es/line/shaders/line_arc_great_circle_frag.glsl +101 -0
- package/es/line/shaders/line_arc_great_circle_vert.glsl +214 -0
- package/es/line/shaders/line_arc_vert.glsl +178 -0
- package/es/line/shaders/line_bezier_vert.glsl +85 -0
- package/es/line/shaders/line_frag.glsl +99 -0
- package/es/line/shaders/line_vert.glsl +192 -0
- package/es/line/shaders/linear/arc3d_linear_frag.glsl +46 -0
- package/es/line/shaders/linear/arc3d_linear_vert.glsl +206 -0
- package/es/line/shaders/linear/arc_linear_frag.glsl +38 -0
- package/es/line/shaders/linear/arc_linear_vert.glsl +138 -0
- package/es/line/shaders/linear/line_linear_frag.glsl +27 -0
- package/es/line/shaders/linearLine/line_linear_frag.glsl +20 -0
- package/es/line/shaders/linearLine/line_linear_vert.glsl +112 -0
- package/es/line/shaders/simple/simpleline_frag.glsl +10 -0
- package/es/line/shaders/simple/simpleline_linear_frag.glsl +11 -0
- package/es/line/shaders/simple/simpleline_vert.glsl +79 -0
- package/es/line/shaders/tile/line_tile_map_vert.glsl +25 -0
- package/es/line/shaders/tile/line_tile_vert.glsl +52 -0
- package/es/line/shaders/tile/simpleline_map_vert.glsl +15 -0
- package/es/line/shaders/tile/simpleline_vert.glsl +21 -0
- package/es/line/shaders/wall/wall_frag.glsl +89 -0
- package/es/line/shaders/wall/wall_vert.glsl +77 -0
- package/es/mask/index.d.ts +18 -0
- package/es/mask/index.js +147 -0
- package/es/mask/models/fill.d.ts +12 -0
- package/es/mask/models/fill.js +124 -0
- package/es/mask/models/index.d.ts +5 -0
- package/es/mask/models/index.js +7 -0
- package/es/mask/shaders/mask_vert.glsl +16 -0
- package/es/plugins/DataMappingPlugin.d.ts +18 -0
- package/es/plugins/DataMappingPlugin.js +413 -0
- package/es/plugins/DataSourcePlugin.d.ts +7 -0
- package/es/plugins/DataSourcePlugin.js +84 -0
- package/es/plugins/FeatureScalePlugin.d.ts +24 -0
- package/es/plugins/FeatureScalePlugin.js +342 -0
- package/es/plugins/LayerAnimateStylePlugin.d.ts +5 -0
- package/es/plugins/LayerAnimateStylePlugin.js +29 -0
- package/es/plugins/LayerModelPlugin.d.ts +10 -0
- package/es/plugins/LayerModelPlugin.js +72 -0
- package/es/plugins/LayerStylePlugin.d.ts +8 -0
- package/es/plugins/LayerStylePlugin.js +39 -0
- package/es/plugins/LightingPlugin.d.ts +36 -0
- package/es/plugins/LightingPlugin.js +104 -0
- package/es/plugins/MultiPassRendererPlugin.d.ts +23 -0
- package/es/plugins/MultiPassRendererPlugin.js +65 -0
- package/es/plugins/PixelPickingPlugin.d.ts +8 -0
- package/es/plugins/PixelPickingPlugin.js +126 -0
- package/es/plugins/RegisterStyleAttributePlugin.d.ts +15 -0
- package/es/plugins/RegisterStyleAttributePlugin.js +151 -0
- package/es/plugins/ShaderUniformPlugin.d.ts +21 -0
- package/es/plugins/ShaderUniformPlugin.js +106 -0
- package/es/plugins/UpdateModelPlugin.d.ts +8 -0
- package/es/plugins/UpdateModelPlugin.js +31 -0
- package/es/plugins/UpdateStyleAttributePlugin.d.ts +12 -0
- package/es/plugins/UpdateStyleAttributePlugin.js +83 -0
- package/es/point/index.d.ts +31 -0
- package/es/point/index.js +216 -0
- package/es/point/models/earthExtrude.d.ts +24 -0
- package/es/point/models/earthExtrude.js +274 -0
- package/es/point/models/earthFill.d.ts +11 -0
- package/es/point/models/earthFill.js +258 -0
- package/es/point/models/extrude.d.ts +24 -0
- package/es/point/models/extrude.js +295 -0
- package/es/point/models/fill.d.ts +40 -0
- package/es/point/models/fill.js +403 -0
- package/es/point/models/fillmage.d.ts +25 -0
- package/es/point/models/fillmage.js +366 -0
- package/es/point/models/image.d.ts +11 -0
- package/es/point/models/image.js +239 -0
- package/es/point/models/index.d.ts +5 -0
- package/es/point/models/index.js +30 -0
- package/es/point/models/normal.d.ts +16 -0
- package/es/point/models/normal.js +124 -0
- package/es/point/models/radar.d.ts +24 -0
- package/es/point/models/radar.js +232 -0
- package/es/point/models/simplePoint.d.ts +16 -0
- package/es/point/models/simplePoint.js +179 -0
- package/es/point/models/text.d.ts +57 -0
- package/es/point/models/text.js +619 -0
- package/es/point/models/tile.d.ts +15 -0
- package/es/point/models/tile.js +175 -0
- package/es/point/models/tileText.d.ts +52 -0
- package/es/point/models/tileText.js +509 -0
- package/es/point/shaders/animate/wave_frag.glsl +65 -0
- package/es/point/shaders/earth/extrude_frag.glsl +44 -0
- package/es/point/shaders/earth/extrude_vert.glsl +140 -0
- package/es/point/shaders/earth/fill_frag.glsl +86 -0
- package/es/point/shaders/earth/fill_vert.glsl +125 -0
- package/es/point/shaders/extrude/extrude_frag.glsl +44 -0
- package/es/point/shaders/extrude/extrude_vert.glsl +121 -0
- package/es/point/shaders/fill_frag.glsl +84 -0
- package/es/point/shaders/fill_vert.glsl +188 -0
- package/es/point/shaders/image/fillImage_frag.glsl +20 -0
- package/es/point/shaders/image/fillImage_vert.glsl +116 -0
- package/es/point/shaders/image_frag.glsl +39 -0
- package/es/point/shaders/image_vert.glsl +90 -0
- package/es/point/shaders/normal_frag.glsl +6 -0
- package/es/point/shaders/normal_vert.glsl +24 -0
- package/es/point/shaders/radar/radar_frag.glsl +53 -0
- package/es/point/shaders/radar/radar_vert.glsl +70 -0
- package/es/point/shaders/simplePoint_frag.glsl +53 -0
- package/es/point/shaders/simplePoint_vert.glsl +79 -0
- package/es/point/shaders/text_frag.glsl +48 -0
- package/es/point/shaders/text_vert.glsl +131 -0
- package/es/point/shaders/tile/fill_tile_frag.glsl +76 -0
- package/es/point/shaders/tile/fill_tile_vert.glsl +78 -0
- package/es/point/shaders/tile/text_frag.glsl +33 -0
- package/es/point/shaders/tile/text_map_frag.glsl +31 -0
- package/es/point/shaders/tile/text_map_vert.glsl +38 -0
- package/es/point/shaders/tile/text_vert.glsl +48 -0
- package/es/point/shape/extrude.d.ts +15 -0
- package/es/point/shape/extrude.js +63 -0
- package/es/polygon/index.d.ts +18 -0
- package/es/polygon/index.js +133 -0
- package/es/polygon/models/extrude.d.ts +28 -0
- package/es/polygon/models/extrude.js +302 -0
- package/es/polygon/models/fill.d.ts +17 -0
- package/es/polygon/models/fill.js +210 -0
- package/es/polygon/models/index.d.ts +5 -0
- package/es/polygon/models/index.js +28 -0
- package/es/polygon/models/ocean.d.ts +21 -0
- package/es/polygon/models/ocean.js +201 -0
- package/es/polygon/models/tile.d.ts +12 -0
- package/es/polygon/models/tile.js +101 -0
- package/es/polygon/models/water.d.ts +16 -0
- package/es/polygon/models/water.js +178 -0
- package/es/polygon/shaders/extrude/polygon_extrude_frag.glsl +44 -0
- package/es/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +44 -0
- package/es/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +85 -0
- package/es/polygon/shaders/extrude/polygon_extrude_vert.glsl +90 -0
- package/es/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +48 -0
- package/es/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +93 -0
- package/es/polygon/shaders/polygon_frag.glsl +12 -0
- package/es/polygon/shaders/polygon_linear_frag.glsl +22 -0
- package/es/polygon/shaders/polygon_linear_vert.glsl +74 -0
- package/es/polygon/shaders/polygon_vert.glsl +66 -0
- package/es/polygon/shaders/tile/polygon_tile_map_vert.glsl +16 -0
- package/es/polygon/shaders/tile/polygon_tile_vert.glsl +42 -0
- package/es/polygon/shaders/water/polygon_ocean_frag.glsl +247 -0
- package/es/polygon/shaders/water/polygon_ocean_vert.glsl +21 -0
- package/es/polygon/shaders/water/polygon_water_frag.glsl +71 -0
- package/es/polygon/shaders/water/polygon_water_vert.glsl +26 -0
- package/es/raster/buffers/triangulation.d.ts +6 -0
- package/es/raster/buffers/triangulation.js +25 -0
- package/es/raster/index.d.ts +10 -0
- package/es/raster/index.js +94 -0
- package/es/raster/models/index.d.ts +5 -0
- package/es/raster/models/index.js +10 -0
- package/es/raster/models/raster.d.ts +22 -0
- package/es/raster/models/raster.js +241 -0
- package/es/raster/models/rasterRgb.d.ts +20 -0
- package/es/raster/models/rasterRgb.js +225 -0
- package/es/raster/models/rasterTile.d.ts +18 -0
- package/es/raster/models/rasterTile.js +139 -0
- package/es/raster/raster.d.ts +21 -0
- package/es/raster/raster.js +161 -0
- package/es/raster/shaders/raster_2d_frag.glsl +64 -0
- package/es/raster/shaders/raster_2d_vert.glsl +17 -0
- package/es/raster/shaders/raster_frag.glsl +9 -0
- package/es/raster/shaders/raster_rgb_frag.glsl +12 -0
- package/es/raster/shaders/raster_vert.glsl +44 -0
- package/es/shader/minify_frag.glsl +7 -0
- package/es/shader/minify_picking_frag.glsl +10 -0
- package/es/tile/interaction/TilePickService.d.ts +16 -0
- package/es/tile/interaction/TilePickService.js +129 -0
- package/es/tile/interaction/getFeatureData.d.ts +0 -0
- package/es/tile/interaction/getFeatureData.js +0 -0
- package/es/tile/interaction/getRasterData.d.ts +4 -0
- package/es/tile/interaction/getRasterData.js +70 -0
- package/es/tile/interaction/utils.d.ts +11 -0
- package/es/tile/interaction/utils.js +97 -0
- package/es/tile/interface.d.ts +28 -0
- package/es/tile/interface.js +1 -0
- package/es/tile/manager/base.d.ts +30 -0
- package/es/tile/manager/base.js +146 -0
- package/es/tile/manager/layerManager.d.ts +19 -0
- package/es/tile/manager/layerManager.js +254 -0
- package/es/tile/manager/mapLayerManager.d.ts +7 -0
- package/es/tile/manager/mapLayerManager.js +119 -0
- package/es/tile/models/tileModel.d.ts +10 -0
- package/es/tile/models/tileModel.js +81 -0
- package/es/tile/render/TileRenderService.d.ts +10 -0
- package/es/tile/render/TileRenderService.js +68 -0
- package/es/tile/style/TileStyleService.d.ts +17 -0
- package/es/tile/style/TileStyleService.js +118 -0
- package/es/tile/style/constants.d.ts +13 -0
- package/es/tile/style/constants.js +17 -0
- package/es/tile/style/utils.d.ts +9 -0
- package/es/tile/style/utils.js +139 -0
- package/es/tile/tileFactory/base.d.ts +45 -0
- package/es/tile/tileFactory/base.js +403 -0
- package/es/tile/tileFactory/index.d.ts +5 -0
- package/es/tile/tileFactory/index.js +38 -0
- package/es/tile/tileFactory/layers/rasterDataLayer.d.ts +11 -0
- package/es/tile/tileFactory/layers/rasterDataLayer.js +77 -0
- package/es/tile/tileFactory/layers/tileTest.d.ts +15 -0
- package/es/tile/tileFactory/layers/tileTest.js +62 -0
- package/es/tile/tileFactory/layers/vectorLayer.d.ts +30 -0
- package/es/tile/tileFactory/layers/vectorLayer.js +253 -0
- package/es/tile/tileFactory/line.d.ts +12 -0
- package/es/tile/tileFactory/line.js +59 -0
- package/es/tile/tileFactory/mask.d.ts +12 -0
- package/es/tile/tileFactory/mask.js +60 -0
- package/es/tile/tileFactory/point.d.ts +12 -0
- package/es/tile/tileFactory/point.js +60 -0
- package/es/tile/tileFactory/polygon.d.ts +12 -0
- package/es/tile/tileFactory/polygon.js +59 -0
- package/es/tile/tileFactory/raster.d.ts +12 -0
- package/es/tile/tileFactory/raster.js +55 -0
- package/es/tile/tileFactory/rasterData.d.ts +12 -0
- package/es/tile/tileFactory/rasterData.js +81 -0
- package/es/tile/tileFactory/test.d.ts +12 -0
- package/es/tile/tileFactory/test.js +94 -0
- package/es/tile/tileLayer/MapTileLayer.d.ts +6 -0
- package/es/tile/tileLayer/MapTileLayer.js +48 -0
- package/es/tile/tileLayer/TileLayer.d.ts +22 -0
- package/es/tile/tileLayer/TileLayer.js +198 -0
- package/es/tile/tileLayer/base.d.ts +33 -0
- package/es/tile/tileLayer/base.js +212 -0
- package/es/tile/utils.d.ts +22 -0
- package/es/tile/utils.js +149 -0
- package/es/utils/blend.d.ts +2 -0
- package/es/utils/blend.js +54 -0
- package/es/utils/collision-index.d.ts +47 -0
- package/es/utils/collision-index.js +102 -0
- package/es/utils/dataMappingStyle.d.ts +31 -0
- package/es/utils/dataMappingStyle.js +147 -0
- package/es/utils/extrude_polyline.d.ts +68 -0
- package/es/utils/extrude_polyline.js +613 -0
- package/es/utils/grid-index.d.ts +28 -0
- package/es/utils/grid-index.js +179 -0
- package/es/utils/layerData.d.ts +2 -0
- package/es/utils/layerData.js +179 -0
- package/es/utils/multiPassRender.d.ts +16 -0
- package/es/utils/multiPassRender.js +49 -0
- package/es/utils/polylineNormal.d.ts +9 -0
- package/es/utils/polylineNormal.js +191 -0
- package/es/utils/simpleLine.d.ts +23 -0
- package/es/utils/simpleLine.js +103 -0
- package/es/utils/symbol-layout.d.ts +43 -0
- package/es/utils/symbol-layout.js +299 -0
- package/es/utils/updateShape.d.ts +2 -0
- package/es/utils/updateShape.js +20 -0
- package/es/wind/index.d.ts +11 -0
- package/es/wind/index.js +85 -0
- package/es/wind/models/index.d.ts +5 -0
- package/es/wind/models/index.js +5 -0
- package/es/wind/models/utils.d.ts +19 -0
- package/es/wind/models/utils.js +226 -0
- package/es/wind/models/wind.d.ts +24 -0
- package/es/wind/models/wind.js +317 -0
- package/es/wind/models/windRender.d.ts +104 -0
- package/es/wind/models/windRender.js +357 -0
- package/es/wind/models/windShader.d.ts +12 -0
- package/es/wind/models/windShader.js +12 -0
- package/es/wind/shaders/wind_frag.glsl +9 -0
- package/es/wind/shaders/wind_vert.glsl +17 -0
- package/lib/Geometry/index.js +117 -0
- package/lib/Geometry/models/billboard.js +229 -0
- package/lib/Geometry/models/index.js +22 -0
- package/lib/Geometry/models/plane.js +421 -0
- package/lib/Geometry/models/sprite.js +302 -0
- package/lib/Geometry/shaders/billboard_frag.glsl +13 -0
- package/lib/Geometry/shaders/billboard_vert.glsl +50 -0
- package/lib/Geometry/shaders/plane_frag.glsl +22 -0
- package/lib/Geometry/shaders/plane_vert.glsl +53 -0
- package/lib/Geometry/shaders/sprite_frag.glsl +21 -0
- package/lib/Geometry/shaders/sprite_vert.glsl +28 -0
- package/lib/canvas/index.js +120 -0
- package/lib/canvas/models/canvas.js +221 -0
- package/lib/canvas/models/index.js +16 -0
- package/lib/citybuliding/building.js +86 -0
- package/lib/citybuliding/models/build.js +202 -0
- package/lib/citybuliding/shaders/build_frag.glsl +117 -0
- package/lib/citybuliding/shaders/build_vert.glsl +54 -0
- package/lib/core/BaseLayer.js +1434 -0
- package/lib/core/BaseModel.js +507 -0
- package/lib/core/interface.js +41 -0
- package/lib/core/schema.js +33 -0
- package/lib/core/shape/Path.js +88 -0
- package/lib/core/shape/extrude.js +180 -0
- package/lib/core/triangulation.js +620 -0
- package/lib/earth/index.js +113 -0
- package/lib/earth/models/atmosphere.js +149 -0
- package/lib/earth/models/base.js +216 -0
- package/lib/earth/models/bloomsphere.js +148 -0
- package/lib/earth/shaders/atmosphere_frag.glsl +17 -0
- package/lib/earth/shaders/atmosphere_vert.glsl +26 -0
- package/lib/earth/shaders/base_frag.glsl +13 -0
- package/lib/earth/shaders/base_vert.glsl +52 -0
- package/lib/earth/shaders/bloomsphere_frag.glsl +15 -0
- package/lib/earth/shaders/bloomsphere_vert.glsl +20 -0
- package/lib/earth/utils.js +136 -0
- package/lib/glsl.d.ts +5 -0
- package/lib/heatmap/index.js +141 -0
- package/lib/heatmap/models/grid.js +120 -0
- package/lib/heatmap/models/grid3d.js +154 -0
- package/lib/heatmap/models/heatmap.js +484 -0
- package/lib/heatmap/models/hexagon.js +121 -0
- package/lib/heatmap/models/index.js +26 -0
- package/lib/heatmap/shaders/grid_vert.glsl +42 -0
- package/lib/heatmap/shaders/heatmap_3d_frag.glsl +14 -0
- package/lib/heatmap/shaders/heatmap_3d_vert.glsl +46 -0
- package/lib/heatmap/shaders/heatmap_frag.glsl +47 -0
- package/lib/heatmap/shaders/heatmap_framebuffer_frag.glsl +10 -0
- package/lib/heatmap/shaders/heatmap_framebuffer_vert.glsl +35 -0
- package/lib/heatmap/shaders/heatmap_vert.glsl +10 -0
- package/lib/heatmap/shaders/hexagon_3d_frag.glsl +0 -0
- package/lib/heatmap/shaders/hexagon_3d_vert.glsl +64 -0
- package/lib/heatmap/shaders/hexagon_frag.glsl +12 -0
- package/lib/heatmap/shaders/hexagon_vert.glsl +41 -0
- package/lib/heatmap/triangulation.js +44 -0
- package/lib/image/index.js +104 -0
- package/lib/image/models/dataImage.js +201 -0
- package/lib/image/models/image.js +164 -0
- package/lib/image/models/index.js +22 -0
- package/lib/image/models/tileDataImage.js +174 -0
- package/lib/image/shaders/dataImage_frag.glsl +38 -0
- package/lib/image/shaders/image_frag.glsl +9 -0
- package/lib/image/shaders/image_vert.glsl +17 -0
- package/lib/index.js +275 -0
- package/lib/line/index.js +139 -0
- package/lib/line/models/arc.js +373 -0
- package/lib/line/models/arc_3d.js +351 -0
- package/lib/line/models/earthArc_3d.js +354 -0
- package/lib/line/models/great_circle.js +310 -0
- package/lib/line/models/half.js +298 -0
- package/lib/line/models/index.js +46 -0
- package/lib/line/models/line.js +460 -0
- package/lib/line/models/linearline.js +292 -0
- package/lib/line/models/simpleLine.js +249 -0
- package/lib/line/models/simpleTileLine.js +115 -0
- package/lib/line/models/tile.js +194 -0
- package/lib/line/models/wall.js +309 -0
- package/lib/line/shaders/arc_chunks.vert.glsl +21 -0
- package/lib/line/shaders/dash/arc_dash_frag.glsl +28 -0
- package/lib/line/shaders/dash/arc_dash_vert.glsl +150 -0
- package/lib/line/shaders/dash/line_dash_frag.glsl +31 -0
- package/lib/line/shaders/dash/line_dash_vert.glsl +93 -0
- package/lib/line/shaders/half/line_half_frag.glsl +53 -0
- package/lib/line/shaders/half/line_half_vert.glsl +169 -0
- package/lib/line/shaders/line_arc2d_vert.glsl +114 -0
- package/lib/line/shaders/line_arc_3d_frag.glsl +103 -0
- package/lib/line/shaders/line_arc_3d_vert.glsl +206 -0
- package/lib/line/shaders/line_arc_frag.glsl +88 -0
- package/lib/line/shaders/line_arc_great_circle_frag.glsl +101 -0
- package/lib/line/shaders/line_arc_great_circle_vert.glsl +214 -0
- package/lib/line/shaders/line_arc_vert.glsl +178 -0
- package/lib/line/shaders/line_bezier_vert.glsl +85 -0
- package/lib/line/shaders/line_frag.glsl +99 -0
- package/lib/line/shaders/line_vert.glsl +192 -0
- package/lib/line/shaders/linear/arc3d_linear_frag.glsl +46 -0
- package/lib/line/shaders/linear/arc3d_linear_vert.glsl +206 -0
- package/lib/line/shaders/linear/arc_linear_frag.glsl +38 -0
- package/lib/line/shaders/linear/arc_linear_vert.glsl +138 -0
- package/lib/line/shaders/linear/line_linear_frag.glsl +27 -0
- package/lib/line/shaders/linearLine/line_linear_frag.glsl +20 -0
- package/lib/line/shaders/linearLine/line_linear_vert.glsl +112 -0
- package/lib/line/shaders/simple/simpleline_frag.glsl +10 -0
- package/lib/line/shaders/simple/simpleline_linear_frag.glsl +11 -0
- package/lib/line/shaders/simple/simpleline_vert.glsl +79 -0
- package/lib/line/shaders/tile/line_tile_map_vert.glsl +25 -0
- package/lib/line/shaders/tile/line_tile_vert.glsl +52 -0
- package/lib/line/shaders/tile/simpleline_map_vert.glsl +15 -0
- package/lib/line/shaders/tile/simpleline_vert.glsl +21 -0
- package/lib/line/shaders/wall/wall_frag.glsl +89 -0
- package/lib/line/shaders/wall/wall_vert.glsl +77 -0
- package/lib/mask/index.js +163 -0
- package/lib/mask/models/fill.js +141 -0
- package/lib/mask/models/index.js +19 -0
- package/lib/mask/shaders/mask_vert.glsl +16 -0
- package/lib/plugins/DataMappingPlugin.js +427 -0
- package/lib/plugins/DataSourcePlugin.js +97 -0
- package/lib/plugins/FeatureScalePlugin.js +365 -0
- package/lib/plugins/LayerAnimateStylePlugin.js +41 -0
- package/lib/plugins/LayerModelPlugin.js +83 -0
- package/lib/plugins/LayerStylePlugin.js +50 -0
- package/lib/plugins/LightingPlugin.js +119 -0
- package/lib/plugins/MultiPassRendererPlugin.js +77 -0
- package/lib/plugins/PixelPickingPlugin.js +139 -0
- package/lib/plugins/RegisterStyleAttributePlugin.js +164 -0
- package/lib/plugins/ShaderUniformPlugin.js +119 -0
- package/lib/plugins/UpdateModelPlugin.js +42 -0
- package/lib/plugins/UpdateStyleAttributePlugin.js +94 -0
- package/lib/point/index.js +229 -0
- package/lib/point/models/earthExtrude.js +290 -0
- package/lib/point/models/earthFill.js +293 -0
- package/lib/point/models/extrude.js +312 -0
- package/lib/point/models/fill.js +419 -0
- package/lib/point/models/fillmage.js +382 -0
- package/lib/point/models/image.js +255 -0
- package/lib/point/models/index.js +53 -0
- package/lib/point/models/normal.js +141 -0
- package/lib/point/models/radar.js +249 -0
- package/lib/point/models/simplePoint.js +196 -0
- package/lib/point/models/text.js +634 -0
- package/lib/point/models/tile.js +189 -0
- package/lib/point/models/tileText.js +524 -0
- package/lib/point/shaders/animate/wave_frag.glsl +65 -0
- package/lib/point/shaders/earth/extrude_frag.glsl +44 -0
- package/lib/point/shaders/earth/extrude_vert.glsl +140 -0
- package/lib/point/shaders/earth/fill_frag.glsl +86 -0
- package/lib/point/shaders/earth/fill_vert.glsl +125 -0
- package/lib/point/shaders/extrude/extrude_frag.glsl +44 -0
- package/lib/point/shaders/extrude/extrude_vert.glsl +121 -0
- package/lib/point/shaders/fill_frag.glsl +84 -0
- package/lib/point/shaders/fill_vert.glsl +188 -0
- package/lib/point/shaders/image/fillImage_frag.glsl +20 -0
- package/lib/point/shaders/image/fillImage_vert.glsl +116 -0
- package/lib/point/shaders/image_frag.glsl +39 -0
- package/lib/point/shaders/image_vert.glsl +90 -0
- package/lib/point/shaders/normal_frag.glsl +6 -0
- package/lib/point/shaders/normal_vert.glsl +24 -0
- package/lib/point/shaders/radar/radar_frag.glsl +53 -0
- package/lib/point/shaders/radar/radar_vert.glsl +70 -0
- package/lib/point/shaders/simplePoint_frag.glsl +53 -0
- package/lib/point/shaders/simplePoint_vert.glsl +79 -0
- package/lib/point/shaders/text_frag.glsl +48 -0
- package/lib/point/shaders/text_vert.glsl +131 -0
- package/lib/point/shaders/tile/fill_tile_frag.glsl +76 -0
- package/lib/point/shaders/tile/fill_tile_vert.glsl +78 -0
- package/lib/point/shaders/tile/text_frag.glsl +33 -0
- package/lib/point/shaders/tile/text_map_frag.glsl +31 -0
- package/lib/point/shaders/tile/text_map_vert.glsl +38 -0
- package/lib/point/shaders/tile/text_vert.glsl +48 -0
- package/lib/point/shape/extrude.js +78 -0
- package/lib/polygon/index.js +147 -0
- package/lib/polygon/models/extrude.js +318 -0
- package/lib/polygon/models/fill.js +225 -0
- package/lib/polygon/models/index.js +50 -0
- package/lib/polygon/models/ocean.js +218 -0
- package/lib/polygon/models/tile.js +114 -0
- package/lib/polygon/models/water.js +195 -0
- package/lib/polygon/shaders/extrude/polygon_extrude_frag.glsl +44 -0
- package/lib/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +44 -0
- package/lib/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +85 -0
- package/lib/polygon/shaders/extrude/polygon_extrude_vert.glsl +90 -0
- package/lib/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +48 -0
- package/lib/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +93 -0
- package/lib/polygon/shaders/polygon_frag.glsl +12 -0
- package/lib/polygon/shaders/polygon_linear_frag.glsl +22 -0
- package/lib/polygon/shaders/polygon_linear_vert.glsl +74 -0
- package/lib/polygon/shaders/polygon_vert.glsl +66 -0
- package/lib/polygon/shaders/tile/polygon_tile_map_vert.glsl +16 -0
- package/lib/polygon/shaders/tile/polygon_tile_vert.glsl +42 -0
- package/lib/polygon/shaders/water/polygon_ocean_frag.glsl +247 -0
- package/lib/polygon/shaders/water/polygon_ocean_vert.glsl +21 -0
- package/lib/polygon/shaders/water/polygon_water_frag.glsl +71 -0
- package/lib/polygon/shaders/water/polygon_water_vert.glsl +26 -0
- package/lib/raster/buffers/triangulation.js +35 -0
- package/lib/raster/index.js +107 -0
- package/lib/raster/models/index.js +23 -0
- package/lib/raster/models/raster.js +258 -0
- package/lib/raster/models/rasterRgb.js +240 -0
- package/lib/raster/models/rasterTile.js +153 -0
- package/lib/raster/raster.js +178 -0
- package/lib/raster/shaders/raster_2d_frag.glsl +64 -0
- package/lib/raster/shaders/raster_2d_vert.glsl +17 -0
- package/lib/raster/shaders/raster_frag.glsl +9 -0
- package/lib/raster/shaders/raster_rgb_frag.glsl +12 -0
- package/lib/raster/shaders/raster_vert.glsl +44 -0
- package/lib/shader/minify_frag.glsl +7 -0
- package/lib/shader/minify_picking_frag.glsl +10 -0
- package/lib/tile/interaction/TilePickService.js +143 -0
- package/lib/tile/interaction/getFeatureData.js +1 -0
- package/lib/tile/interaction/getRasterData.js +83 -0
- package/lib/tile/interaction/utils.js +120 -0
- package/lib/tile/interface.js +5 -0
- package/lib/tile/manager/base.js +161 -0
- package/lib/tile/manager/layerManager.js +275 -0
- package/lib/tile/manager/mapLayerManager.js +134 -0
- package/lib/tile/models/tileModel.js +94 -0
- package/lib/tile/render/TileRenderService.js +78 -0
- package/lib/tile/style/TileStyleService.js +133 -0
- package/lib/tile/style/constants.js +26 -0
- package/lib/tile/style/utils.js +163 -0
- package/lib/tile/tileFactory/base.js +427 -0
- package/lib/tile/tileFactory/index.js +71 -0
- package/lib/tile/tileFactory/layers/rasterDataLayer.js +91 -0
- package/lib/tile/tileFactory/layers/tileTest.js +74 -0
- package/lib/tile/tileFactory/layers/vectorLayer.js +268 -0
- package/lib/tile/tileFactory/line.js +70 -0
- package/lib/tile/tileFactory/mask.js +71 -0
- package/lib/tile/tileFactory/point.js +71 -0
- package/lib/tile/tileFactory/polygon.js +70 -0
- package/lib/tile/tileFactory/raster.js +68 -0
- package/lib/tile/tileFactory/rasterData.js +93 -0
- package/lib/tile/tileFactory/test.js +106 -0
- package/lib/tile/tileLayer/MapTileLayer.js +63 -0
- package/lib/tile/tileLayer/TileLayer.js +215 -0
- package/lib/tile/tileLayer/base.js +225 -0
- package/lib/tile/utils.js +181 -0
- package/lib/utils/blend.js +65 -0
- package/lib/utils/collision-index.js +118 -0
- package/lib/utils/dataMappingStyle.js +151 -0
- package/lib/utils/extrude_polyline.js +656 -0
- package/lib/utils/grid-index.js +188 -0
- package/lib/utils/layerData.js +191 -0
- package/lib/utils/multiPassRender.js +60 -0
- package/lib/utils/polylineNormal.js +230 -0
- package/lib/utils/simpleLine.js +116 -0
- package/lib/utils/symbol-layout.js +308 -0
- package/lib/utils/updateShape.js +27 -0
- package/lib/wind/index.js +98 -0
- package/lib/wind/models/index.js +16 -0
- package/lib/wind/models/utils.js +253 -0
- package/lib/wind/models/wind.js +332 -0
- package/lib/wind/models/windRender.js +373 -0
- package/lib/wind/models/windShader.js +25 -0
- package/lib/wind/shaders/wind_frag.glsl +9 -0
- package/lib/wind/shaders/wind_vert.glsl +17 -0
- package/package.json +6 -6
|
@@ -0,0 +1,293 @@
|
|
|
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 _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
11
|
+
|
|
12
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
|
+
|
|
14
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
15
|
+
|
|
16
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
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 _l7Core = require("@antv/l7-core");
|
|
25
|
+
|
|
26
|
+
var _lodash = require("lodash");
|
|
27
|
+
|
|
28
|
+
var _BaseModel2 = _interopRequireDefault(require("../../core/BaseModel"));
|
|
29
|
+
|
|
30
|
+
var _triangulation = require("../../core/triangulation");
|
|
31
|
+
|
|
32
|
+
var _glMatrix = require("gl-matrix");
|
|
33
|
+
|
|
34
|
+
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); }; }
|
|
35
|
+
|
|
36
|
+
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; } }
|
|
37
|
+
|
|
38
|
+
/* babel-plugin-inline-import '../shaders/earth/fill_frag.glsl' */
|
|
39
|
+
var pointFillFrag = "uniform float u_additive;\n\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\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 if(outer_df > antialiasblur + 0.018) discard;\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";
|
|
40
|
+
|
|
41
|
+
/* babel-plugin-inline-import '../shaders/earth/fill_vert.glsl' */
|
|
42
|
+
var pointFillVert = "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;\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\n\nvoid main() {\n vec3 extrude = a_Extrude;\n float shape_type = a_Shape;\n /*\n * setPickingSize \u8BBE\u7F6E\u62FE\u53D6\u5927\u5C0F\n */\n float newSize = setPickingSize(a_Size);\n // float newSize = setPickingSize(a_Size) * 0.00001038445708445579;\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 // cal style mapping\n\n // unpack color(vec2)\n v_color = a_Color;\n\n // radius(16-bit)\n v_radius = newSize;\n\n // anti-alias\n // float antialiased_blur = -max(u_blur, antialiasblur);\n float antialiasblur = -max(2.0 / u_DevicePixelRatio / newSize, u_blur);\n\n // TODP: /abs(extrude.x) \u662F\u4E3A\u4E86\u517C\u5BB9\u5730\u7403\u6A21\u5F0F\n v_data = vec4(extrude.x/abs(extrude.x), extrude.y/abs(extrude.y), antialiasblur,shape_type);\n\n\n gl_Position = u_ViewProjectionMatrix * vec4(a_Position + extrude * newSize * 0.1, 1.0);\n\n setPickingColor(a_PickingColor);\n}\n";
|
|
43
|
+
|
|
44
|
+
var FillModel = /*#__PURE__*/function (_BaseModel) {
|
|
45
|
+
(0, _inherits2.default)(FillModel, _BaseModel);
|
|
46
|
+
|
|
47
|
+
var _super = _createSuper(FillModel);
|
|
48
|
+
|
|
49
|
+
function FillModel() {
|
|
50
|
+
(0, _classCallCheck2.default)(this, FillModel);
|
|
51
|
+
return _super.apply(this, arguments);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
(0, _createClass2.default)(FillModel, [{
|
|
55
|
+
key: "getUninforms",
|
|
56
|
+
value: function getUninforms() {
|
|
57
|
+
var _ref = this.layer.getLayerConfig(),
|
|
58
|
+
_ref$opacity = _ref.opacity,
|
|
59
|
+
opacity = _ref$opacity === void 0 ? 1 : _ref$opacity,
|
|
60
|
+
_ref$strokeOpacity = _ref.strokeOpacity,
|
|
61
|
+
strokeOpacity = _ref$strokeOpacity === void 0 ? 1 : _ref$strokeOpacity,
|
|
62
|
+
_ref$strokeWidth = _ref.strokeWidth,
|
|
63
|
+
strokeWidth = _ref$strokeWidth === void 0 ? 0 : _ref$strokeWidth,
|
|
64
|
+
_ref$stroke = _ref.stroke,
|
|
65
|
+
stroke = _ref$stroke === void 0 ? 'rgba(0,0,0,0)' : _ref$stroke,
|
|
66
|
+
_ref$offsets = _ref.offsets,
|
|
67
|
+
offsets = _ref$offsets === void 0 ? [0, 0] : _ref$offsets,
|
|
68
|
+
blend = _ref.blend,
|
|
69
|
+
_ref$blur = _ref.blur,
|
|
70
|
+
blur = _ref$blur === void 0 ? 0 : _ref$blur;
|
|
71
|
+
|
|
72
|
+
if (this.dataTextureTest && this.dataTextureNeedUpdate({
|
|
73
|
+
opacity: opacity,
|
|
74
|
+
strokeOpacity: strokeOpacity,
|
|
75
|
+
strokeWidth: strokeWidth,
|
|
76
|
+
stroke: stroke,
|
|
77
|
+
offsets: offsets
|
|
78
|
+
})) {
|
|
79
|
+
// 判断当前的样式中哪些是需要进行数据映射的,哪些是常量,同时计算用于构建数据纹理的一些中间变量
|
|
80
|
+
this.judgeStyleAttributes({
|
|
81
|
+
opacity: opacity,
|
|
82
|
+
strokeOpacity: strokeOpacity,
|
|
83
|
+
strokeWidth: strokeWidth,
|
|
84
|
+
stroke: stroke,
|
|
85
|
+
offsets: offsets
|
|
86
|
+
});
|
|
87
|
+
var encodeData = this.layer.getEncodedData();
|
|
88
|
+
|
|
89
|
+
var _this$calDataFrame = this.calDataFrame(this.cellLength, encodeData, this.cellProperties),
|
|
90
|
+
data = _this$calDataFrame.data,
|
|
91
|
+
width = _this$calDataFrame.width,
|
|
92
|
+
height = _this$calDataFrame.height;
|
|
93
|
+
|
|
94
|
+
this.rowCount = height; // 当前数据纹理有多少行
|
|
95
|
+
|
|
96
|
+
this.dataTexture = this.cellLength > 0 && data.length > 0 ? this.createTexture2D({
|
|
97
|
+
flipY: true,
|
|
98
|
+
data: data,
|
|
99
|
+
format: _l7Core.gl.LUMINANCE,
|
|
100
|
+
type: _l7Core.gl.FLOAT,
|
|
101
|
+
width: width,
|
|
102
|
+
height: height
|
|
103
|
+
}) : this.createTexture2D({
|
|
104
|
+
flipY: true,
|
|
105
|
+
data: [1],
|
|
106
|
+
format: _l7Core.gl.LUMINANCE,
|
|
107
|
+
type: _l7Core.gl.FLOAT,
|
|
108
|
+
width: 1,
|
|
109
|
+
height: 1
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
return {
|
|
114
|
+
u_blur: blur,
|
|
115
|
+
u_additive: blend === 'additive' ? 1.0 : 0.0,
|
|
116
|
+
u_dataTexture: this.dataTexture,
|
|
117
|
+
// 数据纹理 - 有数据映射的时候纹理中带数据,若没有任何数据映射时纹理是 [1]
|
|
118
|
+
u_cellTypeLayout: this.getCellTypeLayout(),
|
|
119
|
+
u_opacity: (0, _lodash.isNumber)(opacity) ? opacity : 1.0,
|
|
120
|
+
u_stroke_opacity: (0, _lodash.isNumber)(strokeOpacity) ? strokeOpacity : 1.0,
|
|
121
|
+
u_stroke_width: (0, _lodash.isNumber)(strokeWidth) ? strokeWidth : 1.0,
|
|
122
|
+
u_stroke_color: this.getStrokeColor(stroke),
|
|
123
|
+
u_offsets: this.isOffsetStatic(offsets) ? offsets : [0, 0]
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
}, {
|
|
127
|
+
key: "getAnimateUniforms",
|
|
128
|
+
value: function getAnimateUniforms() {
|
|
129
|
+
var _ref2 = this.layer.getLayerConfig(),
|
|
130
|
+
_ref2$animateOption = _ref2.animateOption,
|
|
131
|
+
animateOption = _ref2$animateOption === void 0 ? {
|
|
132
|
+
enable: false
|
|
133
|
+
} : _ref2$animateOption;
|
|
134
|
+
|
|
135
|
+
return {
|
|
136
|
+
u_animate: this.animateOption2Array(animateOption),
|
|
137
|
+
u_time: this.layer.getLayerAnimateTime()
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
}, {
|
|
141
|
+
key: "initModels",
|
|
142
|
+
value: function initModels(callbackModel) {
|
|
143
|
+
this.buildModels(callbackModel);
|
|
144
|
+
}
|
|
145
|
+
}, {
|
|
146
|
+
key: "buildModels",
|
|
147
|
+
value: function buildModels(callbackModel) {
|
|
148
|
+
this.layer.triangulation = _triangulation.GlobelPointFillTriangulation;
|
|
149
|
+
this.layer.buildLayerModel({
|
|
150
|
+
moduleName: 'pointEarthFill',
|
|
151
|
+
vertexShader: pointFillVert,
|
|
152
|
+
fragmentShader: pointFillFrag,
|
|
153
|
+
triangulation: _triangulation.GlobelPointFillTriangulation,
|
|
154
|
+
depth: {
|
|
155
|
+
enable: true
|
|
156
|
+
},
|
|
157
|
+
blend: this.getBlend()
|
|
158
|
+
}).then(function (model) {
|
|
159
|
+
callbackModel([model]);
|
|
160
|
+
}).catch(function (err) {
|
|
161
|
+
console.warn(err);
|
|
162
|
+
callbackModel([]);
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
}, {
|
|
166
|
+
key: "clearModels",
|
|
167
|
+
value: function clearModels() {
|
|
168
|
+
var _this$dataTexture;
|
|
169
|
+
|
|
170
|
+
(_this$dataTexture = this.dataTexture) === null || _this$dataTexture === void 0 ? void 0 : _this$dataTexture.destroy();
|
|
171
|
+
} // overwrite baseModel func
|
|
172
|
+
|
|
173
|
+
}, {
|
|
174
|
+
key: "animateOption2Array",
|
|
175
|
+
value: function animateOption2Array(option) {
|
|
176
|
+
return [option.enable ? 0 : 1.0, option.speed || 1, option.rings || 3, 0];
|
|
177
|
+
}
|
|
178
|
+
}, {
|
|
179
|
+
key: "registerBuiltinAttributes",
|
|
180
|
+
value: function registerBuiltinAttributes() {
|
|
181
|
+
var _this = this;
|
|
182
|
+
|
|
183
|
+
this.styleAttributeService.registerStyleAttribute({
|
|
184
|
+
name: 'extrude',
|
|
185
|
+
type: _l7Core.AttributeType.Attribute,
|
|
186
|
+
descriptor: {
|
|
187
|
+
name: 'a_Extrude',
|
|
188
|
+
buffer: {
|
|
189
|
+
// give the WebGL driver a hint that this buffer may change
|
|
190
|
+
usage: _l7Core.gl.DYNAMIC_DRAW,
|
|
191
|
+
data: [],
|
|
192
|
+
type: _l7Core.gl.FLOAT
|
|
193
|
+
},
|
|
194
|
+
size: 3,
|
|
195
|
+
update: function update(feature, featureIdx, vertex, attributeIdx) {
|
|
196
|
+
var _vertex = (0, _slicedToArray2.default)(vertex, 3),
|
|
197
|
+
x = _vertex[0],
|
|
198
|
+
y = _vertex[1],
|
|
199
|
+
z = _vertex[2];
|
|
200
|
+
|
|
201
|
+
var n1 = _glMatrix.vec3.fromValues(0, 0, 1);
|
|
202
|
+
|
|
203
|
+
var n2 = _glMatrix.vec3.fromValues(x, 0, z);
|
|
204
|
+
|
|
205
|
+
var xzReg = x >= 0 ? _glMatrix.vec3.angle(n1, n2) : Math.PI * 2 - _glMatrix.vec3.angle(n1, n2);
|
|
206
|
+
var yReg = Math.PI * 2 - Math.asin(y / 100);
|
|
207
|
+
|
|
208
|
+
var m = _glMatrix.mat4.create();
|
|
209
|
+
|
|
210
|
+
_glMatrix.mat4.rotateY(m, m, xzReg);
|
|
211
|
+
|
|
212
|
+
_glMatrix.mat4.rotateX(m, m, yReg);
|
|
213
|
+
|
|
214
|
+
var v1 = _glMatrix.vec3.fromValues(1, 1, 0);
|
|
215
|
+
|
|
216
|
+
_glMatrix.vec3.transformMat4(v1, v1, m);
|
|
217
|
+
|
|
218
|
+
_glMatrix.vec3.normalize(v1, v1);
|
|
219
|
+
|
|
220
|
+
var v2 = _glMatrix.vec3.fromValues(-1, 1, 0);
|
|
221
|
+
|
|
222
|
+
_glMatrix.vec3.transformMat4(v2, v2, m);
|
|
223
|
+
|
|
224
|
+
_glMatrix.vec3.normalize(v2, v2);
|
|
225
|
+
|
|
226
|
+
var v3 = _glMatrix.vec3.fromValues(-1, -1, 0);
|
|
227
|
+
|
|
228
|
+
_glMatrix.vec3.transformMat4(v3, v3, m);
|
|
229
|
+
|
|
230
|
+
_glMatrix.vec3.normalize(v3, v3);
|
|
231
|
+
|
|
232
|
+
var v4 = _glMatrix.vec3.fromValues(1, -1, 0);
|
|
233
|
+
|
|
234
|
+
_glMatrix.vec3.transformMat4(v4, v4, m);
|
|
235
|
+
|
|
236
|
+
_glMatrix.vec3.normalize(v4, v4);
|
|
237
|
+
|
|
238
|
+
var extrude = [].concat((0, _toConsumableArray2.default)(v1), (0, _toConsumableArray2.default)(v2), (0, _toConsumableArray2.default)(v3), (0, _toConsumableArray2.default)(v4));
|
|
239
|
+
var extrudeIndex = attributeIdx % 4 * 3;
|
|
240
|
+
return [extrude[extrudeIndex], extrude[extrudeIndex + 1], extrude[extrudeIndex + 2]];
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}); // point layer size;
|
|
244
|
+
|
|
245
|
+
this.styleAttributeService.registerStyleAttribute({
|
|
246
|
+
name: 'size',
|
|
247
|
+
type: _l7Core.AttributeType.Attribute,
|
|
248
|
+
descriptor: {
|
|
249
|
+
name: 'a_Size',
|
|
250
|
+
buffer: {
|
|
251
|
+
// give the WebGL driver a hint that this buffer may change
|
|
252
|
+
usage: _l7Core.gl.DYNAMIC_DRAW,
|
|
253
|
+
data: [],
|
|
254
|
+
type: _l7Core.gl.FLOAT
|
|
255
|
+
},
|
|
256
|
+
size: 1,
|
|
257
|
+
update: function update(feature) {
|
|
258
|
+
var _feature$size = feature.size,
|
|
259
|
+
size = _feature$size === void 0 ? 5 : _feature$size;
|
|
260
|
+
return Array.isArray(size) ? [size[0]] : [size];
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}); // point layer size;
|
|
264
|
+
|
|
265
|
+
this.styleAttributeService.registerStyleAttribute({
|
|
266
|
+
name: 'shape',
|
|
267
|
+
type: _l7Core.AttributeType.Attribute,
|
|
268
|
+
descriptor: {
|
|
269
|
+
name: 'a_Shape',
|
|
270
|
+
buffer: {
|
|
271
|
+
// give the WebGL driver a hint that this buffer may change
|
|
272
|
+
usage: _l7Core.gl.DYNAMIC_DRAW,
|
|
273
|
+
data: [],
|
|
274
|
+
type: _l7Core.gl.FLOAT
|
|
275
|
+
},
|
|
276
|
+
size: 1,
|
|
277
|
+
update: function update(feature) {
|
|
278
|
+
var _feature$shape = feature.shape,
|
|
279
|
+
shape = _feature$shape === void 0 ? 2 : _feature$shape;
|
|
280
|
+
|
|
281
|
+
var shape2d = _this.layer.getLayerConfig().shape2d;
|
|
282
|
+
|
|
283
|
+
var shapeIndex = shape2d.indexOf(shape);
|
|
284
|
+
return [shapeIndex];
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
}]);
|
|
290
|
+
return FillModel;
|
|
291
|
+
}(_BaseModel2.default);
|
|
292
|
+
|
|
293
|
+
exports.default = FillModel;
|
|
@@ -0,0 +1,312 @@
|
|
|
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 _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
11
|
+
|
|
12
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
13
|
+
|
|
14
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
15
|
+
|
|
16
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
17
|
+
|
|
18
|
+
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
19
|
+
|
|
20
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
21
|
+
|
|
22
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
23
|
+
|
|
24
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
25
|
+
|
|
26
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
27
|
+
|
|
28
|
+
var _l7Core = require("@antv/l7-core");
|
|
29
|
+
|
|
30
|
+
var _l7Utils = require("@antv/l7-utils");
|
|
31
|
+
|
|
32
|
+
var _lodash = require("lodash");
|
|
33
|
+
|
|
34
|
+
var _BaseModel2 = _interopRequireDefault(require("../../core/BaseModel"));
|
|
35
|
+
|
|
36
|
+
var _triangulation = require("../../core/triangulation");
|
|
37
|
+
|
|
38
|
+
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); }; }
|
|
39
|
+
|
|
40
|
+
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; } }
|
|
41
|
+
|
|
42
|
+
/* babel-plugin-inline-import '../shaders/extrude/extrude_frag.glsl' */
|
|
43
|
+
var pointExtrudeFrag = "varying vec4 v_color;\nuniform float u_opacity: 1.0;\n\nuniform float u_pickLight: 0.0;\n\n#pragma include \"picking\"\n\nvarying mat4 styleMappingMat; // \u4F20\u9012\u4ECE\u7247\u5143\u4E2D\u4F20\u9012\u7684\u6620\u5C04\u6570\u636E\n\nuniform float u_linearColor: 0;\nuniform vec4 u_sourceColor;\nuniform vec4 u_targetColor;\n\nuniform float u_opacitylinear: 0.0;\nuniform float u_opacitylinear_dir: 1.0;\n\nvoid main() {\n float opacity = styleMappingMat[0][0];\n float lightWeight = styleMappingMat[1][3];\n float barLinearZ = styleMappingMat[2][3];\n\n // \u8BBE\u7F6E\u5706\u67F1\u7684\u5E95\u8272\n if(u_linearColor == 1.0) { // \u4F7F\u7528\u6E10\u53D8\u989C\u8272\n gl_FragColor = mix(u_sourceColor, u_targetColor, barLinearZ);\n gl_FragColor.rgb *= lightWeight;\n } else { // \u4F7F\u7528 color \u65B9\u6CD5\u4F20\u5165\u7684\u989C\u8272\n gl_FragColor = v_color;\n }\n\n // \u5E94\u7528\u900F\u660E\u5EA6\n gl_FragColor.a *= opacity;\n\n // \u5F00\u542F\u900F\u660E\u5EA6\u6E10\u53D8\n if(u_opacitylinear > 0.0) {\n gl_FragColor.a *= u_opacitylinear_dir > 0.0 ? (1.0 - barLinearZ): barLinearZ;\n }\n\n // picking\n if(u_pickLight > 0.0) {\n gl_FragColor = filterColorAlpha(gl_FragColor, lightWeight);\n } else {\n gl_FragColor = filterColor(gl_FragColor);\n }\n}\n";
|
|
44
|
+
|
|
45
|
+
/* babel-plugin-inline-import '../shaders/extrude/extrude_vert.glsl' */
|
|
46
|
+
var pointExtrudeVert = "precision highp float;\n\n#define pi 3.1415926535\n#define ambientRatio 0.5\n#define diffuseRatio 0.3\n#define specularRatio 0.2\n\nattribute vec3 a_Position;\nattribute vec3 a_Pos;\nattribute vec4 a_Color;\nattribute vec3 a_Size;\nattribute vec3 a_Normal;\n\nuniform float u_heightfixed: 0.0; // \u9ED8\u8BA4\u4E0D\u56FA\u5B9A\nuniform float u_r;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nvarying vec4 v_color;\n\nuniform float u_opacity : 1;\nuniform float u_lightEnable: 1;\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\n#pragma include \"styleMapping\"\n#pragma include \"styleMappingCalOpacity\"\n\n#pragma include \"projection\"\n#pragma include \"light\"\n#pragma include \"picking\"\n\nfloat getYRadian(float x, float z) {\n if(x > 0.0 && z > 0.0) {\n return atan(x/z);\n } else if(x > 0.0 && z <= 0.0){\n return atan(-z/x) + pi/2.0;\n } else if(x <= 0.0 && z <= 0.0) {\n return pi + atan(x/z); //atan(x/z) + \n } else {\n return atan(z/-x) + pi*3.0/2.0;\n }\n}\n\nfloat getXRadian(float y, float r) {\n return atan(y/r);\n}\n\nvoid main() {\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 - lightWeight\n 0.0, 0.0, 0.0, 0.0, // offsets[0] - offsets[1] - linearZ(\u5782\u76F4\u65B9\u5411 0 - 1 \u7684\u503C)\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 // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\n vec3 size = a_Size * a_Position;\n\n // a_Position.z \u662F\u5728\u6784\u5EFA\u7F51\u683C\u7684\u65F6\u5019\u4F20\u5165\u7684\u6807\u51C6\u503C 0 - 1\uFF0C\u5728\u63D2\u503C\u5668\u63D2\u503C\u53EF\u4EE5\u83B7\u53D6 0\uFF5E1 \u7EBF\u6027\u6E10\u53D8\u7684\u503C\n styleMappingMat[2][3] = a_Position.z;\n\n vec3 offset = size; // \u63A7\u5236\u5706\u67F1\u4F53\u7684\u5927\u5C0F - \u4ECE\u6807\u51C6\u5355\u4F4D\u5706\u67F1\u4F53\u8FDB\u884C\u504F\u79FB\n if(u_heightfixed < 1.0) { // \u5706\u67F1\u4F53\u4E0D\u56FA\u5B9A\u9AD8\u5EA6\n \n if (u_CoordinateSystem == COORDINATE_SYSTEM_P20 || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {\n // P20 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF1\n offset = offset * pow(2.0, (19.0 - u_Zoom));\n }\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {\n // P20_2 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF3\n offset = offset * pow(2.0, (19.0 - 3.0 - u_Zoom));\n }\n } else {// \u5706\u67F1\u4F53\u56FA\u5B9A\u9AD8\u5EA6 \uFF08 \u5904\u7406 mapbox \uFF09\n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n offset *= 4.0/pow(2.0, 21.0 - u_Zoom);\n }\n }\n\n\n vec4 project_pos = project_position(vec4(a_Pos.xy, 0., 1.0));\n\n // u_r \u63A7\u5236\u5706\u67F1\u7684\u751F\u957F\n vec4 pos = vec4(project_pos.xy + offset.xy, offset.z * u_r, 1.0);\n\n // \u5706\u67F1\u5149\u7167\u6548\u679C\n float lightWeight = 1.0;\n if(u_lightEnable > 0.0) { // \u53D6\u6D88\u4E09\u5143\u8868\u8FBE\u5F0F\uFF0C\u589E\u5F3A\u5065\u58EE\u6027\n lightWeight = calc_lighting(pos);\n }\n styleMappingMat[1][3] = lightWeight;\n\n v_color =vec4(a_Color.rgb * lightWeight, a_Color.w);\n\n // gl_Position = project_common_position_to_clipspace(pos);\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * pos;\n } else {\n gl_Position = project_common_position_to_clipspace(pos);\n }\n\n setPickingColor(a_PickingColor);\n}\n";
|
|
47
|
+
|
|
48
|
+
var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
|
|
49
|
+
(0, _inherits2.default)(ExtrudeModel, _BaseModel);
|
|
50
|
+
|
|
51
|
+
var _super = _createSuper(ExtrudeModel);
|
|
52
|
+
|
|
53
|
+
function ExtrudeModel() {
|
|
54
|
+
var _this;
|
|
55
|
+
|
|
56
|
+
(0, _classCallCheck2.default)(this, ExtrudeModel);
|
|
57
|
+
|
|
58
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
59
|
+
args[_key] = arguments[_key];
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
63
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "raiseCount", 0);
|
|
64
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "raiseRepeat", 0);
|
|
65
|
+
return _this;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
(0, _createClass2.default)(ExtrudeModel, [{
|
|
69
|
+
key: "getUninforms",
|
|
70
|
+
value: function getUninforms() {
|
|
71
|
+
var _ref = this.layer.getLayerConfig(),
|
|
72
|
+
_ref$animateOption = _ref.animateOption,
|
|
73
|
+
animateOption = _ref$animateOption === void 0 ? {
|
|
74
|
+
enable: false,
|
|
75
|
+
speed: 0.01,
|
|
76
|
+
repeat: false
|
|
77
|
+
} : _ref$animateOption,
|
|
78
|
+
_ref$opacity = _ref.opacity,
|
|
79
|
+
opacity = _ref$opacity === void 0 ? 1 : _ref$opacity,
|
|
80
|
+
sourceColor = _ref.sourceColor,
|
|
81
|
+
targetColor = _ref.targetColor,
|
|
82
|
+
_ref$pickLight = _ref.pickLight,
|
|
83
|
+
pickLight = _ref$pickLight === void 0 ? false : _ref$pickLight,
|
|
84
|
+
_ref$heightfixed = _ref.heightfixed,
|
|
85
|
+
heightfixed = _ref$heightfixed === void 0 ? false : _ref$heightfixed,
|
|
86
|
+
_ref$opacityLinear = _ref.opacityLinear,
|
|
87
|
+
opacityLinear = _ref$opacityLinear === void 0 ? {
|
|
88
|
+
enable: false,
|
|
89
|
+
dir: 'up'
|
|
90
|
+
} : _ref$opacityLinear,
|
|
91
|
+
_ref$lightEnable = _ref.lightEnable,
|
|
92
|
+
lightEnable = _ref$lightEnable === void 0 ? true : _ref$lightEnable;
|
|
93
|
+
|
|
94
|
+
if (this.dataTextureTest && this.dataTextureNeedUpdate({
|
|
95
|
+
opacity: opacity
|
|
96
|
+
})) {
|
|
97
|
+
this.judgeStyleAttributes({
|
|
98
|
+
opacity: opacity
|
|
99
|
+
});
|
|
100
|
+
var encodeData = this.layer.getEncodedData();
|
|
101
|
+
|
|
102
|
+
var _this$calDataFrame = this.calDataFrame(this.cellLength, encodeData, this.cellProperties),
|
|
103
|
+
data = _this$calDataFrame.data,
|
|
104
|
+
width = _this$calDataFrame.width,
|
|
105
|
+
height = _this$calDataFrame.height;
|
|
106
|
+
|
|
107
|
+
this.rowCount = height; // 当前数据纹理有多少行
|
|
108
|
+
|
|
109
|
+
this.dataTexture = this.cellLength > 0 && data.length > 0 ? this.createTexture2D({
|
|
110
|
+
flipY: true,
|
|
111
|
+
data: data,
|
|
112
|
+
format: _l7Core.gl.LUMINANCE,
|
|
113
|
+
type: _l7Core.gl.FLOAT,
|
|
114
|
+
width: width,
|
|
115
|
+
height: height
|
|
116
|
+
}) : this.createTexture2D({
|
|
117
|
+
flipY: true,
|
|
118
|
+
data: [1],
|
|
119
|
+
format: _l7Core.gl.LUMINANCE,
|
|
120
|
+
type: _l7Core.gl.FLOAT,
|
|
121
|
+
width: 1,
|
|
122
|
+
height: 1
|
|
123
|
+
});
|
|
124
|
+
} // 转化渐变色
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
var useLinearColor = 0; // 默认不生效
|
|
128
|
+
|
|
129
|
+
var sourceColorArr = [0, 0, 0, 0];
|
|
130
|
+
var targetColorArr = [0, 0, 0, 0];
|
|
131
|
+
|
|
132
|
+
if (sourceColor && targetColor) {
|
|
133
|
+
sourceColorArr = (0, _l7Utils.rgb2arr)(sourceColor);
|
|
134
|
+
targetColorArr = (0, _l7Utils.rgb2arr)(targetColor);
|
|
135
|
+
useLinearColor = 1;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
if (this.raiseCount < 1 && this.raiseRepeat > 0) {
|
|
139
|
+
if (animateOption.enable) {
|
|
140
|
+
var _animateOption$speed = animateOption.speed,
|
|
141
|
+
speed = _animateOption$speed === void 0 ? 0.01 : _animateOption$speed;
|
|
142
|
+
this.raiseCount += speed;
|
|
143
|
+
|
|
144
|
+
if (this.raiseCount >= 1) {
|
|
145
|
+
if (this.raiseRepeat > 1) {
|
|
146
|
+
this.raiseCount = 0;
|
|
147
|
+
this.raiseRepeat--;
|
|
148
|
+
} else {
|
|
149
|
+
this.raiseCount = 1;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
return {
|
|
156
|
+
// 圆柱体的拾取高亮是否要计算光照
|
|
157
|
+
u_pickLight: Number(pickLight),
|
|
158
|
+
// 圆柱体是否固定高度
|
|
159
|
+
u_heightfixed: Number(heightfixed),
|
|
160
|
+
u_r: animateOption.enable && this.raiseRepeat > 0 ? this.raiseCount : 1.0,
|
|
161
|
+
u_dataTexture: this.dataTexture,
|
|
162
|
+
// 数据纹理 - 有数据映射的时候纹理中带数据,若没有任何数据映射时纹理是 [1]
|
|
163
|
+
u_cellTypeLayout: this.getCellTypeLayout(),
|
|
164
|
+
u_opacity: (0, _lodash.isNumber)(opacity) ? opacity : 1.0,
|
|
165
|
+
// 渐变色支持参数
|
|
166
|
+
u_linearColor: useLinearColor,
|
|
167
|
+
u_sourceColor: sourceColorArr,
|
|
168
|
+
u_targetColor: targetColorArr,
|
|
169
|
+
// 透明度渐变
|
|
170
|
+
u_opacitylinear: Number(opacityLinear.enable),
|
|
171
|
+
u_opacitylinear_dir: opacityLinear.dir === 'up' ? 1.0 : 0.0,
|
|
172
|
+
// 光照计算开关
|
|
173
|
+
u_lightEnable: Number(lightEnable)
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
}, {
|
|
177
|
+
key: "initModels",
|
|
178
|
+
value: function initModels(callbackModel) {
|
|
179
|
+
this.buildModels(callbackModel);
|
|
180
|
+
}
|
|
181
|
+
}, {
|
|
182
|
+
key: "buildModels",
|
|
183
|
+
value: function () {
|
|
184
|
+
var _buildModels = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(callbackModel) {
|
|
185
|
+
var _ref2, _ref2$depth, depth, _ref2$animateOption$r, repeat;
|
|
186
|
+
|
|
187
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
188
|
+
while (1) {
|
|
189
|
+
switch (_context.prev = _context.next) {
|
|
190
|
+
case 0:
|
|
191
|
+
// GAODE1.x GAODE2.x MAPBOX
|
|
192
|
+
_ref2 = this.layer.getLayerConfig(), _ref2$depth = _ref2.depth, depth = _ref2$depth === void 0 ? true : _ref2$depth, _ref2$animateOption$r = _ref2.animateOption.repeat, repeat = _ref2$animateOption$r === void 0 ? 1 : _ref2$animateOption$r;
|
|
193
|
+
this.raiseRepeat = repeat;
|
|
194
|
+
this.layer.buildLayerModel({
|
|
195
|
+
moduleName: 'pointExtrude',
|
|
196
|
+
vertexShader: pointExtrudeVert,
|
|
197
|
+
fragmentShader: pointExtrudeFrag,
|
|
198
|
+
triangulation: _triangulation.PointExtrudeTriangulation,
|
|
199
|
+
blend: this.getBlend(),
|
|
200
|
+
cull: {
|
|
201
|
+
enable: true,
|
|
202
|
+
face: (0, _l7Utils.getCullFace)(this.mapService.version)
|
|
203
|
+
},
|
|
204
|
+
depth: {
|
|
205
|
+
enable: depth
|
|
206
|
+
}
|
|
207
|
+
}).then(function (model) {
|
|
208
|
+
callbackModel([model]);
|
|
209
|
+
}).catch(function (err) {
|
|
210
|
+
console.warn(err);
|
|
211
|
+
callbackModel([]);
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
case 3:
|
|
215
|
+
case "end":
|
|
216
|
+
return _context.stop();
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}, _callee, this);
|
|
220
|
+
}));
|
|
221
|
+
|
|
222
|
+
function buildModels(_x) {
|
|
223
|
+
return _buildModels.apply(this, arguments);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
return buildModels;
|
|
227
|
+
}()
|
|
228
|
+
}, {
|
|
229
|
+
key: "clearModels",
|
|
230
|
+
value: function clearModels() {
|
|
231
|
+
var _this$dataTexture;
|
|
232
|
+
|
|
233
|
+
(_this$dataTexture = this.dataTexture) === null || _this$dataTexture === void 0 ? void 0 : _this$dataTexture.destroy();
|
|
234
|
+
}
|
|
235
|
+
}, {
|
|
236
|
+
key: "registerBuiltinAttributes",
|
|
237
|
+
value: function registerBuiltinAttributes() {
|
|
238
|
+
// point layer size;
|
|
239
|
+
this.styleAttributeService.registerStyleAttribute({
|
|
240
|
+
name: 'size',
|
|
241
|
+
type: _l7Core.AttributeType.Attribute,
|
|
242
|
+
descriptor: {
|
|
243
|
+
name: 'a_Size',
|
|
244
|
+
buffer: {
|
|
245
|
+
usage: _l7Core.gl.DYNAMIC_DRAW,
|
|
246
|
+
data: [],
|
|
247
|
+
type: _l7Core.gl.FLOAT
|
|
248
|
+
},
|
|
249
|
+
size: 3,
|
|
250
|
+
update: function update(feature) {
|
|
251
|
+
var size = feature.size;
|
|
252
|
+
|
|
253
|
+
if (size) {
|
|
254
|
+
var buffersize = [];
|
|
255
|
+
|
|
256
|
+
if (Array.isArray(size)) {
|
|
257
|
+
buffersize = size.length === 2 ? [size[0], size[0], size[1]] : size;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
if (!Array.isArray(size)) {
|
|
261
|
+
buffersize = [size, size, size];
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
return buffersize;
|
|
265
|
+
} else {
|
|
266
|
+
return [2, 2, 2];
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}); // point layer size;
|
|
271
|
+
|
|
272
|
+
this.styleAttributeService.registerStyleAttribute({
|
|
273
|
+
name: 'normal',
|
|
274
|
+
type: _l7Core.AttributeType.Attribute,
|
|
275
|
+
descriptor: {
|
|
276
|
+
name: 'a_Normal',
|
|
277
|
+
buffer: {
|
|
278
|
+
// give the WebGL driver a hint that this buffer may change
|
|
279
|
+
usage: _l7Core.gl.STATIC_DRAW,
|
|
280
|
+
data: [],
|
|
281
|
+
type: _l7Core.gl.FLOAT
|
|
282
|
+
},
|
|
283
|
+
size: 3,
|
|
284
|
+
update: function update(feature, featureIdx, vertex, attributeIdx, normal) {
|
|
285
|
+
return normal;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
});
|
|
289
|
+
this.styleAttributeService.registerStyleAttribute({
|
|
290
|
+
name: 'pos',
|
|
291
|
+
type: _l7Core.AttributeType.Attribute,
|
|
292
|
+
descriptor: {
|
|
293
|
+
name: 'a_Pos',
|
|
294
|
+
buffer: {
|
|
295
|
+
// give the WebGL driver a hint that this buffer may change
|
|
296
|
+
usage: _l7Core.gl.DYNAMIC_DRAW,
|
|
297
|
+
data: [],
|
|
298
|
+
type: _l7Core.gl.FLOAT
|
|
299
|
+
},
|
|
300
|
+
size: 3,
|
|
301
|
+
update: function update(feature) {
|
|
302
|
+
var coordinates = (0, _l7Utils.calculateCentroid)(feature.coordinates);
|
|
303
|
+
return [coordinates[0], coordinates[1], 0];
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
}]);
|
|
309
|
+
return ExtrudeModel;
|
|
310
|
+
}(_BaseModel2.default);
|
|
311
|
+
|
|
312
|
+
exports.default = ExtrudeModel;
|