@antv/l7-layers 2.25.7 → 2.25.9
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/canvas/index.d.ts +18 -0
- package/es/canvas/index.js +70 -0
- package/es/canvas/models/canvas.d.ts +23 -0
- package/es/canvas/models/canvas.js +141 -0
- package/es/canvas/models/constants.d.ts +2 -0
- package/es/canvas/models/constants.js +6 -0
- package/es/canvas/models/index.d.ts +2 -0
- package/es/canvas/models/index.js +2 -0
- package/es/citybuilding/building.d.ts +7 -0
- package/es/citybuilding/building.js +25 -0
- package/es/citybuilding/models/build.d.ts +33 -0
- package/es/citybuilding/models/build.js +160 -0
- package/es/citybuilding/shaders/build_frag.glsl +123 -0
- package/es/citybuilding/shaders/build_vert.glsl +58 -0
- package/es/core/BaseLayer.d.ts +265 -0
- package/es/core/BaseLayer.js +1310 -0
- package/es/core/BaseModel.d.ts +95 -0
- package/es/core/BaseModel.js +367 -0
- package/es/core/CommonStyleAttribute.d.ts +16 -0
- package/es/core/CommonStyleAttribute.js +114 -0
- package/es/core/LayerPickService.d.ts +12 -0
- package/es/core/LayerPickService.js +102 -0
- package/es/core/TextureService.d.ts +15 -0
- package/es/core/TextureService.js +65 -0
- package/es/core/constant.d.ts +6 -0
- package/es/core/constant.js +19 -0
- package/es/core/interface.d.ts +284 -0
- package/es/core/interface.js +32 -0
- package/es/core/line_trangluation.d.ts +19 -0
- package/es/core/line_trangluation.js +86 -0
- package/es/core/schema.d.ts +27 -0
- package/es/core/schema.js +25 -0
- package/es/core/shape/Path.d.ts +40 -0
- package/es/core/shape/Path.js +69 -0
- package/es/core/shape/arrow.d.ts +25 -0
- package/es/core/shape/arrow.js +144 -0
- package/es/core/shape/extrude.d.ts +17 -0
- package/es/core/shape/extrude.js +133 -0
- package/es/core/triangulation.d.ts +136 -0
- package/es/core/triangulation.js +601 -0
- package/es/core/utils.d.ts +5 -0
- package/es/core/utils.js +36 -0
- package/es/earth/index.d.ts +22 -0
- package/es/earth/index.js +54 -0
- package/es/earth/models/atmosphere.d.ts +30 -0
- package/es/earth/models/atmosphere.js +116 -0
- package/es/earth/models/base.d.ts +37 -0
- package/es/earth/models/base.js +172 -0
- package/es/earth/models/bloomsphere.d.ts +30 -0
- package/es/earth/models/bloomsphere.js +115 -0
- package/es/earth/shaders/atmosphere/atmosphere_frag.glsl +17 -0
- package/es/earth/shaders/atmosphere/atmosphere_vert.glsl +24 -0
- package/es/earth/shaders/base/base_frag.glsl +11 -0
- package/es/earth/shaders/base/base_vert.glsl +52 -0
- package/es/earth/shaders/bloomshpere/bloomsphere_frag.glsl +15 -0
- package/es/earth/shaders/bloomshpere/bloomsphere_vert.glsl +20 -0
- package/es/earth/utils.d.ts +26 -0
- package/es/earth/utils.js +99 -0
- package/es/geometry/index.d.ts +22 -0
- package/es/geometry/index.js +53 -0
- package/es/geometry/models/billboard.d.ts +39 -0
- package/es/geometry/models/billboard.js +175 -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 +58 -0
- package/es/geometry/models/plane.js +308 -0
- package/es/geometry/models/sprite.d.ts +48 -0
- package/es/geometry/models/sprite.js +225 -0
- package/es/geometry/shaders/billboard_frag.glsl +18 -0
- package/es/geometry/shaders/billboard_vert.glsl +43 -0
- package/es/geometry/shaders/plane_frag.glsl +23 -0
- package/es/geometry/shaders/plane_vert.glsl +31 -0
- package/es/geometry/shaders/sprite_frag.glsl +23 -0
- package/es/geometry/shaders/sprite_vert.glsl +21 -0
- package/es/heatmap/index.d.ts +13 -0
- package/es/heatmap/index.js +87 -0
- package/es/heatmap/models/grid.d.ts +29 -0
- package/es/heatmap/models/grid.js +83 -0
- package/es/heatmap/models/grid3d.d.ts +31 -0
- package/es/heatmap/models/grid3d.js +122 -0
- package/es/heatmap/models/heatmap.d.ts +46 -0
- package/es/heatmap/models/heatmap.js +447 -0
- package/es/heatmap/models/hexagon.d.ts +29 -0
- package/es/heatmap/models/hexagon.js +83 -0
- package/es/heatmap/models/index.d.ts +5 -0
- package/es/heatmap/models/index.js +12 -0
- package/es/heatmap/shaders/grid/grid_frag.glsl +9 -0
- package/es/heatmap/shaders/grid/grid_vert.glsl +30 -0
- package/es/heatmap/shaders/grid3d/grid_3d_frag.glsl +17 -0
- package/es/heatmap/shaders/grid3d/grid_3d_vert.glsl +34 -0
- package/es/heatmap/shaders/heatmap/heatmap_3d_frag.glsl +23 -0
- package/es/heatmap/shaders/heatmap/heatmap_3d_vert.glsl +59 -0
- package/es/heatmap/shaders/heatmap/heatmap_frag.glsl +40 -0
- package/es/heatmap/shaders/heatmap/heatmap_framebuffer_frag.glsl +17 -0
- package/es/heatmap/shaders/heatmap/heatmap_framebuffer_vert.glsl +36 -0
- package/es/heatmap/shaders/heatmap/heatmap_vert.glsl +21 -0
- package/es/heatmap/shaders/hexagon/hexagon_frag.glsl +8 -0
- package/es/heatmap/shaders/hexagon/hexagon_vert.glsl +30 -0
- package/es/heatmap/triangulation.d.ts +5 -0
- package/es/heatmap/triangulation.js +33 -0
- package/es/image/index.d.ts +9 -0
- package/es/image/index.js +28 -0
- package/es/image/models/image.d.ts +31 -0
- package/es/image/models/image.js +113 -0
- package/es/image/models/index.d.ts +5 -0
- package/es/image/models/index.js +5 -0
- package/es/image/shaders/dataImage_frag.glsl +32 -0
- package/es/image/shaders/image_frag.glsl +38 -0
- package/es/image/shaders/image_vert.glsl +20 -0
- package/es/index.d.ts +18 -0
- package/es/index.js +18 -0
- package/es/line/index.d.ts +36 -0
- package/es/line/index.js +90 -0
- package/es/line/models/arc.d.ts +40 -0
- package/es/line/models/arc.js +279 -0
- package/es/line/models/arc_3d.d.ts +40 -0
- package/es/line/models/arc_3d.js +269 -0
- package/es/line/models/flow.d.ts +31 -0
- package/es/line/models/flow.js +140 -0
- package/es/line/models/great_circle.d.ts +34 -0
- package/es/line/models/great_circle.js +240 -0
- package/es/line/models/index.d.ts +5 -0
- package/es/line/models/index.js +18 -0
- package/es/line/models/line.d.ts +44 -0
- package/es/line/models/line.js +273 -0
- package/es/line/models/simple_line.d.ts +33 -0
- package/es/line/models/simple_line.js +118 -0
- package/es/line/models/wall.d.ts +34 -0
- package/es/line/models/wall.js +223 -0
- package/es/line/shaders/arc/line_arc_frag.glsl +92 -0
- package/es/line/shaders/arc/line_arc_vert.glsl +156 -0
- package/es/line/shaders/arc3d/line_arc_3d_frag.glsl +108 -0
- package/es/line/shaders/arc3d/line_arc_3d_vert.glsl +177 -0
- package/es/line/shaders/flow/flow_line_frag.glsl +13 -0
- package/es/line/shaders/flow/flow_line_vert.glsl +76 -0
- package/es/line/shaders/greatCircle/line_arc_great_circle_frag.glsl +99 -0
- package/es/line/shaders/greatCircle/line_arc_great_circle_vert.glsl +165 -0
- package/es/line/shaders/line/line_frag.glsl +122 -0
- package/es/line/shaders/line/line_vert.glsl +101 -0
- package/es/line/shaders/simple/simpleline_frag.glsl +30 -0
- package/es/line/shaders/simple/simpleline_vert.glsl +45 -0
- package/es/line/shaders/wall/wall_frag.glsl +94 -0
- package/es/line/shaders/wall/wall_vert.glsl +90 -0
- package/es/mask/index.d.ts +16 -0
- package/es/mask/index.js +21 -0
- package/es/mask/models/fill.d.ts +18 -0
- package/es/mask/models/fill.js +61 -0
- package/es/mask/models/index.d.ts +5 -0
- package/es/mask/models/index.js +5 -0
- package/es/mask/shaders/mask_vert.glsl +14 -0
- package/es/plugins/DataMappingPlugin.d.ts +12 -0
- package/es/plugins/DataMappingPlugin.js +226 -0
- package/es/plugins/DataSourcePlugin.d.ts +6 -0
- package/es/plugins/DataSourcePlugin.js +75 -0
- package/es/plugins/FeatureScalePlugin.d.ts +20 -0
- package/es/plugins/FeatureScalePlugin.js +295 -0
- package/es/plugins/LayerAnimateStylePlugin.d.ts +4 -0
- package/es/plugins/LayerAnimateStylePlugin.js +14 -0
- package/es/plugins/LayerMaskPlugin.d.ts +7 -0
- package/es/plugins/LayerMaskPlugin.js +19 -0
- package/es/plugins/LayerModelPlugin.d.ts +10 -0
- package/es/plugins/LayerModelPlugin.js +60 -0
- package/es/plugins/LayerStylePlugin.d.ts +7 -0
- package/es/plugins/LayerStylePlugin.js +18 -0
- package/es/plugins/LightingPlugin.d.ts +35 -0
- package/es/plugins/LightingPlugin.js +84 -0
- package/es/plugins/MultiPassRendererPlugin.d.ts +22 -0
- package/es/plugins/MultiPassRendererPlugin.js +52 -0
- package/es/plugins/PixelPickingPlugin.d.ts +11 -0
- package/es/plugins/PixelPickingPlugin.js +146 -0
- package/es/plugins/RegisterStyleAttributePlugin.d.ts +10 -0
- package/es/plugins/RegisterStyleAttributePlugin.js +72 -0
- package/es/plugins/ShaderUniformPlugin.d.ts +17 -0
- package/es/plugins/ShaderUniformPlugin.js +196 -0
- package/es/plugins/UpdateModelPlugin.d.ts +7 -0
- package/es/plugins/UpdateModelPlugin.js +20 -0
- package/es/plugins/UpdateStyleAttributePlugin.d.ts +9 -0
- package/es/plugins/UpdateStyleAttributePlugin.js +54 -0
- package/es/plugins/index.d.ts +15 -0
- package/es/plugins/index.js +18 -0
- package/es/point/index.d.ts +35 -0
- package/es/point/index.js +153 -0
- package/es/point/models/billboard_point.d.ts +35 -0
- package/es/point/models/billboard_point.js +95 -0
- package/es/point/models/earthExtrude.d.ts +32 -0
- package/es/point/models/earthExtrude.js +199 -0
- package/es/point/models/earthFill.d.ts +31 -0
- package/es/point/models/earthFill.js +158 -0
- package/es/point/models/extrude.d.ts +32 -0
- package/es/point/models/extrude.js +195 -0
- package/es/point/models/fill.d.ts +47 -0
- package/es/point/models/fill.js +180 -0
- package/es/point/models/fillImage.d.ts +42 -0
- package/es/point/models/fillImage.js +189 -0
- package/es/point/models/image.d.ts +48 -0
- package/es/point/models/image.js +293 -0
- package/es/point/models/index.d.ts +5 -0
- package/es/point/models/index.js +24 -0
- package/es/point/models/normal.d.ts +36 -0
- package/es/point/models/normal.js +89 -0
- package/es/point/models/radar.d.ts +37 -0
- package/es/point/models/radar.js +115 -0
- package/es/point/models/text.d.ts +85 -0
- package/es/point/models/text.js +503 -0
- package/es/point/shaders/billboard/billboard_point_frag.glsl +48 -0
- package/es/point/shaders/billboard/billboard_point_vert.glsl +33 -0
- package/es/point/shaders/earthExtrude/earthExtrude_frag.glsl +36 -0
- package/es/point/shaders/earthExtrude/earthExtrude_vert.glsl +118 -0
- package/es/point/shaders/earthFill/earthFill_frag.glsl +79 -0
- package/es/point/shaders/earthFill/earthFill_vert.glsl +46 -0
- package/es/point/shaders/extrude/extrude_frag.glsl +29 -0
- package/es/point/shaders/extrude/extrude_vert.glsl +95 -0
- package/es/point/shaders/fill/fill_frag.glsl +97 -0
- package/es/point/shaders/fill/fill_vert.glsl +79 -0
- package/es/point/shaders/fillImage/fillImage_frag.glsl +23 -0
- package/es/point/shaders/fillImage/fillImage_vert.glsl +46 -0
- package/es/point/shaders/image/image_frag.glsl +45 -0
- package/es/point/shaders/image/image_vert.glsl +47 -0
- package/es/point/shaders/normal/normal_frag.glsl +5 -0
- package/es/point/shaders/normal/normal_vert.glsl +22 -0
- package/es/point/shaders/radar/radar_frag.glsl +52 -0
- package/es/point/shaders/radar/radar_vert.glsl +53 -0
- package/es/point/shaders/text/text_frag.glsl +47 -0
- package/es/point/shaders/text/text_vert.glsl +65 -0
- package/es/point/shape/extrude.d.ts +15 -0
- package/es/point/shape/extrude.js +48 -0
- package/es/polygon/index.d.ts +18 -0
- package/es/polygon/index.js +71 -0
- package/es/polygon/models/extrude.d.ts +41 -0
- package/es/polygon/models/extrude.js +248 -0
- package/es/polygon/models/extrusion.d.ts +40 -0
- package/es/polygon/models/extrusion.js +137 -0
- package/es/polygon/models/fill.d.ts +32 -0
- package/es/polygon/models/fill.js +127 -0
- package/es/polygon/models/index.d.ts +5 -0
- package/es/polygon/models/index.js +26 -0
- package/es/polygon/models/ocean.d.ts +37 -0
- package/es/polygon/models/ocean.js +172 -0
- package/es/polygon/models/water.d.ts +35 -0
- package/es/polygon/models/water.js +150 -0
- package/es/polygon/shaders/extrude/polygon_extrude_frag.glsl +24 -0
- package/es/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +49 -0
- package/es/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +53 -0
- package/es/polygon/shaders/extrude/polygon_extrude_vert.glsl +74 -0
- package/es/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +55 -0
- package/es/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +54 -0
- package/es/polygon/shaders/extrusion/polygon_extrusion_frag.glsl +8 -0
- package/es/polygon/shaders/extrusion/polygon_extrusion_vert.glsl +24 -0
- package/es/polygon/shaders/fill/fill_frag.glsl +8 -0
- package/es/polygon/shaders/fill/fill_linear_frag.glsl +23 -0
- package/es/polygon/shaders/fill/fill_linear_vert.glsl +36 -0
- package/es/polygon/shaders/fill/fill_vert.glsl +35 -0
- package/es/polygon/shaders/ocean/ocean_frag.glsl +277 -0
- package/es/polygon/shaders/ocean/ocean_vert.glsl +21 -0
- package/es/polygon/shaders/water/polygon_water_frag.glsl +78 -0
- package/es/polygon/shaders/water/polygon_water_vert.glsl +22 -0
- package/es/raster/buffers/triangulation.d.ts +6 -0
- package/es/raster/buffers/triangulation.js +25 -0
- package/es/raster/index.d.ts +11 -0
- package/es/raster/index.js +55 -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 +35 -0
- package/es/raster/models/raster.js +156 -0
- package/es/raster/models/rasterRgb.d.ts +35 -0
- package/es/raster/models/rasterRgb.js +158 -0
- package/es/raster/models/rasterTerrainRgb.d.ts +30 -0
- package/es/raster/models/rasterTerrainRgb.js +118 -0
- package/es/raster/shaders/raster/raster_2d_frag.glsl +37 -0
- package/es/raster/shaders/raster/raster_2d_vert.glsl +21 -0
- package/es/raster/shaders/rgb/raster_rgb_frag.glsl +30 -0
- package/es/raster/shaders/rgb/raster_rgb_vert.glsl +21 -0
- package/es/raster/shaders/terrain/terrain_rgb_frag.glsl +40 -0
- package/es/raster/shaders/terrain/terrain_rgb_vert.glsl +19 -0
- package/es/shader/minify_frag.glsl +11 -0
- package/es/shader/minify_picking_frag.glsl +10 -0
- package/es/tile/core/BaseLayer.d.ts +50 -0
- package/es/tile/core/BaseLayer.js +256 -0
- package/es/tile/core/TileDebugLayer.d.ts +15 -0
- package/es/tile/core/TileDebugLayer.js +23 -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 +45 -0
- package/es/tile/interaction/utils.d.ts +11 -0
- package/es/tile/interaction/utils.js +69 -0
- package/es/tile/interface.d.ts +29 -0
- package/es/tile/interface.js +1 -0
- package/es/tile/service/TileLayerService.d.ts +58 -0
- package/es/tile/service/TileLayerService.js +195 -0
- package/es/tile/service/TilePickService.d.ts +26 -0
- package/es/tile/service/TilePickService.js +126 -0
- package/es/tile/service/TileSourceService.d.ts +7 -0
- package/es/tile/service/TileSourceService.js +26 -0
- package/es/tile/tile/DebugTile.d.ts +16 -0
- package/es/tile/tile/DebugTile.js +47 -0
- package/es/tile/tile/ImageTile.d.ts +14 -0
- package/es/tile/tile/ImageTile.js +39 -0
- package/es/tile/tile/MaskTile.d.ts +18 -0
- package/es/tile/tile/MaskTile.js +54 -0
- package/es/tile/tile/RasterRGBTile.d.ts +11 -0
- package/es/tile/tile/RasterRGBTile.js +47 -0
- package/es/tile/tile/RasterTerrainRGBTile.d.ts +14 -0
- package/es/tile/tile/RasterTerrainRGBTile.js +39 -0
- package/es/tile/tile/RasterTile.d.ts +18 -0
- package/es/tile/tile/RasterTile.js +81 -0
- package/es/tile/tile/Tile.d.ts +112 -0
- package/es/tile/tile/Tile.js +166 -0
- package/es/tile/tile/VectorTile.d.ts +26 -0
- package/es/tile/tile/VectorTile.js +87 -0
- package/es/tile/tile/index.d.ts +12 -0
- package/es/tile/tile/index.js +44 -0
- package/es/tile/tile/util.d.ts +5 -0
- package/es/tile/tile/util.js +18 -0
- package/es/tile/utils/constants.d.ts +1 -0
- package/es/tile/utils/constants.js +8 -0
- package/es/tile/utils/utils.d.ts +8 -0
- package/es/tile/utils/utils.js +11 -0
- package/es/utils/blend.d.ts +2 -0
- package/es/utils/blend.js +57 -0
- package/es/utils/collision-index.d.ts +47 -0
- package/es/utils/collision-index.js +87 -0
- package/es/utils/extrude_polyline.d.ts +53 -0
- package/es/utils/extrude_polyline.js +319 -0
- package/es/utils/grid-index.d.ts +28 -0
- package/es/utils/grid-index.js +128 -0
- package/es/utils/identityScale.d.ts +8 -0
- package/es/utils/identityScale.js +26 -0
- package/es/utils/load-image.d.ts +1 -0
- package/es/utils/load-image.js +22 -0
- package/es/utils/multiPassRender.d.ts +16 -0
- package/es/utils/multiPassRender.js +37 -0
- package/es/utils/polylineNormal.d.ts +9 -0
- package/es/utils/polylineNormal.js +182 -0
- package/es/utils/rampcolor_legend.d.ts +6 -0
- package/es/utils/rampcolor_legend.js +12 -0
- package/es/utils/scale.d.ts +87 -0
- package/es/utils/scale.js +595 -0
- package/es/utils/simpleLine.d.ts +23 -0
- package/es/utils/simpleLine.js +76 -0
- package/es/utils/stencil.d.ts +7 -0
- package/es/utils/stencil.js +49 -0
- package/es/utils/symbol-layout.d.ts +43 -0
- package/es/utils/symbol-layout.js +251 -0
- package/es/wind/index.d.ts +11 -0
- package/es/wind/index.js +34 -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 +213 -0
- package/es/wind/models/wind.d.ts +38 -0
- package/es/wind/models/wind.js +240 -0
- package/es/wind/models/windRender.d.ts +104 -0
- package/es/wind/models/windRender.js +333 -0
- package/es/wind/models/windShader.d.ts +12 -0
- package/es/wind/models/windShader.js +151 -0
- package/es/wind/shaders/wind_frag.glsl +9 -0
- package/es/wind/shaders/wind_vert.glsl +14 -0
- package/lib/canvas/index.d.ts +18 -0
- package/lib/canvas/index.js +79 -0
- package/lib/canvas/models/canvas.d.ts +23 -0
- package/lib/canvas/models/canvas.js +149 -0
- package/lib/canvas/models/constants.d.ts +2 -0
- package/lib/canvas/models/constants.js +12 -0
- package/lib/canvas/models/index.d.ts +2 -0
- package/lib/canvas/models/index.js +27 -0
- package/lib/citybuilding/building.d.ts +7 -0
- package/lib/citybuilding/building.js +33 -0
- package/lib/citybuilding/models/build.d.ts +33 -0
- package/lib/citybuilding/models/build.js +168 -0
- package/lib/citybuilding/shaders/build_frag.glsl +123 -0
- package/lib/citybuilding/shaders/build_vert.glsl +58 -0
- package/lib/core/BaseLayer.d.ts +265 -0
- package/lib/core/BaseLayer.js +1317 -0
- package/lib/core/BaseModel.d.ts +95 -0
- package/lib/core/BaseModel.js +375 -0
- package/lib/core/CommonStyleAttribute.d.ts +16 -0
- package/lib/core/CommonStyleAttribute.js +120 -0
- package/lib/core/LayerPickService.d.ts +12 -0
- package/lib/core/LayerPickService.js +110 -0
- package/lib/core/TextureService.d.ts +15 -0
- package/lib/core/TextureService.js +73 -0
- package/lib/core/constant.d.ts +6 -0
- package/lib/core/constant.js +25 -0
- package/lib/core/interface.d.ts +284 -0
- package/lib/core/interface.js +34 -0
- package/lib/core/line_trangluation.d.ts +19 -0
- package/lib/core/line_trangluation.js +94 -0
- package/lib/core/schema.d.ts +27 -0
- package/lib/core/schema.js +31 -0
- package/lib/core/shape/Path.d.ts +40 -0
- package/lib/core/shape/Path.js +81 -0
- package/lib/core/shape/arrow.d.ts +25 -0
- package/lib/core/shape/arrow.js +158 -0
- package/lib/core/shape/extrude.d.ts +17 -0
- package/lib/core/shape/extrude.js +142 -0
- package/lib/core/triangulation.d.ts +136 -0
- package/lib/core/triangulation.js +628 -0
- package/lib/core/utils.d.ts +5 -0
- package/lib/core/utils.js +44 -0
- package/lib/earth/index.d.ts +22 -0
- package/lib/earth/index.js +62 -0
- package/lib/earth/models/atmosphere.d.ts +30 -0
- package/lib/earth/models/atmosphere.js +124 -0
- package/lib/earth/models/base.d.ts +37 -0
- package/lib/earth/models/base.js +180 -0
- package/lib/earth/models/bloomsphere.d.ts +30 -0
- package/lib/earth/models/bloomsphere.js +123 -0
- package/lib/earth/shaders/atmosphere/atmosphere_frag.glsl +17 -0
- package/lib/earth/shaders/atmosphere/atmosphere_vert.glsl +24 -0
- package/lib/earth/shaders/base/base_frag.glsl +11 -0
- package/lib/earth/shaders/base/base_vert.glsl +52 -0
- package/lib/earth/shaders/bloomshpere/bloomsphere_frag.glsl +15 -0
- package/lib/earth/shaders/bloomshpere/bloomsphere_vert.glsl +20 -0
- package/lib/earth/utils.d.ts +26 -0
- package/lib/earth/utils.js +107 -0
- package/lib/geometry/index.d.ts +22 -0
- package/lib/geometry/index.js +61 -0
- package/lib/geometry/models/billboard.d.ts +39 -0
- package/lib/geometry/models/billboard.js +183 -0
- package/lib/geometry/models/index.d.ts +5 -0
- package/lib/geometry/models/index.js +16 -0
- package/lib/geometry/models/plane.d.ts +58 -0
- package/lib/geometry/models/plane.js +316 -0
- package/lib/geometry/models/sprite.d.ts +48 -0
- package/lib/geometry/models/sprite.js +233 -0
- package/lib/geometry/shaders/billboard_frag.glsl +18 -0
- package/lib/geometry/shaders/billboard_vert.glsl +43 -0
- package/lib/geometry/shaders/plane_frag.glsl +23 -0
- package/lib/geometry/shaders/plane_vert.glsl +31 -0
- package/lib/geometry/shaders/sprite_frag.glsl +23 -0
- package/lib/geometry/shaders/sprite_vert.glsl +21 -0
- package/lib/heatmap/index.d.ts +13 -0
- package/lib/heatmap/index.js +95 -0
- package/lib/heatmap/models/grid.d.ts +29 -0
- package/lib/heatmap/models/grid.js +91 -0
- package/lib/heatmap/models/grid3d.d.ts +31 -0
- package/lib/heatmap/models/grid3d.js +130 -0
- package/lib/heatmap/models/heatmap.d.ts +46 -0
- package/lib/heatmap/models/heatmap.js +455 -0
- package/lib/heatmap/models/hexagon.d.ts +29 -0
- package/lib/heatmap/models/hexagon.js +91 -0
- package/lib/heatmap/models/index.d.ts +5 -0
- package/lib/heatmap/models/index.js +19 -0
- package/lib/heatmap/shaders/grid/grid_frag.glsl +9 -0
- package/lib/heatmap/shaders/grid/grid_vert.glsl +30 -0
- package/lib/heatmap/shaders/grid3d/grid_3d_frag.glsl +17 -0
- package/lib/heatmap/shaders/grid3d/grid_3d_vert.glsl +34 -0
- package/lib/heatmap/shaders/heatmap/heatmap_3d_frag.glsl +23 -0
- package/lib/heatmap/shaders/heatmap/heatmap_3d_vert.glsl +59 -0
- package/lib/heatmap/shaders/heatmap/heatmap_frag.glsl +40 -0
- package/lib/heatmap/shaders/heatmap/heatmap_framebuffer_frag.glsl +17 -0
- package/lib/heatmap/shaders/heatmap/heatmap_framebuffer_vert.glsl +36 -0
- package/lib/heatmap/shaders/heatmap/heatmap_vert.glsl +21 -0
- package/lib/heatmap/shaders/hexagon/hexagon_frag.glsl +8 -0
- package/lib/heatmap/shaders/hexagon/hexagon_vert.glsl +30 -0
- package/lib/heatmap/triangulation.d.ts +5 -0
- package/lib/heatmap/triangulation.js +39 -0
- package/lib/image/index.d.ts +9 -0
- package/lib/image/index.js +36 -0
- package/lib/image/models/image.d.ts +31 -0
- package/lib/image/models/image.js +121 -0
- package/lib/image/models/index.d.ts +5 -0
- package/lib/image/models/index.js +12 -0
- package/lib/image/shaders/dataImage_frag.glsl +32 -0
- package/lib/image/shaders/image_frag.glsl +38 -0
- package/lib/image/shaders/image_vert.glsl +20 -0
- package/lib/index.d.ts +18 -0
- package/lib/index.js +148 -0
- package/lib/line/index.d.ts +36 -0
- package/lib/line/index.js +98 -0
- package/lib/line/models/arc.d.ts +40 -0
- package/lib/line/models/arc.js +287 -0
- package/lib/line/models/arc_3d.d.ts +40 -0
- package/lib/line/models/arc_3d.js +277 -0
- package/lib/line/models/flow.d.ts +31 -0
- package/lib/line/models/flow.js +148 -0
- package/lib/line/models/great_circle.d.ts +34 -0
- package/lib/line/models/great_circle.js +248 -0
- package/lib/line/models/index.d.ts +5 -0
- package/lib/line/models/index.js +25 -0
- package/lib/line/models/line.d.ts +44 -0
- package/lib/line/models/line.js +281 -0
- package/lib/line/models/simple_line.d.ts +33 -0
- package/lib/line/models/simple_line.js +126 -0
- package/lib/line/models/wall.d.ts +34 -0
- package/lib/line/models/wall.js +231 -0
- package/lib/line/shaders/arc/line_arc_frag.glsl +92 -0
- package/lib/line/shaders/arc/line_arc_vert.glsl +156 -0
- package/lib/line/shaders/arc3d/line_arc_3d_frag.glsl +108 -0
- package/lib/line/shaders/arc3d/line_arc_3d_vert.glsl +177 -0
- package/lib/line/shaders/flow/flow_line_frag.glsl +13 -0
- package/lib/line/shaders/flow/flow_line_vert.glsl +76 -0
- package/lib/line/shaders/greatCircle/line_arc_great_circle_frag.glsl +99 -0
- package/lib/line/shaders/greatCircle/line_arc_great_circle_vert.glsl +165 -0
- package/lib/line/shaders/line/line_frag.glsl +122 -0
- package/lib/line/shaders/line/line_vert.glsl +101 -0
- package/lib/line/shaders/simple/simpleline_frag.glsl +30 -0
- package/lib/line/shaders/simple/simpleline_vert.glsl +45 -0
- package/lib/line/shaders/wall/wall_frag.glsl +94 -0
- package/lib/line/shaders/wall/wall_vert.glsl +90 -0
- package/lib/mask/index.d.ts +16 -0
- package/lib/mask/index.js +29 -0
- package/lib/mask/models/fill.d.ts +18 -0
- package/lib/mask/models/fill.js +69 -0
- package/lib/mask/models/index.d.ts +5 -0
- package/lib/mask/models/index.js +12 -0
- package/lib/mask/shaders/mask_vert.glsl +14 -0
- package/lib/plugins/DataMappingPlugin.d.ts +12 -0
- package/lib/plugins/DataMappingPlugin.js +234 -0
- package/lib/plugins/DataSourcePlugin.d.ts +6 -0
- package/lib/plugins/DataSourcePlugin.js +83 -0
- package/lib/plugins/FeatureScalePlugin.d.ts +20 -0
- package/lib/plugins/FeatureScalePlugin.js +303 -0
- package/lib/plugins/LayerAnimateStylePlugin.d.ts +4 -0
- package/lib/plugins/LayerAnimateStylePlugin.js +22 -0
- package/lib/plugins/LayerMaskPlugin.d.ts +7 -0
- package/lib/plugins/LayerMaskPlugin.js +26 -0
- package/lib/plugins/LayerModelPlugin.d.ts +10 -0
- package/lib/plugins/LayerModelPlugin.js +68 -0
- package/lib/plugins/LayerStylePlugin.d.ts +7 -0
- package/lib/plugins/LayerStylePlugin.js +25 -0
- package/lib/plugins/LightingPlugin.d.ts +35 -0
- package/lib/plugins/LightingPlugin.js +93 -0
- package/lib/plugins/MultiPassRendererPlugin.d.ts +22 -0
- package/lib/plugins/MultiPassRendererPlugin.js +59 -0
- package/lib/plugins/PixelPickingPlugin.d.ts +11 -0
- package/lib/plugins/PixelPickingPlugin.js +154 -0
- package/lib/plugins/RegisterStyleAttributePlugin.d.ts +10 -0
- package/lib/plugins/RegisterStyleAttributePlugin.js +78 -0
- package/lib/plugins/ShaderUniformPlugin.d.ts +17 -0
- package/lib/plugins/ShaderUniformPlugin.js +203 -0
- package/lib/plugins/UpdateModelPlugin.d.ts +7 -0
- package/lib/plugins/UpdateModelPlugin.js +27 -0
- package/lib/plugins/UpdateStyleAttributePlugin.d.ts +9 -0
- package/lib/plugins/UpdateStyleAttributePlugin.js +61 -0
- package/lib/plugins/index.d.ts +15 -0
- package/lib/plugins/index.js +26 -0
- package/lib/point/index.d.ts +35 -0
- package/lib/point/index.js +161 -0
- package/lib/point/models/billboard_point.d.ts +35 -0
- package/lib/point/models/billboard_point.js +104 -0
- package/lib/point/models/earthExtrude.d.ts +32 -0
- package/lib/point/models/earthExtrude.js +207 -0
- package/lib/point/models/earthFill.d.ts +31 -0
- package/lib/point/models/earthFill.js +166 -0
- package/lib/point/models/extrude.d.ts +32 -0
- package/lib/point/models/extrude.js +203 -0
- package/lib/point/models/fill.d.ts +47 -0
- package/lib/point/models/fill.js +188 -0
- package/lib/point/models/fillImage.d.ts +42 -0
- package/lib/point/models/fillImage.js +197 -0
- package/lib/point/models/image.d.ts +48 -0
- package/lib/point/models/image.js +301 -0
- package/lib/point/models/index.d.ts +5 -0
- package/lib/point/models/index.js +32 -0
- package/lib/point/models/normal.d.ts +36 -0
- package/lib/point/models/normal.js +98 -0
- package/lib/point/models/radar.d.ts +37 -0
- package/lib/point/models/radar.js +123 -0
- package/lib/point/models/text.d.ts +85 -0
- package/lib/point/models/text.js +512 -0
- package/lib/point/shaders/billboard/billboard_point_frag.glsl +48 -0
- package/lib/point/shaders/billboard/billboard_point_vert.glsl +33 -0
- package/lib/point/shaders/earthExtrude/earthExtrude_frag.glsl +36 -0
- package/lib/point/shaders/earthExtrude/earthExtrude_vert.glsl +118 -0
- package/lib/point/shaders/earthFill/earthFill_frag.glsl +79 -0
- package/lib/point/shaders/earthFill/earthFill_vert.glsl +46 -0
- package/lib/point/shaders/extrude/extrude_frag.glsl +29 -0
- package/lib/point/shaders/extrude/extrude_vert.glsl +95 -0
- package/lib/point/shaders/fill/fill_frag.glsl +97 -0
- package/lib/point/shaders/fill/fill_vert.glsl +79 -0
- package/lib/point/shaders/fillImage/fillImage_frag.glsl +23 -0
- package/lib/point/shaders/fillImage/fillImage_vert.glsl +46 -0
- package/lib/point/shaders/image/image_frag.glsl +45 -0
- package/lib/point/shaders/image/image_vert.glsl +47 -0
- package/lib/point/shaders/normal/normal_frag.glsl +5 -0
- package/lib/point/shaders/normal/normal_vert.glsl +22 -0
- package/lib/point/shaders/radar/radar_frag.glsl +52 -0
- package/lib/point/shaders/radar/radar_vert.glsl +53 -0
- package/lib/point/shaders/text/text_frag.glsl +47 -0
- package/lib/point/shaders/text/text_vert.glsl +65 -0
- package/lib/point/shape/extrude.d.ts +15 -0
- package/lib/point/shape/extrude.js +56 -0
- package/lib/polygon/index.d.ts +18 -0
- package/lib/polygon/index.js +79 -0
- package/lib/polygon/models/extrude.d.ts +41 -0
- package/lib/polygon/models/extrude.js +256 -0
- package/lib/polygon/models/extrusion.d.ts +40 -0
- package/lib/polygon/models/extrusion.js +145 -0
- package/lib/polygon/models/fill.d.ts +32 -0
- package/lib/polygon/models/fill.js +135 -0
- package/lib/polygon/models/index.d.ts +5 -0
- package/lib/polygon/models/index.js +33 -0
- package/lib/polygon/models/ocean.d.ts +37 -0
- package/lib/polygon/models/ocean.js +180 -0
- package/lib/polygon/models/water.d.ts +35 -0
- package/lib/polygon/models/water.js +158 -0
- package/lib/polygon/shaders/extrude/polygon_extrude_frag.glsl +24 -0
- package/lib/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +49 -0
- package/lib/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +53 -0
- package/lib/polygon/shaders/extrude/polygon_extrude_vert.glsl +74 -0
- package/lib/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +55 -0
- package/lib/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +54 -0
- package/lib/polygon/shaders/extrusion/polygon_extrusion_frag.glsl +8 -0
- package/lib/polygon/shaders/extrusion/polygon_extrusion_vert.glsl +24 -0
- package/lib/polygon/shaders/fill/fill_frag.glsl +8 -0
- package/lib/polygon/shaders/fill/fill_linear_frag.glsl +23 -0
- package/lib/polygon/shaders/fill/fill_linear_vert.glsl +36 -0
- package/lib/polygon/shaders/fill/fill_vert.glsl +35 -0
- package/lib/polygon/shaders/ocean/ocean_frag.glsl +277 -0
- package/lib/polygon/shaders/ocean/ocean_vert.glsl +21 -0
- package/lib/polygon/shaders/water/polygon_water_frag.glsl +78 -0
- package/lib/polygon/shaders/water/polygon_water_vert.glsl +22 -0
- package/lib/raster/buffers/triangulation.d.ts +6 -0
- package/lib/raster/buffers/triangulation.js +33 -0
- package/lib/raster/index.d.ts +11 -0
- package/lib/raster/index.js +63 -0
- package/lib/raster/models/index.d.ts +5 -0
- package/lib/raster/models/index.js +17 -0
- package/lib/raster/models/raster.d.ts +35 -0
- package/lib/raster/models/raster.js +164 -0
- package/lib/raster/models/rasterRgb.d.ts +35 -0
- package/lib/raster/models/rasterRgb.js +166 -0
- package/lib/raster/models/rasterTerrainRgb.d.ts +30 -0
- package/lib/raster/models/rasterTerrainRgb.js +126 -0
- package/lib/raster/shaders/raster/raster_2d_frag.glsl +37 -0
- package/lib/raster/shaders/raster/raster_2d_vert.glsl +21 -0
- package/lib/raster/shaders/rgb/raster_rgb_frag.glsl +30 -0
- package/lib/raster/shaders/rgb/raster_rgb_vert.glsl +21 -0
- package/lib/raster/shaders/terrain/terrain_rgb_frag.glsl +40 -0
- package/lib/raster/shaders/terrain/terrain_rgb_vert.glsl +19 -0
- package/lib/shader/minify_frag.glsl +11 -0
- package/lib/shader/minify_picking_frag.glsl +10 -0
- package/lib/tile/core/BaseLayer.d.ts +50 -0
- package/lib/tile/core/BaseLayer.js +264 -0
- package/lib/tile/core/TileDebugLayer.d.ts +15 -0
- package/lib/tile/core/TileDebugLayer.js +31 -0
- package/lib/tile/interaction/getFeatureData.d.ts +0 -0
- package/lib/tile/interaction/getFeatureData.js +1 -0
- package/lib/tile/interaction/getRasterData.d.ts +4 -0
- package/lib/tile/interaction/getRasterData.js +52 -0
- package/lib/tile/interaction/utils.d.ts +11 -0
- package/lib/tile/interaction/utils.js +81 -0
- package/lib/tile/interface.d.ts +29 -0
- package/lib/tile/interface.js +5 -0
- package/lib/tile/service/TileLayerService.d.ts +58 -0
- package/lib/tile/service/TileLayerService.js +203 -0
- package/lib/tile/service/TilePickService.d.ts +26 -0
- package/lib/tile/service/TilePickService.js +134 -0
- package/lib/tile/service/TileSourceService.d.ts +7 -0
- package/lib/tile/service/TileSourceService.js +35 -0
- package/lib/tile/tile/DebugTile.d.ts +16 -0
- package/lib/tile/tile/DebugTile.js +55 -0
- package/lib/tile/tile/ImageTile.d.ts +14 -0
- package/lib/tile/tile/ImageTile.js +47 -0
- package/lib/tile/tile/MaskTile.d.ts +18 -0
- package/lib/tile/tile/MaskTile.js +62 -0
- package/lib/tile/tile/RasterRGBTile.d.ts +11 -0
- package/lib/tile/tile/RasterRGBTile.js +55 -0
- package/lib/tile/tile/RasterTerrainRGBTile.d.ts +14 -0
- package/lib/tile/tile/RasterTerrainRGBTile.js +47 -0
- package/lib/tile/tile/RasterTile.d.ts +18 -0
- package/lib/tile/tile/RasterTile.js +89 -0
- package/lib/tile/tile/Tile.d.ts +112 -0
- package/lib/tile/tile/Tile.js +174 -0
- package/lib/tile/tile/VectorTile.d.ts +26 -0
- package/lib/tile/tile/VectorTile.js +95 -0
- package/lib/tile/tile/index.d.ts +12 -0
- package/lib/tile/tile/index.js +76 -0
- package/lib/tile/tile/util.d.ts +5 -0
- package/lib/tile/tile/util.js +26 -0
- package/lib/tile/utils/constants.d.ts +1 -0
- package/lib/tile/utils/constants.js +14 -0
- package/lib/tile/utils/utils.d.ts +8 -0
- package/lib/tile/utils/utils.js +18 -0
- package/lib/utils/blend.d.ts +2 -0
- package/lib/utils/blend.js +63 -0
- package/lib/utils/collision-index.d.ts +47 -0
- package/lib/utils/collision-index.js +96 -0
- package/lib/utils/extrude_polyline.d.ts +53 -0
- package/lib/utils/extrude_polyline.js +331 -0
- package/lib/utils/grid-index.d.ts +28 -0
- package/lib/utils/grid-index.js +135 -0
- package/lib/utils/identityScale.d.ts +8 -0
- package/lib/utils/identityScale.js +32 -0
- package/lib/utils/load-image.d.ts +1 -0
- package/lib/utils/load-image.js +29 -0
- package/lib/utils/multiPassRender.d.ts +16 -0
- package/lib/utils/multiPassRender.js +44 -0
- package/lib/utils/polylineNormal.d.ts +9 -0
- package/lib/utils/polylineNormal.js +191 -0
- package/lib/utils/rampcolor_legend.d.ts +6 -0
- package/lib/utils/rampcolor_legend.js +18 -0
- package/lib/utils/scale.d.ts +87 -0
- package/lib/utils/scale.js +610 -0
- package/lib/utils/simpleLine.d.ts +23 -0
- package/lib/utils/simpleLine.js +85 -0
- package/lib/utils/stencil.d.ts +7 -0
- package/lib/utils/stencil.js +56 -0
- package/lib/utils/symbol-layout.d.ts +43 -0
- package/lib/utils/symbol-layout.js +258 -0
- package/lib/wind/index.d.ts +11 -0
- package/lib/wind/index.js +42 -0
- package/lib/wind/models/index.d.ts +5 -0
- package/lib/wind/models/index.js +12 -0
- package/lib/wind/models/utils.d.ts +19 -0
- package/lib/wind/models/utils.js +229 -0
- package/lib/wind/models/wind.d.ts +38 -0
- package/lib/wind/models/wind.js +248 -0
- package/lib/wind/models/windRender.d.ts +104 -0
- package/lib/wind/models/windRender.js +343 -0
- package/lib/wind/models/windShader.d.ts +12 -0
- package/lib/wind/models/windShader.js +157 -0
- package/lib/wind/shaders/wind_frag.glsl +9 -0
- package/lib/wind/shaders/wind_vert.glsl +14 -0
- package/package.json +6 -6
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { IModel, IModelUniform } from '@antv/l7-core';
|
|
2
|
+
import BaseModel from '../../core/BaseModel';
|
|
3
|
+
export default class ImageModel extends BaseModel {
|
|
4
|
+
protected get attributeLocation(): {
|
|
5
|
+
readonly POSITION: 0;
|
|
6
|
+
readonly POSITION_64LOW: 1;
|
|
7
|
+
readonly COLOR: 2;
|
|
8
|
+
readonly PICKING_COLOR: 3;
|
|
9
|
+
readonly STROKE: 4;
|
|
10
|
+
readonly OPACITY: 5;
|
|
11
|
+
readonly OFFSETS: 6;
|
|
12
|
+
readonly ROTATION: 7;
|
|
13
|
+
readonly MAX: 8;
|
|
14
|
+
} & Record<string, number> & {
|
|
15
|
+
MAX: 8;
|
|
16
|
+
SIZE: number;
|
|
17
|
+
UV: number;
|
|
18
|
+
};
|
|
19
|
+
private texture;
|
|
20
|
+
imageFilterMap: {
|
|
21
|
+
[key: number]: boolean;
|
|
22
|
+
} | null;
|
|
23
|
+
private currentZoom;
|
|
24
|
+
private extent;
|
|
25
|
+
private preAllowOverlap;
|
|
26
|
+
getUninforms(): IModelUniform;
|
|
27
|
+
protected getCommonUniformsInfo(): {
|
|
28
|
+
uniformsArray: number[];
|
|
29
|
+
uniformsLength: number;
|
|
30
|
+
uniformsOption: {
|
|
31
|
+
[key: string]: any;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
initModels(): Promise<IModel[]>;
|
|
35
|
+
buildModels(): Promise<IModel[]>;
|
|
36
|
+
needUpdate(): Promise<boolean>;
|
|
37
|
+
clearModels(): void;
|
|
38
|
+
protected registerBuiltinAttributes(): void;
|
|
39
|
+
/**
|
|
40
|
+
* 图标碰撞避让:遍历所有 feature,在屏幕空间做 AABB 碰撞检测,
|
|
41
|
+
* 将通过检测的 feature id 写入 imageFilterMap。
|
|
42
|
+
* PointImageTriangulation 绑定 this 后,会跳过不在 map 中的 feature。
|
|
43
|
+
*/
|
|
44
|
+
private filterImages;
|
|
45
|
+
private imageExtent;
|
|
46
|
+
private reBuildModel;
|
|
47
|
+
private updateTexture;
|
|
48
|
+
}
|
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
9
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
var _l7Core = require("@antv/l7-core");
|
|
12
|
+
var _l7Utils = require("@antv/l7-utils");
|
|
13
|
+
var _BaseModel = _interopRequireDefault(require("../../core/BaseModel"));
|
|
14
|
+
var _triangulation = require("../../core/triangulation");
|
|
15
|
+
var _collisionIndex = _interopRequireDefault(require("../../utils/collision-index"));
|
|
16
|
+
/* babel-plugin-inline-import '../shaders/image/image_frag.glsl' */
|
|
17
|
+
const pointImageFrag = "layout(std140) uniform commonUniforms {\n vec2 u_textSize;\n float u_raisingHeight;\n float u_heightfixed;\n};\n\nuniform sampler2D u_texture;\n\nin vec4 v_color;\nin vec2 v_uv;\nin float v_opacity;\n\n#pragma include \"picking\"\n\nout vec4 outputColor;\n\nvoid main() {\n vec2 pos = v_uv / u_textSize + gl_PointCoord / u_textSize * 64.0;\n vec4 textureColor;\n\n // Y = 0.299R + 0.587G + 0.114B // \u4EAE\u5EA6\u63D0\u53D6\n\n textureColor = texture(SAMPLER_2D(u_texture), pos);\n\n // Tip: \u53BB\u9664\u8FB9\u7F18\u90E8\u5206 mipmap \u5BFC\u81F4\u7684\u6DF7\u5408\u53D8\u6697\n float fragmengTocenter = distance(vec2(0.5), gl_PointCoord);\n if (fragmengTocenter >= 0.5) {\n float luma = 0.299 * textureColor.r + 0.587 * textureColor.g + 0.114 * textureColor.b;\n textureColor.a *= luma;\n }\n\n if (\n all(lessThan(v_color, vec4(1.0 + 0.00001))) && all(greaterThan(v_color, vec4(1.0 - 0.00001))) ||\n v_color == vec4(1.0)\n ) {\n outputColor = textureColor;\n } else {\n outputColor = step(0.01, textureColor.z) * v_color;\n }\n outputColor.a *= v_opacity;\n if (outputColor.a < 0.01) {\n discard;\n }\n outputColor = filterColor(outputColor);\n}\n";
|
|
18
|
+
/* babel-plugin-inline-import '../shaders/image/image_vert.glsl' */
|
|
19
|
+
const pointImageVert = "layout(location = ATTRIBUTE_LOCATION_POSITION) in vec3 a_Position;\nlayout(location = ATTRIBUTE_LOCATION_POSITION_64LOW) in vec2 a_Position64Low;\nlayout(location = ATTRIBUTE_LOCATION_COLOR) in vec4 a_Color;\nlayout(location = ATTRIBUTE_LOCATION_SIZE) in float a_Size;\nlayout(location = ATTRIBUTE_LOCATION_UV) in vec2 a_Uv;\n\nlayout(std140) uniform commonUniforms {\n vec2 u_textSize;\n float u_raisingHeight;\n float u_heightfixed;\n};\n\nout vec4 v_color;\nout vec2 v_uv;\nout float v_opacity;\n\n#pragma include \"projection\"\n#pragma include \"picking\"\n\nvoid main() {\n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\n v_color = a_Color;\n v_opacity = opacity;\n v_uv = a_Uv;\n vec4 project_pos = project_position(vec4(a_Position, 1.0), a_Position64Low);\n\n vec2 offset = project_pixel(offsets);\n\n float raisingHeight = u_raisingHeight;\n if (u_heightfixed < 1.0) {\n // false\n raisingHeight = project_pixel(u_raisingHeight);\n } else {\n if (\n u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\n u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET\n ) {\n float mapboxZoomScale = 4.0 / pow(2.0, 21.0 - u_Zoom);\n raisingHeight = u_raisingHeight * mapboxZoomScale;\n }\n }\n\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, raisingHeight, 1.0));\n\n gl_PointSize = a_Size * 2.0 * u_DevicePixelRatio;\n setPickingColor(a_PickingColor);\n}\n";
|
|
20
|
+
class ImageModel extends _BaseModel.default {
|
|
21
|
+
constructor(...args) {
|
|
22
|
+
super(...args);
|
|
23
|
+
(0, _defineProperty2.default)(this, "texture", void 0);
|
|
24
|
+
// 通过碰撞检测的 feature id 集合,由 filterImages() 填充;null 表示不启用过滤(allowOverlap: true)
|
|
25
|
+
(0, _defineProperty2.default)(this, "imageFilterMap", null);
|
|
26
|
+
(0, _defineProperty2.default)(this, "currentZoom", -1);
|
|
27
|
+
(0, _defineProperty2.default)(this, "extent", void 0);
|
|
28
|
+
(0, _defineProperty2.default)(this, "preAllowOverlap", true);
|
|
29
|
+
(0, _defineProperty2.default)(this, "updateTexture", () => {
|
|
30
|
+
const {
|
|
31
|
+
createTexture2D
|
|
32
|
+
} = this.rendererService;
|
|
33
|
+
if (this.texture) {
|
|
34
|
+
this.texture.update({
|
|
35
|
+
data: this.iconService.getCanvas(),
|
|
36
|
+
mag: 'linear',
|
|
37
|
+
min: 'linear mipmap nearest',
|
|
38
|
+
mipmap: true
|
|
39
|
+
});
|
|
40
|
+
// 更新完纹理后在更新的图层的时候需要更新所有的图层
|
|
41
|
+
// this.layer.layerModelNeedUpdate = true;
|
|
42
|
+
setTimeout(() => {
|
|
43
|
+
// 延迟渲染
|
|
44
|
+
this.layerService.throttleRenderLayers();
|
|
45
|
+
});
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
this.texture = createTexture2D({
|
|
49
|
+
data: this.iconService.getCanvas(),
|
|
50
|
+
mag: _l7Core.gl.LINEAR,
|
|
51
|
+
min: _l7Core.gl.LINEAR_MIPMAP_LINEAR,
|
|
52
|
+
premultiplyAlpha: false,
|
|
53
|
+
width: 1024,
|
|
54
|
+
height: this.iconService.canvasHeight || 128,
|
|
55
|
+
mipmap: true
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
get attributeLocation() {
|
|
60
|
+
return Object.assign(super.attributeLocation, {
|
|
61
|
+
MAX: super.attributeLocation.MAX,
|
|
62
|
+
SIZE: 9,
|
|
63
|
+
UV: 10
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
getUninforms() {
|
|
67
|
+
// ThreeJS 图层兼容
|
|
68
|
+
if (this.rendererService.getDirty()) {
|
|
69
|
+
var _this$texture;
|
|
70
|
+
(_this$texture = this.texture) === null || _this$texture === void 0 || _this$texture.bind();
|
|
71
|
+
}
|
|
72
|
+
const commonInfo = this.getCommonUniformsInfo();
|
|
73
|
+
const attributeInfo = this.getUniformsBufferInfo(this.getStyleAttribute());
|
|
74
|
+
this.updateStyleUnifoms();
|
|
75
|
+
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, commonInfo.uniformsOption), attributeInfo.uniformsOption);
|
|
76
|
+
}
|
|
77
|
+
getCommonUniformsInfo() {
|
|
78
|
+
const {
|
|
79
|
+
raisingHeight = 0,
|
|
80
|
+
heightfixed = false
|
|
81
|
+
} = this.layer.getLayerConfig();
|
|
82
|
+
const commonOptions = {
|
|
83
|
+
u_textSize: [1024, this.iconService.canvasHeight || 128],
|
|
84
|
+
u_raisingHeight: Number(raisingHeight),
|
|
85
|
+
u_heightfixed: Number(heightfixed),
|
|
86
|
+
u_texture: this.texture
|
|
87
|
+
};
|
|
88
|
+
this.textures = [this.texture];
|
|
89
|
+
const commonBufferInfo = this.getUniformsBufferInfo(commonOptions);
|
|
90
|
+
return commonBufferInfo;
|
|
91
|
+
}
|
|
92
|
+
initModels() {
|
|
93
|
+
var _this = this;
|
|
94
|
+
return (0, _asyncToGenerator2.default)(function* () {
|
|
95
|
+
const {
|
|
96
|
+
allowOverlap = true
|
|
97
|
+
} = _this.layer.getLayerConfig();
|
|
98
|
+
_this.extent = _this.imageExtent();
|
|
99
|
+
_this.preAllowOverlap = allowOverlap;
|
|
100
|
+
_this.iconService.on('imageUpdate', _this.updateTexture);
|
|
101
|
+
_this.updateTexture();
|
|
102
|
+
return _this.buildModels();
|
|
103
|
+
})();
|
|
104
|
+
}
|
|
105
|
+
buildModels() {
|
|
106
|
+
var _this2 = this;
|
|
107
|
+
return (0, _asyncToGenerator2.default)(function* () {
|
|
108
|
+
const {
|
|
109
|
+
allowOverlap = true
|
|
110
|
+
} = _this2.layer.getLayerConfig();
|
|
111
|
+
_this2.initUniformsBuffer();
|
|
112
|
+
if (!allowOverlap) {
|
|
113
|
+
_this2.filterImages();
|
|
114
|
+
} else {
|
|
115
|
+
// 允许压盖时置 null,PointImageTriangulation 检测到 null 则跳过过滤
|
|
116
|
+
_this2.imageFilterMap = null;
|
|
117
|
+
}
|
|
118
|
+
const model = yield _this2.layer.buildLayerModel({
|
|
119
|
+
moduleName: 'pointImage',
|
|
120
|
+
vertexShader: pointImageVert,
|
|
121
|
+
fragmentShader: pointImageFrag,
|
|
122
|
+
// 绑定 this,让 PointImageTriangulation 能读取 imageFilterMap
|
|
123
|
+
triangulation: _triangulation.PointImageTriangulation.bind(_this2),
|
|
124
|
+
defines: _this2.getDefines(),
|
|
125
|
+
inject: _this2.getInject(),
|
|
126
|
+
depth: {
|
|
127
|
+
enable: false
|
|
128
|
+
},
|
|
129
|
+
primitive: _l7Core.gl.POINTS
|
|
130
|
+
});
|
|
131
|
+
return [model];
|
|
132
|
+
})();
|
|
133
|
+
}
|
|
134
|
+
needUpdate() {
|
|
135
|
+
var _this3 = this;
|
|
136
|
+
return (0, _asyncToGenerator2.default)(function* () {
|
|
137
|
+
const {
|
|
138
|
+
allowOverlap = true
|
|
139
|
+
} = _this3.layer.getLayerConfig();
|
|
140
|
+
|
|
141
|
+
// allowOverlap 开关发生变化时,强制重建
|
|
142
|
+
if (allowOverlap !== _this3.preAllowOverlap) {
|
|
143
|
+
_this3.preAllowOverlap = allowOverlap;
|
|
144
|
+
yield _this3.reBuildModel();
|
|
145
|
+
return true;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// 允许压盖时无需每帧检测
|
|
149
|
+
if (allowOverlap) {
|
|
150
|
+
return false;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// 不允许压盖时,zoom 变化 >0.5 或视野超出上次范围则重算碰撞
|
|
154
|
+
const zoom = _this3.mapService.getZoom();
|
|
155
|
+
const extent = _this3.mapService.getBounds();
|
|
156
|
+
const flag = (0, _l7Utils.boundsContains)(_this3.extent, extent);
|
|
157
|
+
if (Math.abs(_this3.currentZoom - zoom) > 0.5 || !flag) {
|
|
158
|
+
yield _this3.reBuildModel();
|
|
159
|
+
return true;
|
|
160
|
+
}
|
|
161
|
+
return false;
|
|
162
|
+
})();
|
|
163
|
+
}
|
|
164
|
+
clearModels() {
|
|
165
|
+
var _this$texture2;
|
|
166
|
+
(_this$texture2 = this.texture) === null || _this$texture2 === void 0 || _this$texture2.destroy();
|
|
167
|
+
this.iconService.off('imageUpdate', this.updateTexture);
|
|
168
|
+
}
|
|
169
|
+
registerBuiltinAttributes() {
|
|
170
|
+
// 注册 Position 属性 64 位地位部分,经纬度数据开启双精度,避免大于 20层级以上出现数据偏移
|
|
171
|
+
this.registerPosition64LowAttribute();
|
|
172
|
+
|
|
173
|
+
// point layer size;
|
|
174
|
+
this.styleAttributeService.registerStyleAttribute({
|
|
175
|
+
name: 'size',
|
|
176
|
+
type: _l7Core.AttributeType.Attribute,
|
|
177
|
+
descriptor: {
|
|
178
|
+
name: 'a_Size',
|
|
179
|
+
shaderLocation: this.attributeLocation.SIZE,
|
|
180
|
+
buffer: {
|
|
181
|
+
// give the WebGL driver a hint that this buffer may change
|
|
182
|
+
usage: _l7Core.gl.DYNAMIC_DRAW,
|
|
183
|
+
data: [],
|
|
184
|
+
type: _l7Core.gl.FLOAT
|
|
185
|
+
},
|
|
186
|
+
size: 1,
|
|
187
|
+
update: feature => {
|
|
188
|
+
const {
|
|
189
|
+
size = 5
|
|
190
|
+
} = feature;
|
|
191
|
+
return Array.isArray(size) ? [size[0]] : [size];
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
// point layer uv;
|
|
197
|
+
this.styleAttributeService.registerStyleAttribute({
|
|
198
|
+
name: 'uv',
|
|
199
|
+
type: _l7Core.AttributeType.Attribute,
|
|
200
|
+
descriptor: {
|
|
201
|
+
name: 'a_Uv',
|
|
202
|
+
shaderLocation: this.attributeLocation.UV,
|
|
203
|
+
buffer: {
|
|
204
|
+
// give the WebGL driver a hint that this buffer may change
|
|
205
|
+
usage: _l7Core.gl.DYNAMIC_DRAW,
|
|
206
|
+
data: [],
|
|
207
|
+
type: _l7Core.gl.FLOAT
|
|
208
|
+
},
|
|
209
|
+
size: 2,
|
|
210
|
+
update: feature => {
|
|
211
|
+
const iconMap = this.iconService.getIconMap();
|
|
212
|
+
const {
|
|
213
|
+
shape
|
|
214
|
+
} = feature;
|
|
215
|
+
const {
|
|
216
|
+
x,
|
|
217
|
+
y
|
|
218
|
+
} = iconMap[shape] || {
|
|
219
|
+
x: -64,
|
|
220
|
+
y: -64
|
|
221
|
+
}; // 非画布区域,默认的图标改为透明
|
|
222
|
+
return [x, y];
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* 图标碰撞避让:遍历所有 feature,在屏幕空间做 AABB 碰撞检测,
|
|
230
|
+
* 将通过检测的 feature id 写入 imageFilterMap。
|
|
231
|
+
* PointImageTriangulation 绑定 this 后,会跳过不在 map 中的 feature。
|
|
232
|
+
*/
|
|
233
|
+
filterImages() {
|
|
234
|
+
const {
|
|
235
|
+
padding = [0, 0]
|
|
236
|
+
} = this.layer.getLayerConfig();
|
|
237
|
+
this.imageFilterMap = {};
|
|
238
|
+
this.currentZoom = this.mapService.getZoom();
|
|
239
|
+
this.extent = this.imageExtent();
|
|
240
|
+
const {
|
|
241
|
+
width,
|
|
242
|
+
height
|
|
243
|
+
} = this.rendererService.getViewportSize();
|
|
244
|
+
const collisionIndex = new _collisionIndex.default(width, height);
|
|
245
|
+
const data = this.layer.getEncodedData();
|
|
246
|
+
data.forEach(feature => {
|
|
247
|
+
const {
|
|
248
|
+
id = 0,
|
|
249
|
+
size = 5
|
|
250
|
+
} = feature;
|
|
251
|
+
const iconSize = Array.isArray(size) ? size[0] : size;
|
|
252
|
+
const centroid = (0, _l7Utils.calculateCentroid)(feature.coordinates);
|
|
253
|
+
const pixels = this.mapService.lngLatToContainer(centroid);
|
|
254
|
+
const {
|
|
255
|
+
box
|
|
256
|
+
} = collisionIndex.placeCollisionBox({
|
|
257
|
+
x1: -iconSize - padding[0],
|
|
258
|
+
x2: iconSize + padding[0],
|
|
259
|
+
y1: -iconSize - padding[1],
|
|
260
|
+
y2: iconSize + padding[1],
|
|
261
|
+
anchorPointX: pixels.x,
|
|
262
|
+
anchorPointY: pixels.y
|
|
263
|
+
});
|
|
264
|
+
if (box && box.length) {
|
|
265
|
+
collisionIndex.insertCollisionBox(box, id);
|
|
266
|
+
this.imageFilterMap[id] = true;
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
imageExtent() {
|
|
271
|
+
const bounds = this.mapService.getBounds();
|
|
272
|
+
return (0, _l7Utils.padBounds)(bounds, 0.5);
|
|
273
|
+
}
|
|
274
|
+
reBuildModel() {
|
|
275
|
+
var _this4 = this;
|
|
276
|
+
return (0, _asyncToGenerator2.default)(function* () {
|
|
277
|
+
const {
|
|
278
|
+
allowOverlap = true
|
|
279
|
+
} = _this4.layer.getLayerConfig();
|
|
280
|
+
if (!allowOverlap) {
|
|
281
|
+
_this4.filterImages();
|
|
282
|
+
} else {
|
|
283
|
+
_this4.imageFilterMap = null; // 允许压盖:清空过滤表,全量渲染
|
|
284
|
+
}
|
|
285
|
+
const model = yield _this4.layer.buildLayerModel({
|
|
286
|
+
moduleName: 'pointImage',
|
|
287
|
+
vertexShader: pointImageVert,
|
|
288
|
+
fragmentShader: pointImageFrag,
|
|
289
|
+
triangulation: _triangulation.PointImageTriangulation.bind(_this4),
|
|
290
|
+
defines: _this4.getDefines(),
|
|
291
|
+
inject: _this4.getInject(),
|
|
292
|
+
depth: {
|
|
293
|
+
enable: false
|
|
294
|
+
},
|
|
295
|
+
primitive: _l7Core.gl.POINTS
|
|
296
|
+
});
|
|
297
|
+
_this4.layer.models = [model];
|
|
298
|
+
})();
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
exports.default = ImageModel;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _billboard_point = _interopRequireDefault(require("./billboard_point"));
|
|
9
|
+
var _earthExtrude = _interopRequireDefault(require("./earthExtrude"));
|
|
10
|
+
var _earthFill = _interopRequireDefault(require("./earthFill"));
|
|
11
|
+
var _extrude = _interopRequireDefault(require("./extrude"));
|
|
12
|
+
var _fill = _interopRequireDefault(require("./fill"));
|
|
13
|
+
var _fillImage = _interopRequireDefault(require("./fillImage"));
|
|
14
|
+
var _image = _interopRequireDefault(require("./image"));
|
|
15
|
+
var _normal = _interopRequireDefault(require("./normal"));
|
|
16
|
+
var _radar = _interopRequireDefault(require("./radar"));
|
|
17
|
+
var _text = _interopRequireDefault(require("./text"));
|
|
18
|
+
// earth
|
|
19
|
+
|
|
20
|
+
const PointModels = {
|
|
21
|
+
fillImage: _fillImage.default,
|
|
22
|
+
fill: _fill.default,
|
|
23
|
+
radar: _radar.default,
|
|
24
|
+
image: _image.default,
|
|
25
|
+
normal: _normal.default,
|
|
26
|
+
simplePoint: _billboard_point.default,
|
|
27
|
+
extrude: _extrude.default,
|
|
28
|
+
text: _text.default,
|
|
29
|
+
earthFill: _earthFill.default,
|
|
30
|
+
earthExtrude: _earthExtrude.default
|
|
31
|
+
};
|
|
32
|
+
var _default = exports.default = PointModels;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { IEncodeFeature, IModel } from '@antv/l7-core';
|
|
2
|
+
import BaseModel from '../../core/BaseModel';
|
|
3
|
+
import type { IPointLayerStyleOptions } from '../../core/interface';
|
|
4
|
+
export declare function PointTriangulation(feature: IEncodeFeature): {
|
|
5
|
+
vertices: number[];
|
|
6
|
+
indices: number[];
|
|
7
|
+
size: number;
|
|
8
|
+
};
|
|
9
|
+
export default class NormalModel extends BaseModel {
|
|
10
|
+
protected get attributeLocation(): {
|
|
11
|
+
readonly POSITION: 0;
|
|
12
|
+
readonly POSITION_64LOW: 1;
|
|
13
|
+
readonly COLOR: 2;
|
|
14
|
+
readonly PICKING_COLOR: 3;
|
|
15
|
+
readonly STROKE: 4;
|
|
16
|
+
readonly OPACITY: 5;
|
|
17
|
+
readonly OFFSETS: 6;
|
|
18
|
+
readonly ROTATION: 7;
|
|
19
|
+
readonly MAX: 8;
|
|
20
|
+
} & Record<string, number> & {
|
|
21
|
+
MAX: 8;
|
|
22
|
+
SIZE: number;
|
|
23
|
+
};
|
|
24
|
+
getDefaultStyle(): Partial<IPointLayerStyleOptions>;
|
|
25
|
+
protected getCommonUniformsInfo(): {
|
|
26
|
+
uniformsArray: number[];
|
|
27
|
+
uniformsLength: number;
|
|
28
|
+
uniformsOption: {
|
|
29
|
+
[key: string]: any;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
initModels(): Promise<IModel[]>;
|
|
33
|
+
buildModels(): Promise<IModel[]>;
|
|
34
|
+
clearModels(): void;
|
|
35
|
+
protected registerBuiltinAttributes(): void;
|
|
36
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.PointTriangulation = PointTriangulation;
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
|
+
var _l7Core = require("@antv/l7-core");
|
|
11
|
+
var _BaseModel = _interopRequireDefault(require("../../core/BaseModel"));
|
|
12
|
+
/* babel-plugin-inline-import '../shaders/normal/normal_frag.glsl' */
|
|
13
|
+
const normalFrag = "in vec4 v_color;\nout vec4 outputColor;\nvoid main() {\n outputColor = v_color;\n}\n";
|
|
14
|
+
/* babel-plugin-inline-import '../shaders/normal/normal_vert.glsl' */
|
|
15
|
+
const normalVert = "layout(location = ATTRIBUTE_LOCATION_POSITION) in vec3 a_Position;\nlayout(location = ATTRIBUTE_LOCATION_POSITION_64LOW) in vec2 a_Position64Low;\nlayout(location = ATTRIBUTE_LOCATION_COLOR) in vec4 a_Color;\nlayout(location = ATTRIBUTE_LOCATION_SIZE) in float a_Size;\n\nlayout(std140) uniform u_Common {\n float u_size_scale;\n};\n\nout vec4 v_color;\n\n#pragma include \"projection\"\n#pragma include \"project\"\n\nvoid main() {\n v_color = vec4(a_Color.xyz, a_Color.w * opacity);\n\n vec4 project_pos = project_position(vec4(a_Position, 1.0), a_Position64Low);\n gl_Position = project_common_position_to_clipspace(project_pos);\n\n gl_PointSize = a_Size * u_size_scale * 2.0 * u_DevicePixelRatio;\n}\n";
|
|
16
|
+
function PointTriangulation(feature) {
|
|
17
|
+
const coordinates = feature.coordinates;
|
|
18
|
+
return {
|
|
19
|
+
vertices: [...coordinates],
|
|
20
|
+
indices: [0],
|
|
21
|
+
size: coordinates.length
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
class NormalModel extends _BaseModel.default {
|
|
25
|
+
get attributeLocation() {
|
|
26
|
+
return Object.assign(super.attributeLocation, {
|
|
27
|
+
MAX: super.attributeLocation.MAX,
|
|
28
|
+
SIZE: 9
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
getDefaultStyle() {
|
|
32
|
+
return {
|
|
33
|
+
blend: 'additive'
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
getCommonUniformsInfo() {
|
|
37
|
+
const commonOptions = {
|
|
38
|
+
u_size_scale: 0.5
|
|
39
|
+
};
|
|
40
|
+
const commonBufferInfo = this.getUniformsBufferInfo(commonOptions);
|
|
41
|
+
return commonBufferInfo;
|
|
42
|
+
}
|
|
43
|
+
initModels() {
|
|
44
|
+
var _this = this;
|
|
45
|
+
return (0, _asyncToGenerator2.default)(function* () {
|
|
46
|
+
return _this.buildModels();
|
|
47
|
+
})();
|
|
48
|
+
}
|
|
49
|
+
buildModels() {
|
|
50
|
+
var _this2 = this;
|
|
51
|
+
return (0, _asyncToGenerator2.default)(function* () {
|
|
52
|
+
_this2.layer.triangulation = PointTriangulation;
|
|
53
|
+
_this2.initUniformsBuffer();
|
|
54
|
+
const model = yield _this2.layer.buildLayerModel({
|
|
55
|
+
moduleName: 'pointNormal',
|
|
56
|
+
vertexShader: normalVert,
|
|
57
|
+
fragmentShader: normalFrag,
|
|
58
|
+
triangulation: PointTriangulation,
|
|
59
|
+
defines: _this2.getDefines(),
|
|
60
|
+
inject: _this2.getInject(),
|
|
61
|
+
depth: {
|
|
62
|
+
enable: false
|
|
63
|
+
},
|
|
64
|
+
primitive: _l7Core.gl.POINTS,
|
|
65
|
+
pick: false
|
|
66
|
+
});
|
|
67
|
+
return [model];
|
|
68
|
+
})();
|
|
69
|
+
}
|
|
70
|
+
clearModels() {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
registerBuiltinAttributes() {
|
|
74
|
+
// 注册 Position 属性 64 位地位部分,经纬度数据开启双精度,避免大于 20层级以上出现数据偏移
|
|
75
|
+
this.registerPosition64LowAttribute();
|
|
76
|
+
this.styleAttributeService.registerStyleAttribute({
|
|
77
|
+
name: 'size',
|
|
78
|
+
type: _l7Core.AttributeType.Attribute,
|
|
79
|
+
descriptor: {
|
|
80
|
+
name: 'a_Size',
|
|
81
|
+
shaderLocation: this.attributeLocation.SIZE,
|
|
82
|
+
buffer: {
|
|
83
|
+
usage: _l7Core.gl.DYNAMIC_DRAW,
|
|
84
|
+
data: [],
|
|
85
|
+
type: _l7Core.gl.FLOAT
|
|
86
|
+
},
|
|
87
|
+
size: 1,
|
|
88
|
+
update: feature => {
|
|
89
|
+
const {
|
|
90
|
+
size = 1
|
|
91
|
+
} = feature;
|
|
92
|
+
return Array.isArray(size) ? [size[0]] : [size];
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
exports.default = NormalModel;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { IAnimateOption, IAttribute, IElements, IModel, IModelUniform } from '@antv/l7-core';
|
|
2
|
+
import BaseModel from '../../core/BaseModel';
|
|
3
|
+
export default class RadarModel extends BaseModel {
|
|
4
|
+
protected get attributeLocation(): {
|
|
5
|
+
readonly POSITION: 0;
|
|
6
|
+
readonly POSITION_64LOW: 1;
|
|
7
|
+
readonly COLOR: 2;
|
|
8
|
+
readonly PICKING_COLOR: 3;
|
|
9
|
+
readonly STROKE: 4;
|
|
10
|
+
readonly OPACITY: 5;
|
|
11
|
+
readonly OFFSETS: 6;
|
|
12
|
+
readonly ROTATION: 7;
|
|
13
|
+
readonly MAX: 8;
|
|
14
|
+
} & Record<string, number> & {
|
|
15
|
+
MAX: 8;
|
|
16
|
+
SIZE: number;
|
|
17
|
+
EXTRUDE: number;
|
|
18
|
+
};
|
|
19
|
+
protected getCommonUniformsInfo(): {
|
|
20
|
+
uniformsArray: number[];
|
|
21
|
+
uniformsLength: number;
|
|
22
|
+
uniformsOption: {
|
|
23
|
+
[key: string]: any;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
getAnimateUniforms(): IModelUniform;
|
|
27
|
+
getAttribute(): {
|
|
28
|
+
attributes: {
|
|
29
|
+
[attributeName: string]: IAttribute;
|
|
30
|
+
};
|
|
31
|
+
elements: IElements;
|
|
32
|
+
};
|
|
33
|
+
initModels(): Promise<IModel[]>;
|
|
34
|
+
buildModels(): Promise<IModel[]>;
|
|
35
|
+
protected animateOption2Array(option: Partial<IAnimateOption>): number[];
|
|
36
|
+
protected registerBuiltinAttributes(): void;
|
|
37
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
9
|
+
var _l7Core = require("@antv/l7-core");
|
|
10
|
+
var _BaseModel = _interopRequireDefault(require("../../core/BaseModel"));
|
|
11
|
+
var _interface = require("../../core/interface");
|
|
12
|
+
var _triangulation = require("../../core/triangulation");
|
|
13
|
+
/* babel-plugin-inline-import '../shaders/radar/radar_frag.glsl' */
|
|
14
|
+
const pointFillFrag = "\nlayout(std140) uniform commonUniorm{\n float u_additive;\n float u_size_unit;\n float u_speed: 1.0;\n float u_time;\n};\nin vec4 v_data;\nin vec4 v_color;\nin float v_radius;\nin vec2 v_extrude;\n#pragma include \"sdf_2d\"\n#pragma include \"picking\"\n\nout vec4 outputColor;\n\nvoid main() {\n\n lowp float antialiasblur = v_data.z;\n float r = v_radius / (v_radius);\n\n float outer_df = sdCircle(v_data.xy, 1.0);\n float inner_df = sdCircle(v_data.xy, r);\n\n float opacity_t = smoothstep(0.0, antialiasblur, outer_df);\n\n outputColor = vec4(v_color.rgb, v_color.a);\n\n if(u_additive > 0.0) {\n outputColor *= opacity_t;\n } else {\n outputColor.a *= opacity_t;\n }\n\n if(outputColor.a > 0.0) {\n outputColor = filterColor(outputColor);\n }\n\n vec2 extrude = v_extrude;\n vec2 dir = normalize(extrude);\n vec2 baseDir = vec2(1.0, 0.0);\n float pi = 3.14159265359;\n float flag = sign(dir.y);\n float rades = dot(dir, baseDir);\n float radar_v = (flag - 1.0) * -0.5 * acos(rades)/pi;\n // simple AA\n if(radar_v > 0.99) {\n radar_v = 1.0 - (radar_v - 0.99)/0.01;\n }\n\n outputColor.a *= radar_v;\n}\n";
|
|
15
|
+
/* babel-plugin-inline-import '../shaders/radar/radar_vert.glsl' */
|
|
16
|
+
const pointFillVert = "layout(location = ATTRIBUTE_LOCATION_POSITION) in vec3 a_Position;\nlayout(location = ATTRIBUTE_LOCATION_POSITION_64LOW) in vec2 a_Position64Low;\nlayout(location = ATTRIBUTE_LOCATION_COLOR) in vec4 a_Color;\nlayout(location = ATTRIBUTE_LOCATION_SIZE) in float a_Size;\nlayout(location = ATTRIBUTE_LOCATION_EXTRUDE) in vec3 a_Extrude;\n\nlayout(std140) uniform commonUniorm {\n float u_additive;\n float u_size_unit;\n float u_speed: 1.0;\n float u_time;\n};\n\nout vec4 v_data;\nout vec4 v_color;\nout float v_radius;\nout vec2 v_extrude;\n\n#pragma include \"projection\"\n#pragma include \"picking\"\n\nvoid main() {\n float newSize = setPickingSize(a_Size);\n\n float time = u_time * u_speed;\n mat2 rotateMatrix = mat2(\n cos(time), sin(time),\n -sin(time), cos(time)\n );\n v_extrude = rotateMatrix * a_Extrude.xy;\n\n v_color = a_Color;\n v_color.a *= opacity;\n\n float blur = 0.0;\n float antialiasblur = -max(2.0 / u_DevicePixelRatio / a_Size, blur);\n\n if(u_size_unit == 1.) {\n newSize = newSize * u_PixelsPerMeter.z;\n }\n v_radius = newSize;\n\n vec2 offset = (a_Extrude.xy * (newSize));\n\n offset = project_pixel(offset);\n\n v_data = vec4(a_Extrude.x, a_Extrude.y, antialiasblur, -1.0);\n\n vec4 project_pos = project_position(vec4(a_Position.xy, 0.0, 1.0), a_Position64Low);\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, project_pixel(setPickingOrder(0.0)), 1.0));\n\n setPickingColor(a_PickingColor);\n}\n";
|
|
17
|
+
class RadarModel extends _BaseModel.default {
|
|
18
|
+
get attributeLocation() {
|
|
19
|
+
return Object.assign(super.attributeLocation, {
|
|
20
|
+
MAX: super.attributeLocation.MAX,
|
|
21
|
+
SIZE: 9,
|
|
22
|
+
EXTRUDE: 10
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
getCommonUniformsInfo() {
|
|
26
|
+
const {
|
|
27
|
+
blend,
|
|
28
|
+
speed = 1,
|
|
29
|
+
unit = 'pixel'
|
|
30
|
+
} = this.layer.getLayerConfig();
|
|
31
|
+
const commonOptions = {
|
|
32
|
+
u_additive: blend === 'additive' ? 1.0 : 0.0,
|
|
33
|
+
u_size_unit: _interface.SizeUnitType[unit],
|
|
34
|
+
u_speed: speed,
|
|
35
|
+
u_time: this.layer.getLayerAnimateTime()
|
|
36
|
+
}; //1+1+1+1
|
|
37
|
+
const commonBufferInfo = this.getUniformsBufferInfo(commonOptions);
|
|
38
|
+
return commonBufferInfo;
|
|
39
|
+
}
|
|
40
|
+
getAnimateUniforms() {
|
|
41
|
+
return {};
|
|
42
|
+
}
|
|
43
|
+
getAttribute() {
|
|
44
|
+
return this.styleAttributeService.createAttributesAndIndices(this.layer.getEncodedData(), _triangulation.PointFillTriangulation);
|
|
45
|
+
}
|
|
46
|
+
initModels() {
|
|
47
|
+
var _this = this;
|
|
48
|
+
return (0, _asyncToGenerator2.default)(function* () {
|
|
49
|
+
return _this.buildModels();
|
|
50
|
+
})();
|
|
51
|
+
}
|
|
52
|
+
buildModels() {
|
|
53
|
+
var _this2 = this;
|
|
54
|
+
return (0, _asyncToGenerator2.default)(function* () {
|
|
55
|
+
_this2.initUniformsBuffer();
|
|
56
|
+
const model = yield _this2.layer.buildLayerModel({
|
|
57
|
+
moduleName: 'pointRadar',
|
|
58
|
+
vertexShader: pointFillVert,
|
|
59
|
+
fragmentShader: pointFillFrag,
|
|
60
|
+
triangulation: _triangulation.PointFillTriangulation,
|
|
61
|
+
defines: _this2.getDefines(),
|
|
62
|
+
inject: _this2.getInject(),
|
|
63
|
+
depth: {
|
|
64
|
+
enable: false
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
return [model];
|
|
68
|
+
})();
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// overwrite baseModel func
|
|
72
|
+
animateOption2Array(option) {
|
|
73
|
+
return [option.enable ? 0 : 1.0, option.speed || 1, option.rings || 3, 0];
|
|
74
|
+
}
|
|
75
|
+
registerBuiltinAttributes() {
|
|
76
|
+
// 注册 Position 属性 64 位地位部分,经纬度数据开启双精度,避免大于 20层级以上出现数据偏移
|
|
77
|
+
this.registerPosition64LowAttribute();
|
|
78
|
+
this.styleAttributeService.registerStyleAttribute({
|
|
79
|
+
name: 'extrude',
|
|
80
|
+
type: _l7Core.AttributeType.Attribute,
|
|
81
|
+
descriptor: {
|
|
82
|
+
name: 'a_Extrude',
|
|
83
|
+
shaderLocation: this.attributeLocation.EXTRUDE,
|
|
84
|
+
buffer: {
|
|
85
|
+
// give the WebGL driver a hint that this buffer may change
|
|
86
|
+
usage: _l7Core.gl.DYNAMIC_DRAW,
|
|
87
|
+
data: [],
|
|
88
|
+
type: _l7Core.gl.FLOAT
|
|
89
|
+
},
|
|
90
|
+
size: 3,
|
|
91
|
+
update: (feature, featureIdx, vertex, attributeIdx) => {
|
|
92
|
+
const extrude = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, -1, 0];
|
|
93
|
+
const extrudeIndex = attributeIdx % 4 * 3;
|
|
94
|
+
return [extrude[extrudeIndex], extrude[extrudeIndex + 1], extrude[extrudeIndex + 2]];
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
// point layer size;
|
|
100
|
+
this.styleAttributeService.registerStyleAttribute({
|
|
101
|
+
name: 'size',
|
|
102
|
+
type: _l7Core.AttributeType.Attribute,
|
|
103
|
+
descriptor: {
|
|
104
|
+
shaderLocation: this.attributeLocation.SIZE,
|
|
105
|
+
name: 'a_Size',
|
|
106
|
+
buffer: {
|
|
107
|
+
// give the WebGL driver a hint that this buffer may change
|
|
108
|
+
usage: _l7Core.gl.DYNAMIC_DRAW,
|
|
109
|
+
data: [],
|
|
110
|
+
type: _l7Core.gl.FLOAT
|
|
111
|
+
},
|
|
112
|
+
size: 1,
|
|
113
|
+
update: feature => {
|
|
114
|
+
const {
|
|
115
|
+
size = 5
|
|
116
|
+
} = feature;
|
|
117
|
+
return Array.isArray(size) ? [size[0]] : [size];
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
exports.default = RadarModel;
|