@antv/l7-layers 2.9.26-alpha.0 → 2.9.26-alpha.1
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 +208 -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 +16 -0
- package/es/index.js +106 -0
- package/es/line/index.d.ts +25 -0
- package/es/line/index.js +122 -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 +18 -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 +89 -0
- package/es/plugins/FeatureScalePlugin.d.ts +25 -0
- package/es/plugins/FeatureScalePlugin.js +324 -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 +30 -0
- package/es/point/index.js +224 -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 +28 -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/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 +19 -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 +36 -0
- package/es/tile/manager/tileLayerManager.js +312 -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 +29 -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/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/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 +266 -0
- package/lib/line/index.js +136 -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 +108 -0
- package/lib/plugins/FeatureScalePlugin.js +348 -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 +238 -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 +50 -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/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 +330 -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 +59 -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/vectorLayer.js +176 -0
- package/lib/tile/tileLayer/baseTileLayer.js +447 -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 -6
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
#define SDF_PX 8.0
|
|
2
|
+
#define EDGE_GAMMA 0.105
|
|
3
|
+
#define FONT_SIZE 48.0
|
|
4
|
+
uniform sampler2D u_sdf_map;
|
|
5
|
+
uniform float u_gamma_scale : 0.5;
|
|
6
|
+
// uniform float u_font_size : 24.0;
|
|
7
|
+
uniform float u_opacity : 1.0;
|
|
8
|
+
uniform vec4 u_stroke_color : [0, 0, 0, 1];
|
|
9
|
+
uniform float u_stroke_width : 2.0;
|
|
10
|
+
uniform float u_halo_blur : 0.5;
|
|
11
|
+
uniform float u_DevicePixelRatio;
|
|
12
|
+
|
|
13
|
+
varying vec4 v_color;
|
|
14
|
+
varying vec2 v_uv;
|
|
15
|
+
varying float v_gamma_scale;
|
|
16
|
+
varying float v_fontScale;
|
|
17
|
+
|
|
18
|
+
varying mat4 styleMappingMat; // 传递从片元中传递的映射数据
|
|
19
|
+
|
|
20
|
+
#pragma include "picking"
|
|
21
|
+
void main() {
|
|
22
|
+
// get style data mapping
|
|
23
|
+
float opacity = styleMappingMat[0][0];
|
|
24
|
+
float strokeWidth = styleMappingMat[0][2];
|
|
25
|
+
vec4 textrueStroke = vec4(
|
|
26
|
+
styleMappingMat[1][0],
|
|
27
|
+
styleMappingMat[1][1],
|
|
28
|
+
styleMappingMat[1][2],
|
|
29
|
+
styleMappingMat[1][3]
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
// get sdf from atlas
|
|
33
|
+
float dist = texture2D(u_sdf_map, v_uv).a;
|
|
34
|
+
|
|
35
|
+
// float fontScale = u_font_size / FONT_SIZE;
|
|
36
|
+
|
|
37
|
+
// lowp float buff = (6.0 - u_stroke_width / v_fontScale) / SDF_PX;
|
|
38
|
+
lowp float buff = (6.0 - strokeWidth / v_fontScale) / SDF_PX;
|
|
39
|
+
highp float gamma = (u_halo_blur * 1.19 / SDF_PX + EDGE_GAMMA) / (v_fontScale * u_gamma_scale) / 1.0;
|
|
40
|
+
|
|
41
|
+
highp float gamma_scaled = gamma * v_gamma_scale;
|
|
42
|
+
|
|
43
|
+
highp float alpha = smoothstep(buff - gamma_scaled, buff + gamma_scaled, dist);
|
|
44
|
+
// gl_FragColor = mix(vec4(v_color.rgb, v_color.a * u_opacity), vec4(u_stroke_color.rgb, u_stroke_color.a * u_opacity), smoothstep(0., 0.5, 1. - dist));
|
|
45
|
+
gl_FragColor = mix(vec4(v_color.rgb, v_color.a * opacity), vec4(textrueStroke.rgb, textrueStroke.a * opacity), smoothstep(0., 0.5, 1. - dist));
|
|
46
|
+
gl_FragColor.a= gl_FragColor.a * alpha;
|
|
47
|
+
gl_FragColor = filterColor(gl_FragColor);
|
|
48
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
#define SDF_PX 8.0
|
|
2
|
+
#define EDGE_GAMMA 0.105
|
|
3
|
+
#define FONT_SIZE 24.0
|
|
4
|
+
attribute vec3 a_Position;
|
|
5
|
+
attribute vec2 a_tex;
|
|
6
|
+
attribute vec2 a_textOffsets;
|
|
7
|
+
attribute vec4 a_Color;
|
|
8
|
+
attribute float a_Size;
|
|
9
|
+
attribute float a_Rotate;
|
|
10
|
+
|
|
11
|
+
uniform vec2 u_sdf_map_size;
|
|
12
|
+
uniform mat4 u_ModelMatrix;
|
|
13
|
+
uniform mat4 u_Mvp;
|
|
14
|
+
uniform float u_raisingHeight: 0.0;
|
|
15
|
+
|
|
16
|
+
varying vec2 v_uv;
|
|
17
|
+
varying float v_gamma_scale;
|
|
18
|
+
varying vec4 v_color;
|
|
19
|
+
varying float v_fontScale;
|
|
20
|
+
|
|
21
|
+
varying mat4 styleMappingMat; // 用于将在顶点着色器中计算好的样式值传递给片元
|
|
22
|
+
|
|
23
|
+
uniform float u_opacity : 1;
|
|
24
|
+
uniform float u_stroke_width : 2;
|
|
25
|
+
uniform vec4 u_stroke_color : [0.0, 0.0, 0.0, 0.0];
|
|
26
|
+
|
|
27
|
+
#pragma include "styleMapping"
|
|
28
|
+
#pragma include "styleMappingCalOpacity"
|
|
29
|
+
#pragma include "styleMappingCalStrokeWidth"
|
|
30
|
+
|
|
31
|
+
#pragma include "projection"
|
|
32
|
+
#pragma include "picking"
|
|
33
|
+
|
|
34
|
+
void main() {
|
|
35
|
+
// cal style mapping - 数据纹理映射部分的计算
|
|
36
|
+
styleMappingMat = mat4(
|
|
37
|
+
0.0, 0.0, 0.0, 0.0, // opacity - strokeOpacity - strokeWidth - empty
|
|
38
|
+
0.0, 0.0, 0.0, 0.0, // strokeR - strokeG - strokeB - strokeA
|
|
39
|
+
0.0, 0.0, 0.0, 0.0, // offsets[0] - offsets[1]
|
|
40
|
+
0.0, 0.0, 0.0, 0.0
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
float rowCount = u_cellTypeLayout[0][0]; // 当前的数据纹理有几行
|
|
44
|
+
float columnCount = u_cellTypeLayout[0][1]; // 当看到数据纹理有几列
|
|
45
|
+
float columnWidth = 1.0/columnCount; // 列宽
|
|
46
|
+
float rowHeight = 1.0/rowCount; // 行高
|
|
47
|
+
float cellCount = calCellCount(); // opacity - strokeOpacity - strokeWidth - stroke - offsets
|
|
48
|
+
float id = a_vertexId; // 第n个顶点
|
|
49
|
+
float cellCurrentRow = floor(id * cellCount / columnCount) + 1.0; // 起始点在第几行
|
|
50
|
+
float cellCurrentColumn = mod(id * cellCount, columnCount) + 1.0; // 起始点在第几列
|
|
51
|
+
|
|
52
|
+
// cell 固定顺序 opacity -> strokeOpacity -> strokeWidth -> stroke ...
|
|
53
|
+
// 按顺序从 cell 中取值、若没有则自动往下取值
|
|
54
|
+
float textureOffset = 0.0; // 在 cell 中取值的偏移量
|
|
55
|
+
|
|
56
|
+
vec2 opacityAndOffset = calOpacityAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);
|
|
57
|
+
styleMappingMat[0][0] = opacityAndOffset.r;
|
|
58
|
+
textureOffset = opacityAndOffset.g;
|
|
59
|
+
|
|
60
|
+
vec2 strokeWidthAndOffset = calStrokeWidthAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);
|
|
61
|
+
styleMappingMat[0][2] = strokeWidthAndOffset.r;
|
|
62
|
+
textureOffset = strokeWidthAndOffset.g;
|
|
63
|
+
|
|
64
|
+
vec4 textrueStroke = vec4(-1.0, -1.0, -1.0, -1.0);
|
|
65
|
+
if(hasStroke()) {
|
|
66
|
+
vec2 valueRPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);
|
|
67
|
+
styleMappingMat[1][0] = pos2value(valueRPos, columnWidth, rowHeight); // R
|
|
68
|
+
textureOffset += 1.0;
|
|
69
|
+
|
|
70
|
+
vec2 valueGPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);
|
|
71
|
+
styleMappingMat[1][1] = pos2value(valueGPos, columnWidth, rowHeight); // G
|
|
72
|
+
textureOffset += 1.0;
|
|
73
|
+
|
|
74
|
+
vec2 valueBPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);
|
|
75
|
+
styleMappingMat[1][2] = pos2value(valueBPos, columnWidth, rowHeight); // B
|
|
76
|
+
textureOffset += 1.0;
|
|
77
|
+
|
|
78
|
+
vec2 valueAPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);
|
|
79
|
+
styleMappingMat[1][3] = pos2value(valueAPos, columnWidth, rowHeight); // A
|
|
80
|
+
textureOffset += 1.0;
|
|
81
|
+
} else {
|
|
82
|
+
if(u_stroke_color == vec4(0.0)) {
|
|
83
|
+
styleMappingMat[1][0] = v_color.r;
|
|
84
|
+
styleMappingMat[1][1] = v_color.g;
|
|
85
|
+
styleMappingMat[1][2] = v_color.b;
|
|
86
|
+
styleMappingMat[1][3] = v_color.a;
|
|
87
|
+
} else {
|
|
88
|
+
styleMappingMat[1][0] = u_stroke_color.r;
|
|
89
|
+
styleMappingMat[1][1] = u_stroke_color.g;
|
|
90
|
+
styleMappingMat[1][2] = u_stroke_color.b;
|
|
91
|
+
styleMappingMat[1][3] = u_stroke_color.a;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// cal style mapping - 数据纹理映射部分的计算
|
|
96
|
+
|
|
97
|
+
v_color = a_Color;
|
|
98
|
+
v_uv = a_tex / u_sdf_map_size;
|
|
99
|
+
|
|
100
|
+
// 文本缩放比例
|
|
101
|
+
float fontScale = a_Size / FONT_SIZE;
|
|
102
|
+
v_fontScale = fontScale;
|
|
103
|
+
|
|
104
|
+
vec4 project_pos = project_position(vec4(a_Position, 1.0));
|
|
105
|
+
// vec4 projected_position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));
|
|
106
|
+
|
|
107
|
+
highp float angle_sin = sin(a_Rotate);
|
|
108
|
+
highp float angle_cos = cos(a_Rotate);
|
|
109
|
+
mat2 rotation_matrix = mat2(angle_cos, -1.0 * angle_sin, angle_sin, angle_cos);
|
|
110
|
+
|
|
111
|
+
// gl_Position = vec4(projected_position.xy / projected_position.w + rotation_matrix * a_textOffsets * fontScale / u_ViewportSize * 2.0 * u_DevicePixelRatio, 0.0, 1.0);
|
|
112
|
+
|
|
113
|
+
float raiseHeight = u_raisingHeight;
|
|
114
|
+
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
115
|
+
float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);
|
|
116
|
+
raiseHeight = u_raisingHeight * mapboxZoomScale;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
vec4 projected_position;
|
|
120
|
+
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
|
|
121
|
+
projected_position = u_Mvp * (vec4(a_Position.xyz + vec3(0.0, 0.0, raiseHeight), 1.0));
|
|
122
|
+
} else { // else
|
|
123
|
+
projected_position = project_common_position_to_clipspace(vec4(project_pos.xyz + vec3(0.0, 0.0, raiseHeight), 1.0));
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
gl_Position = vec4(
|
|
127
|
+
projected_position.xy / projected_position.w + rotation_matrix * a_textOffsets * fontScale / u_ViewportSize * 2.0 * u_DevicePixelRatio, 0.0, 1.0);
|
|
128
|
+
v_gamma_scale = gl_Position.w;
|
|
129
|
+
setPickingColor(a_PickingColor);
|
|
130
|
+
|
|
131
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
uniform float u_additive;
|
|
2
|
+
varying mat4 styleMappingMat; // 传递从片元中传递的映射数据
|
|
3
|
+
|
|
4
|
+
varying vec4 v_data;
|
|
5
|
+
varying vec4 v_color;
|
|
6
|
+
varying float v_radius;
|
|
7
|
+
|
|
8
|
+
#pragma include "sdf_2d"
|
|
9
|
+
#pragma include "picking"
|
|
10
|
+
|
|
11
|
+
void main() {
|
|
12
|
+
int shape = int(floor(v_data.w + 0.5));
|
|
13
|
+
|
|
14
|
+
vec4 textrueStroke = vec4(
|
|
15
|
+
styleMappingMat[1][0],
|
|
16
|
+
styleMappingMat[1][1],
|
|
17
|
+
styleMappingMat[1][2],
|
|
18
|
+
styleMappingMat[1][3]
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
float opacity = styleMappingMat[0][0];
|
|
22
|
+
float stroke_opacity = styleMappingMat[0][1];
|
|
23
|
+
float strokeWidth = styleMappingMat[0][2];
|
|
24
|
+
vec4 strokeColor = textrueStroke == vec4(0) ? v_color : textrueStroke;
|
|
25
|
+
|
|
26
|
+
lowp float antialiasblur = v_data.z;
|
|
27
|
+
float r = v_radius / (v_radius + strokeWidth);
|
|
28
|
+
|
|
29
|
+
float outer_df;
|
|
30
|
+
float inner_df;
|
|
31
|
+
// 'circle', 'triangle', 'square', 'pentagon', 'hexagon', 'octogon', 'hexagram', 'rhombus', 'vesica'
|
|
32
|
+
if (shape == 0) {
|
|
33
|
+
outer_df = sdCircle(v_data.xy, 1.0);
|
|
34
|
+
inner_df = sdCircle(v_data.xy, r);
|
|
35
|
+
} else if (shape == 1) {
|
|
36
|
+
outer_df = sdEquilateralTriangle(1.1 * v_data.xy);
|
|
37
|
+
inner_df = sdEquilateralTriangle(1.1 / r * v_data.xy);
|
|
38
|
+
} else if (shape == 2) {
|
|
39
|
+
outer_df = sdBox(v_data.xy, vec2(1.));
|
|
40
|
+
inner_df = sdBox(v_data.xy, vec2(r));
|
|
41
|
+
} else if (shape == 3) {
|
|
42
|
+
outer_df = sdPentagon(v_data.xy, 0.8);
|
|
43
|
+
inner_df = sdPentagon(v_data.xy, r * 0.8);
|
|
44
|
+
} else if (shape == 4) {
|
|
45
|
+
outer_df = sdHexagon(v_data.xy, 0.8);
|
|
46
|
+
inner_df = sdHexagon(v_data.xy, r * 0.8);
|
|
47
|
+
} else if (shape == 5) {
|
|
48
|
+
outer_df = sdOctogon(v_data.xy, 1.0);
|
|
49
|
+
inner_df = sdOctogon(v_data.xy, r);
|
|
50
|
+
} else if (shape == 6) {
|
|
51
|
+
outer_df = sdHexagram(v_data.xy, 0.52);
|
|
52
|
+
inner_df = sdHexagram(v_data.xy, r * 0.52);
|
|
53
|
+
} else if (shape == 7) {
|
|
54
|
+
outer_df = sdRhombus(v_data.xy, vec2(1.0));
|
|
55
|
+
inner_df = sdRhombus(v_data.xy, vec2(r));
|
|
56
|
+
} else if (shape == 8) {
|
|
57
|
+
outer_df = sdVesica(v_data.xy, 1.1, 0.8);
|
|
58
|
+
inner_df = sdVesica(v_data.xy, r * 1.1, r * 0.8);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
float opacity_t = smoothstep(0.0, antialiasblur, outer_df);
|
|
63
|
+
|
|
64
|
+
float color_t = strokeWidth < 0.01 ? 0.0 : smoothstep(
|
|
65
|
+
antialiasblur,
|
|
66
|
+
0.0,
|
|
67
|
+
inner_df
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
if(strokeWidth < 0.01) {
|
|
71
|
+
gl_FragColor = vec4(v_color.rgb, v_color.a * opacity);
|
|
72
|
+
} else {
|
|
73
|
+
gl_FragColor = mix(vec4(v_color.rgb, v_color.a * opacity), strokeColor * stroke_opacity, color_t);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if(u_additive > 0.0) {
|
|
77
|
+
gl_FragColor *= opacity_t;
|
|
78
|
+
gl_FragColor = filterColorAlpha(gl_FragColor, gl_FragColor.a);
|
|
79
|
+
} else {
|
|
80
|
+
gl_FragColor.a *= opacity_t;
|
|
81
|
+
gl_FragColor = filterColor(gl_FragColor);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
attribute vec4 a_Color;
|
|
2
|
+
attribute vec3 a_Position;
|
|
3
|
+
attribute vec3 a_Extrude;
|
|
4
|
+
attribute float a_Size;
|
|
5
|
+
attribute float a_Shape;
|
|
6
|
+
|
|
7
|
+
varying mat4 styleMappingMat; // 用于将在顶点着色器中计算好的样式值传递给片元
|
|
8
|
+
|
|
9
|
+
uniform mat4 u_ModelMatrix;
|
|
10
|
+
uniform mat4 u_Mvp;
|
|
11
|
+
uniform float u_isMeter;
|
|
12
|
+
|
|
13
|
+
uniform vec2 u_tileOrigin;
|
|
14
|
+
uniform float u_coord;
|
|
15
|
+
|
|
16
|
+
varying vec4 v_data;
|
|
17
|
+
varying vec4 v_color;
|
|
18
|
+
varying float v_radius;
|
|
19
|
+
|
|
20
|
+
uniform float u_opacity : 1;
|
|
21
|
+
uniform float u_stroke_opacity : 1;
|
|
22
|
+
uniform float u_stroke_width : 2;
|
|
23
|
+
uniform vec4 u_stroke_color : [0.0, 0.0, 0.0, 0.0];
|
|
24
|
+
uniform vec2 u_offsets;
|
|
25
|
+
|
|
26
|
+
uniform float u_blur : 0.0;
|
|
27
|
+
|
|
28
|
+
#pragma include "styleMapping"
|
|
29
|
+
#pragma include "styleMappingCalOpacity"
|
|
30
|
+
#pragma include "styleMappingCalStrokeOpacity"
|
|
31
|
+
#pragma include "styleMappingCalStrokeWidth"
|
|
32
|
+
|
|
33
|
+
#pragma include "projection"
|
|
34
|
+
#pragma include "picking"
|
|
35
|
+
|
|
36
|
+
void main() {
|
|
37
|
+
vec3 extrude = a_Extrude;
|
|
38
|
+
float shape_type = a_Shape;
|
|
39
|
+
float newSize = setPickingSize(a_Size);
|
|
40
|
+
|
|
41
|
+
// cal style mapping - 数据纹理映射部分的计算
|
|
42
|
+
styleMappingMat = mat4(
|
|
43
|
+
0.0, 0.0, 0.0, 0.0, // opacity - strokeOpacity - strokeWidth - empty
|
|
44
|
+
0.0, 0.0, 0.0, 0.0, // strokeR - strokeG - strokeB - strokeA
|
|
45
|
+
0.0, 0.0, 0.0, 0.0, // offsets[0] - offsets[1]
|
|
46
|
+
0.0, 0.0, 0.0, 0.0
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
float rowCount = u_cellTypeLayout[0][0]; // 当前的数据纹理有几行
|
|
50
|
+
float columnCount = u_cellTypeLayout[0][1]; // 当看到数据纹理有几列
|
|
51
|
+
float columnWidth = 1.0/columnCount; // 列宽
|
|
52
|
+
float rowHeight = 1.0/rowCount; // 行高
|
|
53
|
+
float cellCount = calCellCount(); // opacity - strokeOpacity - strokeWidth - stroke - offsets
|
|
54
|
+
float id = a_vertexId; // 第n个顶点
|
|
55
|
+
float cellCurrentRow = floor(id * cellCount / columnCount) + 1.0; // 起始点在第几行
|
|
56
|
+
float cellCurrentColumn = mod(id * cellCount, columnCount) + 1.0; // 起始点在第几列
|
|
57
|
+
|
|
58
|
+
// cell 固定顺序 opacity -> strokeOpacity -> strokeWidth -> stroke ...
|
|
59
|
+
// 按顺序从 cell 中取值、若没有则自动往下取值
|
|
60
|
+
float textureOffset = 0.0; // 在 cell 中取值的偏移量
|
|
61
|
+
|
|
62
|
+
vec2 opacityAndOffset = calOpacityAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);
|
|
63
|
+
styleMappingMat[0][0] = opacityAndOffset.r;
|
|
64
|
+
textureOffset = opacityAndOffset.g;
|
|
65
|
+
|
|
66
|
+
vec2 strokeOpacityAndOffset = calStrokeOpacityAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);
|
|
67
|
+
styleMappingMat[0][1] = strokeOpacityAndOffset.r;
|
|
68
|
+
textureOffset = strokeOpacityAndOffset.g;
|
|
69
|
+
|
|
70
|
+
vec2 strokeWidthAndOffset = calStrokeWidthAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);
|
|
71
|
+
styleMappingMat[0][2] = strokeWidthAndOffset.r;
|
|
72
|
+
textureOffset = strokeWidthAndOffset.g;
|
|
73
|
+
|
|
74
|
+
vec4 textrueStroke = vec4(-1.0, -1.0, -1.0, -1.0);
|
|
75
|
+
if(hasStroke()) {
|
|
76
|
+
vec2 valueRPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);
|
|
77
|
+
styleMappingMat[1][0] = pos2value(valueRPos, columnWidth, rowHeight); // R
|
|
78
|
+
textureOffset += 1.0;
|
|
79
|
+
|
|
80
|
+
vec2 valueGPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);
|
|
81
|
+
styleMappingMat[1][1] = pos2value(valueGPos, columnWidth, rowHeight); // G
|
|
82
|
+
textureOffset += 1.0;
|
|
83
|
+
|
|
84
|
+
vec2 valueBPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);
|
|
85
|
+
styleMappingMat[1][2] = pos2value(valueBPos, columnWidth, rowHeight); // B
|
|
86
|
+
textureOffset += 1.0;
|
|
87
|
+
|
|
88
|
+
vec2 valueAPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);
|
|
89
|
+
styleMappingMat[1][3] = pos2value(valueAPos, columnWidth, rowHeight); // A
|
|
90
|
+
textureOffset += 1.0;
|
|
91
|
+
} else {
|
|
92
|
+
if(u_stroke_color == vec4(0.0)) {
|
|
93
|
+
styleMappingMat[1][0] = v_color.r;
|
|
94
|
+
styleMappingMat[1][1] = v_color.g;
|
|
95
|
+
styleMappingMat[1][2] = v_color.b;
|
|
96
|
+
styleMappingMat[1][3] = v_color.a;
|
|
97
|
+
} else {
|
|
98
|
+
styleMappingMat[1][0] = u_stroke_color.r;
|
|
99
|
+
styleMappingMat[1][1] = u_stroke_color.g;
|
|
100
|
+
styleMappingMat[1][2] = u_stroke_color.b;
|
|
101
|
+
styleMappingMat[1][3] = u_stroke_color.a;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
vec2 textrueOffsets = vec2(0.0, 0.0);
|
|
106
|
+
if(hasOffsets()) {
|
|
107
|
+
vec2 valueXPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);
|
|
108
|
+
textrueOffsets.r = pos2value(valueXPos, columnWidth, rowHeight); // x
|
|
109
|
+
textureOffset += 1.0;
|
|
110
|
+
|
|
111
|
+
vec2 valueYPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);
|
|
112
|
+
textrueOffsets.g = pos2value(valueYPos, columnWidth, rowHeight); // x
|
|
113
|
+
textureOffset += 1.0;
|
|
114
|
+
} else {
|
|
115
|
+
textrueOffsets = u_offsets;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// cal style mapping
|
|
119
|
+
|
|
120
|
+
v_color = a_Color;
|
|
121
|
+
v_radius = newSize;
|
|
122
|
+
|
|
123
|
+
// anti-alias
|
|
124
|
+
// float antialiased_blur = -max(u_blur, antialiasblur);
|
|
125
|
+
float antialiasblur = -max(2.0 / u_DevicePixelRatio / a_Size, u_blur);
|
|
126
|
+
|
|
127
|
+
vec2 offset = (extrude.xy * (newSize + u_stroke_width) + textrueOffsets);
|
|
128
|
+
vec3 aPosition = a_Position;
|
|
129
|
+
if(u_isMeter < 1.0) {
|
|
130
|
+
// 不以米为实际单位
|
|
131
|
+
offset = project_pixel(offset);
|
|
132
|
+
} else {
|
|
133
|
+
// 以米为实际单位
|
|
134
|
+
antialiasblur *= pow(19.0 - u_Zoom, 2.0);
|
|
135
|
+
antialiasblur = max(antialiasblur, -0.01);
|
|
136
|
+
// offset *= 0.5;
|
|
137
|
+
|
|
138
|
+
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
139
|
+
aPosition.xy += offset;
|
|
140
|
+
offset.x = 0.0;
|
|
141
|
+
offset.y = 0.0;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
v_data = vec4(extrude.x, extrude.y, antialiasblur,shape_type);
|
|
146
|
+
|
|
147
|
+
vec4 project_pos = project_position(vec4(aPosition.xy, 0.0, 1.0));
|
|
148
|
+
|
|
149
|
+
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
150
|
+
float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
if(u_coord > 0.0) {
|
|
154
|
+
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
|
|
155
|
+
gl_Position = u_Mvp * vec4(project_pos.xy + offset, 0.0, 1.0);
|
|
156
|
+
} else {
|
|
157
|
+
gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, 0.0, 1.0));
|
|
158
|
+
}
|
|
159
|
+
} else {
|
|
160
|
+
gl_PointSize = 24.0;
|
|
161
|
+
vec2 pointPos = a_Position.xy;
|
|
162
|
+
vec4 world = vec4(project_mvt_offset_position(vec4(u_tileOrigin, 0.0, 1.0)).xyz, 1.0); // 瓦片起始点的世界坐标
|
|
163
|
+
|
|
164
|
+
vec2 pointOffset = pointPos * pow(2.0, u_Zoom); // 瓦片内的点的偏移坐标
|
|
165
|
+
|
|
166
|
+
world.xy += offset;
|
|
167
|
+
world.xy += pointOffset;
|
|
168
|
+
|
|
169
|
+
if (u_CoordinateSystem == COORDINATE_SYSTEM_METER_OFFSET || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
170
|
+
// Needs to be divided with project_uCommonUnitsPerMeter
|
|
171
|
+
world.w *= u_PixelsPerMeter.z;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
gl_Position = u_ViewProjectionMatrix * world + u_ViewportCenterProjection;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
setPickingColor(a_PickingColor);
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
}
|
|
@@ -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,19 @@
|
|
|
1
|
+
import BaseLayer from '../core/BaseLayer';
|
|
2
|
+
import { IPolygonLayerStyleOptions } from '../core/interface';
|
|
3
|
+
import { PolygonModelType } from './models/';
|
|
4
|
+
export default class PolygonLayer extends BaseLayer<IPolygonLayerStyleOptions> {
|
|
5
|
+
type: string;
|
|
6
|
+
buildModels(): void;
|
|
7
|
+
rebuildModels(): void;
|
|
8
|
+
protected getConfigSchema(): {
|
|
9
|
+
properties: {
|
|
10
|
+
opacity: {
|
|
11
|
+
type: string;
|
|
12
|
+
minimum: number;
|
|
13
|
+
maximum: number;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
protected getModelType(): PolygonModelType;
|
|
18
|
+
protected getPointModelType(): PolygonModelType;
|
|
19
|
+
}
|
|
@@ -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 };
|