@antv/l7-layers 2.9.32-alpha.2 → 2.9.32-alpha.4
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 +32 -0
- package/es/Geometry/index.js +118 -0
- package/es/Geometry/models/billboard.d.ts +26 -0
- package/es/Geometry/models/billboard.js +228 -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 +45 -0
- package/es/Geometry/models/plane.js +419 -0
- package/es/Geometry/models/sprite.d.ts +47 -0
- package/es/Geometry/models/sprite.js +301 -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 +23 -0
- package/es/canvas/index.js +121 -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 +17 -0
- package/es/citybuliding/building.js +86 -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 +224 -0
- package/es/core/BaseLayer.js +1415 -0
- package/es/core/BaseModel.d.ts +140 -0
- package/es/core/BaseModel.js +489 -0
- package/es/core/interface.d.ts +221 -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 +128 -0
- package/es/core/triangulation.js +553 -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 +21 -0
- package/es/heatmap/index.js +141 -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 +463 -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 +19 -0
- package/es/image/index.js +104 -0
- package/es/image/models/dataImage.d.ts +22 -0
- package/es/image/models/dataImage.js +200 -0
- package/es/image/models/image.d.ts +19 -0
- package/es/image/models/image.js +164 -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 +19 -0
- package/es/image/models/tileDataImage.js +174 -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 +43 -0
- package/es/line/index.js +140 -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 +27 -0
- package/es/mask/index.js +153 -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 +5 -0
- package/es/mask/shaders/mask_vert.glsl +16 -0
- package/es/plugins/DataMappingPlugin.d.ts +19 -0
- package/es/plugins/DataMappingPlugin.js +420 -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 +340 -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 +156 -0
- package/es/plugins/ShaderUniformPlugin.d.ts +17 -0
- package/es/plugins/ShaderUniformPlugin.js +107 -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 +40 -0
- package/es/point/index.js +229 -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 +27 -0
- package/es/polygon/index.js +146 -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 +202 -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 +179 -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 +19 -0
- package/es/raster/index.js +103 -0
- package/es/raster/models/index.d.ts +5 -0
- package/es/raster/models/index.js +8 -0
- package/es/raster/models/raster.d.ts +21 -0
- package/es/raster/models/raster.js +168 -0
- package/es/raster/models/rasterTile.d.ts +18 -0
- package/es/raster/models/rasterTile.js +140 -0
- package/es/raster/raster.d.ts +30 -0
- package/es/raster/raster.js +174 -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_vert.glsl +44 -0
- package/es/shader/minify_frag.glsl +7 -0
- package/es/shader/minify_picking_frag.glsl +10 -0
- package/es/tile/interface.d.ts +29 -0
- package/es/tile/interface.js +1 -0
- package/es/tile/manager/baseMapTileLayerManager.d.ts +7 -0
- package/es/tile/manager/baseMapTileLayerManager.js +119 -0
- package/es/tile/manager/baseTileManager.d.ts +27 -0
- package/es/tile/manager/baseTileManager.js +107 -0
- package/es/tile/manager/tileConfigManager.d.ts +17 -0
- package/es/tile/manager/tileConfigManager.js +121 -0
- package/es/tile/manager/tileLayerManager.d.ts +15 -0
- package/es/tile/manager/tileLayerManager.js +255 -0
- package/es/tile/manager/tilePickerManager.d.ts +21 -0
- package/es/tile/manager/tilePickerManager.js +194 -0
- package/es/tile/models/tileModel.d.ts +10 -0
- package/es/tile/models/tileModel.js +81 -0
- package/es/tile/tileFactory/base.d.ts +44 -0
- package/es/tile/tileFactory/base.js +472 -0
- package/es/tile/tileFactory/index.d.ts +5 -0
- package/es/tile/tileFactory/index.js +34 -0
- package/es/tile/tileFactory/line.d.ts +12 -0
- package/es/tile/tileFactory/line.js +62 -0
- package/es/tile/tileFactory/point.d.ts +12 -0
- package/es/tile/tileFactory/point.js +63 -0
- package/es/tile/tileFactory/polygon.d.ts +12 -0
- package/es/tile/tileFactory/polygon.js +62 -0
- package/es/tile/tileFactory/raster.d.ts +12 -0
- package/es/tile/tileFactory/raster.js +58 -0
- package/es/tile/tileFactory/rasterData.d.ts +12 -0
- package/es/tile/tileFactory/rasterData.js +81 -0
- package/es/tile/tileFactory/rasterDataLayer.d.ts +19 -0
- package/es/tile/tileFactory/rasterDataLayer.js +85 -0
- package/es/tile/tileFactory/test.d.ts +12 -0
- package/es/tile/tileFactory/test.js +105 -0
- package/es/tile/tileFactory/vectorLayer.d.ts +35 -0
- package/es/tile/tileFactory/vectorLayer.js +260 -0
- package/es/tile/tileLayer/baseMapTileLayer.d.ts +30 -0
- package/es/tile/tileLayer/baseMapTileLayer.js +195 -0
- package/es/tile/tileLayer/baseTileLayer.d.ts +48 -0
- package/es/tile/tileLayer/baseTileLayer.js +420 -0
- package/es/tile/tileTest.d.ts +15 -0
- package/es/tile/tileTest.js +62 -0
- package/es/tile/tmsMapTileLayer.d.ts +7 -0
- package/es/tile/tmsMapTileLayer.js +97 -0
- package/es/tile/tmsTileLayer.d.ts +7 -0
- package/es/tile/tmsTileLayer.js +101 -0
- package/es/tile/utils.d.ts +19 -0
- package/es/tile/utils.js +209 -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 +150 -0
- package/es/utils/extrude_polyline.d.ts +67 -0
- package/es/utils/extrude_polyline.js +611 -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 +176 -0
- package/es/utils/multiPassRender.d.ts +16 -0
- package/es/utils/multiPassRender.js +50 -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 +20 -0
- package/es/wind/index.js +98 -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 +33 -0
- package/es/wind/models/wind.js +331 -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 +130 -0
- package/lib/Geometry/models/billboard.js +242 -0
- package/lib/Geometry/models/index.js +22 -0
- package/lib/Geometry/models/plane.js +434 -0
- package/lib/Geometry/models/sprite.js +315 -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 +133 -0
- package/lib/canvas/models/canvas.js +221 -0
- package/lib/canvas/models/index.js +16 -0
- package/lib/citybuliding/building.js +99 -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 +1410 -0
- package/lib/core/BaseModel.js +506 -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 +619 -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 +154 -0
- package/lib/heatmap/models/grid.js +120 -0
- package/lib/heatmap/models/grid3d.js +154 -0
- package/lib/heatmap/models/heatmap.js +486 -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 +117 -0
- package/lib/image/models/dataImage.js +215 -0
- package/lib/image/models/image.js +178 -0
- package/lib/image/models/index.js +22 -0
- package/lib/image/models/tileDataImage.js +188 -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 +152 -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 +168 -0
- package/lib/mask/models/fill.js +141 -0
- package/lib/mask/models/index.js +16 -0
- package/lib/mask/shaders/mask_vert.glsl +16 -0
- package/lib/plugins/DataMappingPlugin.js +434 -0
- package/lib/plugins/DataSourcePlugin.js +97 -0
- package/lib/plugins/FeatureScalePlugin.js +363 -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 +168 -0
- package/lib/plugins/ShaderUniformPlugin.js +120 -0
- package/lib/plugins/UpdateModelPlugin.js +42 -0
- package/lib/plugins/UpdateStyleAttributePlugin.js +94 -0
- package/lib/point/index.js +242 -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 +160 -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 +219 -0
- package/lib/polygon/models/tile.js +114 -0
- package/lib/polygon/models/water.js +196 -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 +116 -0
- package/lib/raster/models/index.js +20 -0
- package/lib/raster/models/raster.js +183 -0
- package/lib/raster/models/rasterTile.js +154 -0
- package/lib/raster/raster.js +191 -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_vert.glsl +44 -0
- package/lib/shader/minify_frag.glsl +7 -0
- package/lib/shader/minify_picking_frag.glsl +10 -0
- package/lib/tile/interface.js +5 -0
- package/lib/tile/manager/baseMapTileLayerManager.js +134 -0
- package/lib/tile/manager/baseTileManager.js +121 -0
- package/lib/tile/manager/tileConfigManager.js +133 -0
- package/lib/tile/manager/tileLayerManager.js +273 -0
- package/lib/tile/manager/tilePickerManager.js +205 -0
- package/lib/tile/models/tileModel.js +94 -0
- package/lib/tile/tileFactory/base.js +496 -0
- package/lib/tile/tileFactory/index.js +66 -0
- package/lib/tile/tileFactory/line.js +73 -0
- package/lib/tile/tileFactory/point.js +74 -0
- package/lib/tile/tileFactory/polygon.js +73 -0
- package/lib/tile/tileFactory/raster.js +71 -0
- package/lib/tile/tileFactory/rasterData.js +94 -0
- package/lib/tile/tileFactory/rasterDataLayer.js +98 -0
- package/lib/tile/tileFactory/test.js +118 -0
- package/lib/tile/tileFactory/vectorLayer.js +275 -0
- package/lib/tile/tileLayer/baseMapTileLayer.js +202 -0
- package/lib/tile/tileLayer/baseTileLayer.js +429 -0
- package/lib/tile/tileTest.js +74 -0
- package/lib/tile/tmsMapTileLayer.js +114 -0
- package/lib/tile/tmsTileLayer.js +118 -0
- package/lib/tile/utils.js +248 -0
- package/lib/utils/blend.js +65 -0
- package/lib/utils/collision-index.js +118 -0
- package/lib/utils/dataMappingStyle.js +154 -0
- package/lib/utils/extrude_polyline.js +653 -0
- package/lib/utils/grid-index.js +188 -0
- package/lib/utils/layerData.js +187 -0
- package/lib/utils/multiPassRender.js +61 -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 +111 -0
- package/lib/wind/models/index.js +16 -0
- package/lib/wind/models/utils.js +253 -0
- package/lib/wind/models/wind.js +346 -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,210 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
4
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
|
+
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
|
+
|
|
7
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
8
|
+
|
|
9
|
+
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; } }
|
|
10
|
+
|
|
11
|
+
import { AttributeType, gl } from '@antv/l7-core';
|
|
12
|
+
import { getMask, polygonFillTriangulation } from '@antv/l7-utils';
|
|
13
|
+
import { isNumber } from 'lodash';
|
|
14
|
+
import BaseModel from "../../core/BaseModel";
|
|
15
|
+
import { polygonTriangulationWithCenter } from "../../core/triangulation";
|
|
16
|
+
|
|
17
|
+
/* babel-plugin-inline-import '../shaders/polygon_frag.glsl' */
|
|
18
|
+
var polygon_frag = "uniform float u_opacity: 1.0;\nvarying vec4 v_color;\nvarying mat4 styleMappingMat; // \u4F20\u9012\u4ECE\u7247\u5143\u4E2D\u4F20\u9012\u7684\u6620\u5C04\u6570\u636E\n\n#pragma include \"picking\"\n\nvoid main() {\n float opacity = styleMappingMat[0][0];\n gl_FragColor = v_color;\n gl_FragColor.a *= opacity;\n gl_FragColor = filterColor(gl_FragColor);\n}\n";
|
|
19
|
+
|
|
20
|
+
/* babel-plugin-inline-import '../shaders/polygon_linear_frag.glsl' */
|
|
21
|
+
var polygon_linear_frag = "uniform float u_opacity: 1.0;\nvarying vec4 v_Color;\nvarying mat4 styleMappingMat; // \u4F20\u9012\u4ECE\u7247\u5143\u4E2D\u4F20\u9012\u7684\u6620\u5C04\u6570\u636E\n\n#pragma include \"picking\"\nuniform float u_opacitylinear: 0.0;\nuniform float u_dir: 1.0;\nvarying vec3 v_linear;\nvarying vec2 v_pos;\n\n\nvoid main() {\n float opacity = styleMappingMat[0][0];\n gl_FragColor = v_Color;\n \n if(u_opacitylinear > 0.0) {\n gl_FragColor.a *= u_dir == 1.0 ? 1.0 - length(v_pos - v_linear.xy)/v_linear.z : length(v_pos - v_linear.xy)/v_linear.z;\n }\n\n gl_FragColor.a *= opacity;\n gl_FragColor = filterColor(gl_FragColor);\n}\n";
|
|
22
|
+
|
|
23
|
+
/* babel-plugin-inline-import '../shaders/polygon_linear_vert.glsl' */
|
|
24
|
+
var polygon_linear_vert = "attribute vec4 a_Color;\nattribute vec3 a_Position;\n\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nuniform float u_opacity: 1.0;\nuniform float u_raisingHeight: 0.0;\n\nvarying vec4 v_Color;\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 \"picking\"\n\nuniform float u_opacitylinear: 0.0;\n\nattribute vec3 a_linear;\nvarying vec3 v_linear;\nvarying vec2 v_pos;\n\nvoid main() {\n if(u_opacitylinear > 0.0) {\n v_linear = a_linear;\n v_pos = a_Position.xy;\n }\n \n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\nstyleMappingMat = 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 // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\n\n v_Color = a_Color;\n vec4 project_pos = project_position(vec4(a_Position, 1.0));\n // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n project_pos.z += u_raisingHeight;\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);\n project_pos.z *= mapboxZoomScale;\n project_pos.z += u_raisingHeight * mapboxZoomScale;\n }\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(project_pos.xyz, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n }\n\n setPickingColor(a_PickingColor);\n}";
|
|
25
|
+
|
|
26
|
+
/* babel-plugin-inline-import '../shaders/polygon_vert.glsl' */
|
|
27
|
+
var polygon_vert = "attribute vec4 a_Color;\nattribute vec3 a_Position;\n\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\n\nuniform float u_opacity: 1.0;\nuniform float u_raisingHeight: 0.0;\n\nvarying vec4 v_color;\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 \"picking\"\n\nvoid main() {\n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\nstyleMappingMat = 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 // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\n\n v_color = a_Color;\n vec4 project_pos = project_position(vec4(a_Position, 1.0));\n // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n\n project_pos.z += u_raisingHeight;\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);\n project_pos.z *= mapboxZoomScale;\n project_pos.z += u_raisingHeight * mapboxZoomScale;\n }\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(project_pos.xyz, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n }\n\n setPickingColor(a_PickingColor);\n}\n\n";
|
|
28
|
+
|
|
29
|
+
var FillModel = /*#__PURE__*/function (_BaseModel) {
|
|
30
|
+
_inherits(FillModel, _BaseModel);
|
|
31
|
+
|
|
32
|
+
var _super = _createSuper(FillModel);
|
|
33
|
+
|
|
34
|
+
function FillModel() {
|
|
35
|
+
_classCallCheck(this, FillModel);
|
|
36
|
+
|
|
37
|
+
return _super.apply(this, arguments);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
_createClass(FillModel, [{
|
|
41
|
+
key: "getUninforms",
|
|
42
|
+
value: function getUninforms() {
|
|
43
|
+
var _ref = this.layer.getLayerConfig(),
|
|
44
|
+
_ref$raisingHeight = _ref.raisingHeight,
|
|
45
|
+
raisingHeight = _ref$raisingHeight === void 0 ? 0 : _ref$raisingHeight,
|
|
46
|
+
_ref$opacity = _ref.opacity,
|
|
47
|
+
opacity = _ref$opacity === void 0 ? 1 : _ref$opacity,
|
|
48
|
+
_ref$opacityLinear = _ref.opacityLinear,
|
|
49
|
+
opacityLinear = _ref$opacityLinear === void 0 ? {
|
|
50
|
+
enable: false,
|
|
51
|
+
dir: 'in'
|
|
52
|
+
} : _ref$opacityLinear;
|
|
53
|
+
|
|
54
|
+
if (this.dataTextureTest && this.dataTextureNeedUpdate({
|
|
55
|
+
opacity: opacity
|
|
56
|
+
})) {
|
|
57
|
+
this.judgeStyleAttributes({
|
|
58
|
+
opacity: opacity
|
|
59
|
+
});
|
|
60
|
+
var encodeData = this.layer.getEncodedData();
|
|
61
|
+
|
|
62
|
+
var _this$calDataFrame = this.calDataFrame(this.cellLength, encodeData, this.cellProperties),
|
|
63
|
+
data = _this$calDataFrame.data,
|
|
64
|
+
width = _this$calDataFrame.width,
|
|
65
|
+
height = _this$calDataFrame.height;
|
|
66
|
+
|
|
67
|
+
this.rowCount = height; // 当前数据纹理有多少行
|
|
68
|
+
|
|
69
|
+
this.dataTexture = this.cellLength > 0 && data.length > 0 ? this.createTexture2D({
|
|
70
|
+
flipY: true,
|
|
71
|
+
data: data,
|
|
72
|
+
format: gl.LUMINANCE,
|
|
73
|
+
type: gl.FLOAT,
|
|
74
|
+
width: width,
|
|
75
|
+
height: height
|
|
76
|
+
}) : this.createTexture2D({
|
|
77
|
+
flipY: true,
|
|
78
|
+
data: [1],
|
|
79
|
+
format: gl.LUMINANCE,
|
|
80
|
+
type: gl.FLOAT,
|
|
81
|
+
width: 1,
|
|
82
|
+
height: 1
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return {
|
|
87
|
+
u_dataTexture: this.dataTexture,
|
|
88
|
+
// 数据纹理 - 有数据映射的时候纹理中带数据,若没有任何数据映射时纹理是 [1]
|
|
89
|
+
u_cellTypeLayout: this.getCellTypeLayout(),
|
|
90
|
+
u_raisingHeight: Number(raisingHeight),
|
|
91
|
+
u_opacity: isNumber(opacity) ? opacity : 1.0,
|
|
92
|
+
u_opacitylinear: Number(opacityLinear.enable),
|
|
93
|
+
u_dir: opacityLinear.dir === 'in' ? 1.0 : 0.0
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
}, {
|
|
97
|
+
key: "initModels",
|
|
98
|
+
value: function initModels(callbackModel) {
|
|
99
|
+
this.buildModels(callbackModel);
|
|
100
|
+
}
|
|
101
|
+
}, {
|
|
102
|
+
key: "buildModels",
|
|
103
|
+
value: function buildModels(callbackModel) {
|
|
104
|
+
var _this$getModelParams = this.getModelParams(),
|
|
105
|
+
frag = _this$getModelParams.frag,
|
|
106
|
+
vert = _this$getModelParams.vert,
|
|
107
|
+
triangulation = _this$getModelParams.triangulation,
|
|
108
|
+
type = _this$getModelParams.type;
|
|
109
|
+
|
|
110
|
+
var _ref2 = this.layer.getLayerConfig(),
|
|
111
|
+
_ref2$mask = _ref2.mask,
|
|
112
|
+
mask = _ref2$mask === void 0 ? false : _ref2$mask,
|
|
113
|
+
_ref2$maskInside = _ref2.maskInside,
|
|
114
|
+
maskInside = _ref2$maskInside === void 0 ? true : _ref2$maskInside,
|
|
115
|
+
_ref2$workerEnabled = _ref2.workerEnabled,
|
|
116
|
+
workerEnabled = _ref2$workerEnabled === void 0 ? false : _ref2$workerEnabled,
|
|
117
|
+
enablePicking = _ref2.enablePicking;
|
|
118
|
+
|
|
119
|
+
this.layer.triangulation = triangulation;
|
|
120
|
+
this.layer.buildLayerModel({
|
|
121
|
+
moduleName: type,
|
|
122
|
+
vertexShader: vert,
|
|
123
|
+
fragmentShader: frag,
|
|
124
|
+
triangulation: triangulation,
|
|
125
|
+
primitive: gl.TRIANGLES,
|
|
126
|
+
depth: {
|
|
127
|
+
enable: false
|
|
128
|
+
},
|
|
129
|
+
blend: this.getBlend(),
|
|
130
|
+
stencil: getMask(mask, maskInside),
|
|
131
|
+
workerEnabled: workerEnabled,
|
|
132
|
+
workerOptions: {
|
|
133
|
+
modelType: type,
|
|
134
|
+
enablePicking: enablePicking
|
|
135
|
+
}
|
|
136
|
+
}).then(function (model) {
|
|
137
|
+
callbackModel([model]);
|
|
138
|
+
}).catch(function (err) {
|
|
139
|
+
console.warn(err);
|
|
140
|
+
callbackModel([]);
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
}, {
|
|
144
|
+
key: "clearModels",
|
|
145
|
+
value: function clearModels() {
|
|
146
|
+
var _this$dataTexture;
|
|
147
|
+
|
|
148
|
+
(_this$dataTexture = this.dataTexture) === null || _this$dataTexture === void 0 ? void 0 : _this$dataTexture.destroy();
|
|
149
|
+
}
|
|
150
|
+
}, {
|
|
151
|
+
key: "registerBuiltinAttributes",
|
|
152
|
+
value: function registerBuiltinAttributes() {
|
|
153
|
+
var _ref3 = this.layer.getLayerConfig(),
|
|
154
|
+
_ref3$opacityLinear = _ref3.opacityLinear,
|
|
155
|
+
opacityLinear = _ref3$opacityLinear === void 0 ? {
|
|
156
|
+
enable: false,
|
|
157
|
+
dir: 'in'
|
|
158
|
+
} : _ref3$opacityLinear;
|
|
159
|
+
|
|
160
|
+
if (opacityLinear.enable) {
|
|
161
|
+
this.styleAttributeService.registerStyleAttribute({
|
|
162
|
+
name: 'linear',
|
|
163
|
+
type: AttributeType.Attribute,
|
|
164
|
+
descriptor: {
|
|
165
|
+
name: 'a_linear',
|
|
166
|
+
buffer: {
|
|
167
|
+
// give the WebGL driver a hint that this buffer may change
|
|
168
|
+
usage: gl.STATIC_DRAW,
|
|
169
|
+
data: [],
|
|
170
|
+
type: gl.FLOAT
|
|
171
|
+
},
|
|
172
|
+
size: 3,
|
|
173
|
+
update: function update(feature, featureIdx, vertex) {
|
|
174
|
+
return [vertex[3], vertex[4], vertex[5]];
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}, {
|
|
181
|
+
key: "getModelParams",
|
|
182
|
+
value: function getModelParams() {
|
|
183
|
+
var _ref4 = this.layer.getLayerConfig(),
|
|
184
|
+
_ref4$opacityLinear = _ref4.opacityLinear,
|
|
185
|
+
opacityLinear = _ref4$opacityLinear === void 0 ? {
|
|
186
|
+
enable: false
|
|
187
|
+
} : _ref4$opacityLinear;
|
|
188
|
+
|
|
189
|
+
if (opacityLinear.enable) {
|
|
190
|
+
return {
|
|
191
|
+
frag: polygon_linear_frag,
|
|
192
|
+
vert: polygon_linear_vert,
|
|
193
|
+
type: 'polygonLinear',
|
|
194
|
+
triangulation: polygonTriangulationWithCenter
|
|
195
|
+
};
|
|
196
|
+
} else {
|
|
197
|
+
return {
|
|
198
|
+
frag: polygon_frag,
|
|
199
|
+
vert: polygon_vert,
|
|
200
|
+
type: 'polygonFill',
|
|
201
|
+
triangulation: polygonFillTriangulation
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}]);
|
|
206
|
+
|
|
207
|
+
return FillModel;
|
|
208
|
+
}(BaseModel);
|
|
209
|
+
|
|
210
|
+
export { FillModel as default };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare type PolygonModelType = 'fill' | 'extrude' | 'line' | 'point_fill' | 'point_image' | 'point_normal' | 'point_extrude' | 'text' | 'water' | 'ocean' | 'vectorpolygon' | 'tile';
|
|
2
|
+
declare const PolygonModels: {
|
|
3
|
+
[key in PolygonModelType]: any;
|
|
4
|
+
};
|
|
5
|
+
export default PolygonModels;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import LineModel from "../../line/models/line";
|
|
2
|
+
import PointExtrudeModel from "../../point/models/extrude";
|
|
3
|
+
import PointFillModel from "../../point/models/fill";
|
|
4
|
+
import IMageModel from "../../point/models/image";
|
|
5
|
+
import NormalModel from "../../point/models/normal";
|
|
6
|
+
import TextModel from "../../point/models/text";
|
|
7
|
+
import PolygonTileModel from "../../tile/models/tileModel";
|
|
8
|
+
import ExtrudeModel from "./extrude";
|
|
9
|
+
import FillModel from "./fill";
|
|
10
|
+
import Ocean from "./ocean";
|
|
11
|
+
import TilePolygonModel from "./tile";
|
|
12
|
+
import Water from "./water";
|
|
13
|
+
var PolygonModels = {
|
|
14
|
+
fill: FillModel,
|
|
15
|
+
line: LineModel,
|
|
16
|
+
extrude: ExtrudeModel,
|
|
17
|
+
text: TextModel,
|
|
18
|
+
point_fill: PointFillModel,
|
|
19
|
+
point_image: IMageModel,
|
|
20
|
+
point_normal: NormalModel,
|
|
21
|
+
point_extrude: PointExtrudeModel,
|
|
22
|
+
water: Water,
|
|
23
|
+
ocean: Ocean,
|
|
24
|
+
// point_fill: PointModels.fill,
|
|
25
|
+
vectorpolygon: PolygonTileModel,
|
|
26
|
+
tile: TilePolygonModel
|
|
27
|
+
};
|
|
28
|
+
export default PolygonModels;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { IModel, IModelUniform, ITexture2D } from '@antv/l7-core';
|
|
2
|
+
import BaseModel from '../../core/BaseModel';
|
|
3
|
+
export default class OceanModel extends BaseModel {
|
|
4
|
+
private texture1;
|
|
5
|
+
private texture2;
|
|
6
|
+
private texture3;
|
|
7
|
+
getUninforms(): {
|
|
8
|
+
u_texture1: ITexture2D;
|
|
9
|
+
u_texture2: ITexture2D;
|
|
10
|
+
u_texture3: ITexture2D;
|
|
11
|
+
u_watercolor: number[];
|
|
12
|
+
u_watercolor2: number[];
|
|
13
|
+
u_opacity: number;
|
|
14
|
+
};
|
|
15
|
+
getAnimateUniforms(): IModelUniform;
|
|
16
|
+
initModels(callbackModel: (models: IModel[]) => void): void;
|
|
17
|
+
buildModels(callbackModel: (models: IModel[]) => void): void;
|
|
18
|
+
clearModels(): void;
|
|
19
|
+
protected registerBuiltinAttributes(): void;
|
|
20
|
+
private loadTexture;
|
|
21
|
+
}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
|
+
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
+
|
|
8
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
9
|
+
|
|
10
|
+
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; } }
|
|
11
|
+
|
|
12
|
+
import { AttributeType, gl } from '@antv/l7-core';
|
|
13
|
+
import { Version } from '@antv/l7-maps';
|
|
14
|
+
import { getMask, rgb2arr } from '@antv/l7-utils';
|
|
15
|
+
import { isNumber } from 'lodash';
|
|
16
|
+
import BaseModel from "../../core/BaseModel";
|
|
17
|
+
import { polygonTriangulation } from "../../core/triangulation";
|
|
18
|
+
|
|
19
|
+
/* babel-plugin-inline-import '../shaders/water/polygon_ocean_frag.glsl' */
|
|
20
|
+
var ocean_frag = "\nuniform float u_time: 0.0;\nuniform float u_opacity: 1.0;\n\nvarying vec2 v_uv;\n\nfloat coast2water_fadedepth = 0.10;\nfloat large_waveheight = .750; // change to adjust the \"heavy\" waves\nfloat large_wavesize = 3.4; // factor to adjust the large wave size\nfloat small_waveheight = 0.6; // change to adjust the small random waves\nfloat small_wavesize = 0.5; // factor to ajust the small wave size\nfloat water_softlight_fact = 15.; // range [1..200] (should be << smaller than glossy-fact)\nfloat water_glossylight_fact= 120.; // range [1..200]\nfloat particle_amount = 70.;\n// vec3 watercolor = vec3(0.43, 0.60, 0.66); // 'transparent' low-water color (RGB)\n// vec3 watercolor2 = vec3(0.06, 0.07, 0.11); // deep-water color (RGB, should be darker than the low-water color)\nuniform vec4 u_watercolor;\nuniform vec4 u_watercolor2;\nvec3 water_specularcolor = vec3(1.3, 1.3, 0.9); // specular Color (RGB) of the water-highlights\n#define light vec3(-0., sin(u_time*0.5)*.5 + .35, 2.8) // position of the sun\n\nuniform sampler2D u_texture1;\nuniform sampler2D u_texture2;\nuniform sampler2D u_texture3;\n\n \n\nfloat hash( float n ) {\n return fract(sin(n)*43758.5453123);\n}\n\n// 2d noise function\nfloat noise1( in vec2 x ) {\n vec2 p = floor(x);\n vec2 f = smoothstep(0.0, 1.0, fract(x));\n float n = p.x + p.y*57.0;\n return mix(mix( hash(n+ 0.0), hash(n+ 1.0),f.x),\n mix( hash(n+ 57.0), hash(n+ 58.0),f.x),f.y);\n}\n\nfloat noise(vec2 p) {\n return texture2D(u_texture2,p*vec2(1./256.)).x;\n}\n\nvec4 highness(vec2 p) {\n vec4 t = texture2D(u_texture1,fract(p));\n float clipped = -2.0-smoothstep(3.,10.,t.a)*6.9-smoothstep(10.,100.,t.a)*89.9-smoothstep(0.,10000.,t.a)*10000.0;\n return clamp(t, 0.0,3.0)+clamp(t/3.0-1.0, 0.0,1.0)+clamp(t/16.0-1.0, 0.0,1.0);\n}\n\nfloat height_map( vec2 p ) {\n vec4 height=highness(p);\n /*\n height = -0.5+\n 0.5*smoothstep(-100.,0.,-height)+\n 2.75*smoothstep(0.,2.,height)+\n 1.75*smoothstep(2.,4.,height)+\n 2.75*smoothstep(4.,16.,height)+\n 1.5*smoothstep(16.,1000.,height);\n */\n\n mat2 m = mat2( 0.9563*1.4, -0.2924*1.4, 0.2924*1.4, 0.9563*1.4 );\n //p = p*6.;\n float f = 0.6000*noise1( p ); p = m*p*1.1*6.;\n f += 0.2500*noise( p ); p = m*p*1.32;\n f += 0.1666*noise( p ); p = m*p*1.11;\n f += 0.0834*noise( p ); p = m*p*1.12;\n f += 0.0634*noise( p ); p = m*p*1.13;\n f += 0.0444*noise( p ); p = m*p*1.14;\n f += 0.0274*noise( p ); p = m*p*1.15;\n f += 0.0134*noise( p ); p = m*p*1.16;\n f += 0.0104*noise( p ); p = m*p*1.17;\n f += 0.0084*noise( p );\n f = .25*f+dot(height,vec4(-.03125,-.125,.25,.25))*.5;\n const float FLAT_LEVEL = 0.92525;\n //f = f*0.25+height*0.75;\n if (f<FLAT_LEVEL)\n f = f;\n else\n f = pow((f-FLAT_LEVEL)/(1.-FLAT_LEVEL), 2.)*(1.-FLAT_LEVEL)*2.0+FLAT_LEVEL; // makes a smooth coast-increase\n return clamp(f, 0., 10.);\n}\n\nvec3 plasma_quintic( float x ) {\n x = clamp( x, 0.0, 1.0);\n vec4 x1 = vec4( 1.0, x, x * x, x * x * x ); // 1 x x2 x3\n vec4 x2 = x1 * x1.w * x; // x4 x5 x6 x7\n return vec3(\n dot( x1.xyzw, vec4( +0.063861086, +1.992659096, -1.023901152, -0.490832805 ) ) + dot( x2.xy, vec2( +1.308442123, -0.914547012 ) ),\n dot( x1.xyzw, vec4( +0.049718590, -0.791144343, +2.892305078, +0.811726816 ) ) + dot( x2.xy, vec2( -4.686502417, +2.717794514 ) ),\n dot( x1.xyzw, vec4( +0.513275779, +1.580255060, -5.164414457, +4.559573646 ) ) + dot( x2.xy, vec2( -1.916810682, +0.570638854 ) ) );\n}\n\nvec4 color(vec2 p){\n vec4 c1 = vec4(1.7,1.6,.9,1);\n vec4 c2 = vec4(.2,.94,.1,1);\n vec4 c3 = vec4(.3,.2,.0,1);\n vec4 c4 = vec4(.99,.99,1.6,1);\n vec4 v = highness(p);\n float los = smoothstep(0.1,1.1,v.b);\n float his = smoothstep(3.5,6.5,v.b);\n float ces = smoothstep(1.,5.,v.a);\n vec4 lo = mix(c1,c2,los);\n vec4 hi = mix(c3,c4,his);\n vec4 ce = mix(lo,hi,ces);\n\n return vec4(plasma_quintic(ces),1).ragb;\n}\n\nvec3 terrain_map( vec2 p )\n{\n return color(p).rgb*0.75+0.25*vec3(0.7, .55, .4)+texture2D(u_texture3, fract(p*5.)).rgb*.5; // test-terrain is simply 'sandstone'\n}\n\nconst mat2 m = mat2( 0.72, -1.60, 1.60, 0.72 );\n\nfloat water_map( vec2 p, float height ) {\n vec2 p2 = p*large_wavesize;\n vec2 shift1 = 0.001*vec2( u_time*160.0*2.0, u_time*120.0*2.0 );\n vec2 shift2 = 0.001*vec2( u_time*190.0*2.0, -u_time*130.0*2.0 );\n\n // coarse crossing 'ocean' waves...\n float f = 0.6000*noise( p );\n f += 0.2500*noise( p*m );\n f += 0.1666*noise( p*m*m );\n float wave = sin(p2.x*0.622+p2.y*0.622+shift2.x*4.269)*large_waveheight*f*height*height ;\n\n p *= small_wavesize;\n f = 0.;\n float amp = 1.0, s = .5;\n for (int i=0; i<9; i++)\n { p = m*p*.947; f -= amp*abs(sin((noise( p+shift1*s )-.5)*2.)); amp = amp*.59; s*=-1.329; }\n \n return wave+f*small_waveheight;\n}\n\nfloat nautic(vec2 p) {\n p *= 18.;\n float f = 0.;\n float amp = 1.0, s = .5;\n for (int i=0; i<3; i++)\n { p = m*p*1.2; f += amp*abs(smoothstep(0., 1., noise( p+u_time*s ))-.5); amp = amp*.5; s*=-1.227; }\n return pow(1.-f, 5.);\n}\n\nfloat particles(vec2 p) {\n p *= 200.;\n float f = 0.;\n float amp = 1.0, s = 1.5;\n for (int i=0; i<3; i++)\n { p = m*p*1.2; f += amp*noise( p+u_time*s ); amp = amp*.5; s*=-1.227; }\n return pow(f*.35, 7.)*particle_amount;\n}\n\nfloat test_shadow( vec2 xy, float height) {\n vec3 r0 = vec3(xy, height);\n vec3 rd = normalize( light - r0 );\n \n float hit = 1.0;\n float t = 0.001;\n for (int j=1; j<25; j++)\n {\n vec3 p = r0 + t*rd;\n float h = height_map( p.xy );\n float height_diff = p.z - h;\n if (height_diff<0.0)\n {\n return 0.0;\n }\n t += 0.01+height_diff*.02;\n hit = min(hit, 2.*height_diff/t); // soft shaddow \n }\n return hit;\n}\n\nvec3 CalcTerrain(vec2 uv, float height) {\n vec3 col = terrain_map( uv );\n vec2 iResolution = vec2(512.);\n float h1 = height_map(uv-vec2(0., 0.5)/ iResolution.xy);\n float h2 = height_map(uv+vec2(0., 0.5)/ iResolution.xy);\n float h3 = height_map(uv-vec2(0.5, 0.)/ iResolution.xy);\n float h4 = height_map(uv+vec2(0.5, 0.)/ iResolution.xy);\n vec3 norm = normalize(vec3(h3-h4, h1-h2, 1.));\n vec3 r0 = vec3(uv, height);\n vec3 rd = normalize( light - r0 );\n float grad = dot(norm, rd);\n col *= grad+pow(grad, 8.);\n float terrainshade = test_shadow( uv, height );\n col = mix(col*.25, col, terrainshade);\n return col;\n}\n\n\nvoid main() {\n vec3 watercolor = u_watercolor.rgb;\n vec3 watercolor2 = u_watercolor2.rgb;\n vec2 uv = v_uv;\n float WATER_LEVEL = 0.84; // Water level (range: 0.0 - 2.0)\n float deepwater_fadedepth = 0.4 + coast2water_fadedepth;\n float height = height_map( uv );\n vec3 col;\n\n float waveheight = clamp(WATER_LEVEL*3.-1.5, 0., 1.);\n float level = WATER_LEVEL + .2*water_map(uv*15. + vec2(u_time*.1), waveheight);\n if (height > level)\n {\n col = CalcTerrain(uv, height);\n }\n if (height <= level)\n {\n vec2 dif = vec2(.0, .01);\n vec2 pos = uv*15. + vec2(u_time*.01);\n float h1 = water_map(pos-dif,waveheight);\n float h2 = water_map(pos+dif,waveheight);\n float h3 = water_map(pos-dif.yx,waveheight);\n float h4 = water_map(pos+dif.yx,waveheight);\n vec3 normwater = normalize(vec3(h3-h4, h1-h2, .125)); // norm-vector of the 'bumpy' water-plane\n uv += normwater.xy*.002*(level-height);\n \n col = CalcTerrain(uv, height);\n\n float coastfade = clamp((level-height)/coast2water_fadedepth, 0., 1.);\n float coastfade2= clamp((level-height)/deepwater_fadedepth, 0., 1.);\n float intensity = col.r*.2126+col.g*.7152+col.b*.0722;\n watercolor = mix(watercolor*intensity, watercolor2, smoothstep(0., 1., coastfade2));\n\n vec3 r0 = vec3(uv, WATER_LEVEL);\n vec3 rd = normalize( light - r0 ); // ray-direction to the light from water-position\n float grad = dot(normwater, rd); // dot-product of norm-vector and light-direction\n float specular = pow(grad, water_softlight_fact); // used for soft highlights \n float specular2= pow(grad, water_glossylight_fact); // used for glossy highlights\n float gradpos = dot(vec3(0., 0., 1.), rd);\n float specular1= smoothstep(0., 1., pow(gradpos, 5.)); // used for diffusity (some darker corona around light's specular reflections...) \n float watershade = test_shadow( uv, level );\n watercolor *= 2.2+watershade;\n watercolor += (.2+.8*watershade) * ((grad-1.0)*.5+specular) * .25;\n watercolor /= (1.+specular1*1.25);\n watercolor += watershade*specular2*water_specularcolor;\n watercolor += watershade*coastfade*(1.-coastfade2)*(vec3(.5, .6, .7)*nautic(uv)+vec3(1., 1., 1.)*particles(uv));\n \n col = mix(col, watercolor, coastfade);\n }\n \n\n float opacity = u_opacity;\n gl_FragColor = vec4(col, opacity); \n}\n";
|
|
21
|
+
|
|
22
|
+
/* babel-plugin-inline-import '../shaders/water/polygon_ocean_vert.glsl' */
|
|
23
|
+
var ocean_vert = "attribute vec2 a_uv;\nattribute vec3 a_Position;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\n\nvarying vec2 v_uv;\n\n#pragma include \"projection\"\n\nvoid main() {\n v_uv = a_uv;\n\n vec4 project_pos = project_position(vec4(a_Position, 1.0));\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(project_pos.xyz, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n }\n}\n\n";
|
|
24
|
+
|
|
25
|
+
var OceanModel = /*#__PURE__*/function (_BaseModel) {
|
|
26
|
+
_inherits(OceanModel, _BaseModel);
|
|
27
|
+
|
|
28
|
+
var _super = _createSuper(OceanModel);
|
|
29
|
+
|
|
30
|
+
function OceanModel() {
|
|
31
|
+
_classCallCheck(this, OceanModel);
|
|
32
|
+
|
|
33
|
+
return _super.apply(this, arguments);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
_createClass(OceanModel, [{
|
|
37
|
+
key: "getUninforms",
|
|
38
|
+
value: function getUninforms() {
|
|
39
|
+
var _ref = this.layer.getLayerConfig(),
|
|
40
|
+
_ref$opacity = _ref.opacity,
|
|
41
|
+
opacity = _ref$opacity === void 0 ? 1 : _ref$opacity,
|
|
42
|
+
_ref$watercolor = _ref.watercolor,
|
|
43
|
+
watercolor = _ref$watercolor === void 0 ? '#6D99A8' : _ref$watercolor,
|
|
44
|
+
_ref$watercolor2 = _ref.watercolor2,
|
|
45
|
+
watercolor2 = _ref$watercolor2 === void 0 ? '#0F121C' : _ref$watercolor2;
|
|
46
|
+
|
|
47
|
+
return {
|
|
48
|
+
u_texture1: this.texture1,
|
|
49
|
+
u_texture2: this.texture2,
|
|
50
|
+
u_texture3: this.texture3,
|
|
51
|
+
u_watercolor: rgb2arr(watercolor),
|
|
52
|
+
u_watercolor2: rgb2arr(watercolor2),
|
|
53
|
+
u_opacity: isNumber(opacity) ? opacity : 1.0
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
}, {
|
|
57
|
+
key: "getAnimateUniforms",
|
|
58
|
+
value: function getAnimateUniforms() {
|
|
59
|
+
return {
|
|
60
|
+
u_time: this.layer.getLayerAnimateTime()
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
}, {
|
|
64
|
+
key: "initModels",
|
|
65
|
+
value: function initModels(callbackModel) {
|
|
66
|
+
this.loadTexture();
|
|
67
|
+
this.buildModels(callbackModel);
|
|
68
|
+
}
|
|
69
|
+
}, {
|
|
70
|
+
key: "buildModels",
|
|
71
|
+
value: function buildModels(callbackModel) {
|
|
72
|
+
var _ref2 = this.layer.getLayerConfig(),
|
|
73
|
+
_ref2$mask = _ref2.mask,
|
|
74
|
+
mask = _ref2$mask === void 0 ? false : _ref2$mask,
|
|
75
|
+
_ref2$maskInside = _ref2.maskInside,
|
|
76
|
+
maskInside = _ref2$maskInside === void 0 ? true : _ref2$maskInside;
|
|
77
|
+
|
|
78
|
+
this.layer.buildLayerModel({
|
|
79
|
+
moduleName: 'polygonOcean',
|
|
80
|
+
vertexShader: ocean_vert,
|
|
81
|
+
fragmentShader: ocean_frag,
|
|
82
|
+
triangulation: polygonTriangulation,
|
|
83
|
+
primitive: gl.TRIANGLES,
|
|
84
|
+
depth: {
|
|
85
|
+
enable: false
|
|
86
|
+
},
|
|
87
|
+
stencil: getMask(mask, maskInside),
|
|
88
|
+
pick: false
|
|
89
|
+
}).then(function (model) {
|
|
90
|
+
callbackModel([model]);
|
|
91
|
+
}).catch(function (err) {
|
|
92
|
+
console.warn(err);
|
|
93
|
+
callbackModel([]);
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
}, {
|
|
97
|
+
key: "clearModels",
|
|
98
|
+
value: function clearModels() {
|
|
99
|
+
var _this$texture, _this$texture2, _this$texture3;
|
|
100
|
+
|
|
101
|
+
(_this$texture = this.texture1) === null || _this$texture === void 0 ? void 0 : _this$texture.destroy();
|
|
102
|
+
(_this$texture2 = this.texture2) === null || _this$texture2 === void 0 ? void 0 : _this$texture2.destroy();
|
|
103
|
+
(_this$texture3 = this.texture3) === null || _this$texture3 === void 0 ? void 0 : _this$texture3.destroy();
|
|
104
|
+
}
|
|
105
|
+
}, {
|
|
106
|
+
key: "registerBuiltinAttributes",
|
|
107
|
+
value: function registerBuiltinAttributes() {
|
|
108
|
+
var bbox = this.layer.getSource().extent;
|
|
109
|
+
|
|
110
|
+
var _bbox = _slicedToArray(bbox, 4),
|
|
111
|
+
minLng = _bbox[0],
|
|
112
|
+
minLat = _bbox[1],
|
|
113
|
+
maxLng = _bbox[2],
|
|
114
|
+
maxLat = _bbox[3];
|
|
115
|
+
|
|
116
|
+
var lngLen = maxLng - minLng;
|
|
117
|
+
var latLen = maxLat - minLat;
|
|
118
|
+
this.styleAttributeService.registerStyleAttribute({
|
|
119
|
+
name: 'oceanUv',
|
|
120
|
+
type: AttributeType.Attribute,
|
|
121
|
+
descriptor: {
|
|
122
|
+
name: 'a_uv',
|
|
123
|
+
buffer: {
|
|
124
|
+
// give the WebGL driver a hint that this buffer may change
|
|
125
|
+
usage: gl.STATIC_DRAW,
|
|
126
|
+
data: [],
|
|
127
|
+
type: gl.FLOAT
|
|
128
|
+
},
|
|
129
|
+
size: 2,
|
|
130
|
+
update: function update(feature, featureIdx, vertex, attributeIdx) {
|
|
131
|
+
var v = feature.version === Version['GAODE2.x'] ? feature.originCoordinates[0][attributeIdx] : vertex;
|
|
132
|
+
|
|
133
|
+
var _v = _slicedToArray(v, 2),
|
|
134
|
+
lng = _v[0],
|
|
135
|
+
lat = _v[1];
|
|
136
|
+
|
|
137
|
+
return [(lng - minLng) / lngLen, (lat - minLat) / latLen];
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
}, {
|
|
143
|
+
key: "loadTexture",
|
|
144
|
+
value: function loadTexture() {
|
|
145
|
+
var _this = this;
|
|
146
|
+
|
|
147
|
+
var createTexture2D = this.rendererService.createTexture2D;
|
|
148
|
+
var defaultTextureOptions = {
|
|
149
|
+
height: 0,
|
|
150
|
+
width: 0
|
|
151
|
+
}; // 默认索引为 undefined,所以单独赋值
|
|
152
|
+
|
|
153
|
+
this.texture1 = createTexture2D(defaultTextureOptions);
|
|
154
|
+
this.texture2 = createTexture2D(defaultTextureOptions);
|
|
155
|
+
this.texture3 = createTexture2D(defaultTextureOptions); // 加载完 image 后单独给 texture f赋值
|
|
156
|
+
|
|
157
|
+
initImage(function (images) {
|
|
158
|
+
_this.texture1 = initTex(images[0]);
|
|
159
|
+
_this.texture2 = initTex(images[1]);
|
|
160
|
+
_this.texture3 = initTex(images[2]);
|
|
161
|
+
|
|
162
|
+
_this.layerService.reRender();
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
function initImage(callback) {
|
|
166
|
+
var loadedCount = 0;
|
|
167
|
+
var loadedImages = [];
|
|
168
|
+
var images = ['https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*EojwT4VzSiYAAAAAAAAAAAAAARQnAQ', 'https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*MJ22QbpuCzIAAAAAAAAAAAAAARQnAQ', 'https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*-z2HSIVDsHIAAAAAAAAAAAAAARQnAQ'];
|
|
169
|
+
images.map(function (imgSrc) {
|
|
170
|
+
var image = new Image();
|
|
171
|
+
image.crossOrigin = '';
|
|
172
|
+
image.src = imgSrc;
|
|
173
|
+
loadedImages.push(image);
|
|
174
|
+
|
|
175
|
+
image.onload = function () {
|
|
176
|
+
loadedCount++;
|
|
177
|
+
|
|
178
|
+
if (loadedCount === 3) {
|
|
179
|
+
callback(loadedImages);
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
function initTex(image) {
|
|
186
|
+
return createTexture2D({
|
|
187
|
+
data: image,
|
|
188
|
+
width: image.width,
|
|
189
|
+
height: image.height,
|
|
190
|
+
wrapS: gl.MIRRORED_REPEAT,
|
|
191
|
+
wrapT: gl.MIRRORED_REPEAT,
|
|
192
|
+
min: gl.LINEAR,
|
|
193
|
+
mag: gl.LINEAR
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}]);
|
|
198
|
+
|
|
199
|
+
return OceanModel;
|
|
200
|
+
}(BaseModel);
|
|
201
|
+
|
|
202
|
+
export { OceanModel as default };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IModel } from '@antv/l7-core';
|
|
2
|
+
import BaseModel from '../../core/BaseModel';
|
|
3
|
+
export default class FillModel extends BaseModel {
|
|
4
|
+
getUninforms(): {
|
|
5
|
+
u_opacity: number;
|
|
6
|
+
u_color: number[];
|
|
7
|
+
};
|
|
8
|
+
initModels(callbackModel: (models: IModel[]) => void): void;
|
|
9
|
+
buildModels(callbackModel: (models: IModel[]) => void): void;
|
|
10
|
+
clearModels(): void;
|
|
11
|
+
protected registerBuiltinAttributes(): void;
|
|
12
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
4
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
|
+
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
|
+
|
|
7
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
8
|
+
|
|
9
|
+
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; } }
|
|
10
|
+
|
|
11
|
+
import { getMask, rgb2arr } from '@antv/l7-utils';
|
|
12
|
+
import BaseModel from "../../core/BaseModel";
|
|
13
|
+
import { polygonTriangulation } from "../../core/triangulation";
|
|
14
|
+
|
|
15
|
+
/* babel-plugin-inline-import '../../shader/minify_picking_frag.glsl' */
|
|
16
|
+
var polygon_tile_frag = "uniform float u_opacity : 1.0;\nvarying vec4 v_color;\n\n#pragma include \"picking\"\n\nvoid main() {\n gl_FragColor = v_color;\n gl_FragColor.a *= u_opacity;\n gl_FragColor = filterColor(gl_FragColor);\n}\n";
|
|
17
|
+
|
|
18
|
+
/* babel-plugin-inline-import '../shaders/tile/polygon_tile_vert.glsl' */
|
|
19
|
+
var polygon_tile_vert = "attribute vec4 a_Color;\nattribute vec3 a_Position;\n\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\n\n// uniform vec2 u_tileOrigin;\n// uniform float u_coord;\n\nvarying vec4 v_color;\n\n#pragma include \"projection\"\n#pragma include \"picking\"\n\nvoid main() {\n v_color = a_Color;\n vec4 project_pos = project_position(vec4(a_Position, 1.0));\n\n // if(u_coord > 0.0) {\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(project_pos.xyz, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n }\n // } else {\n // vec4 world = vec4(project_mvt_offset_position(vec4(u_tileOrigin, 0.0, 1.0)).xyz, 1.0); // \u74E6\u7247\u8D77\u59CB\u70B9\u7684\u4E16\u754C\u5750\u6807\n\n // vec2 pointOffset = a_Position.xy * pow(2.0, u_Zoom); // \u74E6\u7247\u5185\u7684\u70B9\u7684\u504F\u79FB\u5750\u6807\n \n // world.xy += pointOffset;\n\n // if (u_CoordinateSystem == COORDINATE_SYSTEM_METER_OFFSET || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n // // Needs to be divided with project_uCommonUnitsPerMeter\n // world.w *= u_PixelsPerMeter.z;\n // }\n\n // gl_Position = u_ViewProjectionMatrix * world + u_ViewportCenterProjection;\n // }\n\n setPickingColor(a_PickingColor);\n}\n\n";
|
|
20
|
+
|
|
21
|
+
/* babel-plugin-inline-import '../../shader/minify_frag.glsl' */
|
|
22
|
+
var polygon_tile_map_frag = "uniform float u_opacity : 1.0;\nuniform vec4 u_color;\n\nvoid main() {\n gl_FragColor = u_color;\n gl_FragColor.a *= u_opacity;\n}\n";
|
|
23
|
+
|
|
24
|
+
/* babel-plugin-inline-import '../shaders/tile/polygon_tile_map_vert.glsl' */
|
|
25
|
+
var polygon_tile_map_vert = "attribute vec3 a_Position;\n\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\n\n#pragma include \"projection\"\n\nvoid main() {\n vec4 project_pos = project_position(vec4(a_Position, 1.0));\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(project_pos.xyz, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n }\n}";
|
|
26
|
+
|
|
27
|
+
var FillModel = /*#__PURE__*/function (_BaseModel) {
|
|
28
|
+
_inherits(FillModel, _BaseModel);
|
|
29
|
+
|
|
30
|
+
var _super = _createSuper(FillModel);
|
|
31
|
+
|
|
32
|
+
function FillModel() {
|
|
33
|
+
_classCallCheck(this, FillModel);
|
|
34
|
+
|
|
35
|
+
return _super.apply(this, arguments);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
_createClass(FillModel, [{
|
|
39
|
+
key: "getUninforms",
|
|
40
|
+
value: function getUninforms() {
|
|
41
|
+
var _ref = this.layer.getLayerConfig(),
|
|
42
|
+
_ref$opacity = _ref.opacity,
|
|
43
|
+
opacity = _ref$opacity === void 0 ? 1 : _ref$opacity,
|
|
44
|
+
usage = _ref.usage,
|
|
45
|
+
_ref$color = _ref.color,
|
|
46
|
+
color = _ref$color === void 0 ? '#fff' : _ref$color;
|
|
47
|
+
|
|
48
|
+
return {
|
|
49
|
+
// u_tileOrigin: tileOrigin || [0, 0],
|
|
50
|
+
// u_coord: coord === 'lnglat' ? 1.0 : 0.0,
|
|
51
|
+
u_opacity: opacity,
|
|
52
|
+
u_color: usage === 'basemap' ? rgb2arr(color) : [0, 0, 0, 0]
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
}, {
|
|
56
|
+
key: "initModels",
|
|
57
|
+
value: function initModels(callbackModel) {
|
|
58
|
+
this.buildModels(callbackModel);
|
|
59
|
+
}
|
|
60
|
+
}, {
|
|
61
|
+
key: "buildModels",
|
|
62
|
+
value: function buildModels(callbackModel) {
|
|
63
|
+
var _ref2 = this.layer.getLayerConfig(),
|
|
64
|
+
_ref2$mask = _ref2.mask,
|
|
65
|
+
mask = _ref2$mask === void 0 ? false : _ref2$mask,
|
|
66
|
+
_ref2$maskInside = _ref2.maskInside,
|
|
67
|
+
maskInside = _ref2$maskInside === void 0 ? true : _ref2$maskInside,
|
|
68
|
+
usage = _ref2.usage;
|
|
69
|
+
|
|
70
|
+
this.layer.triangulation = polygonTriangulation;
|
|
71
|
+
this.layer.buildLayerModel({
|
|
72
|
+
moduleName: 'polygonTile_' + usage,
|
|
73
|
+
vertexShader: usage === 'basemap' ? polygon_tile_map_vert : polygon_tile_vert,
|
|
74
|
+
fragmentShader: usage === 'basemap' ? polygon_tile_map_frag : polygon_tile_frag,
|
|
75
|
+
triangulation: polygonTriangulation,
|
|
76
|
+
depth: {
|
|
77
|
+
enable: false
|
|
78
|
+
},
|
|
79
|
+
blend: this.getBlend(),
|
|
80
|
+
stencil: getMask(mask, maskInside),
|
|
81
|
+
pick: usage !== 'basemap'
|
|
82
|
+
}).then(function (model) {
|
|
83
|
+
callbackModel([model]);
|
|
84
|
+
}).catch(function (err) {
|
|
85
|
+
console.warn(err);
|
|
86
|
+
callbackModel([]);
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
}, {
|
|
90
|
+
key: "clearModels",
|
|
91
|
+
value: function clearModels() {}
|
|
92
|
+
}, {
|
|
93
|
+
key: "registerBuiltinAttributes",
|
|
94
|
+
value: function registerBuiltinAttributes() {//
|
|
95
|
+
}
|
|
96
|
+
}]);
|
|
97
|
+
|
|
98
|
+
return FillModel;
|
|
99
|
+
}(BaseModel);
|
|
100
|
+
|
|
101
|
+
export { FillModel as default };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IModel, IModelUniform, ITexture2D } from '@antv/l7-core';
|
|
2
|
+
import BaseModel from '../../core/BaseModel';
|
|
3
|
+
export default class WaterModel extends BaseModel {
|
|
4
|
+
private texture;
|
|
5
|
+
getUninforms(): {
|
|
6
|
+
u_texture: ITexture2D;
|
|
7
|
+
u_speed: number;
|
|
8
|
+
u_opacity: number;
|
|
9
|
+
};
|
|
10
|
+
getAnimateUniforms(): IModelUniform;
|
|
11
|
+
initModels(callbackModel: (models: IModel[]) => void): void;
|
|
12
|
+
buildModels(callbackModel: (models: IModel[]) => void): void;
|
|
13
|
+
clearModels(): void;
|
|
14
|
+
protected registerBuiltinAttributes(): void;
|
|
15
|
+
private loadTexture;
|
|
16
|
+
}
|