@antv/l7-layers 2.9.26-alpha.0 → 2.9.26
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 +19 -0
- package/es/Geometry/index.js +106 -0
- package/es/Geometry/models/billboard.d.ts +26 -0
- package/es/Geometry/models/billboard.js +232 -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 +421 -0
- package/es/Geometry/models/sprite.d.ts +47 -0
- package/es/Geometry/models/sprite.js +304 -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 +19 -0
- package/es/canvas/index.js +91 -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 +88 -0
- package/es/citybuliding/models/build.d.ts +22 -0
- package/es/citybuliding/models/build.js +188 -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 +212 -0
- package/es/core/BaseLayer.js +1409 -0
- package/es/core/BaseModel.d.ts +140 -0
- package/es/core/BaseModel.js +486 -0
- package/es/core/interface.d.ts +201 -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 +122 -0
- package/es/core/triangulation.js +491 -0
- package/es/earth/index.d.ts +17 -0
- package/es/earth/index.js +91 -0
- package/es/earth/models/atmosphere.d.ts +9 -0
- package/es/earth/models/atmosphere.js +138 -0
- package/es/earth/models/base.d.ts +16 -0
- package/es/earth/models/base.js +212 -0
- package/es/earth/models/bloomsphere.d.ts +9 -0
- package/es/earth/models/bloomsphere.js +138 -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/heatmap/index.d.ts +21 -0
- package/es/heatmap/index.js +145 -0
- package/es/heatmap/models/grid.d.ts +8 -0
- package/es/heatmap/models/grid.js +108 -0
- package/es/heatmap/models/grid3d.d.ts +8 -0
- package/es/heatmap/models/grid3d.js +147 -0
- package/es/heatmap/models/heatmap.d.ts +24 -0
- package/es/heatmap/models/heatmap.js +464 -0
- package/es/heatmap/models/hexagon.d.ts +8 -0
- package/es/heatmap/models/hexagon.js +111 -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 +38 -0
- package/es/image/index.d.ts +19 -0
- package/es/image/index.js +103 -0
- package/es/image/models/dataImage.d.ts +22 -0
- package/es/image/models/dataImage.js +225 -0
- package/es/image/models/image.d.ts +19 -0
- package/es/image/models/image.js +169 -0
- package/es/image/models/index.d.ts +5 -0
- package/es/image/models/index.js +7 -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 +42 -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 +335 -0
- package/es/line/models/earthArc_3d.d.ts +17 -0
- package/es/line/models/earthArc_3d.js +338 -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 +282 -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 +442 -0
- package/es/line/models/linearline.d.ts +11 -0
- package/es/line/models/linearline.js +276 -0
- package/es/line/models/simpleLine.d.ts +14 -0
- package/es/line/models/simpleLine.js +233 -0
- package/es/line/models/tile.d.ts +11 -0
- package/es/line/models/tile.js +351 -0
- package/es/line/models/wall.d.ts +12 -0
- package/es/line/models/wall.js +329 -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 +148 -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 +207 -0
- package/es/line/shaders/line_arc_frag.glsl +89 -0
- package/es/line/shaders/line_arc_great_circle_frag.glsl +101 -0
- package/es/line/shaders/line_arc_great_circle_vert.glsl +215 -0
- package/es/line/shaders/line_arc_vert.glsl +176 -0
- package/es/line/shaders/line_bezier_vert.glsl +85 -0
- package/es/line/shaders/line_frag.glsl +100 -0
- package/es/line/shaders/line_vert.glsl +192 -0
- package/es/line/shaders/linear/arc3d_linear_frag.glsl +47 -0
- package/es/line/shaders/linear/arc3d_linear_vert.glsl +207 -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_frag.glsl +79 -0
- package/es/line/shaders/tile/line_tile_vert.glsl +210 -0
- package/es/line/shaders/wall_frag.glsl +93 -0
- package/es/line/shaders/wall_vert.glsl +111 -0
- package/es/mask/index.d.ts +26 -0
- package/es/mask/index.js +82 -0
- package/es/mask/models/fill.d.ts +11 -0
- package/es/mask/models/fill.js +121 -0
- package/es/mask/models/index.d.ts +5 -0
- package/es/mask/models/index.js +5 -0
- package/es/mask/shaders/mask_frag.glsl +7 -0
- package/es/mask/shaders/mask_vert.glsl +22 -0
- package/es/plugins/DataMappingPlugin.d.ts +18 -0
- package/es/plugins/DataMappingPlugin.js +345 -0
- package/es/plugins/DataSourcePlugin.d.ts +7 -0
- package/es/plugins/DataSourcePlugin.js +83 -0
- package/es/plugins/FeatureScalePlugin.d.ts +26 -0
- package/es/plugins/FeatureScalePlugin.js +380 -0
- package/es/plugins/LayerAnimateStylePlugin.d.ts +7 -0
- package/es/plugins/LayerAnimateStylePlugin.js +49 -0
- package/es/plugins/LayerModelPlugin.d.ts +10 -0
- package/es/plugins/LayerModelPlugin.js +71 -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 +110 -0
- package/es/plugins/MultiPassRendererPlugin.d.ts +24 -0
- package/es/plugins/MultiPassRendererPlugin.js +77 -0
- package/es/plugins/PixelPickingPlugin.d.ts +8 -0
- package/es/plugins/PixelPickingPlugin.js +146 -0
- package/es/plugins/RegisterStyleAttributePlugin.d.ts +11 -0
- package/es/plugins/RegisterStyleAttributePlugin.js +105 -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 +87 -0
- package/es/point/index.d.ts +40 -0
- package/es/point/index.js +234 -0
- package/es/point/models/earthExtrude.d.ts +24 -0
- package/es/point/models/earthExtrude.js +279 -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 +298 -0
- package/es/point/models/fill.d.ts +40 -0
- package/es/point/models/fill.js +404 -0
- package/es/point/models/fillmage.d.ts +25 -0
- package/es/point/models/fillmage.js +367 -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 +17 -0
- package/es/point/models/normal.js +177 -0
- package/es/point/models/radar.d.ts +24 -0
- package/es/point/models/radar.js +297 -0
- package/es/point/models/simplePoint.d.ts +17 -0
- package/es/point/models/simplePoint.js +188 -0
- package/es/point/models/text.d.ts +57 -0
- package/es/point/models/text.js +622 -0
- package/es/point/models/tile.d.ts +22 -0
- package/es/point/models/tile.js +309 -0
- package/es/point/models/tileText.d.ts +56 -0
- package/es/point/models/tileText.js +598 -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 +126 -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 +189 -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 +15 -0
- package/es/point/shaders/normal_vert.glsl +79 -0
- package/es/point/shaders/radar/radar_frag.glsl +64 -0
- package/es/point/shaders/radar/radar_vert.glsl +120 -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 +83 -0
- package/es/point/shaders/tile/fill_tile_vert.glsl +181 -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 +148 -0
- package/es/polygon/models/extrude.d.ts +28 -0
- package/es/polygon/models/extrude.js +306 -0
- package/es/polygon/models/fill.d.ts +17 -0
- package/es/polygon/models/fill.js +211 -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 +23 -0
- package/es/polygon/models/ocean.js +236 -0
- package/es/polygon/models/tile.d.ts +15 -0
- package/es/polygon/models/tile.js +133 -0
- package/es/polygon/models/water.d.ts +18 -0
- package/es/polygon/models/water.js +213 -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_frag.glsl +12 -0
- package/es/polygon/shaders/tile/polygon_tile_vert.glsl +82 -0
- package/es/polygon/shaders/water/polygon_ocean_frag.glsl +248 -0
- package/es/polygon/shaders/water/polygon_ocean_vert.glsl +52 -0
- package/es/polygon/shaders/water/polygon_water_frag.glsl +73 -0
- package/es/polygon/shaders/water/polygon_water_vert.glsl +55 -0
- package/es/raster/buffers/triangulation.d.ts +6 -0
- package/es/raster/buffers/triangulation.js +28 -0
- package/es/raster/index.d.ts +19 -0
- package/es/raster/index.js +106 -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 +167 -0
- package/es/raster/raster.d.ts +30 -0
- package/es/raster/raster.js +174 -0
- package/es/raster/shaders/raster_2d_frag.glsl +28 -0
- package/es/raster/shaders/raster_2d_vert.glsl +18 -0
- package/es/raster/shaders/raster_frag.glsl +9 -0
- package/es/raster/shaders/raster_vert.glsl +44 -0
- package/es/tile/interface.d.ts +28 -0
- package/es/tile/interface.js +1 -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 +37 -0
- package/es/tile/manager/tileLayerManager.js +323 -0
- package/es/tile/manager/tilePickerManager.d.ts +21 -0
- package/es/tile/manager/tilePickerManager.js +190 -0
- package/es/tile/models/tileModel.d.ts +8 -0
- package/es/tile/models/tileModel.js +62 -0
- package/es/tile/tileFactory/base.d.ts +44 -0
- package/es/tile/tileFactory/base.js +444 -0
- package/es/tile/tileFactory/index.d.ts +5 -0
- package/es/tile/tileFactory/index.js +33 -0
- package/es/tile/tileFactory/line.d.ts +12 -0
- package/es/tile/tileFactory/line.js +59 -0
- package/es/tile/tileFactory/point.d.ts +12 -0
- package/es/tile/tileFactory/point.js +59 -0
- package/es/tile/tileFactory/polygon.d.ts +12 -0
- package/es/tile/tileFactory/polygon.js +59 -0
- package/es/tile/tileFactory/raster.d.ts +12 -0
- package/es/tile/tileFactory/raster.js +55 -0
- package/es/tile/tileFactory/rasterData.d.ts +12 -0
- package/es/tile/tileFactory/rasterData.js +80 -0
- package/es/tile/tileFactory/rasterDataLayer.d.ts +19 -0
- package/es/tile/tileFactory/rasterDataLayer.js +87 -0
- package/es/tile/tileFactory/test.d.ts +12 -0
- package/es/tile/tileFactory/test.js +82 -0
- package/es/tile/tileFactory/vectorLayer.d.ts +29 -0
- package/es/tile/tileFactory/vectorLayer.js +161 -0
- package/es/tile/tileLayer/baseTileLayer.d.ts +47 -0
- package/es/tile/tileLayer/baseTileLayer.js +438 -0
- package/es/tile/tileTest.d.ts +14 -0
- package/es/tile/tileTest.js +63 -0
- package/es/tile/tmsTileLayer.d.ts +7 -0
- package/es/tile/tmsTileLayer.js +101 -0
- package/es/tile/utils.d.ts +13 -0
- package/es/tile/utils.js +131 -0
- package/es/utils/blend.d.ts +2 -0
- package/es/utils/blend.js +54 -0
- package/es/utils/collision-index.d.ts +47 -0
- package/es/utils/collision-index.js +102 -0
- package/es/utils/dataMappingStyle.d.ts +31 -0
- package/es/utils/dataMappingStyle.js +147 -0
- package/es/utils/extrude_polyline.d.ts +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 +100 -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 +119 -0
- package/lib/Geometry/models/billboard.js +246 -0
- package/lib/Geometry/models/index.js +22 -0
- package/lib/Geometry/models/plane.js +436 -0
- package/lib/Geometry/models/sprite.js +318 -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 +104 -0
- package/lib/canvas/models/canvas.js +221 -0
- package/lib/canvas/models/index.js +16 -0
- package/lib/citybuliding/building.js +101 -0
- package/lib/citybuliding/models/build.js +203 -0
- package/lib/citybuliding/shaders/build_frag.glsl +117 -0
- package/lib/citybuliding/shaders/build_vert.glsl +54 -0
- package/lib/core/BaseLayer.js +1408 -0
- package/lib/core/BaseModel.js +503 -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 +555 -0
- package/lib/earth/index.js +107 -0
- package/lib/earth/models/atmosphere.js +152 -0
- package/lib/earth/models/base.js +222 -0
- package/lib/earth/models/bloomsphere.js +152 -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/heatmap/index.js +158 -0
- package/lib/heatmap/models/grid.js +122 -0
- package/lib/heatmap/models/grid3d.js +161 -0
- package/lib/heatmap/models/heatmap.js +487 -0
- package/lib/heatmap/models/hexagon.js +125 -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 +45 -0
- package/lib/image/index.js +116 -0
- package/lib/image/models/dataImage.js +240 -0
- package/lib/image/models/image.js +183 -0
- package/lib/image/models/index.js +19 -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 +153 -0
- package/lib/line/models/arc.js +373 -0
- package/lib/line/models/arc_3d.js +353 -0
- package/lib/line/models/earthArc_3d.js +356 -0
- package/lib/line/models/great_circle.js +310 -0
- package/lib/line/models/half.js +299 -0
- package/lib/line/models/index.js +46 -0
- package/lib/line/models/line.js +459 -0
- package/lib/line/models/linearline.js +293 -0
- package/lib/line/models/simpleLine.js +248 -0
- package/lib/line/models/tile.js +368 -0
- package/lib/line/models/wall.js +345 -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 +148 -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 +207 -0
- package/lib/line/shaders/line_arc_frag.glsl +89 -0
- package/lib/line/shaders/line_arc_great_circle_frag.glsl +101 -0
- package/lib/line/shaders/line_arc_great_circle_vert.glsl +215 -0
- package/lib/line/shaders/line_arc_vert.glsl +176 -0
- package/lib/line/shaders/line_bezier_vert.glsl +85 -0
- package/lib/line/shaders/line_frag.glsl +100 -0
- package/lib/line/shaders/line_vert.glsl +192 -0
- package/lib/line/shaders/linear/arc3d_linear_frag.glsl +47 -0
- package/lib/line/shaders/linear/arc3d_linear_vert.glsl +207 -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_frag.glsl +79 -0
- package/lib/line/shaders/tile/line_tile_vert.glsl +210 -0
- package/lib/line/shaders/wall_frag.glsl +93 -0
- package/lib/line/shaders/wall_vert.glsl +111 -0
- package/lib/mask/index.js +95 -0
- package/lib/mask/models/fill.js +137 -0
- package/lib/mask/models/index.js +16 -0
- package/lib/mask/shaders/mask_frag.glsl +7 -0
- package/lib/mask/shaders/mask_vert.glsl +22 -0
- package/lib/plugins/DataMappingPlugin.js +360 -0
- package/lib/plugins/DataSourcePlugin.js +96 -0
- package/lib/plugins/FeatureScalePlugin.js +404 -0
- package/lib/plugins/LayerAnimateStylePlugin.js +64 -0
- package/lib/plugins/LayerModelPlugin.js +82 -0
- package/lib/plugins/LayerStylePlugin.js +50 -0
- package/lib/plugins/LightingPlugin.js +125 -0
- package/lib/plugins/MultiPassRendererPlugin.js +93 -0
- package/lib/plugins/PixelPickingPlugin.js +159 -0
- package/lib/plugins/RegisterStyleAttributePlugin.js +117 -0
- package/lib/plugins/ShaderUniformPlugin.js +120 -0
- package/lib/plugins/UpdateModelPlugin.js +42 -0
- package/lib/plugins/UpdateStyleAttributePlugin.js +98 -0
- package/lib/point/index.js +247 -0
- package/lib/point/models/earthExtrude.js +295 -0
- package/lib/point/models/earthFill.js +293 -0
- package/lib/point/models/extrude.js +315 -0
- package/lib/point/models/fill.js +420 -0
- package/lib/point/models/fillmage.js +383 -0
- package/lib/point/models/image.js +255 -0
- package/lib/point/models/index.js +53 -0
- package/lib/point/models/normal.js +194 -0
- package/lib/point/models/radar.js +314 -0
- package/lib/point/models/simplePoint.js +205 -0
- package/lib/point/models/text.js +637 -0
- package/lib/point/models/tile.js +325 -0
- package/lib/point/models/tileText.js +613 -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 +126 -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 +189 -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 +15 -0
- package/lib/point/shaders/normal_vert.glsl +79 -0
- package/lib/point/shaders/radar/radar_frag.glsl +64 -0
- package/lib/point/shaders/radar/radar_vert.glsl +120 -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 +83 -0
- package/lib/point/shaders/tile/fill_tile_vert.glsl +181 -0
- package/lib/point/shape/extrude.js +78 -0
- package/lib/polygon/index.js +162 -0
- package/lib/polygon/models/extrude.js +322 -0
- package/lib/polygon/models/fill.js +226 -0
- package/lib/polygon/models/index.js +50 -0
- package/lib/polygon/models/ocean.js +252 -0
- package/lib/polygon/models/tile.js +147 -0
- package/lib/polygon/models/water.js +229 -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_frag.glsl +12 -0
- package/lib/polygon/shaders/tile/polygon_tile_vert.glsl +82 -0
- package/lib/polygon/shaders/water/polygon_ocean_frag.glsl +248 -0
- package/lib/polygon/shaders/water/polygon_ocean_vert.glsl +52 -0
- package/lib/polygon/shaders/water/polygon_water_frag.glsl +73 -0
- package/lib/polygon/shaders/water/polygon_water_vert.glsl +55 -0
- package/lib/raster/buffers/triangulation.js +38 -0
- package/lib/raster/index.js +119 -0
- package/lib/raster/models/index.js +20 -0
- package/lib/raster/models/raster.js +182 -0
- package/lib/raster/raster.js +191 -0
- package/lib/raster/shaders/raster_2d_frag.glsl +28 -0
- package/lib/raster/shaders/raster_2d_vert.glsl +18 -0
- package/lib/raster/shaders/raster_frag.glsl +9 -0
- package/lib/raster/shaders/raster_vert.glsl +44 -0
- package/lib/tile/interface.js +5 -0
- package/lib/tile/manager/tileConfigManager.js +133 -0
- package/lib/tile/manager/tileLayerManager.js +341 -0
- package/lib/tile/manager/tilePickerManager.js +201 -0
- package/lib/tile/models/tileModel.js +74 -0
- package/lib/tile/tileFactory/base.js +466 -0
- package/lib/tile/tileFactory/index.js +64 -0
- package/lib/tile/tileFactory/line.js +70 -0
- package/lib/tile/tileFactory/point.js +70 -0
- package/lib/tile/tileFactory/polygon.js +70 -0
- package/lib/tile/tileFactory/raster.js +68 -0
- package/lib/tile/tileFactory/rasterData.js +93 -0
- package/lib/tile/tileFactory/rasterDataLayer.js +100 -0
- package/lib/tile/tileFactory/test.js +95 -0
- package/lib/tile/tileFactory/vectorLayer.js +176 -0
- package/lib/tile/tileLayer/baseTileLayer.js +447 -0
- package/lib/tile/tileTest.js +75 -0
- package/lib/tile/tmsTileLayer.js +117 -0
- package/lib/tile/utils.js +158 -0
- package/lib/utils/blend.js +65 -0
- package/lib/utils/collision-index.js +118 -0
- package/lib/utils/dataMappingStyle.js +151 -0
- package/lib/utils/extrude_polyline.js +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 +113 -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 -7
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IPath } from '../../core/shape/Path';
|
|
2
|
+
export interface IExtrudeGeomety {
|
|
3
|
+
positions: number[];
|
|
4
|
+
index: number[];
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* 拉伸多边形顶点,返回拉伸后的顶点信息
|
|
8
|
+
* @param paths 路径数据组
|
|
9
|
+
* @param extrude 是否拉伸
|
|
10
|
+
*/
|
|
11
|
+
export default function extrudePolygon(path: IPath[]): IExtrudeGeomety;
|
|
12
|
+
export declare function fillPolygon(points: IPath[]): {
|
|
13
|
+
positions: number[];
|
|
14
|
+
index: number[];
|
|
15
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
+
import earcut from 'earcut';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 拉伸多边形顶点,返回拉伸后的顶点信息
|
|
6
|
+
* @param paths 路径数据组
|
|
7
|
+
* @param extrude 是否拉伸
|
|
8
|
+
*/
|
|
9
|
+
export default function extrudePolygon(path) {
|
|
10
|
+
var p1 = path[0][0];
|
|
11
|
+
var p2 = path[0][path[0].length - 1];
|
|
12
|
+
|
|
13
|
+
if (p1[0] === p2[0] && p1[1] === p2[1]) {
|
|
14
|
+
path[0] = path[0].slice(0, path[0].length - 1);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
var n = path[0].length;
|
|
18
|
+
var flattengeo = earcut.flatten(path);
|
|
19
|
+
var positions = [];
|
|
20
|
+
var indexArray = [];
|
|
21
|
+
var normals = []; // 设置顶部z值
|
|
22
|
+
|
|
23
|
+
for (var j = 0; j < flattengeo.vertices.length / 3; j++) {
|
|
24
|
+
flattengeo.vertices[j * 3 + 2] = 1;
|
|
25
|
+
normals.push(0, 0, 1);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
positions.push.apply(positions, _toConsumableArray(flattengeo.vertices));
|
|
29
|
+
var triangles = earcut(flattengeo.vertices, flattengeo.holes, flattengeo.dimensions);
|
|
30
|
+
indexArray.push.apply(indexArray, _toConsumableArray(triangles));
|
|
31
|
+
|
|
32
|
+
var _loop = function _loop(i) {
|
|
33
|
+
var prePoint = flattengeo.vertices.slice(i * 3, i * 3 + 3);
|
|
34
|
+
var nextPoint = flattengeo.vertices.slice(i * 3 + 3, i * 3 + 6);
|
|
35
|
+
|
|
36
|
+
if (nextPoint.length === 0) {
|
|
37
|
+
nextPoint = flattengeo.vertices.slice(0, 3);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
var indexOffset = positions.length / 3;
|
|
41
|
+
positions.push(prePoint[0], prePoint[1], 1, nextPoint[0], nextPoint[1], 1, prePoint[0], prePoint[1], 0, nextPoint[0], nextPoint[1], 0);
|
|
42
|
+
indexArray.push.apply(indexArray, _toConsumableArray([1, 2, 0, 3, 2, 1].map(function (v) {
|
|
43
|
+
return v + indexOffset;
|
|
44
|
+
})));
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
for (var i = 0; i < n; i++) {
|
|
48
|
+
_loop(i);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return {
|
|
52
|
+
positions: positions,
|
|
53
|
+
index: indexArray
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
export function fillPolygon(points) {
|
|
57
|
+
var flattengeo = earcut.flatten(points);
|
|
58
|
+
var triangles = earcut(flattengeo.vertices, flattengeo.holes, flattengeo.dimensions);
|
|
59
|
+
return {
|
|
60
|
+
positions: flattengeo.vertices,
|
|
61
|
+
index: triangles
|
|
62
|
+
};
|
|
63
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import BaseLayer from '../core/BaseLayer';
|
|
2
|
+
import { IPolygonLayerStyleOptions } from '../core/interface';
|
|
3
|
+
import { PolygonModelType } from './models/';
|
|
4
|
+
export default class PolygonLayer extends BaseLayer<IPolygonLayerStyleOptions> {
|
|
5
|
+
type: string;
|
|
6
|
+
defaultSourceConfig: {
|
|
7
|
+
data: [];
|
|
8
|
+
options: {
|
|
9
|
+
parser: {
|
|
10
|
+
type: 'geojson';
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
buildModels(): void;
|
|
15
|
+
rebuildModels(): void;
|
|
16
|
+
protected getConfigSchema(): {
|
|
17
|
+
properties: {
|
|
18
|
+
opacity: {
|
|
19
|
+
type: string;
|
|
20
|
+
minimum: number;
|
|
21
|
+
maximum: number;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
protected getModelType(): PolygonModelType;
|
|
26
|
+
protected getPointModelType(): PolygonModelType;
|
|
27
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
|
+
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
+
|
|
9
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
+
|
|
11
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
12
|
+
|
|
13
|
+
import BaseLayer from "../core/BaseLayer";
|
|
14
|
+
import PolygonModels from "./models/";
|
|
15
|
+
import { isVectorTile } from "../tile/utils";
|
|
16
|
+
|
|
17
|
+
var PolygonLayer = /*#__PURE__*/function (_BaseLayer) {
|
|
18
|
+
_inherits(PolygonLayer, _BaseLayer);
|
|
19
|
+
|
|
20
|
+
var _super = _createSuper(PolygonLayer);
|
|
21
|
+
|
|
22
|
+
function PolygonLayer() {
|
|
23
|
+
var _this;
|
|
24
|
+
|
|
25
|
+
_classCallCheck(this, PolygonLayer);
|
|
26
|
+
|
|
27
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
28
|
+
args[_key] = arguments[_key];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
32
|
+
|
|
33
|
+
_defineProperty(_assertThisInitialized(_this), "type", 'PolygonLayer');
|
|
34
|
+
|
|
35
|
+
return _this;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
_createClass(PolygonLayer, [{
|
|
39
|
+
key: "buildModels",
|
|
40
|
+
value: function buildModels() {
|
|
41
|
+
var _this2 = this;
|
|
42
|
+
|
|
43
|
+
var shape = this.getModelType();
|
|
44
|
+
this.layerModel = new PolygonModels[shape](this);
|
|
45
|
+
this.layerModel.initModels(function (models) {
|
|
46
|
+
_this2.models = models;
|
|
47
|
+
|
|
48
|
+
_this2.renderLayers();
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}, {
|
|
52
|
+
key: "rebuildModels",
|
|
53
|
+
value: function rebuildModels() {
|
|
54
|
+
var _this3 = this;
|
|
55
|
+
|
|
56
|
+
this.layerModel.buildModels(function (models) {
|
|
57
|
+
return _this3.models = models;
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}, {
|
|
61
|
+
key: "getConfigSchema",
|
|
62
|
+
value: function getConfigSchema() {
|
|
63
|
+
return {
|
|
64
|
+
properties: {
|
|
65
|
+
opacity: {
|
|
66
|
+
type: 'number',
|
|
67
|
+
minimum: 0,
|
|
68
|
+
maximum: 1
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
}, {
|
|
74
|
+
key: "getModelType",
|
|
75
|
+
value: function getModelType() {
|
|
76
|
+
var _shapeAttribute$scale;
|
|
77
|
+
|
|
78
|
+
var parserType = this.layerSource.getParserType();
|
|
79
|
+
|
|
80
|
+
if (isVectorTile(parserType)) {
|
|
81
|
+
return 'vectorpolygon';
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
var shapeAttribute = this.styleAttributeService.getLayerStyleAttribute('shape');
|
|
85
|
+
var shape = shapeAttribute === null || shapeAttribute === void 0 ? void 0 : (_shapeAttribute$scale = shapeAttribute.scale) === null || _shapeAttribute$scale === void 0 ? void 0 : _shapeAttribute$scale.field;
|
|
86
|
+
|
|
87
|
+
if (shape === 'fill') {
|
|
88
|
+
return 'fill';
|
|
89
|
+
} else if (shape === 'extrude') {
|
|
90
|
+
return 'extrude';
|
|
91
|
+
} else if (shape === 'water') {
|
|
92
|
+
return 'water';
|
|
93
|
+
} else if (shape === 'ocean') {
|
|
94
|
+
return 'ocean';
|
|
95
|
+
} else if (shape === 'line') {
|
|
96
|
+
return 'line';
|
|
97
|
+
} else if (shape === 'tile') {
|
|
98
|
+
return 'tile';
|
|
99
|
+
} else {
|
|
100
|
+
return this.getPointModelType();
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}, {
|
|
104
|
+
key: "getPointModelType",
|
|
105
|
+
value: function getPointModelType() {
|
|
106
|
+
// pointlayer
|
|
107
|
+
// 2D、 3d、 shape、image、text、normal、
|
|
108
|
+
var layerData = this.getEncodedData();
|
|
109
|
+
|
|
110
|
+
var _this$getLayerConfig = this.getLayerConfig(),
|
|
111
|
+
shape2d = _this$getLayerConfig.shape2d,
|
|
112
|
+
shape3d = _this$getLayerConfig.shape3d;
|
|
113
|
+
|
|
114
|
+
var iconMap = this.iconService.getIconMap();
|
|
115
|
+
var item = layerData.find(function (fe) {
|
|
116
|
+
return fe.hasOwnProperty('shape');
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
if (!item) {
|
|
120
|
+
return 'fill';
|
|
121
|
+
} else {
|
|
122
|
+
var shape = item.shape;
|
|
123
|
+
|
|
124
|
+
if (shape === 'dot') {
|
|
125
|
+
return 'point_normal';
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
if ((shape2d === null || shape2d === void 0 ? void 0 : shape2d.indexOf(shape)) !== -1) {
|
|
129
|
+
return 'point_fill';
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
if ((shape3d === null || shape3d === void 0 ? void 0 : shape3d.indexOf(shape)) !== -1) {
|
|
133
|
+
return 'point_extrude';
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
if (iconMap.hasOwnProperty(shape)) {
|
|
137
|
+
return 'point_image';
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
return 'text';
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}]);
|
|
144
|
+
|
|
145
|
+
return PolygonLayer;
|
|
146
|
+
}(BaseLayer);
|
|
147
|
+
|
|
148
|
+
export { PolygonLayer as default };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { IModel, ITexture2D } from '@antv/l7-core';
|
|
2
|
+
import BaseModel from '../../core/BaseModel';
|
|
3
|
+
export default class ExtrudeModel extends BaseModel {
|
|
4
|
+
protected texture: ITexture2D;
|
|
5
|
+
getUninforms(): {
|
|
6
|
+
u_topsurface: number;
|
|
7
|
+
u_sidesurface: number;
|
|
8
|
+
u_heightfixed: number;
|
|
9
|
+
u_dataTexture: ITexture2D;
|
|
10
|
+
u_cellTypeLayout: number[];
|
|
11
|
+
u_raisingHeight: number;
|
|
12
|
+
u_opacity: number;
|
|
13
|
+
u_linearColor: number;
|
|
14
|
+
u_sourceColor: number[];
|
|
15
|
+
u_targetColor: number[];
|
|
16
|
+
u_texture: ITexture2D;
|
|
17
|
+
};
|
|
18
|
+
initModels(callbackModel: (models: IModel[]) => void): void;
|
|
19
|
+
buildModels(callbackModel: (models: IModel[]) => void): void;
|
|
20
|
+
getShaders(): {
|
|
21
|
+
frag: string;
|
|
22
|
+
vert: string;
|
|
23
|
+
type: string;
|
|
24
|
+
};
|
|
25
|
+
clearModels(): void;
|
|
26
|
+
protected registerBuiltinAttributes(): void;
|
|
27
|
+
private loadTexture;
|
|
28
|
+
}
|
|
@@ -0,0 +1,306 @@
|
|
|
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 { getMask, rgb2arr } from '@antv/l7-utils';
|
|
14
|
+
import { isNumber } from 'lodash';
|
|
15
|
+
import BaseModel from "../../core/BaseModel";
|
|
16
|
+
import { PolygonExtrudeTriangulation } from "../../core/triangulation";
|
|
17
|
+
|
|
18
|
+
/* babel-plugin-inline-import '../shaders/extrude/polygon_extrude_frag.glsl' */
|
|
19
|
+
var polygonExtrudeFrag = "uniform float u_opacity: 1.0;\nuniform vec4 u_sourceColor;\nuniform vec4 u_targetColor;\nuniform float u_linearColor: 0;\n\nuniform float u_topsurface: 1.0;\nuniform float u_sidesurface: 1.0;\n\nvarying vec4 v_Color;\nvarying mat4 styleMappingMat; // \u4F20\u9012\u4ECE\u7247\u5143\u4E2D\u4F20\u9012\u7684\u6620\u5C04\u6570\u636E\n#pragma include \"picking\"\n\nvoid main() {\n float opacity = styleMappingMat[0][0]; \n float isSide = styleMappingMat[0][3];\n float sidey = styleMappingMat[3][0];\n float lightWeight = styleMappingMat[3][1];\n\n if(isSide < 1.0) {\n // side face\n if(u_sidesurface < 1.0) {\n discard;\n }\n\n if(u_linearColor == 1.0) {\n vec4 linearColor = mix(u_targetColor, u_sourceColor, sidey);\n linearColor.rgb *= lightWeight;\n gl_FragColor = linearColor;\n } else {\n gl_FragColor = v_Color;\n }\n\n } else {\n // top face\n if(u_topsurface < 1.0) {\n discard;\n }\n\n gl_FragColor = v_Color;\n }\n\n gl_FragColor.a *= opacity;\n gl_FragColor = filterColor(gl_FragColor);\n}\n"; // extrude
|
|
20
|
+
|
|
21
|
+
/* babel-plugin-inline-import '../shaders/extrude/polygon_extrude_vert.glsl' */
|
|
22
|
+
var polygonExtrudeVert = "precision highp float;\n\n#define ambientRatio 0.5\n#define diffuseRatio 0.3\n#define specularRatio 0.2\n\nattribute vec4 a_Color;\nattribute vec3 a_Position;\nattribute vec3 a_Normal;\nattribute float a_Size;\nattribute vec3 a_uvs;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\n\nvarying vec4 v_Color;\nuniform float u_heightfixed: 0.0; // \u9ED8\u8BA4\u4E0D\u56FA\u5B9A\nuniform float u_raisingHeight: 0.0;\nuniform float u_opacity: 1.0;\nvarying mat4 styleMappingMat; // \u7528\u4E8E\u5C06\u5728\u9876\u70B9\u7740\u8272\u5668\u4E2D\u8BA1\u7B97\u597D\u7684\u6837\u5F0F\u503C\u4F20\u9012\u7ED9\u7247\u5143\n\n#pragma include \"styleMapping\"\n#pragma include \"styleMappingCalOpacity\"\n\n#pragma include \"projection\"\n#pragma include \"light\"\n#pragma include \"picking\"\n\nvoid main() {\n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\n styleMappingMat = mat4(\n 0.0, 0.0, 0.0, 0.0, // opacity - strokeOpacity - strokeWidth - isSide\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 // sidey\n );\n styleMappingMat[0][3] = a_Position.z;\n styleMappingMat[3][0] = a_uvs[2];\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 vec4 pos = vec4(a_Position.xy, a_Position.z * a_Size, 1.0);\n vec4 project_pos = project_position(pos);\n\n if(u_heightfixed > 0.0) { // \u5224\u65AD\u51E0\u4F55\u4F53\u662F\u5426\u56FA\u5B9A\u9AD8\u5EA6\n project_pos.z = a_Position.z * a_Size;\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\n // project_pos.z += 500000.0; // amap1\n\n // project_pos.z += (500000.0 * 4.0)/pow(2.0, 21.0 - u_Zoom); // mapbox\n // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n // gl_Position = u_Mvp * (vec4(project_pos.xyz * vec3(1.0, 1.0, -1.0), 1.0));\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 float lightWeight = calc_lighting(pos);\n // v_Color = a_Color;\n v_Color = vec4(a_Color.rgb * lightWeight, a_Color.w);\n\n styleMappingMat[3][1] = lightWeight;\n\n setPickingColor(a_PickingColor);\n}\n";
|
|
23
|
+
|
|
24
|
+
/* babel-plugin-inline-import '../shaders/extrude/polygon_extrudetex_frag.glsl' */
|
|
25
|
+
var polygonExtrudeTexFrag = "uniform sampler2D u_texture;\nuniform float u_opacity: 1.0;\nuniform vec4 u_sourceColor;\nuniform vec4 u_targetColor;\nuniform float u_linearColor: 0;\n\nuniform float u_topsurface: 1.0;\nuniform float u_sidesurface: 1.0;\n\nvarying vec4 v_Color;\nvarying mat4 styleMappingMat; // \u4F20\u9012\u4ECE\u7247\u5143\u4E2D\u4F20\u9012\u7684\u6620\u5C04\u6570\u636E\n#pragma include \"picking\"\n\nvoid main() {\n float opacity = styleMappingMat[0][0];\n float isSide = styleMappingMat[0][3];\n float lightWeight = styleMappingMat[3][1];\n float topU = styleMappingMat[2][2];\n float topV = styleMappingMat[2][3];\n\n float sidey = styleMappingMat[3][0];\n if(isSide < 1.0) {\n // side face\n if(u_sidesurface < 1.0) {\n discard;\n }\n\n if(u_linearColor == 1.0) {\n vec4 linearColor = mix(u_targetColor, u_sourceColor, sidey);\n linearColor.rgb *= lightWeight;\n gl_FragColor = linearColor;\n } else {\n gl_FragColor = v_Color;\n }\n } else {\n\n // top face\n if(u_topsurface < 1.0) {\n discard;\n }\n\n gl_FragColor = texture2D(u_texture, vec2(topU, topV));\n }\n \n\n gl_FragColor.a *= opacity;\n gl_FragColor = filterColor(gl_FragColor);\n}\n"; // texture
|
|
26
|
+
|
|
27
|
+
/* babel-plugin-inline-import '../shaders/extrude/polygon_extrudetex_vert.glsl' */
|
|
28
|
+
var polygonExtrudeTexVert = "precision highp float;\n\n#define ambientRatio 0.5\n#define diffuseRatio 0.3\n#define specularRatio 0.2\n\nattribute vec4 a_Color;\nattribute vec3 a_Position;\nattribute vec3 a_Normal;\nattribute float a_Size;\nattribute vec3 a_uvs;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\n\nvarying vec4 v_Color;\nuniform float u_heightfixed: 0.0; // \u9ED8\u8BA4\u4E0D\u56FA\u5B9A\nuniform float u_raisingHeight: 0.0;\nuniform float u_opacity: 1.0;\nvarying mat4 styleMappingMat; // \u7528\u4E8E\u5C06\u5728\u9876\u70B9\u7740\u8272\u5668\u4E2D\u8BA1\u7B97\u597D\u7684\u6837\u5F0F\u503C\u4F20\u9012\u7ED9\u7247\u5143\n\n#pragma include \"styleMapping\"\n#pragma include \"styleMappingCalOpacity\"\n\n#pragma include \"projection\"\n#pragma include \"light\"\n#pragma include \"picking\"\n\nvoid main() {\n v_Color = a_Color;\n\n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\n styleMappingMat = mat4(\n 0.0, 0.0, 0.0, 0.0, // opacity - strokeOpacity - strokeWidth - a_Position.z(judge side by a_Position.z)\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] - u - v\n 0.0, 0.0, 0.0, 0.0 // sidey\n );\n \n styleMappingMat[0][3] = a_Position.z;\n styleMappingMat[2][2] = a_uvs[0];\n styleMappingMat[2][3] = 1.0 - a_uvs[1];\n styleMappingMat[3][0] = a_uvs[2];\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 vec4 pos = vec4(a_Position.xy, a_Position.z * a_Size, 1.0);\n vec4 project_pos = project_position(pos);\n\n if(u_heightfixed > 0.0) { // \u5224\u65AD\u51E0\u4F55\u4F53\u662F\u5426\u56FA\u5B9A\u9AD8\u5EA6\n project_pos.z = a_Position.z * a_Size;\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\n // project_pos.z += 500000.0; // amap1\n\n // project_pos.z += (500000.0 * 4.0)/pow(2.0, 21.0 - u_Zoom); // mapbox\n // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n // gl_Position = u_Mvp * (vec4(project_pos.xyz * vec3(1.0, 1.0, -1.0), 1.0));\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 float lightWeight = calc_lighting(pos);\n styleMappingMat[3][1] = lightWeight;\n\n setPickingColor(a_PickingColor);\n}\n"; // extrude picking
|
|
29
|
+
|
|
30
|
+
/* babel-plugin-inline-import '../shaders/extrude/polygon_extrude_picklight_frag.glsl' */
|
|
31
|
+
var polygonExtrudePickLightFrag = "uniform float u_opacity: 1.0;\nuniform vec4 u_sourceColor;\nuniform vec4 u_targetColor;\nuniform float u_linearColor: 0;\n\nuniform float u_topsurface: 1.0;\nuniform float u_sidesurface: 1.0;\n\nvarying vec4 v_Color;\nvarying mat4 styleMappingMat; // \u4F20\u9012\u4ECE\u7247\u5143\u4E2D\u4F20\u9012\u7684\u6620\u5C04\u6570\u636E\n#pragma include \"picking\"\n\nvoid main() {\n float opacity = styleMappingMat[0][0];\n float isSide = styleMappingMat[0][3];\n float sidey = styleMappingMat[3][0];\n float lightWeight = styleMappingMat[3][1];\n\n if(isSide < 1.0) {\n // side face\n if(u_sidesurface < 1.0) {\n discard;\n }\n \n if( u_linearColor == 1.0) {\n // side use linear\n vec4 linearColor = mix(u_targetColor, u_sourceColor, sidey);\n linearColor.rgb *= lightWeight;\n gl_FragColor = linearColor;\n } else {\n // side notuse linear\n gl_FragColor = v_Color;\n }\n } else {\n // top face\n if(u_topsurface < 1.0) {\n discard;\n }\n gl_FragColor = v_Color;\n }\n\n gl_FragColor.a *= opacity;\n gl_FragColor = filterColorAlpha(gl_FragColor, lightWeight);\n}\n";
|
|
32
|
+
|
|
33
|
+
/* babel-plugin-inline-import '../shaders/extrude/polygon_extrude_picklight_vert.glsl' */
|
|
34
|
+
var polygonExtrudePickLightVert = "precision highp float;\n\n#define ambientRatio 0.5\n#define diffuseRatio 0.3\n#define specularRatio 0.2\n\nattribute vec4 a_Color;\nattribute vec3 a_Position;\nattribute vec3 a_Normal;\nattribute float a_Size;\nattribute vec3 a_uvs;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\n\nvarying vec4 v_Color;\nuniform float u_heightfixed: 0.0; // \u9ED8\u8BA4\u4E0D\u56FA\u5B9A\nuniform float u_raisingHeight: 0.0;\nuniform float u_opacity: 1.0;\nvarying mat4 styleMappingMat; // \u7528\u4E8E\u5C06\u5728\u9876\u70B9\u7740\u8272\u5668\u4E2D\u8BA1\u7B97\u597D\u7684\u6837\u5F0F\u503C\u4F20\u9012\u7ED9\u7247\u5143\n\n#pragma include \"styleMapping\"\n#pragma include \"styleMappingCalOpacity\"\n\n#pragma include \"projection\"\n#pragma include \"light\"\n#pragma include \"picking\"\n\nvoid main() {\n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\n styleMappingMat = mat4(\n 0.0, 0.0, 0.0, 0.0, // opacity - strokeOpacity - strokeWidth - isSide\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 // sidey\n );\n styleMappingMat[0][3] = a_Position.z;\n styleMappingMat[3][0] = a_uvs[2];\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 vec4 pos = vec4(a_Position.xy, a_Position.z * a_Size, 1.0);\n vec4 project_pos = project_position(pos);\n\n if(u_heightfixed > 0.0) { // \u5224\u65AD\u51E0\u4F55\u4F53\u662F\u5426\u56FA\u5B9A\u9AD8\u5EA6\n project_pos.z = a_Position.z * a_Size;\n project_pos.z += u_raisingHeight;\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\n // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n // gl_Position = u_Mvp * (vec4(project_pos.xyz * vec3(1.0, 1.0, -1.0), 1.0));\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 float lightWeight = calc_lighting(pos);\n // v_Color = a_Color;\n v_Color = vec4(a_Color.rgb * lightWeight, a_Color.w);\n\n styleMappingMat[3][1] = lightWeight;\n\n setPickingColor(a_PickingColor);\n}\n";
|
|
35
|
+
|
|
36
|
+
var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
|
|
37
|
+
_inherits(ExtrudeModel, _BaseModel);
|
|
38
|
+
|
|
39
|
+
var _super = _createSuper(ExtrudeModel);
|
|
40
|
+
|
|
41
|
+
function ExtrudeModel() {
|
|
42
|
+
_classCallCheck(this, ExtrudeModel);
|
|
43
|
+
|
|
44
|
+
return _super.apply(this, arguments);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
_createClass(ExtrudeModel, [{
|
|
48
|
+
key: "getUninforms",
|
|
49
|
+
value: function getUninforms() {
|
|
50
|
+
var _ref = this.layer.getLayerConfig(),
|
|
51
|
+
_ref$opacity = _ref.opacity,
|
|
52
|
+
opacity = _ref$opacity === void 0 ? 1 : _ref$opacity,
|
|
53
|
+
_ref$heightfixed = _ref.heightfixed,
|
|
54
|
+
heightfixed = _ref$heightfixed === void 0 ? false : _ref$heightfixed,
|
|
55
|
+
_ref$raisingHeight = _ref.raisingHeight,
|
|
56
|
+
raisingHeight = _ref$raisingHeight === void 0 ? 0 : _ref$raisingHeight,
|
|
57
|
+
_ref$topsurface = _ref.topsurface,
|
|
58
|
+
topsurface = _ref$topsurface === void 0 ? true : _ref$topsurface,
|
|
59
|
+
_ref$sidesurface = _ref.sidesurface,
|
|
60
|
+
sidesurface = _ref$sidesurface === void 0 ? true : _ref$sidesurface,
|
|
61
|
+
sourceColor = _ref.sourceColor,
|
|
62
|
+
targetColor = _ref.targetColor;
|
|
63
|
+
|
|
64
|
+
if (this.dataTextureTest && this.dataTextureNeedUpdate({
|
|
65
|
+
opacity: opacity
|
|
66
|
+
})) {
|
|
67
|
+
this.judgeStyleAttributes({
|
|
68
|
+
opacity: opacity
|
|
69
|
+
});
|
|
70
|
+
var encodeData = this.layer.getEncodedData();
|
|
71
|
+
|
|
72
|
+
var _this$calDataFrame = this.calDataFrame(this.cellLength, encodeData, this.cellProperties),
|
|
73
|
+
data = _this$calDataFrame.data,
|
|
74
|
+
width = _this$calDataFrame.width,
|
|
75
|
+
height = _this$calDataFrame.height;
|
|
76
|
+
|
|
77
|
+
this.rowCount = height; // 当前数据纹理有多少行
|
|
78
|
+
|
|
79
|
+
this.dataTexture = this.cellLength > 0 && data.length > 0 ? this.createTexture2D({
|
|
80
|
+
flipY: true,
|
|
81
|
+
data: data,
|
|
82
|
+
format: gl.LUMINANCE,
|
|
83
|
+
type: gl.FLOAT,
|
|
84
|
+
width: width,
|
|
85
|
+
height: height
|
|
86
|
+
}) : this.createTexture2D({
|
|
87
|
+
flipY: true,
|
|
88
|
+
data: [1],
|
|
89
|
+
format: gl.LUMINANCE,
|
|
90
|
+
type: gl.FLOAT,
|
|
91
|
+
width: 1,
|
|
92
|
+
height: 1
|
|
93
|
+
});
|
|
94
|
+
} // 转化渐变色
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
var useLinearColor = 0; // 默认不生效
|
|
98
|
+
|
|
99
|
+
var sourceColorArr = [1, 1, 1, 1];
|
|
100
|
+
var targetColorArr = [1, 1, 1, 1];
|
|
101
|
+
|
|
102
|
+
if (sourceColor && targetColor) {
|
|
103
|
+
sourceColorArr = rgb2arr(sourceColor);
|
|
104
|
+
targetColorArr = rgb2arr(targetColor);
|
|
105
|
+
useLinearColor = 1;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
return {
|
|
109
|
+
// 控制侧面和顶面的显示隐藏
|
|
110
|
+
u_topsurface: Number(topsurface),
|
|
111
|
+
u_sidesurface: Number(sidesurface),
|
|
112
|
+
u_heightfixed: Number(heightfixed),
|
|
113
|
+
u_dataTexture: this.dataTexture,
|
|
114
|
+
// 数据纹理 - 有数据映射的时候纹理中带数据,若没有任何数据映射时纹理是 [1]
|
|
115
|
+
u_cellTypeLayout: this.getCellTypeLayout(),
|
|
116
|
+
u_raisingHeight: Number(raisingHeight),
|
|
117
|
+
u_opacity: isNumber(opacity) ? opacity : 1.0,
|
|
118
|
+
// 渐变色支持参数
|
|
119
|
+
u_linearColor: useLinearColor,
|
|
120
|
+
u_sourceColor: sourceColorArr,
|
|
121
|
+
u_targetColor: targetColorArr,
|
|
122
|
+
u_texture: this.texture
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
}, {
|
|
126
|
+
key: "initModels",
|
|
127
|
+
value: function initModels(callbackModel) {
|
|
128
|
+
this.loadTexture();
|
|
129
|
+
this.buildModels(callbackModel);
|
|
130
|
+
}
|
|
131
|
+
}, {
|
|
132
|
+
key: "buildModels",
|
|
133
|
+
value: function buildModels(callbackModel) {
|
|
134
|
+
var _ref2 = this.layer.getLayerConfig(),
|
|
135
|
+
_ref2$mask = _ref2.mask,
|
|
136
|
+
mask = _ref2$mask === void 0 ? false : _ref2$mask,
|
|
137
|
+
_ref2$maskInside = _ref2.maskInside,
|
|
138
|
+
maskInside = _ref2$maskInside === void 0 ? true : _ref2$maskInside;
|
|
139
|
+
|
|
140
|
+
var _this$getShaders = this.getShaders(),
|
|
141
|
+
frag = _this$getShaders.frag,
|
|
142
|
+
vert = _this$getShaders.vert,
|
|
143
|
+
type = _this$getShaders.type;
|
|
144
|
+
|
|
145
|
+
this.layer.buildLayerModel({
|
|
146
|
+
moduleName: type,
|
|
147
|
+
vertexShader: vert,
|
|
148
|
+
fragmentShader: frag,
|
|
149
|
+
triangulation: PolygonExtrudeTriangulation,
|
|
150
|
+
stencil: getMask(mask, maskInside)
|
|
151
|
+
}).then(function (model) {
|
|
152
|
+
callbackModel([model]);
|
|
153
|
+
}).catch(function (err) {
|
|
154
|
+
console.warn(err);
|
|
155
|
+
callbackModel([]);
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
}, {
|
|
159
|
+
key: "getShaders",
|
|
160
|
+
value: function getShaders() {
|
|
161
|
+
var _ref3 = this.layer.getLayerConfig(),
|
|
162
|
+
pickLight = _ref3.pickLight,
|
|
163
|
+
mapTexture = _ref3.mapTexture;
|
|
164
|
+
|
|
165
|
+
if (mapTexture) {
|
|
166
|
+
return {
|
|
167
|
+
frag: polygonExtrudeTexFrag,
|
|
168
|
+
vert: polygonExtrudeTexVert,
|
|
169
|
+
type: 'polygonExtrudeTexture'
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
if (pickLight) {
|
|
174
|
+
return {
|
|
175
|
+
frag: polygonExtrudePickLightFrag,
|
|
176
|
+
vert: polygonExtrudePickLightVert,
|
|
177
|
+
type: 'polygonExtrudePickLight'
|
|
178
|
+
};
|
|
179
|
+
} else {
|
|
180
|
+
return {
|
|
181
|
+
frag: polygonExtrudeFrag,
|
|
182
|
+
vert: polygonExtrudeVert,
|
|
183
|
+
type: 'polygonExtrude'
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}, {
|
|
188
|
+
key: "clearModels",
|
|
189
|
+
value: function clearModels() {
|
|
190
|
+
var _this$dataTexture, _this$texture;
|
|
191
|
+
|
|
192
|
+
(_this$dataTexture = this.dataTexture) === null || _this$dataTexture === void 0 ? void 0 : _this$dataTexture.destroy();
|
|
193
|
+
(_this$texture = this.texture) === null || _this$texture === void 0 ? void 0 : _this$texture.destroy();
|
|
194
|
+
}
|
|
195
|
+
}, {
|
|
196
|
+
key: "registerBuiltinAttributes",
|
|
197
|
+
value: function registerBuiltinAttributes() {
|
|
198
|
+
var bbox = this.layer.getSource().extent;
|
|
199
|
+
|
|
200
|
+
var _bbox = _slicedToArray(bbox, 4),
|
|
201
|
+
minLng = _bbox[0],
|
|
202
|
+
minLat = _bbox[1],
|
|
203
|
+
maxLng = _bbox[2],
|
|
204
|
+
maxLat = _bbox[3];
|
|
205
|
+
|
|
206
|
+
var lngLen = maxLng - minLng;
|
|
207
|
+
var latLen = maxLat - minLat;
|
|
208
|
+
this.styleAttributeService.registerStyleAttribute({
|
|
209
|
+
name: 'uvs',
|
|
210
|
+
type: AttributeType.Attribute,
|
|
211
|
+
descriptor: {
|
|
212
|
+
name: 'a_uvs',
|
|
213
|
+
buffer: {
|
|
214
|
+
// give the WebGL driver a hint that this buffer may change
|
|
215
|
+
usage: gl.STATIC_DRAW,
|
|
216
|
+
data: [],
|
|
217
|
+
type: gl.FLOAT
|
|
218
|
+
},
|
|
219
|
+
size: 3,
|
|
220
|
+
update: function update(feature, featureIdx, vertex, attributeIdx, normal) {
|
|
221
|
+
var lng = vertex[0];
|
|
222
|
+
var lat = vertex[1];
|
|
223
|
+
return [(lng - minLng) / lngLen, (lat - minLat) / latLen, vertex[4]];
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}); // point layer size;
|
|
227
|
+
|
|
228
|
+
this.styleAttributeService.registerStyleAttribute({
|
|
229
|
+
name: 'normal',
|
|
230
|
+
type: AttributeType.Attribute,
|
|
231
|
+
descriptor: {
|
|
232
|
+
name: 'a_Normal',
|
|
233
|
+
buffer: {
|
|
234
|
+
// give the WebGL driver a hint that this buffer may change
|
|
235
|
+
usage: gl.STATIC_DRAW,
|
|
236
|
+
data: [],
|
|
237
|
+
type: gl.FLOAT
|
|
238
|
+
},
|
|
239
|
+
size: 3,
|
|
240
|
+
update: function update(feature, featureIdx, vertex, attributeIdx, normal) {
|
|
241
|
+
return normal;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
this.styleAttributeService.registerStyleAttribute({
|
|
246
|
+
name: 'size',
|
|
247
|
+
type: AttributeType.Attribute,
|
|
248
|
+
descriptor: {
|
|
249
|
+
name: 'a_Size',
|
|
250
|
+
buffer: {
|
|
251
|
+
// give the WebGL driver a hint that this buffer may change
|
|
252
|
+
usage: gl.DYNAMIC_DRAW,
|
|
253
|
+
data: [],
|
|
254
|
+
type: gl.FLOAT
|
|
255
|
+
},
|
|
256
|
+
size: 1,
|
|
257
|
+
update: function update(feature, featureIdx, vertex, attributeIdx) {
|
|
258
|
+
var _feature$size = feature.size,
|
|
259
|
+
size = _feature$size === void 0 ? 10 : _feature$size;
|
|
260
|
+
return Array.isArray(size) ? [size[0]] : [size];
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
}, {
|
|
266
|
+
key: "loadTexture",
|
|
267
|
+
value: function loadTexture() {
|
|
268
|
+
var _this = this;
|
|
269
|
+
|
|
270
|
+
var _ref4 = this.layer.getLayerConfig(),
|
|
271
|
+
mapTexture = _ref4.mapTexture;
|
|
272
|
+
|
|
273
|
+
var createTexture2D = this.rendererService.createTexture2D;
|
|
274
|
+
this.texture = createTexture2D({
|
|
275
|
+
height: 0,
|
|
276
|
+
width: 0
|
|
277
|
+
});
|
|
278
|
+
|
|
279
|
+
if (mapTexture) {
|
|
280
|
+
var image = new Image();
|
|
281
|
+
image.crossOrigin = '';
|
|
282
|
+
image.src = mapTexture;
|
|
283
|
+
|
|
284
|
+
image.onload = function () {
|
|
285
|
+
_this.texture = createTexture2D({
|
|
286
|
+
data: image,
|
|
287
|
+
width: image.width,
|
|
288
|
+
height: image.height,
|
|
289
|
+
wrapS: gl.CLAMP_TO_EDGE,
|
|
290
|
+
wrapT: gl.CLAMP_TO_EDGE,
|
|
291
|
+
min: gl.LINEAR,
|
|
292
|
+
mag: gl.LINEAR
|
|
293
|
+
});
|
|
294
|
+
|
|
295
|
+
_this.layerService.updateLayerRenderList();
|
|
296
|
+
|
|
297
|
+
_this.layerService.renderLayers();
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}]);
|
|
302
|
+
|
|
303
|
+
return ExtrudeModel;
|
|
304
|
+
}(BaseModel);
|
|
305
|
+
|
|
306
|
+
export { ExtrudeModel as default };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IModel } from '@antv/l7-core';
|
|
2
|
+
import BaseModel from '../../core/BaseModel';
|
|
3
|
+
export default class FillModel extends BaseModel {
|
|
4
|
+
getUninforms(): {
|
|
5
|
+
u_dataTexture: import("@antv/l7-core").ITexture2D;
|
|
6
|
+
u_cellTypeLayout: number[];
|
|
7
|
+
u_raisingHeight: number;
|
|
8
|
+
u_opacity: number;
|
|
9
|
+
u_opacitylinear: number;
|
|
10
|
+
u_dir: number;
|
|
11
|
+
};
|
|
12
|
+
initModels(callbackModel: (models: IModel[]) => void): void;
|
|
13
|
+
buildModels(callbackModel: (models: IModel[]) => void): void;
|
|
14
|
+
clearModels(): void;
|
|
15
|
+
protected registerBuiltinAttributes(): void;
|
|
16
|
+
private getModelParams;
|
|
17
|
+
}
|