@antv/l7-layers 2.9.37-alpha.2 → 2.9.37-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/Geometry/index.d.ts +23 -0
- package/es/Geometry/index.js +105 -0
- package/es/Geometry/models/billboard.d.ts +17 -0
- package/es/Geometry/models/billboard.js +215 -0
- package/es/Geometry/models/index.d.ts +5 -0
- package/es/Geometry/models/index.js +9 -0
- package/es/Geometry/models/plane.d.ts +36 -0
- package/es/Geometry/models/plane.js +406 -0
- package/es/Geometry/models/sprite.d.ts +38 -0
- package/es/Geometry/models/sprite.js +288 -0
- package/es/Geometry/shaders/billboard_frag.glsl +13 -0
- package/es/Geometry/shaders/billboard_vert.glsl +50 -0
- package/es/Geometry/shaders/plane_frag.glsl +22 -0
- package/es/Geometry/shaders/plane_vert.glsl +53 -0
- package/es/Geometry/shaders/sprite_frag.glsl +21 -0
- package/es/Geometry/shaders/sprite_vert.glsl +28 -0
- package/es/canvas/index.d.ts +14 -0
- package/es/canvas/index.js +108 -0
- package/es/canvas/models/canvas.d.ts +18 -0
- package/es/canvas/models/canvas.js +212 -0
- package/es/canvas/models/index.d.ts +5 -0
- package/es/canvas/models/index.js +5 -0
- package/es/citybuliding/building.d.ts +8 -0
- package/es/citybuliding/building.js +73 -0
- package/es/citybuliding/models/build.d.ts +22 -0
- package/es/citybuliding/models/build.js +187 -0
- package/es/citybuliding/shaders/build_frag.glsl +117 -0
- package/es/citybuliding/shaders/build_vert.glsl +54 -0
- package/es/core/BaseLayer.d.ts +225 -0
- package/es/core/BaseLayer.js +1439 -0
- package/es/core/BaseModel.d.ts +140 -0
- package/es/core/BaseModel.js +490 -0
- package/es/core/interface.d.ts +225 -0
- package/es/core/interface.js +30 -0
- package/es/core/schema.d.ts +27 -0
- package/es/core/schema.js +25 -0
- package/es/core/shape/Path.d.ts +39 -0
- package/es/core/shape/Path.js +62 -0
- package/es/core/shape/extrude.d.ts +17 -0
- package/es/core/shape/extrude.js +148 -0
- package/es/core/triangulation.d.ts +130 -0
- package/es/core/triangulation.js +552 -0
- package/es/earth/index.d.ts +22 -0
- package/es/earth/index.js +98 -0
- package/es/earth/models/atmosphere.d.ts +9 -0
- package/es/earth/models/atmosphere.js +135 -0
- package/es/earth/models/base.d.ts +16 -0
- package/es/earth/models/base.js +206 -0
- package/es/earth/models/bloomsphere.d.ts +9 -0
- package/es/earth/models/bloomsphere.js +134 -0
- package/es/earth/shaders/atmosphere_frag.glsl +17 -0
- package/es/earth/shaders/atmosphere_vert.glsl +26 -0
- package/es/earth/shaders/base_frag.glsl +13 -0
- package/es/earth/shaders/base_vert.glsl +52 -0
- package/es/earth/shaders/bloomsphere_frag.glsl +15 -0
- package/es/earth/shaders/bloomsphere_vert.glsl +20 -0
- package/es/earth/utils.d.ts +26 -0
- package/es/earth/utils.js +104 -0
- package/es/glsl.d.ts +5 -0
- package/es/heatmap/index.d.ts +12 -0
- package/es/heatmap/index.js +128 -0
- package/es/heatmap/models/grid.d.ts +8 -0
- package/es/heatmap/models/grid.js +106 -0
- package/es/heatmap/models/grid3d.d.ts +8 -0
- package/es/heatmap/models/grid3d.js +140 -0
- package/es/heatmap/models/heatmap.d.ts +24 -0
- package/es/heatmap/models/heatmap.js +461 -0
- package/es/heatmap/models/hexagon.d.ts +8 -0
- package/es/heatmap/models/hexagon.js +107 -0
- package/es/heatmap/models/index.d.ts +5 -0
- package/es/heatmap/models/index.js +12 -0
- package/es/heatmap/shaders/grid_vert.glsl +42 -0
- package/es/heatmap/shaders/heatmap_3d_frag.glsl +14 -0
- package/es/heatmap/shaders/heatmap_3d_vert.glsl +46 -0
- package/es/heatmap/shaders/heatmap_frag.glsl +47 -0
- package/es/heatmap/shaders/heatmap_framebuffer_frag.glsl +10 -0
- package/es/heatmap/shaders/heatmap_framebuffer_vert.glsl +35 -0
- package/es/heatmap/shaders/heatmap_vert.glsl +10 -0
- package/es/heatmap/shaders/hexagon_3d_frag.glsl +0 -0
- package/es/heatmap/shaders/hexagon_3d_vert.glsl +64 -0
- package/es/heatmap/shaders/hexagon_frag.glsl +12 -0
- package/es/heatmap/shaders/hexagon_vert.glsl +41 -0
- package/es/heatmap/triangulation.d.ts +5 -0
- package/es/heatmap/triangulation.js +37 -0
- package/es/image/index.d.ts +10 -0
- package/es/image/index.js +91 -0
- package/es/image/models/dataImage.d.ts +13 -0
- package/es/image/models/dataImage.js +186 -0
- package/es/image/models/image.d.ts +10 -0
- package/es/image/models/image.js +150 -0
- package/es/image/models/index.d.ts +5 -0
- package/es/image/models/index.js +9 -0
- package/es/image/models/tileDataImage.d.ts +10 -0
- package/es/image/models/tileDataImage.js +160 -0
- package/es/image/shaders/dataImage_frag.glsl +38 -0
- package/es/image/shaders/image_frag.glsl +9 -0
- package/es/image/shaders/image_vert.glsl +17 -0
- package/es/index.d.ts +17 -0
- package/es/index.js +107 -0
- package/es/line/index.d.ts +34 -0
- package/es/line/index.js +127 -0
- package/es/line/models/arc.d.ts +17 -0
- package/es/line/models/arc.js +356 -0
- package/es/line/models/arc_3d.d.ts +17 -0
- package/es/line/models/arc_3d.js +333 -0
- package/es/line/models/earthArc_3d.d.ts +17 -0
- package/es/line/models/earthArc_3d.js +336 -0
- package/es/line/models/great_circle.d.ts +12 -0
- package/es/line/models/great_circle.js +294 -0
- package/es/line/models/half.d.ts +18 -0
- package/es/line/models/half.js +281 -0
- package/es/line/models/index.d.ts +5 -0
- package/es/line/models/index.js +25 -0
- package/es/line/models/line.d.ts +21 -0
- package/es/line/models/line.js +443 -0
- package/es/line/models/linearline.d.ts +11 -0
- package/es/line/models/linearline.js +275 -0
- package/es/line/models/simpleLine.d.ts +14 -0
- package/es/line/models/simpleLine.js +234 -0
- package/es/line/models/simpleTileLine.d.ts +9 -0
- package/es/line/models/simpleTileLine.js +100 -0
- package/es/line/models/tile.d.ts +8 -0
- package/es/line/models/tile.js +178 -0
- package/es/line/models/wall.d.ts +12 -0
- package/es/line/models/wall.js +293 -0
- package/es/line/shaders/arc_chunks.vert.glsl +21 -0
- package/es/line/shaders/dash/arc_dash_frag.glsl +28 -0
- package/es/line/shaders/dash/arc_dash_vert.glsl +150 -0
- package/es/line/shaders/dash/line_dash_frag.glsl +31 -0
- package/es/line/shaders/dash/line_dash_vert.glsl +93 -0
- package/es/line/shaders/half/line_half_frag.glsl +53 -0
- package/es/line/shaders/half/line_half_vert.glsl +169 -0
- package/es/line/shaders/line_arc2d_vert.glsl +114 -0
- package/es/line/shaders/line_arc_3d_frag.glsl +103 -0
- package/es/line/shaders/line_arc_3d_vert.glsl +206 -0
- package/es/line/shaders/line_arc_frag.glsl +88 -0
- package/es/line/shaders/line_arc_great_circle_frag.glsl +101 -0
- package/es/line/shaders/line_arc_great_circle_vert.glsl +214 -0
- package/es/line/shaders/line_arc_vert.glsl +178 -0
- package/es/line/shaders/line_bezier_vert.glsl +85 -0
- package/es/line/shaders/line_frag.glsl +99 -0
- package/es/line/shaders/line_vert.glsl +192 -0
- package/es/line/shaders/linear/arc3d_linear_frag.glsl +46 -0
- package/es/line/shaders/linear/arc3d_linear_vert.glsl +206 -0
- package/es/line/shaders/linear/arc_linear_frag.glsl +38 -0
- package/es/line/shaders/linear/arc_linear_vert.glsl +138 -0
- package/es/line/shaders/linear/line_linear_frag.glsl +27 -0
- package/es/line/shaders/linearLine/line_linear_frag.glsl +20 -0
- package/es/line/shaders/linearLine/line_linear_vert.glsl +112 -0
- package/es/line/shaders/simple/simpleline_frag.glsl +10 -0
- package/es/line/shaders/simple/simpleline_linear_frag.glsl +11 -0
- package/es/line/shaders/simple/simpleline_vert.glsl +79 -0
- package/es/line/shaders/tile/line_tile_map_vert.glsl +25 -0
- package/es/line/shaders/tile/line_tile_vert.glsl +52 -0
- package/es/line/shaders/tile/simpleline_map_vert.glsl +15 -0
- package/es/line/shaders/tile/simpleline_vert.glsl +21 -0
- package/es/line/shaders/wall/wall_frag.glsl +89 -0
- package/es/line/shaders/wall/wall_vert.glsl +77 -0
- package/es/mask/index.d.ts +18 -0
- package/es/mask/index.js +147 -0
- package/es/mask/models/fill.d.ts +12 -0
- package/es/mask/models/fill.js +124 -0
- package/es/mask/models/index.d.ts +5 -0
- package/es/mask/models/index.js +7 -0
- package/es/mask/shaders/mask_vert.glsl +16 -0
- package/es/plugins/DataMappingPlugin.d.ts +18 -0
- package/es/plugins/DataMappingPlugin.js +413 -0
- package/es/plugins/DataSourcePlugin.d.ts +7 -0
- package/es/plugins/DataSourcePlugin.js +84 -0
- package/es/plugins/FeatureScalePlugin.d.ts +24 -0
- package/es/plugins/FeatureScalePlugin.js +342 -0
- package/es/plugins/LayerAnimateStylePlugin.d.ts +5 -0
- package/es/plugins/LayerAnimateStylePlugin.js +29 -0
- package/es/plugins/LayerModelPlugin.d.ts +10 -0
- package/es/plugins/LayerModelPlugin.js +72 -0
- package/es/plugins/LayerStylePlugin.d.ts +8 -0
- package/es/plugins/LayerStylePlugin.js +39 -0
- package/es/plugins/LightingPlugin.d.ts +36 -0
- package/es/plugins/LightingPlugin.js +104 -0
- package/es/plugins/MultiPassRendererPlugin.d.ts +23 -0
- package/es/plugins/MultiPassRendererPlugin.js +65 -0
- package/es/plugins/PixelPickingPlugin.d.ts +8 -0
- package/es/plugins/PixelPickingPlugin.js +126 -0
- package/es/plugins/RegisterStyleAttributePlugin.d.ts +15 -0
- package/es/plugins/RegisterStyleAttributePlugin.js +151 -0
- package/es/plugins/ShaderUniformPlugin.d.ts +21 -0
- package/es/plugins/ShaderUniformPlugin.js +106 -0
- package/es/plugins/UpdateModelPlugin.d.ts +8 -0
- package/es/plugins/UpdateModelPlugin.js +31 -0
- package/es/plugins/UpdateStyleAttributePlugin.d.ts +12 -0
- package/es/plugins/UpdateStyleAttributePlugin.js +83 -0
- package/es/point/index.d.ts +31 -0
- package/es/point/index.js +216 -0
- package/es/point/models/earthExtrude.d.ts +24 -0
- package/es/point/models/earthExtrude.js +274 -0
- package/es/point/models/earthFill.d.ts +11 -0
- package/es/point/models/earthFill.js +258 -0
- package/es/point/models/extrude.d.ts +24 -0
- package/es/point/models/extrude.js +295 -0
- package/es/point/models/fill.d.ts +40 -0
- package/es/point/models/fill.js +403 -0
- package/es/point/models/fillmage.d.ts +25 -0
- package/es/point/models/fillmage.js +366 -0
- package/es/point/models/image.d.ts +11 -0
- package/es/point/models/image.js +239 -0
- package/es/point/models/index.d.ts +5 -0
- package/es/point/models/index.js +30 -0
- package/es/point/models/normal.d.ts +16 -0
- package/es/point/models/normal.js +124 -0
- package/es/point/models/radar.d.ts +24 -0
- package/es/point/models/radar.js +232 -0
- package/es/point/models/simplePoint.d.ts +16 -0
- package/es/point/models/simplePoint.js +179 -0
- package/es/point/models/text.d.ts +57 -0
- package/es/point/models/text.js +619 -0
- package/es/point/models/tile.d.ts +15 -0
- package/es/point/models/tile.js +175 -0
- package/es/point/models/tileText.d.ts +52 -0
- package/es/point/models/tileText.js +509 -0
- package/es/point/shaders/animate/wave_frag.glsl +65 -0
- package/es/point/shaders/earth/extrude_frag.glsl +44 -0
- package/es/point/shaders/earth/extrude_vert.glsl +140 -0
- package/es/point/shaders/earth/fill_frag.glsl +86 -0
- package/es/point/shaders/earth/fill_vert.glsl +125 -0
- package/es/point/shaders/extrude/extrude_frag.glsl +44 -0
- package/es/point/shaders/extrude/extrude_vert.glsl +121 -0
- package/es/point/shaders/fill_frag.glsl +84 -0
- package/es/point/shaders/fill_vert.glsl +188 -0
- package/es/point/shaders/image/fillImage_frag.glsl +20 -0
- package/es/point/shaders/image/fillImage_vert.glsl +116 -0
- package/es/point/shaders/image_frag.glsl +39 -0
- package/es/point/shaders/image_vert.glsl +90 -0
- package/es/point/shaders/normal_frag.glsl +6 -0
- package/es/point/shaders/normal_vert.glsl +24 -0
- package/es/point/shaders/radar/radar_frag.glsl +53 -0
- package/es/point/shaders/radar/radar_vert.glsl +70 -0
- package/es/point/shaders/simplePoint_frag.glsl +53 -0
- package/es/point/shaders/simplePoint_vert.glsl +79 -0
- package/es/point/shaders/text_frag.glsl +48 -0
- package/es/point/shaders/text_vert.glsl +131 -0
- package/es/point/shaders/tile/fill_tile_frag.glsl +76 -0
- package/es/point/shaders/tile/fill_tile_vert.glsl +78 -0
- package/es/point/shaders/tile/text_frag.glsl +33 -0
- package/es/point/shaders/tile/text_map_frag.glsl +31 -0
- package/es/point/shaders/tile/text_map_vert.glsl +38 -0
- package/es/point/shaders/tile/text_vert.glsl +48 -0
- package/es/point/shape/extrude.d.ts +15 -0
- package/es/point/shape/extrude.js +63 -0
- package/es/polygon/index.d.ts +18 -0
- package/es/polygon/index.js +133 -0
- package/es/polygon/models/extrude.d.ts +28 -0
- package/es/polygon/models/extrude.js +302 -0
- package/es/polygon/models/fill.d.ts +17 -0
- package/es/polygon/models/fill.js +210 -0
- package/es/polygon/models/index.d.ts +5 -0
- package/es/polygon/models/index.js +28 -0
- package/es/polygon/models/ocean.d.ts +21 -0
- package/es/polygon/models/ocean.js +201 -0
- package/es/polygon/models/tile.d.ts +12 -0
- package/es/polygon/models/tile.js +101 -0
- package/es/polygon/models/water.d.ts +16 -0
- package/es/polygon/models/water.js +178 -0
- package/es/polygon/shaders/extrude/polygon_extrude_frag.glsl +44 -0
- package/es/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +44 -0
- package/es/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +85 -0
- package/es/polygon/shaders/extrude/polygon_extrude_vert.glsl +90 -0
- package/es/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +48 -0
- package/es/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +93 -0
- package/es/polygon/shaders/polygon_frag.glsl +12 -0
- package/es/polygon/shaders/polygon_linear_frag.glsl +22 -0
- package/es/polygon/shaders/polygon_linear_vert.glsl +74 -0
- package/es/polygon/shaders/polygon_vert.glsl +66 -0
- package/es/polygon/shaders/tile/polygon_tile_map_vert.glsl +16 -0
- package/es/polygon/shaders/tile/polygon_tile_vert.glsl +42 -0
- package/es/polygon/shaders/water/polygon_ocean_frag.glsl +247 -0
- package/es/polygon/shaders/water/polygon_ocean_vert.glsl +21 -0
- package/es/polygon/shaders/water/polygon_water_frag.glsl +71 -0
- package/es/polygon/shaders/water/polygon_water_vert.glsl +26 -0
- package/es/raster/buffers/triangulation.d.ts +6 -0
- package/es/raster/buffers/triangulation.js +25 -0
- package/es/raster/index.d.ts +10 -0
- package/es/raster/index.js +94 -0
- package/es/raster/models/index.d.ts +5 -0
- package/es/raster/models/index.js +10 -0
- package/es/raster/models/raster.d.ts +22 -0
- package/es/raster/models/raster.js +241 -0
- package/es/raster/models/rasterRgb.d.ts +20 -0
- package/es/raster/models/rasterRgb.js +225 -0
- package/es/raster/models/rasterTile.d.ts +18 -0
- package/es/raster/models/rasterTile.js +139 -0
- package/es/raster/raster.d.ts +21 -0
- package/es/raster/raster.js +161 -0
- package/es/raster/shaders/raster_2d_frag.glsl +64 -0
- package/es/raster/shaders/raster_2d_vert.glsl +17 -0
- package/es/raster/shaders/raster_frag.glsl +9 -0
- package/es/raster/shaders/raster_rgb_frag.glsl +12 -0
- package/es/raster/shaders/raster_vert.glsl +44 -0
- package/es/shader/minify_frag.glsl +7 -0
- package/es/shader/minify_picking_frag.glsl +10 -0
- package/es/tile/interaction/TilePickService.d.ts +16 -0
- package/es/tile/interaction/TilePickService.js +129 -0
- package/es/tile/interaction/getFeatureData.d.ts +0 -0
- package/es/tile/interaction/getFeatureData.js +0 -0
- package/es/tile/interaction/getRasterData.d.ts +4 -0
- package/es/tile/interaction/getRasterData.js +70 -0
- package/es/tile/interaction/utils.d.ts +11 -0
- package/es/tile/interaction/utils.js +97 -0
- package/es/tile/interface.d.ts +28 -0
- package/es/tile/interface.js +1 -0
- package/es/tile/manager/base.d.ts +30 -0
- package/es/tile/manager/base.js +146 -0
- package/es/tile/manager/layerManager.d.ts +19 -0
- package/es/tile/manager/layerManager.js +254 -0
- package/es/tile/manager/mapLayerManager.d.ts +7 -0
- package/es/tile/manager/mapLayerManager.js +119 -0
- package/es/tile/models/tileModel.d.ts +10 -0
- package/es/tile/models/tileModel.js +81 -0
- package/es/tile/render/TileRenderService.d.ts +10 -0
- package/es/tile/render/TileRenderService.js +68 -0
- package/es/tile/style/TileStyleService.d.ts +17 -0
- package/es/tile/style/TileStyleService.js +118 -0
- package/es/tile/style/constants.d.ts +13 -0
- package/es/tile/style/constants.js +17 -0
- package/es/tile/style/utils.d.ts +9 -0
- package/es/tile/style/utils.js +139 -0
- package/es/tile/tileFactory/base.d.ts +45 -0
- package/es/tile/tileFactory/base.js +403 -0
- package/es/tile/tileFactory/index.d.ts +5 -0
- package/es/tile/tileFactory/index.js +38 -0
- package/es/tile/tileFactory/layers/rasterDataLayer.d.ts +11 -0
- package/es/tile/tileFactory/layers/rasterDataLayer.js +77 -0
- package/es/tile/tileFactory/layers/tileTest.d.ts +15 -0
- package/es/tile/tileFactory/layers/tileTest.js +62 -0
- package/es/tile/tileFactory/layers/vectorLayer.d.ts +30 -0
- package/es/tile/tileFactory/layers/vectorLayer.js +253 -0
- package/es/tile/tileFactory/line.d.ts +12 -0
- package/es/tile/tileFactory/line.js +59 -0
- package/es/tile/tileFactory/mask.d.ts +12 -0
- package/es/tile/tileFactory/mask.js +60 -0
- package/es/tile/tileFactory/point.d.ts +12 -0
- package/es/tile/tileFactory/point.js +60 -0
- package/es/tile/tileFactory/polygon.d.ts +12 -0
- package/es/tile/tileFactory/polygon.js +59 -0
- package/es/tile/tileFactory/raster.d.ts +12 -0
- package/es/tile/tileFactory/raster.js +55 -0
- package/es/tile/tileFactory/rasterData.d.ts +12 -0
- package/es/tile/tileFactory/rasterData.js +81 -0
- package/es/tile/tileFactory/test.d.ts +12 -0
- package/es/tile/tileFactory/test.js +94 -0
- package/es/tile/tileLayer/MapTileLayer.d.ts +6 -0
- package/es/tile/tileLayer/MapTileLayer.js +48 -0
- package/es/tile/tileLayer/TileLayer.d.ts +22 -0
- package/es/tile/tileLayer/TileLayer.js +198 -0
- package/es/tile/tileLayer/base.d.ts +33 -0
- package/es/tile/tileLayer/base.js +212 -0
- package/es/tile/utils.d.ts +22 -0
- package/es/tile/utils.js +149 -0
- package/es/utils/blend.d.ts +2 -0
- package/es/utils/blend.js +54 -0
- package/es/utils/collision-index.d.ts +47 -0
- package/es/utils/collision-index.js +102 -0
- package/es/utils/dataMappingStyle.d.ts +31 -0
- package/es/utils/dataMappingStyle.js +147 -0
- package/es/utils/extrude_polyline.d.ts +68 -0
- package/es/utils/extrude_polyline.js +613 -0
- package/es/utils/grid-index.d.ts +28 -0
- package/es/utils/grid-index.js +179 -0
- package/es/utils/layerData.d.ts +2 -0
- package/es/utils/layerData.js +179 -0
- package/es/utils/multiPassRender.d.ts +16 -0
- package/es/utils/multiPassRender.js +49 -0
- package/es/utils/polylineNormal.d.ts +9 -0
- package/es/utils/polylineNormal.js +191 -0
- package/es/utils/simpleLine.d.ts +23 -0
- package/es/utils/simpleLine.js +103 -0
- package/es/utils/symbol-layout.d.ts +43 -0
- package/es/utils/symbol-layout.js +299 -0
- package/es/utils/updateShape.d.ts +2 -0
- package/es/utils/updateShape.js +20 -0
- package/es/wind/index.d.ts +11 -0
- package/es/wind/index.js +85 -0
- package/es/wind/models/index.d.ts +5 -0
- package/es/wind/models/index.js +5 -0
- package/es/wind/models/utils.d.ts +19 -0
- package/es/wind/models/utils.js +226 -0
- package/es/wind/models/wind.d.ts +24 -0
- package/es/wind/models/wind.js +317 -0
- package/es/wind/models/windRender.d.ts +104 -0
- package/es/wind/models/windRender.js +357 -0
- package/es/wind/models/windShader.d.ts +12 -0
- package/es/wind/models/windShader.js +12 -0
- package/es/wind/shaders/wind_frag.glsl +9 -0
- package/es/wind/shaders/wind_vert.glsl +17 -0
- package/lib/Geometry/index.js +117 -0
- package/lib/Geometry/models/billboard.js +229 -0
- package/lib/Geometry/models/index.js +22 -0
- package/lib/Geometry/models/plane.js +421 -0
- package/lib/Geometry/models/sprite.js +302 -0
- package/lib/Geometry/shaders/billboard_frag.glsl +13 -0
- package/lib/Geometry/shaders/billboard_vert.glsl +50 -0
- package/lib/Geometry/shaders/plane_frag.glsl +22 -0
- package/lib/Geometry/shaders/plane_vert.glsl +53 -0
- package/lib/Geometry/shaders/sprite_frag.glsl +21 -0
- package/lib/Geometry/shaders/sprite_vert.glsl +28 -0
- package/lib/canvas/index.js +120 -0
- package/lib/canvas/models/canvas.js +221 -0
- package/lib/canvas/models/index.js +16 -0
- package/lib/citybuliding/building.js +86 -0
- package/lib/citybuliding/models/build.js +202 -0
- package/lib/citybuliding/shaders/build_frag.glsl +117 -0
- package/lib/citybuliding/shaders/build_vert.glsl +54 -0
- package/lib/core/BaseLayer.js +1434 -0
- package/lib/core/BaseModel.js +507 -0
- package/lib/core/interface.js +41 -0
- package/lib/core/schema.js +33 -0
- package/lib/core/shape/Path.js +88 -0
- package/lib/core/shape/extrude.js +180 -0
- package/lib/core/triangulation.js +620 -0
- package/lib/earth/index.js +113 -0
- package/lib/earth/models/atmosphere.js +149 -0
- package/lib/earth/models/base.js +216 -0
- package/lib/earth/models/bloomsphere.js +148 -0
- package/lib/earth/shaders/atmosphere_frag.glsl +17 -0
- package/lib/earth/shaders/atmosphere_vert.glsl +26 -0
- package/lib/earth/shaders/base_frag.glsl +13 -0
- package/lib/earth/shaders/base_vert.glsl +52 -0
- package/lib/earth/shaders/bloomsphere_frag.glsl +15 -0
- package/lib/earth/shaders/bloomsphere_vert.glsl +20 -0
- package/lib/earth/utils.js +136 -0
- package/lib/glsl.d.ts +5 -0
- package/lib/heatmap/index.js +141 -0
- package/lib/heatmap/models/grid.js +120 -0
- package/lib/heatmap/models/grid3d.js +154 -0
- package/lib/heatmap/models/heatmap.js +484 -0
- package/lib/heatmap/models/hexagon.js +121 -0
- package/lib/heatmap/models/index.js +26 -0
- package/lib/heatmap/shaders/grid_vert.glsl +42 -0
- package/lib/heatmap/shaders/heatmap_3d_frag.glsl +14 -0
- package/lib/heatmap/shaders/heatmap_3d_vert.glsl +46 -0
- package/lib/heatmap/shaders/heatmap_frag.glsl +47 -0
- package/lib/heatmap/shaders/heatmap_framebuffer_frag.glsl +10 -0
- package/lib/heatmap/shaders/heatmap_framebuffer_vert.glsl +35 -0
- package/lib/heatmap/shaders/heatmap_vert.glsl +10 -0
- package/lib/heatmap/shaders/hexagon_3d_frag.glsl +0 -0
- package/lib/heatmap/shaders/hexagon_3d_vert.glsl +64 -0
- package/lib/heatmap/shaders/hexagon_frag.glsl +12 -0
- package/lib/heatmap/shaders/hexagon_vert.glsl +41 -0
- package/lib/heatmap/triangulation.js +44 -0
- package/lib/image/index.js +104 -0
- package/lib/image/models/dataImage.js +201 -0
- package/lib/image/models/image.js +164 -0
- package/lib/image/models/index.js +22 -0
- package/lib/image/models/tileDataImage.js +174 -0
- package/lib/image/shaders/dataImage_frag.glsl +38 -0
- package/lib/image/shaders/image_frag.glsl +9 -0
- package/lib/image/shaders/image_vert.glsl +17 -0
- package/lib/index.js +275 -0
- package/lib/line/index.js +139 -0
- package/lib/line/models/arc.js +373 -0
- package/lib/line/models/arc_3d.js +351 -0
- package/lib/line/models/earthArc_3d.js +354 -0
- package/lib/line/models/great_circle.js +310 -0
- package/lib/line/models/half.js +298 -0
- package/lib/line/models/index.js +46 -0
- package/lib/line/models/line.js +460 -0
- package/lib/line/models/linearline.js +292 -0
- package/lib/line/models/simpleLine.js +249 -0
- package/lib/line/models/simpleTileLine.js +115 -0
- package/lib/line/models/tile.js +194 -0
- package/lib/line/models/wall.js +309 -0
- package/lib/line/shaders/arc_chunks.vert.glsl +21 -0
- package/lib/line/shaders/dash/arc_dash_frag.glsl +28 -0
- package/lib/line/shaders/dash/arc_dash_vert.glsl +150 -0
- package/lib/line/shaders/dash/line_dash_frag.glsl +31 -0
- package/lib/line/shaders/dash/line_dash_vert.glsl +93 -0
- package/lib/line/shaders/half/line_half_frag.glsl +53 -0
- package/lib/line/shaders/half/line_half_vert.glsl +169 -0
- package/lib/line/shaders/line_arc2d_vert.glsl +114 -0
- package/lib/line/shaders/line_arc_3d_frag.glsl +103 -0
- package/lib/line/shaders/line_arc_3d_vert.glsl +206 -0
- package/lib/line/shaders/line_arc_frag.glsl +88 -0
- package/lib/line/shaders/line_arc_great_circle_frag.glsl +101 -0
- package/lib/line/shaders/line_arc_great_circle_vert.glsl +214 -0
- package/lib/line/shaders/line_arc_vert.glsl +178 -0
- package/lib/line/shaders/line_bezier_vert.glsl +85 -0
- package/lib/line/shaders/line_frag.glsl +99 -0
- package/lib/line/shaders/line_vert.glsl +192 -0
- package/lib/line/shaders/linear/arc3d_linear_frag.glsl +46 -0
- package/lib/line/shaders/linear/arc3d_linear_vert.glsl +206 -0
- package/lib/line/shaders/linear/arc_linear_frag.glsl +38 -0
- package/lib/line/shaders/linear/arc_linear_vert.glsl +138 -0
- package/lib/line/shaders/linear/line_linear_frag.glsl +27 -0
- package/lib/line/shaders/linearLine/line_linear_frag.glsl +20 -0
- package/lib/line/shaders/linearLine/line_linear_vert.glsl +112 -0
- package/lib/line/shaders/simple/simpleline_frag.glsl +10 -0
- package/lib/line/shaders/simple/simpleline_linear_frag.glsl +11 -0
- package/lib/line/shaders/simple/simpleline_vert.glsl +79 -0
- package/lib/line/shaders/tile/line_tile_map_vert.glsl +25 -0
- package/lib/line/shaders/tile/line_tile_vert.glsl +52 -0
- package/lib/line/shaders/tile/simpleline_map_vert.glsl +15 -0
- package/lib/line/shaders/tile/simpleline_vert.glsl +21 -0
- package/lib/line/shaders/wall/wall_frag.glsl +89 -0
- package/lib/line/shaders/wall/wall_vert.glsl +77 -0
- package/lib/mask/index.js +163 -0
- package/lib/mask/models/fill.js +141 -0
- package/lib/mask/models/index.js +19 -0
- package/lib/mask/shaders/mask_vert.glsl +16 -0
- package/lib/plugins/DataMappingPlugin.js +427 -0
- package/lib/plugins/DataSourcePlugin.js +97 -0
- package/lib/plugins/FeatureScalePlugin.js +365 -0
- package/lib/plugins/LayerAnimateStylePlugin.js +41 -0
- package/lib/plugins/LayerModelPlugin.js +83 -0
- package/lib/plugins/LayerStylePlugin.js +50 -0
- package/lib/plugins/LightingPlugin.js +119 -0
- package/lib/plugins/MultiPassRendererPlugin.js +77 -0
- package/lib/plugins/PixelPickingPlugin.js +139 -0
- package/lib/plugins/RegisterStyleAttributePlugin.js +164 -0
- package/lib/plugins/ShaderUniformPlugin.js +119 -0
- package/lib/plugins/UpdateModelPlugin.js +42 -0
- package/lib/plugins/UpdateStyleAttributePlugin.js +94 -0
- package/lib/point/index.js +229 -0
- package/lib/point/models/earthExtrude.js +290 -0
- package/lib/point/models/earthFill.js +293 -0
- package/lib/point/models/extrude.js +312 -0
- package/lib/point/models/fill.js +419 -0
- package/lib/point/models/fillmage.js +382 -0
- package/lib/point/models/image.js +255 -0
- package/lib/point/models/index.js +53 -0
- package/lib/point/models/normal.js +141 -0
- package/lib/point/models/radar.js +249 -0
- package/lib/point/models/simplePoint.js +196 -0
- package/lib/point/models/text.js +634 -0
- package/lib/point/models/tile.js +189 -0
- package/lib/point/models/tileText.js +524 -0
- package/lib/point/shaders/animate/wave_frag.glsl +65 -0
- package/lib/point/shaders/earth/extrude_frag.glsl +44 -0
- package/lib/point/shaders/earth/extrude_vert.glsl +140 -0
- package/lib/point/shaders/earth/fill_frag.glsl +86 -0
- package/lib/point/shaders/earth/fill_vert.glsl +125 -0
- package/lib/point/shaders/extrude/extrude_frag.glsl +44 -0
- package/lib/point/shaders/extrude/extrude_vert.glsl +121 -0
- package/lib/point/shaders/fill_frag.glsl +84 -0
- package/lib/point/shaders/fill_vert.glsl +188 -0
- package/lib/point/shaders/image/fillImage_frag.glsl +20 -0
- package/lib/point/shaders/image/fillImage_vert.glsl +116 -0
- package/lib/point/shaders/image_frag.glsl +39 -0
- package/lib/point/shaders/image_vert.glsl +90 -0
- package/lib/point/shaders/normal_frag.glsl +6 -0
- package/lib/point/shaders/normal_vert.glsl +24 -0
- package/lib/point/shaders/radar/radar_frag.glsl +53 -0
- package/lib/point/shaders/radar/radar_vert.glsl +70 -0
- package/lib/point/shaders/simplePoint_frag.glsl +53 -0
- package/lib/point/shaders/simplePoint_vert.glsl +79 -0
- package/lib/point/shaders/text_frag.glsl +48 -0
- package/lib/point/shaders/text_vert.glsl +131 -0
- package/lib/point/shaders/tile/fill_tile_frag.glsl +76 -0
- package/lib/point/shaders/tile/fill_tile_vert.glsl +78 -0
- package/lib/point/shaders/tile/text_frag.glsl +33 -0
- package/lib/point/shaders/tile/text_map_frag.glsl +31 -0
- package/lib/point/shaders/tile/text_map_vert.glsl +38 -0
- package/lib/point/shaders/tile/text_vert.glsl +48 -0
- package/lib/point/shape/extrude.js +78 -0
- package/lib/polygon/index.js +147 -0
- package/lib/polygon/models/extrude.js +318 -0
- package/lib/polygon/models/fill.js +225 -0
- package/lib/polygon/models/index.js +50 -0
- package/lib/polygon/models/ocean.js +218 -0
- package/lib/polygon/models/tile.js +114 -0
- package/lib/polygon/models/water.js +195 -0
- package/lib/polygon/shaders/extrude/polygon_extrude_frag.glsl +44 -0
- package/lib/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +44 -0
- package/lib/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +85 -0
- package/lib/polygon/shaders/extrude/polygon_extrude_vert.glsl +90 -0
- package/lib/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +48 -0
- package/lib/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +93 -0
- package/lib/polygon/shaders/polygon_frag.glsl +12 -0
- package/lib/polygon/shaders/polygon_linear_frag.glsl +22 -0
- package/lib/polygon/shaders/polygon_linear_vert.glsl +74 -0
- package/lib/polygon/shaders/polygon_vert.glsl +66 -0
- package/lib/polygon/shaders/tile/polygon_tile_map_vert.glsl +16 -0
- package/lib/polygon/shaders/tile/polygon_tile_vert.glsl +42 -0
- package/lib/polygon/shaders/water/polygon_ocean_frag.glsl +247 -0
- package/lib/polygon/shaders/water/polygon_ocean_vert.glsl +21 -0
- package/lib/polygon/shaders/water/polygon_water_frag.glsl +71 -0
- package/lib/polygon/shaders/water/polygon_water_vert.glsl +26 -0
- package/lib/raster/buffers/triangulation.js +35 -0
- package/lib/raster/index.js +107 -0
- package/lib/raster/models/index.js +23 -0
- package/lib/raster/models/raster.js +258 -0
- package/lib/raster/models/rasterRgb.js +240 -0
- package/lib/raster/models/rasterTile.js +153 -0
- package/lib/raster/raster.js +178 -0
- package/lib/raster/shaders/raster_2d_frag.glsl +64 -0
- package/lib/raster/shaders/raster_2d_vert.glsl +17 -0
- package/lib/raster/shaders/raster_frag.glsl +9 -0
- package/lib/raster/shaders/raster_rgb_frag.glsl +12 -0
- package/lib/raster/shaders/raster_vert.glsl +44 -0
- package/lib/shader/minify_frag.glsl +7 -0
- package/lib/shader/minify_picking_frag.glsl +10 -0
- package/lib/tile/interaction/TilePickService.js +143 -0
- package/lib/tile/interaction/getFeatureData.js +1 -0
- package/lib/tile/interaction/getRasterData.js +83 -0
- package/lib/tile/interaction/utils.js +120 -0
- package/lib/tile/interface.js +5 -0
- package/lib/tile/manager/base.js +161 -0
- package/lib/tile/manager/layerManager.js +275 -0
- package/lib/tile/manager/mapLayerManager.js +134 -0
- package/lib/tile/models/tileModel.js +94 -0
- package/lib/tile/render/TileRenderService.js +78 -0
- package/lib/tile/style/TileStyleService.js +133 -0
- package/lib/tile/style/constants.js +26 -0
- package/lib/tile/style/utils.js +163 -0
- package/lib/tile/tileFactory/base.js +427 -0
- package/lib/tile/tileFactory/index.js +71 -0
- package/lib/tile/tileFactory/layers/rasterDataLayer.js +91 -0
- package/lib/tile/tileFactory/layers/tileTest.js +74 -0
- package/lib/tile/tileFactory/layers/vectorLayer.js +268 -0
- package/lib/tile/tileFactory/line.js +70 -0
- package/lib/tile/tileFactory/mask.js +71 -0
- package/lib/tile/tileFactory/point.js +71 -0
- package/lib/tile/tileFactory/polygon.js +70 -0
- package/lib/tile/tileFactory/raster.js +68 -0
- package/lib/tile/tileFactory/rasterData.js +93 -0
- package/lib/tile/tileFactory/test.js +106 -0
- package/lib/tile/tileLayer/MapTileLayer.js +63 -0
- package/lib/tile/tileLayer/TileLayer.js +215 -0
- package/lib/tile/tileLayer/base.js +225 -0
- package/lib/tile/utils.js +181 -0
- package/lib/utils/blend.js +65 -0
- package/lib/utils/collision-index.js +118 -0
- package/lib/utils/dataMappingStyle.js +151 -0
- package/lib/utils/extrude_polyline.js +656 -0
- package/lib/utils/grid-index.js +188 -0
- package/lib/utils/layerData.js +191 -0
- package/lib/utils/multiPassRender.js +60 -0
- package/lib/utils/polylineNormal.js +230 -0
- package/lib/utils/simpleLine.js +116 -0
- package/lib/utils/symbol-layout.js +308 -0
- package/lib/utils/updateShape.js +27 -0
- package/lib/wind/index.js +98 -0
- package/lib/wind/models/index.js +16 -0
- package/lib/wind/models/utils.js +253 -0
- package/lib/wind/models/wind.js +332 -0
- package/lib/wind/models/windRender.js +373 -0
- package/lib/wind/models/windShader.js +25 -0
- package/lib/wind/shaders/wind_frag.glsl +9 -0
- package/lib/wind/shaders/wind_vert.glsl +17 -0
- package/package.json +6 -6
|
@@ -0,0 +1,188 @@
|
|
|
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_meter2coord;
|
|
12
|
+
uniform float u_meteryScale;
|
|
13
|
+
uniform float u_isMeter;
|
|
14
|
+
|
|
15
|
+
varying vec4 v_data;
|
|
16
|
+
varying vec4 v_color;
|
|
17
|
+
varying float v_radius;
|
|
18
|
+
|
|
19
|
+
uniform float u_opacity : 1;
|
|
20
|
+
uniform float u_stroke_opacity : 1;
|
|
21
|
+
uniform float u_stroke_width : 2;
|
|
22
|
+
uniform vec4 u_stroke_color : [0.0, 0.0, 0.0, 0.0];
|
|
23
|
+
uniform vec2 u_offsets;
|
|
24
|
+
|
|
25
|
+
uniform float u_blur : 0.0;
|
|
26
|
+
uniform float u_raisingHeight: 0.0;
|
|
27
|
+
uniform float u_heightfixed: 0.0;
|
|
28
|
+
|
|
29
|
+
#pragma include "styleMapping"
|
|
30
|
+
#pragma include "styleMappingCalOpacity"
|
|
31
|
+
#pragma include "styleMappingCalStrokeOpacity"
|
|
32
|
+
#pragma include "styleMappingCalStrokeWidth"
|
|
33
|
+
|
|
34
|
+
#pragma include "projection"
|
|
35
|
+
#pragma include "picking"
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
void main() {
|
|
39
|
+
vec3 extrude = a_Extrude;
|
|
40
|
+
float shape_type = a_Shape;
|
|
41
|
+
/*
|
|
42
|
+
* setPickingSize 设置拾取大小
|
|
43
|
+
* u_meter2coord 在等面积大小的时候设置单位
|
|
44
|
+
*/
|
|
45
|
+
float newSize = setPickingSize(a_Size) * u_meter2coord;
|
|
46
|
+
// float newSize = setPickingSize(a_Size) * 0.00001038445708445579;
|
|
47
|
+
|
|
48
|
+
// cal style mapping - 数据纹理映射部分的计算
|
|
49
|
+
styleMappingMat = mat4(
|
|
50
|
+
0.0, 0.0, 0.0, 0.0, // opacity - strokeOpacity - strokeWidth - empty
|
|
51
|
+
0.0, 0.0, 0.0, 0.0, // strokeR - strokeG - strokeB - strokeA
|
|
52
|
+
0.0, 0.0, 0.0, 0.0, // offsets[0] - offsets[1]
|
|
53
|
+
0.0, 0.0, 0.0, 0.0
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
float rowCount = u_cellTypeLayout[0][0]; // 当前的数据纹理有几行
|
|
57
|
+
float columnCount = u_cellTypeLayout[0][1]; // 当看到数据纹理有几列
|
|
58
|
+
float columnWidth = 1.0/columnCount; // 列宽
|
|
59
|
+
float rowHeight = 1.0/rowCount; // 行高
|
|
60
|
+
float cellCount = calCellCount(); // opacity - strokeOpacity - strokeWidth - stroke - offsets
|
|
61
|
+
float id = a_vertexId; // 第n个顶点
|
|
62
|
+
float cellCurrentRow = floor(id * cellCount / columnCount) + 1.0; // 起始点在第几行
|
|
63
|
+
float cellCurrentColumn = mod(id * cellCount, columnCount) + 1.0; // 起始点在第几列
|
|
64
|
+
|
|
65
|
+
// cell 固定顺序 opacity -> strokeOpacity -> strokeWidth -> stroke ...
|
|
66
|
+
// 按顺序从 cell 中取值、若没有则自动往下取值
|
|
67
|
+
float textureOffset = 0.0; // 在 cell 中取值的偏移量
|
|
68
|
+
|
|
69
|
+
vec2 opacityAndOffset = calOpacityAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);
|
|
70
|
+
styleMappingMat[0][0] = opacityAndOffset.r;
|
|
71
|
+
textureOffset = opacityAndOffset.g;
|
|
72
|
+
|
|
73
|
+
vec2 strokeOpacityAndOffset = calStrokeOpacityAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);
|
|
74
|
+
styleMappingMat[0][1] = strokeOpacityAndOffset.r;
|
|
75
|
+
textureOffset = strokeOpacityAndOffset.g;
|
|
76
|
+
|
|
77
|
+
vec2 strokeWidthAndOffset = calStrokeWidthAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);
|
|
78
|
+
styleMappingMat[0][2] = strokeWidthAndOffset.r;
|
|
79
|
+
textureOffset = strokeWidthAndOffset.g;
|
|
80
|
+
|
|
81
|
+
vec4 textrueStroke = vec4(-1.0, -1.0, -1.0, -1.0);
|
|
82
|
+
if(hasStroke()) {
|
|
83
|
+
vec2 valueRPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);
|
|
84
|
+
styleMappingMat[1][0] = pos2value(valueRPos, columnWidth, rowHeight); // R
|
|
85
|
+
textureOffset += 1.0;
|
|
86
|
+
|
|
87
|
+
vec2 valueGPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);
|
|
88
|
+
styleMappingMat[1][1] = pos2value(valueGPos, columnWidth, rowHeight); // G
|
|
89
|
+
textureOffset += 1.0;
|
|
90
|
+
|
|
91
|
+
vec2 valueBPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);
|
|
92
|
+
styleMappingMat[1][2] = pos2value(valueBPos, columnWidth, rowHeight); // B
|
|
93
|
+
textureOffset += 1.0;
|
|
94
|
+
|
|
95
|
+
vec2 valueAPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);
|
|
96
|
+
styleMappingMat[1][3] = pos2value(valueAPos, columnWidth, rowHeight); // A
|
|
97
|
+
textureOffset += 1.0;
|
|
98
|
+
} else {
|
|
99
|
+
if(u_stroke_color == vec4(0.0)) {
|
|
100
|
+
styleMappingMat[1][0] = v_color.r;
|
|
101
|
+
styleMappingMat[1][1] = v_color.g;
|
|
102
|
+
styleMappingMat[1][2] = v_color.b;
|
|
103
|
+
styleMappingMat[1][3] = v_color.a;
|
|
104
|
+
} else {
|
|
105
|
+
styleMappingMat[1][0] = u_stroke_color.r;
|
|
106
|
+
styleMappingMat[1][1] = u_stroke_color.g;
|
|
107
|
+
styleMappingMat[1][2] = u_stroke_color.b;
|
|
108
|
+
styleMappingMat[1][3] = u_stroke_color.a;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
vec2 textrueOffsets = vec2(0.0, 0.0);
|
|
113
|
+
if(hasOffsets()) {
|
|
114
|
+
vec2 valueXPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);
|
|
115
|
+
textrueOffsets.r = pos2value(valueXPos, columnWidth, rowHeight); // x
|
|
116
|
+
textureOffset += 1.0;
|
|
117
|
+
|
|
118
|
+
vec2 valueYPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);
|
|
119
|
+
textrueOffsets.g = pos2value(valueYPos, columnWidth, rowHeight); // x
|
|
120
|
+
textureOffset += 1.0;
|
|
121
|
+
} else {
|
|
122
|
+
textrueOffsets = u_offsets;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// cal style mapping
|
|
126
|
+
|
|
127
|
+
// unpack color(vec2)
|
|
128
|
+
v_color = a_Color;
|
|
129
|
+
|
|
130
|
+
// radius(16-bit)
|
|
131
|
+
v_radius = newSize;
|
|
132
|
+
|
|
133
|
+
// anti-alias
|
|
134
|
+
// float antialiased_blur = -max(u_blur, antialiasblur);
|
|
135
|
+
float antialiasblur = -max(2.0 / u_DevicePixelRatio / newSize, u_blur);
|
|
136
|
+
|
|
137
|
+
vec2 offset = (extrude.xy * (newSize + u_stroke_width) + textrueOffsets);
|
|
138
|
+
vec3 aPosition = a_Position;
|
|
139
|
+
if(u_isMeter < 1.0) {
|
|
140
|
+
// 不以米为实际单位
|
|
141
|
+
offset = project_pixel(offset);
|
|
142
|
+
} else {
|
|
143
|
+
// 以米为实际单位
|
|
144
|
+
if(newSize * pow(2.0, u_Zoom) < 48.0) {
|
|
145
|
+
antialiasblur = max(antialiasblur, -0.05);
|
|
146
|
+
} else if(newSize * pow(2.0, u_Zoom) < 128.0) {
|
|
147
|
+
antialiasblur = max(antialiasblur, -0.6/pow(u_Zoom, 2.0));
|
|
148
|
+
} else {
|
|
149
|
+
antialiasblur = max(antialiasblur, -0.8/pow(u_Zoom, 2.0));
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
153
|
+
aPosition.x += offset.x / u_meteryScale;
|
|
154
|
+
aPosition.y += offset.y;
|
|
155
|
+
offset = vec2(0.0);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// TODP: /abs(extrude.x) 是为了兼容地球模式
|
|
160
|
+
v_data = vec4(extrude.x/abs(extrude.x), extrude.y/abs(extrude.y), antialiasblur,shape_type);
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
// vec4 project_pos = project_position(vec4(a_Position.xy, 0.0, 1.0));
|
|
164
|
+
vec4 project_pos = project_position(vec4(aPosition.xy, 0.0, 1.0));
|
|
165
|
+
// gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, project_pixel(setPickingOrder(0.0)), 1.0));
|
|
166
|
+
|
|
167
|
+
float raisingHeight = u_raisingHeight;
|
|
168
|
+
|
|
169
|
+
if(u_heightfixed < 1.0) { // false
|
|
170
|
+
raisingHeight = project_pixel(u_raisingHeight);
|
|
171
|
+
} else {
|
|
172
|
+
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
173
|
+
float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);
|
|
174
|
+
raisingHeight = u_raisingHeight * mapboxZoomScale;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
|
|
180
|
+
gl_Position = u_Mvp * vec4(project_pos.xy + offset, raisingHeight, 1.0);
|
|
181
|
+
} else {
|
|
182
|
+
gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, raisingHeight, 1.0));
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
// gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, 0.0, 1.0));
|
|
186
|
+
|
|
187
|
+
setPickingColor(a_PickingColor);
|
|
188
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
uniform sampler2D u_texture;
|
|
2
|
+
uniform vec2 u_textSize;
|
|
3
|
+
|
|
4
|
+
varying mat4 styleMappingMat; // 传递从片元中传递的映射数据
|
|
5
|
+
|
|
6
|
+
#pragma include "sdf_2d"
|
|
7
|
+
#pragma include "picking"
|
|
8
|
+
varying vec2 v_uv; // 本身的 uv 坐标
|
|
9
|
+
varying vec2 v_Iconuv;
|
|
10
|
+
|
|
11
|
+
void main() {
|
|
12
|
+
|
|
13
|
+
float opacity = styleMappingMat[0][0];
|
|
14
|
+
|
|
15
|
+
vec2 pos = v_Iconuv / u_textSize + v_uv / u_textSize * 64.;
|
|
16
|
+
gl_FragColor = texture2D(u_texture, pos);
|
|
17
|
+
gl_FragColor.a *= opacity;
|
|
18
|
+
|
|
19
|
+
gl_FragColor = filterColor(gl_FragColor);
|
|
20
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
attribute vec4 a_Color;
|
|
2
|
+
attribute vec3 a_Position;
|
|
3
|
+
attribute vec3 a_Extrude;
|
|
4
|
+
attribute float a_Size;
|
|
5
|
+
attribute vec2 a_Uv;
|
|
6
|
+
attribute float a_Rotate;
|
|
7
|
+
|
|
8
|
+
varying mat4 styleMappingMat; // 用于将在顶点着色器中计算好的样式值传递给片元
|
|
9
|
+
|
|
10
|
+
uniform mat4 u_ModelMatrix;
|
|
11
|
+
uniform mat4 u_Mvp;
|
|
12
|
+
uniform mat2 u_RotateMatrix;
|
|
13
|
+
uniform float u_isMeter;
|
|
14
|
+
|
|
15
|
+
varying vec2 v_uv; // 本身的 uv 坐标
|
|
16
|
+
varying vec2 v_Iconuv; // icon 贴图的 uv 坐标
|
|
17
|
+
|
|
18
|
+
uniform float u_raisingHeight: 0.0;
|
|
19
|
+
uniform float u_heightfixed: 0.0;
|
|
20
|
+
uniform float u_opacity : 1;
|
|
21
|
+
uniform vec2 u_offsets;
|
|
22
|
+
|
|
23
|
+
#pragma include "styleMapping"
|
|
24
|
+
#pragma include "styleMappingCalOpacity"
|
|
25
|
+
|
|
26
|
+
#pragma include "projection"
|
|
27
|
+
#pragma include "picking"
|
|
28
|
+
|
|
29
|
+
void main() {
|
|
30
|
+
vec3 extrude = a_Extrude;
|
|
31
|
+
|
|
32
|
+
v_uv = (a_Extrude.xy + 1.0)/2.0;
|
|
33
|
+
v_uv.y = 1.0 - v_uv.y;
|
|
34
|
+
v_Iconuv = a_Uv;
|
|
35
|
+
|
|
36
|
+
// cal style mapping - 数据纹理映射部分的计算
|
|
37
|
+
styleMappingMat = mat4(
|
|
38
|
+
0.0, 0.0, 0.0, 0.0, // opacity - empty - empty - empty
|
|
39
|
+
0.0, 0.0, 0.0, 0.0, // empty - empty - empty - empty
|
|
40
|
+
0.0, 0.0, 0.0, 0.0, // offsets[0] - offsets[1]
|
|
41
|
+
0.0, 0.0, 0.0, 0.0
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
float rowCount = u_cellTypeLayout[0][0]; // 当前的数据纹理有几行
|
|
45
|
+
float columnCount = u_cellTypeLayout[0][1]; // 当看到数据纹理有几列
|
|
46
|
+
float columnWidth = 1.0/columnCount; // 列宽
|
|
47
|
+
float rowHeight = 1.0/rowCount; // 行高
|
|
48
|
+
float cellCount = calCellCount(); // opacity - strokeOpacity - strokeWidth - stroke - offsets
|
|
49
|
+
float id = a_vertexId; // 第n个顶点
|
|
50
|
+
float cellCurrentRow = floor(id * cellCount / columnCount) + 1.0; // 起始点在第几行
|
|
51
|
+
float cellCurrentColumn = mod(id * cellCount, columnCount) + 1.0; // 起始点在第几列
|
|
52
|
+
|
|
53
|
+
// cell 固定顺序 opacity -> strokeOpacity -> strokeWidth -> stroke ...
|
|
54
|
+
// 按顺序从 cell 中取值、若没有则自动往下取值
|
|
55
|
+
float textureOffset = 0.0; // 在 cell 中取值的偏移量
|
|
56
|
+
|
|
57
|
+
vec2 opacityAndOffset = calOpacityAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);
|
|
58
|
+
styleMappingMat[0][0] = opacityAndOffset.r;
|
|
59
|
+
textureOffset = opacityAndOffset.g;
|
|
60
|
+
|
|
61
|
+
vec2 textrueOffsets = vec2(0.0, 0.0);
|
|
62
|
+
if(hasOffsets()) {
|
|
63
|
+
vec2 valueXPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);
|
|
64
|
+
textrueOffsets.r = pos2value(valueXPos, columnWidth, rowHeight); // x
|
|
65
|
+
textureOffset += 1.0;
|
|
66
|
+
|
|
67
|
+
vec2 valueYPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);
|
|
68
|
+
textrueOffsets.g = pos2value(valueYPos, columnWidth, rowHeight); // x
|
|
69
|
+
textureOffset += 1.0;
|
|
70
|
+
} else {
|
|
71
|
+
textrueOffsets = u_offsets;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// cal style mapping
|
|
75
|
+
|
|
76
|
+
highp float angle_sin = sin(a_Rotate);
|
|
77
|
+
highp float angle_cos = cos(a_Rotate);
|
|
78
|
+
mat2 rotation_matrix = mat2(angle_cos, -1.0 * angle_sin, angle_sin, angle_cos);
|
|
79
|
+
|
|
80
|
+
// vec2 offset = (u_RotateMatrix * extrude.xy * (a_Size) + textrueOffsets);
|
|
81
|
+
vec2 offset = (rotation_matrix * u_RotateMatrix * extrude.xy * (a_Size) + textrueOffsets);
|
|
82
|
+
vec3 aPosition = a_Position;
|
|
83
|
+
if(u_isMeter < 1.0) {
|
|
84
|
+
// 不以米为实际单位
|
|
85
|
+
offset = project_pixel(offset);
|
|
86
|
+
} else {
|
|
87
|
+
// 以米为实际单位
|
|
88
|
+
|
|
89
|
+
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
90
|
+
aPosition.xy += offset;
|
|
91
|
+
offset.x = 0.0;
|
|
92
|
+
offset.y = 0.0;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
vec4 project_pos = project_position(vec4(aPosition.xy, 0.0, 1.0));
|
|
97
|
+
float raisingHeight = u_raisingHeight;
|
|
98
|
+
if(u_heightfixed < 1.0) { // height fixed
|
|
99
|
+
raisingHeight = project_pixel(u_raisingHeight);
|
|
100
|
+
} else {
|
|
101
|
+
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
102
|
+
float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);
|
|
103
|
+
raisingHeight = u_raisingHeight * mapboxZoomScale;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
|
|
108
|
+
gl_Position = u_Mvp * vec4(project_pos.xy + offset, raisingHeight, 1.0);
|
|
109
|
+
} else {
|
|
110
|
+
gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, raisingHeight, 1.0));
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, 0.0, 1.0));
|
|
114
|
+
|
|
115
|
+
setPickingColor(a_PickingColor);
|
|
116
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
|
|
2
|
+
uniform sampler2D u_texture;
|
|
3
|
+
varying vec4 v_color;
|
|
4
|
+
varying vec2 v_uv;
|
|
5
|
+
uniform vec2 u_textSize;
|
|
6
|
+
uniform float u_opacity : 1;
|
|
7
|
+
|
|
8
|
+
varying mat4 styleMappingMat; // 传递从片元中传递的映射数据
|
|
9
|
+
|
|
10
|
+
#pragma include "picking"
|
|
11
|
+
|
|
12
|
+
void main(){
|
|
13
|
+
float opacity = styleMappingMat[0][0];
|
|
14
|
+
float size = styleMappingMat[1][0];
|
|
15
|
+
vec2 pos = v_uv / u_textSize + gl_PointCoord / u_textSize * 64.;
|
|
16
|
+
vec4 textureColor;
|
|
17
|
+
|
|
18
|
+
// Y = 0.299R + 0.587G + 0.114B // 亮度提取
|
|
19
|
+
|
|
20
|
+
textureColor = texture2D(u_texture, pos);
|
|
21
|
+
|
|
22
|
+
// Tip: 去除边缘部分 mipmap 导致的混合变暗
|
|
23
|
+
float fragmengTocenter = distance(vec2(0.5), gl_PointCoord);
|
|
24
|
+
if(fragmengTocenter >= 0.5) {
|
|
25
|
+
float luma = 0.299 * textureColor.r + 0.587 * textureColor.g + 0.114 * textureColor.b;
|
|
26
|
+
textureColor.a *= luma;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
if(all(lessThan(v_color, vec4(1.0+0.00001))) && all(greaterThan(v_color, vec4(1.0-0.00001))) || v_color==vec4(1.0)){
|
|
32
|
+
gl_FragColor= textureColor;
|
|
33
|
+
}else {
|
|
34
|
+
gl_FragColor= step(0.01, textureColor.z) * v_color;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
gl_FragColor.a = gl_FragColor.a * opacity;
|
|
38
|
+
gl_FragColor = filterColor(gl_FragColor);
|
|
39
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
precision highp float;
|
|
2
|
+
attribute vec3 a_Position;
|
|
3
|
+
attribute vec4 a_Color;
|
|
4
|
+
attribute vec2 a_Uv;
|
|
5
|
+
attribute float a_Size;
|
|
6
|
+
varying vec4 v_color;
|
|
7
|
+
varying vec2 v_uv;
|
|
8
|
+
uniform mat4 u_ModelMatrix;
|
|
9
|
+
uniform mat4 u_Mvp;
|
|
10
|
+
uniform vec2 u_offsets;
|
|
11
|
+
|
|
12
|
+
uniform float u_opacity : 1;
|
|
13
|
+
uniform float u_raisingHeight: 0.0;
|
|
14
|
+
uniform float u_heightfixed: 0.0;
|
|
15
|
+
|
|
16
|
+
varying mat4 styleMappingMat; // 用于将在顶点着色器中计算好的样式值传递给片元
|
|
17
|
+
|
|
18
|
+
#pragma include "styleMapping"
|
|
19
|
+
#pragma include "styleMappingCalOpacity"
|
|
20
|
+
|
|
21
|
+
#pragma include "projection"
|
|
22
|
+
#pragma include "picking"
|
|
23
|
+
|
|
24
|
+
void main() {
|
|
25
|
+
// cal style mapping - 数据纹理映射部分的计算
|
|
26
|
+
styleMappingMat = mat4(
|
|
27
|
+
0.0, 0.0, 0.0, 0.0, // opacity - strokeOpacity - strokeWidth - empty
|
|
28
|
+
0.0, 0.0, 0.0, 0.0, // strokeR - strokeG - strokeB - strokeA
|
|
29
|
+
0.0, 0.0, 0.0, 0.0, // offsets[0] - offsets[1]
|
|
30
|
+
0.0, 0.0, 0.0, 0.0
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
float rowCount = u_cellTypeLayout[0][0]; // 当前的数据纹理有几行
|
|
34
|
+
float columnCount = u_cellTypeLayout[0][1]; // 当看到数据纹理有几列
|
|
35
|
+
float columnWidth = 1.0/columnCount; // 列宽
|
|
36
|
+
float rowHeight = 1.0/rowCount; // 行高
|
|
37
|
+
float cellCount = calCellCount(); // opacity - strokeOpacity - strokeWidth - stroke - offsets
|
|
38
|
+
float id = a_vertexId; // 第n个顶点
|
|
39
|
+
float cellCurrentRow = floor(id * cellCount / columnCount) + 1.0; // 起始点在第几行
|
|
40
|
+
float cellCurrentColumn = mod(id * cellCount, columnCount) + 1.0; // 起始点在第几列
|
|
41
|
+
|
|
42
|
+
// cell 固定顺序 opacity -> strokeOpacity -> strokeWidth -> stroke ...
|
|
43
|
+
// 按顺序从 cell 中取值、若没有则自动往下取值
|
|
44
|
+
float textureOffset = 0.0; // 在 cell 中取值的偏移量
|
|
45
|
+
|
|
46
|
+
vec2 opacityAndOffset = calOpacityAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);
|
|
47
|
+
styleMappingMat[0][0] = opacityAndOffset.r;
|
|
48
|
+
textureOffset = opacityAndOffset.g;
|
|
49
|
+
|
|
50
|
+
styleMappingMat[1][0] = a_Size;
|
|
51
|
+
|
|
52
|
+
vec2 textrueOffsets = vec2(0.0, 0.0);
|
|
53
|
+
if(hasOffsets()) {
|
|
54
|
+
vec2 valueXPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);
|
|
55
|
+
textrueOffsets.r = pos2value(valueXPos, columnWidth, rowHeight); // x
|
|
56
|
+
textureOffset += 1.0;
|
|
57
|
+
|
|
58
|
+
vec2 valueYPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);
|
|
59
|
+
textrueOffsets.g = pos2value(valueYPos, columnWidth, rowHeight); // x
|
|
60
|
+
textureOffset += 1.0;
|
|
61
|
+
} else {
|
|
62
|
+
textrueOffsets = u_offsets;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// cal style mapping - 数据纹理映射部分的计算
|
|
66
|
+
v_color = a_Color;
|
|
67
|
+
v_uv = a_Uv;
|
|
68
|
+
vec4 project_pos = project_position(vec4(a_Position, 1.0));
|
|
69
|
+
|
|
70
|
+
vec2 offset = project_pixel(textrueOffsets);
|
|
71
|
+
|
|
72
|
+
float raisingHeight = u_raisingHeight;
|
|
73
|
+
if(u_heightfixed < 1.0) { // false
|
|
74
|
+
raisingHeight = project_pixel(u_raisingHeight);
|
|
75
|
+
} else {
|
|
76
|
+
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
77
|
+
float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);
|
|
78
|
+
raisingHeight = u_raisingHeight * mapboxZoomScale;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
|
|
83
|
+
gl_Position = u_Mvp * vec4(project_pos.xy + offset, raisingHeight, 1.0);
|
|
84
|
+
} else {
|
|
85
|
+
gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, raisingHeight, 1.0));
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
gl_PointSize = a_Size * 2.0 * u_DevicePixelRatio;
|
|
89
|
+
setPickingColor(a_PickingColor);
|
|
90
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
|
|
2
|
+
attribute vec3 a_Position;
|
|
3
|
+
uniform mat4 u_ModelMatrix;
|
|
4
|
+
uniform mat4 u_Mvp;
|
|
5
|
+
attribute float a_Size;
|
|
6
|
+
attribute vec4 a_Color;
|
|
7
|
+
|
|
8
|
+
varying vec4 v_color;
|
|
9
|
+
|
|
10
|
+
#pragma include "projection"
|
|
11
|
+
#pragma include "project"
|
|
12
|
+
|
|
13
|
+
void main() {
|
|
14
|
+
v_color = a_Color;
|
|
15
|
+
|
|
16
|
+
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
|
|
17
|
+
gl_Position = u_Mvp * vec4(a_Position.xy, a_Position.z, 1.0);
|
|
18
|
+
} else {
|
|
19
|
+
vec4 project_pos = project_position(vec4(a_Position, 1.0)) + vec4(a_Size / 2.,-a_Size /2.,0.,0.);
|
|
20
|
+
gl_Position = project_common_position_to_clipspace(vec4(vec2(project_pos.xy),project_pos.z,project_pos.w));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
gl_PointSize = a_Size * 2.0 * u_DevicePixelRatio;
|
|
24
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
|
|
2
|
+
uniform float u_additive;
|
|
3
|
+
uniform float u_opacity: 1.0;
|
|
4
|
+
|
|
5
|
+
varying vec4 v_data;
|
|
6
|
+
varying vec4 v_color;
|
|
7
|
+
varying float v_radius;
|
|
8
|
+
varying vec2 v_exteude;
|
|
9
|
+
#pragma include "sdf_2d"
|
|
10
|
+
#pragma include "picking"
|
|
11
|
+
|
|
12
|
+
void main() {
|
|
13
|
+
|
|
14
|
+
lowp float antialiasblur = v_data.z;
|
|
15
|
+
float r = v_radius / (v_radius);
|
|
16
|
+
|
|
17
|
+
float outer_df = sdCircle(v_data.xy, 1.0);
|
|
18
|
+
float inner_df = sdCircle(v_data.xy, r);
|
|
19
|
+
|
|
20
|
+
float opacity_t = smoothstep(0.0, antialiasblur, outer_df);
|
|
21
|
+
|
|
22
|
+
gl_FragColor = vec4(v_color.rgb, v_color.a * u_opacity);
|
|
23
|
+
|
|
24
|
+
if(u_additive > 0.0) {
|
|
25
|
+
gl_FragColor *= opacity_t;
|
|
26
|
+
} else {
|
|
27
|
+
gl_FragColor.a *= opacity_t;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if(gl_FragColor.a > 0.0) {
|
|
31
|
+
gl_FragColor = filterColor(gl_FragColor);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
vec2 extrude = v_exteude;
|
|
35
|
+
vec2 dir = normalize(extrude);
|
|
36
|
+
vec2 baseDir = vec2(1.0, 0.0);
|
|
37
|
+
float pi = 3.14159265359;
|
|
38
|
+
// full circle
|
|
39
|
+
// float rades = dot(dir, baseDir);
|
|
40
|
+
// float flag = sign(dir.y);
|
|
41
|
+
// float radar_v = (flag - 1.0) * -0.5 + flag * acos(rades)/pi/2.0;
|
|
42
|
+
|
|
43
|
+
// half circle
|
|
44
|
+
float flag = sign(dir.y);
|
|
45
|
+
float rades = dot(dir, baseDir);
|
|
46
|
+
float radar_v = (flag - 1.0) * -0.5 * acos(rades)/pi;
|
|
47
|
+
// simple AA
|
|
48
|
+
if(radar_v > 0.99) {
|
|
49
|
+
radar_v = 1.0 - (radar_v - 0.99)/0.01;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
gl_FragColor.a *= radar_v;
|
|
53
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
attribute vec4 a_Color;
|
|
2
|
+
attribute vec3 a_Position;
|
|
3
|
+
attribute vec3 a_Extrude;
|
|
4
|
+
attribute float a_Size;
|
|
5
|
+
uniform float u_speed: 1.0;
|
|
6
|
+
uniform float u_time;
|
|
7
|
+
|
|
8
|
+
uniform mat4 u_ModelMatrix;
|
|
9
|
+
uniform mat4 u_Mvp;
|
|
10
|
+
uniform float u_isMeter;
|
|
11
|
+
|
|
12
|
+
varying vec4 v_data;
|
|
13
|
+
varying vec4 v_color;
|
|
14
|
+
varying float v_radius;
|
|
15
|
+
varying vec2 v_exteude;
|
|
16
|
+
|
|
17
|
+
#pragma include "projection"
|
|
18
|
+
#pragma include "picking"
|
|
19
|
+
|
|
20
|
+
void main() {
|
|
21
|
+
vec3 extrude = a_Extrude;
|
|
22
|
+
float newSize = setPickingSize(a_Size);
|
|
23
|
+
|
|
24
|
+
float time = u_time * u_speed;
|
|
25
|
+
mat2 rotateMatrix = mat2(
|
|
26
|
+
cos(time), sin(time),
|
|
27
|
+
-sin(time), cos(time)
|
|
28
|
+
);
|
|
29
|
+
v_exteude = rotateMatrix * a_Extrude.xy;
|
|
30
|
+
|
|
31
|
+
// unpack color(vec2)
|
|
32
|
+
v_color = a_Color;
|
|
33
|
+
|
|
34
|
+
// radius(16-bit)
|
|
35
|
+
v_radius = newSize;
|
|
36
|
+
|
|
37
|
+
// anti-alias
|
|
38
|
+
float blur = 0.0;
|
|
39
|
+
float antialiasblur = -max(2.0 / u_DevicePixelRatio / a_Size, blur);
|
|
40
|
+
|
|
41
|
+
vec2 offset = (extrude.xy * (newSize));
|
|
42
|
+
vec3 aPosition = a_Position;
|
|
43
|
+
if(u_isMeter < 1.0) {
|
|
44
|
+
// 不以米为实际单位
|
|
45
|
+
offset = project_pixel(offset);
|
|
46
|
+
} else {
|
|
47
|
+
// 以米为实际单位
|
|
48
|
+
antialiasblur *= pow(19.0 - u_Zoom, 2.0);
|
|
49
|
+
antialiasblur = max(antialiasblur, -0.01);
|
|
50
|
+
// offset *= 0.5;
|
|
51
|
+
|
|
52
|
+
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
53
|
+
aPosition.xy += offset;
|
|
54
|
+
offset.x = 0.0;
|
|
55
|
+
offset.y = 0.0;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
v_data = vec4(extrude.x, extrude.y, antialiasblur, -1.0);
|
|
60
|
+
|
|
61
|
+
vec4 project_pos = project_position(vec4(aPosition.xy, 0.0, 1.0));
|
|
62
|
+
|
|
63
|
+
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
|
|
64
|
+
gl_Position = u_Mvp * vec4(project_pos.xy + offset, 0.0, 1.0);
|
|
65
|
+
} else {
|
|
66
|
+
gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, project_pixel(setPickingOrder(0.0)), 1.0));
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
setPickingColor(a_PickingColor);
|
|
70
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
|
|
2
|
+
uniform float u_opacity : 1;
|
|
3
|
+
uniform vec2 u_offsets;
|
|
4
|
+
uniform float u_additive;
|
|
5
|
+
|
|
6
|
+
uniform float u_stroke_opacity : 1;
|
|
7
|
+
|
|
8
|
+
uniform vec4 u_stroke_color : [0.0, 0.0, 0.0, 0.0];
|
|
9
|
+
|
|
10
|
+
varying vec4 v_color;
|
|
11
|
+
varying mat4 styleMappingMat; // 传递从片元中传递的映射数据
|
|
12
|
+
varying float v_blur;
|
|
13
|
+
varying float v_innerRadius;
|
|
14
|
+
|
|
15
|
+
#pragma include "picking"
|
|
16
|
+
void main() {
|
|
17
|
+
vec2 center = vec2(0.5);
|
|
18
|
+
|
|
19
|
+
float opacity = styleMappingMat[0][0];
|
|
20
|
+
// Tip: 片元到中心点的距离 0 - 1
|
|
21
|
+
float fragmengTocenter = distance(center, gl_PointCoord) * 2.0;
|
|
22
|
+
// Tip: 片元的剪切成圆形
|
|
23
|
+
float circleClipOpacity = 1.0 - smoothstep(v_blur, 1.0, fragmengTocenter);
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
if(v_innerRadius < 0.99) {
|
|
27
|
+
// 当存在 stroke 且 stroke > 0.01
|
|
28
|
+
float blurWidth = (1.0 - v_blur)/2.0;
|
|
29
|
+
vec4 stroke = vec4(u_stroke_color.rgb, u_stroke_opacity);
|
|
30
|
+
if(fragmengTocenter > v_innerRadius + blurWidth) {
|
|
31
|
+
gl_FragColor = stroke;
|
|
32
|
+
} else if(fragmengTocenter > v_innerRadius - blurWidth){
|
|
33
|
+
float mixR = (fragmengTocenter - (v_innerRadius - blurWidth)) / (blurWidth * 2.0);
|
|
34
|
+
gl_FragColor = mix(v_color, stroke, mixR);
|
|
35
|
+
} else {
|
|
36
|
+
gl_FragColor = v_color;
|
|
37
|
+
}
|
|
38
|
+
} else {
|
|
39
|
+
// 当不存在 stroke 或 stroke <= 0.01
|
|
40
|
+
gl_FragColor = v_color;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
gl_FragColor.a *= opacity;
|
|
44
|
+
|
|
45
|
+
gl_FragColor = filterColor(gl_FragColor);
|
|
46
|
+
|
|
47
|
+
if(u_additive > 0.0) {
|
|
48
|
+
gl_FragColor *= circleClipOpacity;
|
|
49
|
+
} else {
|
|
50
|
+
gl_FragColor.a *= circleClipOpacity;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
}
|