@antv/l7-layers 2.9.21 → 2.9.23
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.js +4 -5
- package/es/Geometry/models/billboard.js +23 -9
- package/es/Geometry/models/index.js +4 -5
- package/es/Geometry/models/plane.js +25 -13
- package/es/Geometry/models/sprite.js +11 -21
- 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.js +4 -5
- package/es/canvas/models/canvas.js +6 -12
- package/es/canvas/models/index.js +2 -3
- package/es/citybuliding/building.js +4 -5
- package/es/citybuliding/models/build.js +19 -22
- package/es/citybuliding/shaders/build_frag.glsl +117 -0
- package/es/citybuliding/shaders/build_vert.glsl +54 -0
- package/es/core/BaseLayer.js +205 -157
- package/es/core/BaseModel.js +135 -76
- package/es/core/interface.js +1 -2
- package/es/core/schema.js +4 -2
- package/es/core/shape/Path.js +8 -3
- package/es/core/shape/extrude.js +9 -4
- package/es/core/triangulation.js +89 -17
- package/es/earth/index.js +11 -7
- package/es/earth/models/atmosphere.js +15 -7
- package/es/earth/models/base.js +19 -7
- package/es/earth/models/bloomsphere.js +15 -7
- 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.js +28 -5
- package/es/heatmap/index.js +8 -7
- package/es/heatmap/models/grid.js +11 -5
- package/es/heatmap/models/grid3d.js +18 -7
- package/es/heatmap/models/heatmap.js +45 -44
- package/es/heatmap/models/hexagon.js +14 -6
- package/es/heatmap/models/index.js +5 -6
- 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.js +2 -2
- package/es/image/index.js +4 -5
- package/es/image/models/dataImage.js +21 -31
- package/es/image/models/image.js +19 -25
- package/es/image/models/index.js +3 -4
- 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 +2 -2
- package/es/index.js +92 -30
- package/es/line/index.js +4 -5
- package/es/line/models/arc.js +38 -15
- package/es/line/models/arc_3d.js +33 -14
- package/es/line/models/earthArc_3d.js +33 -14
- package/es/line/models/great_circle.js +25 -13
- package/es/line/models/half.js +33 -12
- package/es/line/models/index.js +12 -13
- package/es/line/models/line.js +48 -15
- package/es/line/models/linearline.js +26 -12
- package/es/line/models/simpleLine.js +26 -11
- package/es/line/models/tile.js +28 -10
- package/es/line/models/wall.js +30 -13
- 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 +174 -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 +78 -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.js +4 -5
- package/es/mask/models/fill.js +11 -8
- package/es/mask/models/index.js +2 -3
- package/es/mask/shaders/mask_frag.glsl +7 -0
- package/es/mask/shaders/mask_vert.glsl +22 -0
- package/es/plugins/DataMappingPlugin.js +71 -34
- package/es/plugins/DataSourcePlugin.js +12 -10
- package/es/plugins/FeatureScalePlugin.js +44 -24
- package/es/plugins/LayerAnimateStylePlugin.js +6 -7
- package/es/plugins/LayerModelPlugin.js +16 -7
- package/es/plugins/LayerStylePlugin.js +7 -3
- package/es/plugins/LightingPlugin.js +21 -13
- package/es/plugins/MultiPassRendererPlugin.js +21 -8
- package/es/plugins/PixelPickingPlugin.js +33 -11
- package/es/plugins/RegisterStyleAttributePlugin.js +10 -3
- package/es/plugins/ShaderUniformPlugin.js +24 -10
- package/es/plugins/UpdateModelPlugin.js +7 -3
- package/es/plugins/UpdateStyleAttributePlugin.js +20 -7
- package/es/point/index.js +12 -6
- package/es/point/models/earthExtrude.js +30 -12
- package/es/point/models/earthFill.js +25 -13
- package/es/point/models/extrude.js +30 -12
- package/es/point/models/fill.js +50 -15
- package/es/point/models/fillmage.js +46 -17
- package/es/point/models/image.js +20 -12
- package/es/point/models/index.js +14 -14
- package/es/point/models/normal.js +15 -7
- package/es/point/models/radar.js +33 -13
- package/es/point/models/simplePoint.js +17 -9
- package/es/point/models/text.js +77 -30
- package/es/point/models/tile.js +33 -12
- 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 +182 -0
- package/es/point/shaders/image/fillImage_frag.glsl +20 -0
- package/es/point/shaders/image/fillImage_vert.glsl +108 -0
- package/es/point/shaders/image_frag.glsl +39 -0
- package/es/point/shaders/image_vert.glsl +81 -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.js +8 -3
- package/es/polygon/index.js +6 -5
- package/es/polygon/models/extrude.js +40 -31
- package/es/polygon/models/fill.js +19 -8
- package/es/polygon/models/index.js +14 -14
- package/es/polygon/models/ocean.js +25 -33
- package/es/polygon/models/tile.js +13 -7
- package/es/polygon/models/water.js +21 -25
- 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.js +2 -2
- package/es/raster/index.js +7 -6
- package/es/raster/models/index.js +3 -4
- package/es/raster/models/raster.js +15 -25
- package/es/raster/raster.js +9 -13
- 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.js +1 -2
- package/es/tile/manager/tileConfigManager.js +6 -8
- package/es/tile/manager/tileLayerManager.js +19 -30
- package/es/tile/manager/tilePickerManager.js +14 -14
- package/es/tile/models/tileModel.js +6 -6
- package/es/tile/tileFactory/base.js +26 -32
- package/es/tile/tileFactory/index.js +6 -7
- package/es/tile/tileFactory/line.js +3 -9
- package/es/tile/tileFactory/point.js +3 -9
- package/es/tile/tileFactory/polygon.js +3 -9
- package/es/tile/tileFactory/raster.js +4 -10
- package/es/tile/tileFactory/rasterData.js +5 -11
- package/es/tile/tileFactory/rasterDataLayer.js +4 -5
- package/es/tile/tileFactory/vectorLayer.js +8 -9
- package/es/tile/tileLayer/baseTileLayer.js +67 -39
- package/es/tile/tmsTileLayer.js +5 -4
- package/es/tile/utils.js +5 -3
- package/es/utils/blend.js +1 -2
- package/es/utils/collision-index.js +36 -21
- package/es/utils/dataMappingStyle.js +71 -15
- package/es/utils/extrude_polyline.js +90 -48
- package/es/utils/grid-index.js +7 -21
- package/es/utils/layerData.js +41 -17
- package/es/utils/multiPassRender.js +21 -5
- package/es/utils/polylineNormal.js +40 -20
- package/es/utils/simpleLine.js +4 -6
- package/es/utils/symbol-layout.js +49 -10
- package/es/utils/updateShape.js +6 -3
- package/es/wind/index.js +5 -6
- package/es/wind/models/index.js +2 -3
- package/es/wind/models/utils.js +50 -26
- package/es/wind/models/wind.js +15 -18
- package/es/wind/models/windRender.js +89 -78
- package/es/wind/models/windShader.d.ts +6 -6
- package/es/wind/models/windShader.js +12 -7
- package/es/wind/shaders/wind_frag.glsl +9 -0
- package/es/wind/shaders/wind_vert.glsl +17 -0
- package/lib/Geometry/index.js +77 -115
- package/lib/Geometry/models/billboard.js +181 -218
- package/lib/Geometry/models/index.js +34 -19
- package/lib/Geometry/models/plane.js +278 -394
- package/lib/Geometry/models/sprite.js +189 -294
- 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 +66 -102
- package/lib/canvas/models/canvas.js +140 -210
- package/lib/canvas/models/index.js +30 -13
- package/lib/citybuliding/building.js +63 -99
- package/lib/citybuliding/models/build.js +146 -196
- package/lib/citybuliding/shaders/build_frag.glsl +117 -0
- package/lib/citybuliding/shaders/build_vert.glsl +54 -0
- package/lib/core/BaseLayer.js +807 -1245
- package/lib/core/BaseModel.js +275 -375
- package/lib/core/interface.js +53 -37
- package/lib/core/schema.js +39 -18
- package/lib/core/shape/Path.js +78 -60
- package/lib/core/shape/extrude.js +90 -127
- package/lib/core/triangulation.js +191 -304
- package/lib/earth/index.js +62 -96
- package/lib/earth/models/atmosphere.js +112 -139
- package/lib/earth/models/base.js +150 -198
- package/lib/earth/models/bloomsphere.js +112 -139
- 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 +89 -85
- package/lib/heatmap/index.js +92 -148
- package/lib/heatmap/models/grid.js +91 -113
- package/lib/heatmap/models/grid3d.js +123 -145
- package/lib/heatmap/models/heatmap.js +338 -470
- package/lib/heatmap/models/hexagon.js +92 -114
- package/lib/heatmap/models/index.js +37 -23
- 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 +46 -30
- package/lib/image/index.js +74 -112
- package/lib/image/models/dataImage.js +173 -241
- package/lib/image/models/image.js +123 -177
- package/lib/image/models/index.js +32 -16
- 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 +96 -193
- package/lib/line/index.js +83 -128
- package/lib/line/models/arc.js +237 -328
- package/lib/line/models/arc_3d.js +228 -314
- package/lib/line/models/earthArc_3d.js +228 -316
- package/lib/line/models/great_circle.js +200 -279
- package/lib/line/models/half.js +201 -266
- package/lib/line/models/index.js +50 -43
- package/lib/line/models/line.js +299 -394
- package/lib/line/models/linearline.js +203 -263
- package/lib/line/models/simpleLine.js +175 -225
- package/lib/line/models/tile.js +237 -330
- package/lib/line/models/wall.js +235 -310
- 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 +174 -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 +78 -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 +59 -93
- package/lib/mask/models/fill.js +82 -132
- package/lib/mask/models/index.js +30 -13
- package/lib/mask/shaders/mask_frag.glsl +7 -0
- package/lib/mask/shaders/mask_vert.glsl +22 -0
- package/lib/plugins/DataMappingPlugin.js +222 -304
- package/lib/plugins/DataSourcePlugin.js +87 -100
- package/lib/plugins/FeatureScalePlugin.js +239 -310
- package/lib/plugins/LayerAnimateStylePlugin.js +55 -61
- package/lib/plugins/LayerModelPlugin.js +72 -70
- package/lib/plugins/LayerStylePlugin.js +51 -44
- package/lib/plugins/LightingPlugin.js +68 -72
- package/lib/plugins/MultiPassRendererPlugin.js +65 -77
- package/lib/plugins/PixelPickingPlugin.js +109 -128
- package/lib/plugins/RegisterStyleAttributePlugin.js +110 -103
- package/lib/plugins/ShaderUniformPlugin.js +98 -103
- package/lib/plugins/UpdateModelPlugin.js +47 -36
- package/lib/plugins/UpdateStyleAttributePlugin.js +75 -80
- package/lib/point/index.js +147 -216
- package/lib/point/models/earthExtrude.js +201 -262
- package/lib/point/models/earthFill.js +202 -276
- package/lib/point/models/extrude.js +203 -282
- package/lib/point/models/fill.js +273 -369
- package/lib/point/models/fillmage.js +250 -327
- package/lib/point/models/image.js +163 -226
- package/lib/point/models/index.js +52 -46
- package/lib/point/models/normal.js +134 -176
- package/lib/point/models/radar.js +212 -286
- package/lib/point/models/simplePoint.js +142 -187
- package/lib/point/models/text.js +385 -559
- package/lib/point/models/tile.js +223 -294
- 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 +182 -0
- package/lib/point/shaders/image/fillImage_frag.glsl +20 -0
- package/lib/point/shaders/image/fillImage_vert.glsl +108 -0
- package/lib/point/shaders/image_frag.glsl +39 -0
- package/lib/point/shaders/image_vert.glsl +81 -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 +51 -51
- package/lib/polygon/index.js +100 -149
- package/lib/polygon/models/extrude.js +222 -303
- package/lib/polygon/models/fill.js +153 -205
- package/lib/polygon/models/index.js +52 -46
- package/lib/polygon/models/ocean.js +172 -251
- package/lib/polygon/models/tile.js +100 -139
- package/lib/polygon/models/water.js +152 -227
- 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 +39 -26
- package/lib/raster/index.js +73 -111
- package/lib/raster/models/index.js +33 -17
- package/lib/raster/models/raster.js +134 -187
- package/lib/raster/raster.js +132 -189
- 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 +17 -2
- package/lib/tile/manager/tileConfigManager.js +86 -126
- package/lib/tile/manager/tileLayerManager.js +227 -312
- package/lib/tile/manager/tilePickerManager.js +123 -187
- package/lib/tile/models/tileModel.js +51 -70
- package/lib/tile/tileFactory/base.js +292 -403
- package/lib/tile/tileFactory/index.js +48 -51
- package/lib/tile/tileFactory/line.js +50 -71
- package/lib/tile/tileFactory/point.js +50 -71
- package/lib/tile/tileFactory/polygon.js +50 -71
- package/lib/tile/tileFactory/raster.js +54 -72
- package/lib/tile/tileFactory/rasterData.js +76 -94
- package/lib/tile/tileFactory/rasterDataLayer.js +62 -98
- package/lib/tile/tileFactory/vectorLayer.js +95 -148
- package/lib/tile/tileLayer/baseTileLayer.js +220 -380
- package/lib/tile/tmsTileLayer.js +67 -109
- package/lib/tile/utils.js +86 -101
- package/lib/utils/blend.js +79 -60
- package/lib/utils/collision-index.js +63 -83
- package/lib/utils/dataMappingStyle.js +59 -56
- package/lib/utils/extrude_polyline.js +397 -554
- package/lib/utils/grid-index.js +111 -168
- package/lib/utils/layerData.js +88 -95
- package/lib/utils/multiPassRender.js +38 -31
- package/lib/utils/polylineNormal.js +86 -118
- package/lib/utils/simpleLine.js +85 -101
- package/lib/utils/symbol-layout.js +109 -173
- package/lib/utils/updateShape.js +40 -11
- package/lib/wind/index.js +71 -110
- package/lib/wind/models/index.js +30 -13
- package/lib/wind/models/utils.js +89 -104
- package/lib/wind/models/wind.js +224 -332
- package/lib/wind/models/windRender.js +215 -293
- package/lib/wind/models/windShader.js +181 -17
- package/lib/wind/shaders/wind_frag.glsl +9 -0
- package/lib/wind/shaders/wind_vert.glsl +17 -0
- package/package.json +11 -9
- package/es/Geometry/index.js.map +0 -1
- package/es/Geometry/models/billboard.js.map +0 -1
- package/es/Geometry/models/index.js.map +0 -1
- package/es/Geometry/models/plane.js.map +0 -1
- package/es/Geometry/models/sprite.js.map +0 -1
- package/es/canvas/index.js.map +0 -1
- package/es/canvas/models/canvas.js.map +0 -1
- package/es/canvas/models/index.js.map +0 -1
- package/es/citybuliding/building.js.map +0 -1
- package/es/citybuliding/models/build.js.map +0 -1
- package/es/core/BaseLayer.js.map +0 -1
- package/es/core/BaseModel.js.map +0 -1
- package/es/core/interface.js.map +0 -1
- package/es/core/schema.js.map +0 -1
- package/es/core/shape/Path.js.map +0 -1
- package/es/core/shape/extrude.js.map +0 -1
- package/es/core/triangulation.js.map +0 -1
- package/es/earth/index.js.map +0 -1
- package/es/earth/models/atmosphere.js.map +0 -1
- package/es/earth/models/base.js.map +0 -1
- package/es/earth/models/bloomsphere.js.map +0 -1
- package/es/earth/utils.js.map +0 -1
- package/es/glsl.d.js +0 -2
- package/es/glsl.d.js.map +0 -1
- package/es/heatmap/index.js.map +0 -1
- package/es/heatmap/models/grid.js.map +0 -1
- package/es/heatmap/models/grid3d.js.map +0 -1
- package/es/heatmap/models/heatmap.js.map +0 -1
- package/es/heatmap/models/hexagon.js.map +0 -1
- package/es/heatmap/models/index.js.map +0 -1
- package/es/heatmap/triangulation.js.map +0 -1
- package/es/image/index.js.map +0 -1
- package/es/image/models/dataImage.js.map +0 -1
- package/es/image/models/image.js.map +0 -1
- package/es/image/models/index.js.map +0 -1
- package/es/index.js.map +0 -1
- package/es/line/index.js.map +0 -1
- package/es/line/models/arc.js.map +0 -1
- package/es/line/models/arc_3d.js.map +0 -1
- package/es/line/models/earthArc_3d.js.map +0 -1
- package/es/line/models/great_circle.js.map +0 -1
- package/es/line/models/half.js.map +0 -1
- package/es/line/models/index.js.map +0 -1
- package/es/line/models/line.js.map +0 -1
- package/es/line/models/linearline.js.map +0 -1
- package/es/line/models/simpleLine.js.map +0 -1
- package/es/line/models/tile.js.map +0 -1
- package/es/line/models/wall.js.map +0 -1
- package/es/mask/index.js.map +0 -1
- package/es/mask/models/fill.js.map +0 -1
- package/es/mask/models/index.js.map +0 -1
- package/es/plugins/DataMappingPlugin.js.map +0 -1
- package/es/plugins/DataSourcePlugin.js.map +0 -1
- package/es/plugins/FeatureScalePlugin.js.map +0 -1
- package/es/plugins/LayerAnimateStylePlugin.js.map +0 -1
- package/es/plugins/LayerModelPlugin.js.map +0 -1
- package/es/plugins/LayerStylePlugin.js.map +0 -1
- package/es/plugins/LightingPlugin.js.map +0 -1
- package/es/plugins/MultiPassRendererPlugin.js.map +0 -1
- package/es/plugins/PixelPickingPlugin.js.map +0 -1
- package/es/plugins/RegisterStyleAttributePlugin.js.map +0 -1
- package/es/plugins/ShaderUniformPlugin.js.map +0 -1
- package/es/plugins/UpdateModelPlugin.js.map +0 -1
- package/es/plugins/UpdateStyleAttributePlugin.js.map +0 -1
- package/es/point/index.js.map +0 -1
- package/es/point/models/earthExtrude.js.map +0 -1
- package/es/point/models/earthFill.js.map +0 -1
- package/es/point/models/extrude.js.map +0 -1
- package/es/point/models/fill.js.map +0 -1
- package/es/point/models/fillmage.js.map +0 -1
- package/es/point/models/image.js.map +0 -1
- package/es/point/models/index.js.map +0 -1
- package/es/point/models/normal.js.map +0 -1
- package/es/point/models/radar.js.map +0 -1
- package/es/point/models/simplePoint.js.map +0 -1
- package/es/point/models/text.js.map +0 -1
- package/es/point/models/tile.js.map +0 -1
- package/es/point/shape/extrude.js.map +0 -1
- package/es/polygon/index.js.map +0 -1
- package/es/polygon/models/extrude.js.map +0 -1
- package/es/polygon/models/fill.js.map +0 -1
- package/es/polygon/models/index.js.map +0 -1
- package/es/polygon/models/ocean.js.map +0 -1
- package/es/polygon/models/tile.js.map +0 -1
- package/es/polygon/models/water.js.map +0 -1
- package/es/raster/buffers/triangulation.js.map +0 -1
- package/es/raster/index.js.map +0 -1
- package/es/raster/models/index.js.map +0 -1
- package/es/raster/models/raster.js.map +0 -1
- package/es/raster/raster.js.map +0 -1
- package/es/tile/interface.js.map +0 -1
- package/es/tile/manager/tileConfigManager.js.map +0 -1
- package/es/tile/manager/tileLayerManager.js.map +0 -1
- package/es/tile/manager/tilePickerManager.js.map +0 -1
- package/es/tile/models/tileModel.js.map +0 -1
- package/es/tile/tileFactory/base.js.map +0 -1
- package/es/tile/tileFactory/index.js.map +0 -1
- package/es/tile/tileFactory/line.js.map +0 -1
- package/es/tile/tileFactory/point.js.map +0 -1
- package/es/tile/tileFactory/polygon.js.map +0 -1
- package/es/tile/tileFactory/raster.js.map +0 -1
- package/es/tile/tileFactory/rasterData.js.map +0 -1
- package/es/tile/tileFactory/rasterDataLayer.js.map +0 -1
- package/es/tile/tileFactory/vectorLayer.js.map +0 -1
- package/es/tile/tileLayer/baseTileLayer.js.map +0 -1
- package/es/tile/tmsTileLayer.js.map +0 -1
- package/es/tile/utils.js.map +0 -1
- package/es/utils/blend.js.map +0 -1
- package/es/utils/collision-index.js.map +0 -1
- package/es/utils/dataMappingStyle.js.map +0 -1
- package/es/utils/extrude_polyline.js.map +0 -1
- package/es/utils/grid-index.js.map +0 -1
- package/es/utils/layerData.js.map +0 -1
- package/es/utils/multiPassRender.js.map +0 -1
- package/es/utils/polylineNormal.js.map +0 -1
- package/es/utils/simpleLine.js.map +0 -1
- package/es/utils/symbol-layout.js.map +0 -1
- package/es/utils/updateShape.js.map +0 -1
- package/es/wind/index.js.map +0 -1
- package/es/wind/models/index.js.map +0 -1
- package/es/wind/models/utils.js.map +0 -1
- package/es/wind/models/wind.js.map +0 -1
- package/es/wind/models/windRender.js.map +0 -1
- package/es/wind/models/windShader.js.map +0 -1
- package/lib/Geometry/index.js.map +0 -1
- package/lib/Geometry/models/billboard.js.map +0 -1
- package/lib/Geometry/models/index.js.map +0 -1
- package/lib/Geometry/models/plane.js.map +0 -1
- package/lib/Geometry/models/sprite.js.map +0 -1
- package/lib/canvas/index.js.map +0 -1
- package/lib/canvas/models/canvas.js.map +0 -1
- package/lib/canvas/models/index.js.map +0 -1
- package/lib/citybuliding/building.js.map +0 -1
- package/lib/citybuliding/models/build.js.map +0 -1
- package/lib/core/BaseLayer.js.map +0 -1
- package/lib/core/BaseModel.js.map +0 -1
- package/lib/core/interface.js.map +0 -1
- package/lib/core/schema.js.map +0 -1
- package/lib/core/shape/Path.js.map +0 -1
- package/lib/core/shape/extrude.js.map +0 -1
- package/lib/core/triangulation.js.map +0 -1
- package/lib/earth/index.js.map +0 -1
- package/lib/earth/models/atmosphere.js.map +0 -1
- package/lib/earth/models/base.js.map +0 -1
- package/lib/earth/models/bloomsphere.js.map +0 -1
- package/lib/earth/utils.js.map +0 -1
- package/lib/glsl.d.js +0 -2
- package/lib/glsl.d.js.map +0 -1
- package/lib/heatmap/index.js.map +0 -1
- package/lib/heatmap/models/grid.js.map +0 -1
- package/lib/heatmap/models/grid3d.js.map +0 -1
- package/lib/heatmap/models/heatmap.js.map +0 -1
- package/lib/heatmap/models/hexagon.js.map +0 -1
- package/lib/heatmap/models/index.js.map +0 -1
- package/lib/heatmap/triangulation.js.map +0 -1
- package/lib/image/index.js.map +0 -1
- package/lib/image/models/dataImage.js.map +0 -1
- package/lib/image/models/image.js.map +0 -1
- package/lib/image/models/index.js.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/line/index.js.map +0 -1
- package/lib/line/models/arc.js.map +0 -1
- package/lib/line/models/arc_3d.js.map +0 -1
- package/lib/line/models/earthArc_3d.js.map +0 -1
- package/lib/line/models/great_circle.js.map +0 -1
- package/lib/line/models/half.js.map +0 -1
- package/lib/line/models/index.js.map +0 -1
- package/lib/line/models/line.js.map +0 -1
- package/lib/line/models/linearline.js.map +0 -1
- package/lib/line/models/simpleLine.js.map +0 -1
- package/lib/line/models/tile.js.map +0 -1
- package/lib/line/models/wall.js.map +0 -1
- package/lib/mask/index.js.map +0 -1
- package/lib/mask/models/fill.js.map +0 -1
- package/lib/mask/models/index.js.map +0 -1
- package/lib/plugins/DataMappingPlugin.js.map +0 -1
- package/lib/plugins/DataSourcePlugin.js.map +0 -1
- package/lib/plugins/FeatureScalePlugin.js.map +0 -1
- package/lib/plugins/LayerAnimateStylePlugin.js.map +0 -1
- package/lib/plugins/LayerModelPlugin.js.map +0 -1
- package/lib/plugins/LayerStylePlugin.js.map +0 -1
- package/lib/plugins/LightingPlugin.js.map +0 -1
- package/lib/plugins/MultiPassRendererPlugin.js.map +0 -1
- package/lib/plugins/PixelPickingPlugin.js.map +0 -1
- package/lib/plugins/RegisterStyleAttributePlugin.js.map +0 -1
- package/lib/plugins/ShaderUniformPlugin.js.map +0 -1
- package/lib/plugins/UpdateModelPlugin.js.map +0 -1
- package/lib/plugins/UpdateStyleAttributePlugin.js.map +0 -1
- package/lib/point/index.js.map +0 -1
- package/lib/point/models/earthExtrude.js.map +0 -1
- package/lib/point/models/earthFill.js.map +0 -1
- package/lib/point/models/extrude.js.map +0 -1
- package/lib/point/models/fill.js.map +0 -1
- package/lib/point/models/fillmage.js.map +0 -1
- package/lib/point/models/image.js.map +0 -1
- package/lib/point/models/index.js.map +0 -1
- package/lib/point/models/normal.js.map +0 -1
- package/lib/point/models/radar.js.map +0 -1
- package/lib/point/models/simplePoint.js.map +0 -1
- package/lib/point/models/text.js.map +0 -1
- package/lib/point/models/tile.js.map +0 -1
- package/lib/point/shape/extrude.js.map +0 -1
- package/lib/polygon/index.js.map +0 -1
- package/lib/polygon/models/extrude.js.map +0 -1
- package/lib/polygon/models/fill.js.map +0 -1
- package/lib/polygon/models/index.js.map +0 -1
- package/lib/polygon/models/ocean.js.map +0 -1
- package/lib/polygon/models/tile.js.map +0 -1
- package/lib/polygon/models/water.js.map +0 -1
- package/lib/raster/buffers/triangulation.js.map +0 -1
- package/lib/raster/index.js.map +0 -1
- package/lib/raster/models/index.js.map +0 -1
- package/lib/raster/models/raster.js.map +0 -1
- package/lib/raster/raster.js.map +0 -1
- package/lib/tile/interface.js.map +0 -1
- package/lib/tile/manager/tileConfigManager.js.map +0 -1
- package/lib/tile/manager/tileLayerManager.js.map +0 -1
- package/lib/tile/manager/tilePickerManager.js.map +0 -1
- package/lib/tile/models/tileModel.js.map +0 -1
- package/lib/tile/tileFactory/base.js.map +0 -1
- package/lib/tile/tileFactory/index.js.map +0 -1
- package/lib/tile/tileFactory/line.js.map +0 -1
- package/lib/tile/tileFactory/point.js.map +0 -1
- package/lib/tile/tileFactory/polygon.js.map +0 -1
- package/lib/tile/tileFactory/raster.js.map +0 -1
- package/lib/tile/tileFactory/rasterData.js.map +0 -1
- package/lib/tile/tileFactory/rasterDataLayer.js.map +0 -1
- package/lib/tile/tileFactory/vectorLayer.js.map +0 -1
- package/lib/tile/tileLayer/baseTileLayer.js.map +0 -1
- package/lib/tile/tmsTileLayer.js.map +0 -1
- package/lib/tile/utils.js.map +0 -1
- package/lib/utils/blend.js.map +0 -1
- package/lib/utils/collision-index.js.map +0 -1
- package/lib/utils/dataMappingStyle.js.map +0 -1
- package/lib/utils/extrude_polyline.js.map +0 -1
- package/lib/utils/grid-index.js.map +0 -1
- package/lib/utils/layerData.js.map +0 -1
- package/lib/utils/multiPassRender.js.map +0 -1
- package/lib/utils/polylineNormal.js.map +0 -1
- package/lib/utils/simpleLine.js.map +0 -1
- package/lib/utils/symbol-layout.js.map +0 -1
- package/lib/utils/updateShape.js.map +0 -1
- package/lib/wind/index.js.map +0 -1
- package/lib/wind/models/index.js.map +0 -1
- package/lib/wind/models/utils.js.map +0 -1
- package/lib/wind/models/wind.js.map +0 -1
- package/lib/wind/models/windRender.js.map +0 -1
- package/lib/wind/models/windShader.js.map +0 -1
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// attribute vec4 a_Color;
|
|
2
|
+
attribute vec3 a_Position;
|
|
3
|
+
attribute vec3 a_Normal;
|
|
4
|
+
attribute vec2 a_Uv;
|
|
5
|
+
varying vec2 v_texCoord;
|
|
6
|
+
|
|
7
|
+
// attribute vec2 a_Extrude;
|
|
8
|
+
// attribute float a_Size;
|
|
9
|
+
// attribute float a_Shape;
|
|
10
|
+
|
|
11
|
+
uniform vec3 u_CameraPosition;
|
|
12
|
+
uniform mat4 u_ViewProjectionMatrix;
|
|
13
|
+
uniform mat4 u_ModelMatrix;
|
|
14
|
+
uniform float u_ambientRatio : 0.5;
|
|
15
|
+
uniform float u_diffuseRatio : 0.3;
|
|
16
|
+
uniform float u_specularRatio : 0.2;
|
|
17
|
+
uniform vec3 u_sunLight: [1.0, -10.5, 12.0];
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
float calc_lighting(vec4 pos) {
|
|
22
|
+
|
|
23
|
+
vec3 worldPos = vec3(pos * u_ModelMatrix);
|
|
24
|
+
|
|
25
|
+
vec3 worldNormal = a_Normal;
|
|
26
|
+
|
|
27
|
+
// cal light weight
|
|
28
|
+
vec3 viewDir = normalize(u_CameraPosition - worldPos);
|
|
29
|
+
|
|
30
|
+
vec3 lightDir = normalize(u_sunLight);
|
|
31
|
+
|
|
32
|
+
vec3 halfDir = normalize(viewDir+lightDir);
|
|
33
|
+
// lambert
|
|
34
|
+
float lambert = dot(worldNormal, lightDir);
|
|
35
|
+
// specular
|
|
36
|
+
float specular = pow(max(0.0, dot(worldNormal, halfDir)), 32.0);
|
|
37
|
+
//sum to light weight
|
|
38
|
+
float lightWeight = u_ambientRatio + u_diffuseRatio * lambert + u_specularRatio * specular;
|
|
39
|
+
|
|
40
|
+
return lightWeight;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
varying float v_lightWeight;
|
|
44
|
+
void main() {
|
|
45
|
+
|
|
46
|
+
v_texCoord = a_Uv;
|
|
47
|
+
|
|
48
|
+
float lightWeight = calc_lighting(vec4(a_Position, 1.0));
|
|
49
|
+
v_lightWeight = lightWeight;
|
|
50
|
+
|
|
51
|
+
gl_Position = u_ViewProjectionMatrix * u_ModelMatrix * vec4(a_Position, 1.0);
|
|
52
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
|
|
2
|
+
uniform float u_opacity;
|
|
3
|
+
uniform vec3 u_CameraPosition;
|
|
4
|
+
varying vec3 vVertexNormal;
|
|
5
|
+
|
|
6
|
+
varying vec4 v_Color;
|
|
7
|
+
void main() {
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
float intensity = - dot(normalize(vVertexNormal), normalize(u_CameraPosition));
|
|
11
|
+
// TODO: 去除背面
|
|
12
|
+
if(intensity > 1.0) intensity = 0.0;
|
|
13
|
+
|
|
14
|
+
gl_FragColor = vec4(v_Color.rgb, v_Color.a * intensity * u_opacity);
|
|
15
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
|
|
2
|
+
attribute vec3 a_Position;
|
|
3
|
+
attribute vec3 a_Normal;
|
|
4
|
+
attribute vec2 a_Uv;
|
|
5
|
+
attribute vec4 a_Color;
|
|
6
|
+
uniform vec3 u_CameraPosition;
|
|
7
|
+
uniform mat4 u_ViewProjectionMatrix;
|
|
8
|
+
uniform mat4 u_ModelMatrix;
|
|
9
|
+
uniform mat4 u_ViewMatrix;
|
|
10
|
+
|
|
11
|
+
varying vec3 vVertexNormal;
|
|
12
|
+
varying vec4 v_Color;
|
|
13
|
+
|
|
14
|
+
void main() {
|
|
15
|
+
v_Color = a_Color;
|
|
16
|
+
|
|
17
|
+
vVertexNormal = a_Normal;
|
|
18
|
+
|
|
19
|
+
gl_Position = u_ViewProjectionMatrix * u_ModelMatrix * vec4(a_Position, 1.0);
|
|
20
|
+
}
|
package/es/earth/utils.js
CHANGED
|
@@ -1,22 +1,45 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
-
import { mat4, vec3 } from 'gl-matrix';
|
|
2
|
+
import { mat4, vec3 } from 'gl-matrix'; // 该文件专门记录地球模式的数值
|
|
3
|
+
// 地球网格半径
|
|
4
|
+
|
|
3
5
|
export var EARTH_RADIUS = 100;
|
|
4
6
|
export var EARTH_SEGMENTS = 36;
|
|
5
7
|
export var EARTH_RADIUS_OUTER = 40;
|
|
8
|
+
/**
|
|
9
|
+
* 角度转弧度
|
|
10
|
+
* @param deg
|
|
11
|
+
* @returns
|
|
12
|
+
*/
|
|
6
13
|
|
|
7
14
|
function torad(deg) {
|
|
8
15
|
return deg / 180 * Math.acos(-1);
|
|
9
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* 经纬度转xyz
|
|
19
|
+
* @param longitude 经度
|
|
20
|
+
* @param latitude 纬度
|
|
21
|
+
* @param radius 半径
|
|
22
|
+
*/
|
|
23
|
+
|
|
10
24
|
|
|
11
25
|
export function lglt2xyz(lnglat) {
|
|
26
|
+
// TODO: + Math.PI/2 是为了对齐坐标
|
|
12
27
|
var lng = torad(lnglat[0]) + Math.PI / 2;
|
|
13
|
-
var lat = torad(lnglat[1]);
|
|
28
|
+
var lat = torad(lnglat[1]); // TODO: 手动增加一些偏移,减轻面的冲突
|
|
29
|
+
|
|
14
30
|
var radius = EARTH_RADIUS + Math.random() * 0.4;
|
|
15
31
|
var z = radius * Math.cos(lat) * Math.cos(lng);
|
|
16
32
|
var x = radius * Math.cos(lat) * Math.sin(lng);
|
|
17
33
|
var y = radius * Math.sin(lat);
|
|
18
34
|
return [x, y, z];
|
|
19
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* 构建地球球体网格
|
|
38
|
+
* @param radius
|
|
39
|
+
* @param opt
|
|
40
|
+
* @returns
|
|
41
|
+
*/
|
|
42
|
+
|
|
20
43
|
export function primitiveSphere(radius, opt) {
|
|
21
44
|
var matRotY = mat4.create();
|
|
22
45
|
var matRotZ = mat4.create();
|
|
@@ -52,7 +75,8 @@ export function primitiveSphere(radius, opt) {
|
|
|
52
75
|
positionsArr.push.apply(positionsArr, _toConsumableArray(tmpVec3.slice()));
|
|
53
76
|
vec3.normalize(tmpVec3, tmpVec3);
|
|
54
77
|
normalArr.push.apply(normalArr, _toConsumableArray(tmpVec3.slice()));
|
|
55
|
-
uvs.push([normalizedY, 1 - normalizedZ]);
|
|
78
|
+
uvs.push([normalizedY, 1 - normalizedZ]); // position 和 uv 一起存储
|
|
79
|
+
|
|
56
80
|
positionsArr.push(normalizedY, 1 - normalizedZ);
|
|
57
81
|
}
|
|
58
82
|
|
|
@@ -77,5 +101,4 @@ export function primitiveSphere(radius, opt) {
|
|
|
77
101
|
indicesArr: indicesArr,
|
|
78
102
|
normalArr: normalArr
|
|
79
103
|
};
|
|
80
|
-
}
|
|
81
|
-
//# sourceMappingURL=utils.js.map
|
|
104
|
+
}
|
package/es/heatmap/index.js
CHANGED
|
@@ -10,10 +10,10 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
10
10
|
|
|
11
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
12
|
|
|
13
|
-
import BaseLayer from
|
|
14
|
-
import HeatMapModels from
|
|
13
|
+
import BaseLayer from "../core/BaseLayer";
|
|
14
|
+
import HeatMapModels from "./models";
|
|
15
15
|
|
|
16
|
-
var HeatMapLayer = function (_BaseLayer) {
|
|
16
|
+
var HeatMapLayer = /*#__PURE__*/function (_BaseLayer) {
|
|
17
17
|
_inherits(HeatMapLayer, _BaseLayer);
|
|
18
18
|
|
|
19
19
|
var _super = _createSuper(HeatMapLayer);
|
|
@@ -65,7 +65,7 @@ var HeatMapLayer = function (_BaseLayer) {
|
|
|
65
65
|
|
|
66
66
|
if (shape === 'heatmap') {
|
|
67
67
|
if (this.layerModel) {
|
|
68
|
-
this.layerModel.render();
|
|
68
|
+
this.layerModel.render(); // 独立的渲染流程
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
return this;
|
|
@@ -74,7 +74,9 @@ var HeatMapLayer = function (_BaseLayer) {
|
|
|
74
74
|
if (this.layerModelNeedUpdate) {
|
|
75
75
|
this.layerModel.buildModels(function (models) {
|
|
76
76
|
return _this4.models = models;
|
|
77
|
-
});
|
|
77
|
+
}); // @ts-ignore
|
|
78
|
+
// this.models = this.layerModel.buildModels();
|
|
79
|
+
|
|
78
80
|
this.layerModelNeedUpdate = false;
|
|
79
81
|
}
|
|
80
82
|
|
|
@@ -140,5 +142,4 @@ var HeatMapLayer = function (_BaseLayer) {
|
|
|
140
142
|
return HeatMapLayer;
|
|
141
143
|
}(BaseLayer);
|
|
142
144
|
|
|
143
|
-
export { HeatMapLayer as default };
|
|
144
|
-
//# sourceMappingURL=index.js.map
|
|
145
|
+
export { HeatMapLayer as default };
|
|
@@ -10,12 +10,16 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
10
10
|
|
|
11
11
|
import { AttributeType, gl } from '@antv/l7-core';
|
|
12
12
|
import { getMask } from '@antv/l7-utils';
|
|
13
|
-
import BaseModel from
|
|
14
|
-
import { HeatmapGridTriangulation } from
|
|
13
|
+
import BaseModel from "../../core/BaseModel";
|
|
14
|
+
import { HeatmapGridTriangulation } from "../../core/triangulation";
|
|
15
|
+
|
|
16
|
+
/* babel-plugin-inline-import '../shaders/grid_vert.glsl' */
|
|
15
17
|
var heatmapGridVert = "precision highp float;\r\n// \u591A\u8FB9\u5F62\u9876\u70B9\u5750\u6807\r\nattribute vec3 a_Position;\r\n// \u591A\u8FB9\u5F62\u7ECF\u7EAC\u5EA6\u5750\u6807\r\nattribute vec3 a_Pos;\r\nattribute float a_Size;\r\nattribute vec4 a_Color;\r\nuniform vec2 u_radius;\r\nuniform float u_coverage: 0.9;\r\nuniform float u_angle: 0;\r\nuniform mat4 u_ModelMatrix;\r\nuniform mat4 u_Mvp;\r\nvarying vec4 v_color;\r\n\r\nuniform vec2 u_SceneCenterMKT;\r\n\r\n#pragma include \"projection\"\r\n#pragma include \"project\"\r\n#pragma include \"picking\"\r\n\r\nvoid main() {\r\n v_color = a_Color;\r\n\r\n mat2 rotationMatrix = mat2(cos(u_angle), sin(u_angle), -sin(u_angle), cos(u_angle));\r\n vec2 offset = a_Position.xy * u_radius * rotationMatrix * u_coverage ;\r\n // vec2 lnglat = unProjectFlat(a_Pos.xy + offset);\r\n // vec4 project_pos = project_position(vec4(lnglat, 0, 1.0));\r\n // gl_Position = project_common_position_to_clipspace(project_pos);\r\n\r\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\r\n vec2 lnglat = unProjectFlat(a_Pos.xy + offset);\r\n vec2 customLnglat = customProject(lnglat) - u_SceneCenterMKT; // \u5C06\u7ECF\u7EAC\u5EA6\u8F6C\u6362\u4E3A\u9AD8\u5FB72.0\u9700\u8981\u7684\u5E73\u9762\u5750\u6807\r\n vec4 project_pos = project_position(vec4(customLnglat, 0, 1.0));\r\n gl_Position = u_Mvp * (project_pos);\r\n } else {\r\n vec2 lnglat = unProjectFlat(a_Pos.xy + offset);\r\n vec4 project_pos = project_position(vec4(lnglat, 0, 1.0));\r\n gl_Position = project_common_position_to_clipspace(project_pos);\r\n }\r\n\r\n setPickingColor(a_PickingColor);\r\n}\r\n";
|
|
18
|
+
|
|
19
|
+
/* babel-plugin-inline-import '../shaders/hexagon_frag.glsl' */
|
|
16
20
|
var heatmapGridFrag = "precision highp float;\nvarying vec4 v_color;\nuniform float u_opacity: 1;\n\n#pragma include \"picking\"\n\nvoid main() {\n gl_FragColor = v_color;\n gl_FragColor.a *= u_opacity;\n\n gl_FragColor = filterColor(gl_FragColor);\n}\n";
|
|
17
21
|
|
|
18
|
-
var GridModel = function (_BaseModel) {
|
|
22
|
+
var GridModel = /*#__PURE__*/function (_BaseModel) {
|
|
19
23
|
_inherits(GridModel, _BaseModel);
|
|
20
24
|
|
|
21
25
|
var _super = _createSuper(GridModel);
|
|
@@ -77,16 +81,19 @@ var GridModel = function (_BaseModel) {
|
|
|
77
81
|
value: function registerBuiltinAttributes() {
|
|
78
82
|
this.styleAttributeService.registerStyleAttribute({
|
|
79
83
|
name: 'pos',
|
|
84
|
+
// 顶点经纬度位置
|
|
80
85
|
type: AttributeType.Attribute,
|
|
81
86
|
descriptor: {
|
|
82
87
|
name: 'a_Pos',
|
|
83
88
|
buffer: {
|
|
89
|
+
// give the WebGL driver a hint that this buffer may change
|
|
84
90
|
usage: gl.DYNAMIC_DRAW,
|
|
85
91
|
data: [],
|
|
86
92
|
type: gl.FLOAT
|
|
87
93
|
},
|
|
88
94
|
size: 3,
|
|
89
95
|
update: function update(feature, featureIdx) {
|
|
96
|
+
// const coordinates = feature.coordinates as number[];
|
|
90
97
|
var coordinates = feature.version === 'GAODE2.x' ? feature.originCoordinates : feature.coordinates;
|
|
91
98
|
return [coordinates[0], coordinates[1], 0];
|
|
92
99
|
}
|
|
@@ -98,5 +105,4 @@ var GridModel = function (_BaseModel) {
|
|
|
98
105
|
return GridModel;
|
|
99
106
|
}(BaseModel);
|
|
100
107
|
|
|
101
|
-
export { GridModel as default };
|
|
102
|
-
//# sourceMappingURL=grid.js.map
|
|
108
|
+
export { GridModel as default };
|
|
@@ -10,12 +10,16 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
10
10
|
|
|
11
11
|
import { AttributeType, gl } from '@antv/l7-core';
|
|
12
12
|
import { getMask } from '@antv/l7-utils';
|
|
13
|
-
import BaseModel from
|
|
14
|
-
import { PointExtrudeTriangulation } from
|
|
13
|
+
import BaseModel from "../../core/BaseModel";
|
|
14
|
+
import { PointExtrudeTriangulation } from "../../core/triangulation";
|
|
15
|
+
|
|
16
|
+
/* babel-plugin-inline-import '../shaders/hexagon_3d_vert.glsl' */
|
|
15
17
|
var heatmapGrid3dVert = "precision highp float;\n// \u591A\u8FB9\u5F62\u9876\u70B9\u5750\u6807\nattribute vec3 a_Position;\n// \u591A\u8FB9\u5F62\u7ECF\u7EAC\u5EA6\u5750\u6807\nattribute vec3 a_Pos;\n\nattribute vec3 a_Normal;\nattribute float a_Size;\nattribute vec4 a_Color;\nuniform vec2 u_radius;\nuniform float u_coverage: 0.9;\nuniform float u_angle: 0;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nvarying vec4 v_color;\n\nuniform vec2 u_SceneCenterMKT;\n\n#pragma include \"projection\"\n#pragma include \"project\"\n#pragma include \"light\"\n#pragma include \"picking\"\n\n\nvoid main() {\n mat2 rotationMatrix = mat2(cos(u_angle), sin(u_angle), -sin(u_angle), cos(u_angle));\n vec2 offset =(vec2(a_Position.xy * u_radius * rotationMatrix * u_coverage));\n // vec2 lnglat = unProjectFlat(a_Pos.xy + offset); // \u5B9E\u9645\u7684\u7ECF\u7EAC\u5EA6\n // vec2 lnglat = (a_Pos.xy + offset); \n // vec4 project_pos = project_position(vec4(lnglat, a_Position.z * a_Size, 1.0));\n // gl_Position = project_common_position_to_clipspace(project_pos);\n // float lightWeight = calc_lighting(project_pos);\n // v_color =vec4(a_Color.rgb*lightWeight, a_Color.w);\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n // vec2 lnglat = (a_Pos.xy + offset); \n // vec4 project_pos = project_position(vec4(lnglat, a_Position.z * a_Size, 1.0));\n\n // float lightWeight = calc_lighting(project_pos);\n // v_color =vec4(a_Color.rgb*lightWeight, a_Color.w);\n \n // gl_Position = u_Mvp * vec4(lnglat , a_Position.z * a_Size, 1.0);\n vec2 lnglat = unProjectFlat(a_Pos.xy + offset); // \u7ECF\u7EAC\u5EA6\n vec2 customLnglat = customProject(lnglat) - u_SceneCenterMKT; // \u5C06\u7ECF\u7EAC\u5EA6\u8F6C\u6362\u4E3A\u9AD8\u5FB72.0\u9700\u8981\u7684\u5E73\u9762\u5750\u6807\n vec4 project_pos = project_position(vec4(customLnglat, a_Position.z * a_Size, 1.0));\n\n float lightWeight = calc_lighting(project_pos);\n v_color =vec4(a_Color.rgb*lightWeight, a_Color.w);\n \n gl_Position = u_Mvp * vec4(customLnglat , a_Position.z * a_Size, 1.0);\n } else {\n vec2 lnglat = unProjectFlat(a_Pos.xy + offset); // \u5B9E\u9645\u7684\u7ECF\u7EAC\u5EA6\n vec4 project_pos = project_position(vec4(lnglat, a_Position.z * a_Size, 1.0));\n \n float lightWeight = calc_lighting(project_pos);\n v_color =vec4(a_Color.rgb*lightWeight, a_Color.w);\n \n gl_Position = project_common_position_to_clipspace(project_pos);\n }\n\n\n\n setPickingColor(a_PickingColor);\n}\n";
|
|
18
|
+
|
|
19
|
+
/* babel-plugin-inline-import '../shaders/hexagon_frag.glsl' */
|
|
16
20
|
var heatmapGridFrag = "precision highp float;\nvarying vec4 v_color;\nuniform float u_opacity: 1;\n\n#pragma include \"picking\"\n\nvoid main() {\n gl_FragColor = v_color;\n gl_FragColor.a *= u_opacity;\n\n gl_FragColor = filterColor(gl_FragColor);\n}\n";
|
|
17
21
|
|
|
18
|
-
var Grid3DModel = function (_BaseModel) {
|
|
22
|
+
var Grid3DModel = /*#__PURE__*/function (_BaseModel) {
|
|
19
23
|
_inherits(Grid3DModel, _BaseModel);
|
|
20
24
|
|
|
21
25
|
var _super = _createSuper(Grid3DModel);
|
|
@@ -76,12 +80,14 @@ var Grid3DModel = function (_BaseModel) {
|
|
|
76
80
|
}, {
|
|
77
81
|
key: "registerBuiltinAttributes",
|
|
78
82
|
value: function registerBuiltinAttributes() {
|
|
83
|
+
// point layer size;
|
|
79
84
|
this.styleAttributeService.registerStyleAttribute({
|
|
80
85
|
name: 'size',
|
|
81
86
|
type: AttributeType.Attribute,
|
|
82
87
|
descriptor: {
|
|
83
88
|
name: 'a_Size',
|
|
84
89
|
buffer: {
|
|
90
|
+
// give the WebGL driver a hint that this buffer may change
|
|
85
91
|
usage: gl.DYNAMIC_DRAW,
|
|
86
92
|
data: [],
|
|
87
93
|
type: gl.FLOAT
|
|
@@ -92,13 +98,15 @@ var Grid3DModel = function (_BaseModel) {
|
|
|
92
98
|
return Array.isArray(size) ? [size[0]] : [size];
|
|
93
99
|
}
|
|
94
100
|
}
|
|
95
|
-
});
|
|
101
|
+
}); // point layer size;
|
|
102
|
+
|
|
96
103
|
this.styleAttributeService.registerStyleAttribute({
|
|
97
104
|
name: 'normal',
|
|
98
105
|
type: AttributeType.Attribute,
|
|
99
106
|
descriptor: {
|
|
100
107
|
name: 'a_Normal',
|
|
101
108
|
buffer: {
|
|
109
|
+
// give the WebGL driver a hint that this buffer may change
|
|
102
110
|
usage: gl.STATIC_DRAW,
|
|
103
111
|
data: [],
|
|
104
112
|
type: gl.FLOAT
|
|
@@ -111,17 +119,21 @@ var Grid3DModel = function (_BaseModel) {
|
|
|
111
119
|
});
|
|
112
120
|
this.styleAttributeService.registerStyleAttribute({
|
|
113
121
|
name: 'pos',
|
|
122
|
+
// 顶点经纬度位置
|
|
114
123
|
type: AttributeType.Attribute,
|
|
115
124
|
descriptor: {
|
|
116
125
|
name: 'a_Pos',
|
|
117
126
|
buffer: {
|
|
127
|
+
// give the WebGL driver a hint that this buffer may change
|
|
118
128
|
usage: gl.DYNAMIC_DRAW,
|
|
119
129
|
data: [],
|
|
120
130
|
type: gl.FLOAT
|
|
121
131
|
},
|
|
122
132
|
size: 3,
|
|
123
133
|
update: function update(feature, featureIdx) {
|
|
124
|
-
var coordinates = feature.version === 'GAODE2.x' ? feature.originCoordinates : feature.coordinates;
|
|
134
|
+
var coordinates = feature.version === 'GAODE2.x' ? feature.originCoordinates : feature.coordinates; // const coordinates = feature.coordinates as number[];
|
|
135
|
+
// const coordinates = feature.originCoordinates as number[];
|
|
136
|
+
|
|
125
137
|
return [coordinates[0], coordinates[1], 0];
|
|
126
138
|
}
|
|
127
139
|
}
|
|
@@ -132,5 +144,4 @@ var Grid3DModel = function (_BaseModel) {
|
|
|
132
144
|
return Grid3DModel;
|
|
133
145
|
}(BaseModel);
|
|
134
146
|
|
|
135
|
-
export { Grid3DModel as default };
|
|
136
|
-
//# sourceMappingURL=grid3d.js.map
|
|
147
|
+
export { Grid3DModel as default };
|
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
+
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
2
3
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
4
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
5
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
5
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
6
6
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
7
7
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
8
8
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
9
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
10
9
|
|
|
11
10
|
var _dec, _class;
|
|
12
11
|
|
|
13
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
14
|
-
|
|
15
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
16
|
-
|
|
17
12
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
18
13
|
|
|
19
14
|
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); }; }
|
|
@@ -25,50 +20,42 @@ import { generateColorRamp, getCullFace, getMask } from '@antv/l7-utils';
|
|
|
25
20
|
import { mat4 } from 'gl-matrix';
|
|
26
21
|
import { injectable } from 'inversify';
|
|
27
22
|
import 'reflect-metadata';
|
|
28
|
-
import BaseModel from
|
|
29
|
-
import { HeatmapTriangulation } from
|
|
23
|
+
import BaseModel from "../../core/BaseModel";
|
|
24
|
+
import { HeatmapTriangulation } from "../../core/triangulation";
|
|
25
|
+
|
|
26
|
+
/* babel-plugin-inline-import '../shaders/heatmap_3d_frag.glsl' */
|
|
30
27
|
var heatmap3DFrag = "uniform sampler2D u_texture;\nuniform sampler2D u_colorTexture;\nuniform float u_opacity;\nvarying vec2 v_texCoord;\nvarying float v_intensity;\n\nvoid main(){\n \n float intensity = texture2D(u_texture, v_texCoord).r;\n vec4 color = texture2D(u_colorTexture,vec2(intensity, 0));\n gl_FragColor = color;\n // gl_FragColor.a = color.a * smoothstep(0.1,0.2,intensity)* u_opacity;\n gl_FragColor.a = color.a * smoothstep(0.,0.1,intensity) * u_opacity;\n}\n";
|
|
31
|
-
|
|
28
|
+
|
|
29
|
+
/* babel-plugin-inline-import '../shaders/heatmap_3d_vert.glsl' */
|
|
30
|
+
var heatmap3DVert = "precision highp float;\nattribute vec3 a_Position;\nattribute vec2 a_Uv;\nuniform sampler2D u_texture;\nvarying vec2 v_texCoord;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_InverseViewProjectionMatrix;\nuniform mat4 u_ViewProjectionMatrixUncentered;\nvarying float v_intensity;\n\n\nvec2 toBezier(float t, vec2 P0, vec2 P1, vec2 P2, vec2 P3) {\n float t2 = t * t;\n float one_minus_t = 1.0 - t;\n float one_minus_t2 = one_minus_t * one_minus_t;\n return (P0 * one_minus_t2 * one_minus_t + P1 * 3.0 * t * one_minus_t2 + P2 * 3.0 * t2 * one_minus_t + P3 * t2 * t);\n}\nvec2 toBezier(float t, vec4 p){\n return toBezier(t, vec2(0.0, 0.0), vec2(p.x, p.y), vec2(p.z, p.w), vec2(1.0, 1.0));\n}\n#pragma include \"projection\"\nvoid main() {\n v_texCoord = a_Uv;\n\n vec2 pos = a_Uv * vec2(2.0) - vec2(1.0); // \u5C06\u539F\u672C 0 -> 1 \u7684 uv \u8F6C\u6362\u4E3A -1 -> 1 \u7684\u6807\u51C6\u5750\u6807\u7A7A\u95F4\uFF08NDC\uFF09\n\n vec4 p1 = vec4(pos, 0.0, 1.0); // x/y \u5E73\u9762\u4E0A\u7684\u70B9\uFF08z == 0\uFF09\u53EF\u4EE5\u8BA4\u4E3A\u662F\u4E09\u7EF4\u4E0A\u7684\u70B9\u88AB\u6295\u5F71\u5230\u5E73\u9762\u540E\u7684\u70B9\n\tvec4 p2 = vec4(pos, 1.0, 1.0); // \u5E73\u884C\u4E8Ex/y\u5E73\u9762\u3001z==1 \u7684\u5E73\u9762\u4E0A\u7684\u70B9\n\n\tvec4 inverseP1 = u_InverseViewProjectionMatrix * p1; // \u6839\u636E\u89C6\u56FE\u6295\u5F71\u77E9\u9635\u7684\u9006\u77E9\u9635\u5E73\u9762\u4E0A\u7684\u53CD\u7B97\u51FA\u4E09\u7EF4\u7A7A\u95F4\u4E2D\u7684\u70B9\uFF08p1\u5E73\u9762\u4E0A\u7684\u70B9\uFF09\n\tvec4 inverseP2 = u_InverseViewProjectionMatrix * p2;\n\n inverseP1 = inverseP1 / inverseP1.w; // \u5F52\u4E00\u5316\u64CD\u4F5C\uFF08\u5F52\u4E00\u5316\u540E\u4E3A\u4E16\u754C\u5750\u6807\uFF09\n\tinverseP2 = inverseP2 / inverseP2.w;\n\n\tfloat zPos = (0.0 - inverseP1.z) / (inverseP2.z - inverseP1.z); // ??\n\tvec4 position = inverseP1 + zPos * (inverseP2 - inverseP1);\n\n vec4 b= vec4(0.5000, 0.0, 1.0, 0.5000);\n float fh;\n\n v_intensity = texture2D(u_texture, v_texCoord).r;\n fh = toBezier(v_intensity, b).y;\n gl_Position = u_ViewProjectionMatrixUncentered * vec4(position.xy, fh * project_pixel(50.), 1.0);\n \n}\n"; // 绘制平面热力的 shader
|
|
31
|
+
|
|
32
|
+
/* babel-plugin-inline-import '../shaders/heatmap_frag.glsl' */
|
|
32
33
|
var heatmapColorFrag = "uniform sampler2D u_texture; // \u70ED\u529B\u5F3A\u5EA6\u56FE\nuniform sampler2D u_colorTexture; // \u6839\u636E\u5F3A\u5EA6\u5206\u5E03\u7684\u8272\u5E26\nuniform float u_opacity;\nvarying vec2 v_texCoord;\n\nuniform vec2 u_ViewportSize;\n\nfloat getBlurIndusty() {\n float vW = 2.0/u_ViewportSize.x;\n float vH = 2.0/u_ViewportSize.y;\n vec2 vUv = v_texCoord;\n float i11 = texture2D( u_texture, vec2( vUv.x - 1.0 * vW, vUv.y + 1.0 * vH) ).r;\n float i12 = texture2D( u_texture, vec2( vUv.x - 0.0 * vW, vUv.y + 1.0 * vH) ).r;\n float i13 = texture2D( u_texture, vec2( vUv.x + 1.0 * vW, vUv.y + 1.0 * vH) ).r;\n\n float i21 = texture2D( u_texture, vec2( vUv.x - 1.0 * vW, vUv.y) ).r;\n float i22 = texture2D( u_texture, vec2( vUv.x , vUv.y) ).r;\n float i23 = texture2D( u_texture, vec2( vUv.x + 1.0 * vW, vUv.y) ).r;\n\n float i31 = texture2D( u_texture, vec2( vUv.x - 1.0 * vW, vUv.y-1.0*vH) ).r;\n float i32 = texture2D( u_texture, vec2( vUv.x - 0.0 * vW, vUv.y-1.0*vH) ).r;\n float i33 = texture2D( u_texture, vec2( vUv.x + 1.0 * vW, vUv.y-1.0*vH) ).r;\n\n return(\n i11 + \n i12 + \n i13 + \n i21 + \n i21 + \n i22 + \n i23 + \n i31 + \n i32 + \n i33\n )/9.0;\n}\n\n\nvoid main(){\n // float intensity = texture2D(u_texture, v_texCoord).r;\n float intensity = getBlurIndusty();\n vec4 color = texture2D(u_colorTexture, vec2(intensity, 0.0));\n\n gl_FragColor =color;\n gl_FragColor.a = color.a * smoothstep(0.,0.1,intensity) * u_opacity;\n\n}\n";
|
|
34
|
+
|
|
35
|
+
/* babel-plugin-inline-import '../shaders/heatmap_vert.glsl' */
|
|
33
36
|
var heatmapColorVert = "precision highp float;\nattribute vec3 a_Position;\nattribute vec2 a_Uv;\nvarying vec2 v_texCoord;\n\nvoid main() {\n v_texCoord = a_Uv;\n\n gl_Position = vec4(a_Position.xy, 0, 1.);\n}\n";
|
|
37
|
+
|
|
38
|
+
/* babel-plugin-inline-import '../shaders/heatmap_framebuffer_frag.glsl' */
|
|
34
39
|
var heatmapFramebufferFrag = "precision highp float;\nuniform float u_intensity;\nvarying float v_weight;\nvarying vec2 v_extrude;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(){\n float d = -0.5 * 3.0 * 3.0 * dot(v_extrude, v_extrude);\n float val = v_weight * u_intensity * GAUSS_COEF * exp(d);\n gl_FragColor = vec4(val, 1., 1., 1.);\n}\n";
|
|
40
|
+
|
|
41
|
+
/* babel-plugin-inline-import '../shaders/heatmap_framebuffer_vert.glsl' */
|
|
35
42
|
var heatmapFramebufferVert = "precision highp float;\nattribute vec3 a_Position;\nattribute float a_Size;\nattribute vec2 a_Dir;\nuniform float u_intensity;\nuniform float u_radius;\nvarying vec2 v_extrude;\nvarying float v_weight;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\n\n#define GAUSS_COEF 0.3989422804014327\n\n#pragma include \"projection\"\n\nvoid main(){\n v_weight = a_Size;\n float ZERO = 1.0 / 255.0 / 16.0;\n float extrude_x = a_Dir.x * 2.0 -1.0;\n float extrude_y = a_Dir.y * 2.0 -1.0;\n vec2 extrude_dir = normalize(vec2(extrude_x,extrude_y));\n float S = sqrt(-2.0 * log(ZERO / a_Size / u_intensity / GAUSS_COEF)) / 2.5;\n v_extrude = extrude_dir * S;\n\n vec2 offset = project_pixel(v_extrude * u_radius);\n vec4 project_pos = project_position(vec4(a_Position.xy, 0.0, 1.0));\n\n // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, 0.0, 1.0));\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(project_pos.xy + offset, 0.0, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, 0.0, 1.0));\n }\n}\n";
|
|
36
|
-
import { heatMap3DTriangulation } from
|
|
37
|
-
var HeatMapModel = (_dec = injectable(), _dec(_class = function (_BaseModel) {
|
|
43
|
+
import { heatMap3DTriangulation } from "../triangulation";
|
|
44
|
+
var HeatMapModel = (_dec = injectable(), _dec(_class = /*#__PURE__*/function (_BaseModel) {
|
|
38
45
|
_inherits(HeatMapModel, _BaseModel);
|
|
39
46
|
|
|
40
47
|
var _super = _createSuper(HeatMapModel);
|
|
41
48
|
|
|
42
49
|
function HeatMapModel() {
|
|
43
|
-
var _this;
|
|
44
|
-
|
|
45
50
|
_classCallCheck(this, HeatMapModel);
|
|
46
51
|
|
|
47
|
-
|
|
48
|
-
args[_key] = arguments[_key];
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
52
|
-
|
|
53
|
-
_defineProperty(_assertThisInitialized(_this), "texture", void 0);
|
|
54
|
-
|
|
55
|
-
_defineProperty(_assertThisInitialized(_this), "colorTexture", void 0);
|
|
56
|
-
|
|
57
|
-
_defineProperty(_assertThisInitialized(_this), "heatmapFramerBuffer", void 0);
|
|
58
|
-
|
|
59
|
-
_defineProperty(_assertThisInitialized(_this), "intensityModel", void 0);
|
|
60
|
-
|
|
61
|
-
_defineProperty(_assertThisInitialized(_this), "colorModel", void 0);
|
|
62
|
-
|
|
63
|
-
_defineProperty(_assertThisInitialized(_this), "shapeType", void 0);
|
|
64
|
-
|
|
65
|
-
return _this;
|
|
52
|
+
return _super.apply(this, arguments);
|
|
66
53
|
}
|
|
67
54
|
|
|
68
55
|
_createClass(HeatMapModel, [{
|
|
69
56
|
key: "render",
|
|
70
57
|
value: function render() {
|
|
71
|
-
var
|
|
58
|
+
var _this = this;
|
|
72
59
|
|
|
73
60
|
var _this$rendererService = this.rendererService,
|
|
74
61
|
clear = _this$rendererService.clear,
|
|
@@ -78,10 +65,10 @@ var HeatMapModel = (_dec = injectable(), _dec(_class = function (_BaseModel) {
|
|
|
78
65
|
color: [0, 0, 0, 0],
|
|
79
66
|
depth: 1,
|
|
80
67
|
stencil: 0,
|
|
81
|
-
framebuffer:
|
|
68
|
+
framebuffer: _this.heatmapFramerBuffer
|
|
82
69
|
});
|
|
83
70
|
|
|
84
|
-
|
|
71
|
+
_this.drawIntensityMode();
|
|
85
72
|
});
|
|
86
73
|
|
|
87
74
|
if (this.layer.styleNeedUpdate) {
|
|
@@ -98,7 +85,7 @@ var HeatMapModel = (_dec = injectable(), _dec(_class = function (_BaseModel) {
|
|
|
98
85
|
}, {
|
|
99
86
|
key: "initModels",
|
|
100
87
|
value: function () {
|
|
101
|
-
var _initModels = _asyncToGenerator(_regeneratorRuntime.mark(function _callee(callbackModel) {
|
|
88
|
+
var _initModels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(callbackModel) {
|
|
102
89
|
var _shapeAttr$scale;
|
|
103
90
|
|
|
104
91
|
var _this$rendererService2, createFramebuffer, clear, getViewportSize, createTexture2D, useFramebuffer, shapeAttr, shapeType, _getViewportSize, width, height;
|
|
@@ -110,14 +97,19 @@ var HeatMapModel = (_dec = injectable(), _dec(_class = function (_BaseModel) {
|
|
|
110
97
|
_this$rendererService2 = this.rendererService, createFramebuffer = _this$rendererService2.createFramebuffer, clear = _this$rendererService2.clear, getViewportSize = _this$rendererService2.getViewportSize, createTexture2D = _this$rendererService2.createTexture2D, useFramebuffer = _this$rendererService2.useFramebuffer;
|
|
111
98
|
shapeAttr = this.styleAttributeService.getLayerStyleAttribute('shape');
|
|
112
99
|
shapeType = (shapeAttr === null || shapeAttr === void 0 ? void 0 : (_shapeAttr$scale = shapeAttr.scale) === null || _shapeAttr$scale === void 0 ? void 0 : _shapeAttr$scale.field) || 'heatmap';
|
|
113
|
-
this.shapeType = shapeType;
|
|
100
|
+
this.shapeType = shapeType; // 生成热力图密度图
|
|
101
|
+
|
|
114
102
|
_context.next = 6;
|
|
115
103
|
return this.buildHeatMapIntensity();
|
|
116
104
|
|
|
117
105
|
case 6:
|
|
118
106
|
this.intensityModel = _context.sent;
|
|
119
|
-
|
|
120
|
-
|
|
107
|
+
// 渲染到屏幕
|
|
108
|
+
this.colorModel = shapeType === 'heatmap' ? this.buildHeatmapColor() // 2D
|
|
109
|
+
: this.build3dHeatMap(); // 3D
|
|
110
|
+
|
|
111
|
+
_getViewportSize = getViewportSize(), width = _getViewportSize.width, height = _getViewportSize.height; // 初始化密度图纹理
|
|
112
|
+
|
|
121
113
|
this.heatmapFramerBuffer = createFramebuffer({
|
|
122
114
|
color: createTexture2D({
|
|
123
115
|
width: Math.floor(width / 4),
|
|
@@ -160,6 +152,7 @@ var HeatMapModel = (_dec = injectable(), _dec(_class = function (_BaseModel) {
|
|
|
160
152
|
descriptor: {
|
|
161
153
|
name: 'a_Dir',
|
|
162
154
|
buffer: {
|
|
155
|
+
// give the WebGL driver a hint that this buffer may change
|
|
163
156
|
usage: gl.DYNAMIC_DRAW,
|
|
164
157
|
data: [],
|
|
165
158
|
type: gl.FLOAT
|
|
@@ -169,13 +162,15 @@ var HeatMapModel = (_dec = injectable(), _dec(_class = function (_BaseModel) {
|
|
|
169
162
|
return [vertex[3], vertex[4]];
|
|
170
163
|
}
|
|
171
164
|
}
|
|
172
|
-
});
|
|
165
|
+
}); // point layer size;
|
|
166
|
+
|
|
173
167
|
this.styleAttributeService.registerStyleAttribute({
|
|
174
168
|
name: 'size',
|
|
175
169
|
type: AttributeType.Attribute,
|
|
176
170
|
descriptor: {
|
|
177
171
|
name: 'a_Size',
|
|
178
172
|
buffer: {
|
|
173
|
+
// give the WebGL driver a hint that this buffer may change
|
|
179
174
|
usage: gl.DYNAMIC_DRAW,
|
|
180
175
|
data: [],
|
|
181
176
|
type: gl.FLOAT
|
|
@@ -192,7 +187,7 @@ var HeatMapModel = (_dec = injectable(), _dec(_class = function (_BaseModel) {
|
|
|
192
187
|
}, {
|
|
193
188
|
key: "buildHeatMapIntensity",
|
|
194
189
|
value: function () {
|
|
195
|
-
var _buildHeatMapIntensity = _asyncToGenerator(_regeneratorRuntime.mark(function _callee2() {
|
|
190
|
+
var _buildHeatMapIntensity = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
196
191
|
var model;
|
|
197
192
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
198
193
|
while (1) {
|
|
@@ -340,7 +335,14 @@ var HeatMapModel = (_dec = injectable(), _dec(_class = function (_BaseModel) {
|
|
|
340
335
|
var _this$colorModel2;
|
|
341
336
|
|
|
342
337
|
var _ref4 = this.layer.getLayerConfig(),
|
|
343
|
-
opacity = _ref4.opacity;
|
|
338
|
+
opacity = _ref4.opacity; // const invert = mat4.invert(
|
|
339
|
+
// mat4.create(),
|
|
340
|
+
// mat4.fromValues(
|
|
341
|
+
// // @ts-ignore
|
|
342
|
+
// ...this.cameraService.getViewProjectionMatrixUncentered(),
|
|
343
|
+
// ),
|
|
344
|
+
// ) as mat4;
|
|
345
|
+
|
|
344
346
|
|
|
345
347
|
var invert = mat4.create();
|
|
346
348
|
mat4.invert(invert, this.cameraService.getViewProjectionMatrixUncentered());
|
|
@@ -459,5 +461,4 @@ var HeatMapModel = (_dec = injectable(), _dec(_class = function (_BaseModel) {
|
|
|
459
461
|
|
|
460
462
|
return HeatMapModel;
|
|
461
463
|
}(BaseModel)) || _class);
|
|
462
|
-
export { HeatMapModel as default };
|
|
463
|
-
//# sourceMappingURL=heatmap.js.map
|
|
464
|
+
export { HeatMapModel as default };
|
|
@@ -10,12 +10,16 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
10
10
|
|
|
11
11
|
import { AttributeType, gl } from '@antv/l7-core';
|
|
12
12
|
import { getMask } from '@antv/l7-utils';
|
|
13
|
-
import BaseModel from
|
|
14
|
-
import { HeatmapGridTriangulation } from
|
|
13
|
+
import BaseModel from "../../core/BaseModel";
|
|
14
|
+
import { HeatmapGridTriangulation } from "../../core/triangulation";
|
|
15
|
+
|
|
16
|
+
/* babel-plugin-inline-import '../shaders/hexagon_frag.glsl' */
|
|
15
17
|
var heatmapGridFrag = "precision highp float;\nvarying vec4 v_color;\nuniform float u_opacity: 1;\n\n#pragma include \"picking\"\n\nvoid main() {\n gl_FragColor = v_color;\n gl_FragColor.a *= u_opacity;\n\n gl_FragColor = filterColor(gl_FragColor);\n}\n";
|
|
18
|
+
|
|
19
|
+
/* babel-plugin-inline-import '../shaders/hexagon_vert.glsl' */
|
|
16
20
|
var heatmapGridVert = "precision highp float;\n// \u591A\u8FB9\u5F62\u9876\u70B9\u5750\u6807\nattribute vec3 a_Position;\n// \u591A\u8FB9\u5F62\u7ECF\u7EAC\u5EA6\u5750\u6807\nattribute vec3 a_Pos;\nattribute float a_Size;\nattribute vec4 a_Color;\nuniform vec2 u_radius;\nuniform float u_coverage: 0.9;\nuniform float u_angle: 0;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nvarying vec4 v_color;\n\nuniform vec2 u_SceneCenterMKT;\n\n#pragma include \"projection\"\n#pragma include \"project\"\n#pragma include \"picking\"\n\nvoid main() {\n v_color = a_Color;\n \n mat2 rotationMatrix = mat2(cos(u_angle), sin(u_angle), -sin(u_angle), cos(u_angle));\n vec2 offset =(vec2(a_Position.xy * u_radius * rotationMatrix * u_coverage));\n vec2 lnglat = unProjectFlat(a_Pos.xy + offset);\n \n // vec4 project_pos = project_position(vec4(lnglat, 0, 1.0));\n // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy, 0., 1.0));\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n // gl_Position = u_Mvp * (vec4(project_pos.xy, 0., 1.0));\n // gl_Position = u_Mvp * (vec4(a_Pos.xy + offset, 0., 1.0));\n vec2 customLnglat = customProject(lnglat) - u_SceneCenterMKT;\n vec4 project_pos = project_position(vec4(customLnglat, 0, 1.0));\n gl_Position = u_Mvp * vec4(project_pos.xy, 0.0, 1.0);\n } else {\n vec4 project_pos = project_position(vec4(lnglat, 0, 1.0));\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy, 0., 1.0));\n }\n setPickingColor(a_PickingColor);\n}\n";
|
|
17
21
|
|
|
18
|
-
var HexagonModel = function (_BaseModel) {
|
|
22
|
+
var HexagonModel = /*#__PURE__*/function (_BaseModel) {
|
|
19
23
|
_inherits(HexagonModel, _BaseModel);
|
|
20
24
|
|
|
21
25
|
var _super = _createSuper(HexagonModel);
|
|
@@ -78,17 +82,22 @@ var HexagonModel = function (_BaseModel) {
|
|
|
78
82
|
value: function registerBuiltinAttributes() {
|
|
79
83
|
this.styleAttributeService.registerStyleAttribute({
|
|
80
84
|
name: 'pos',
|
|
85
|
+
// 顶点经纬度位置
|
|
81
86
|
type: AttributeType.Attribute,
|
|
82
87
|
descriptor: {
|
|
83
88
|
name: 'a_Pos',
|
|
84
89
|
buffer: {
|
|
90
|
+
// give the WebGL driver a hint that this buffer may change
|
|
85
91
|
usage: gl.DYNAMIC_DRAW,
|
|
86
92
|
data: [],
|
|
87
93
|
type: gl.FLOAT
|
|
88
94
|
},
|
|
89
95
|
size: 3,
|
|
90
96
|
update: function update(feature, featureIdx) {
|
|
91
|
-
|
|
97
|
+
// const coordinates = (feature.verison==='GAODE2.x'?feature.originoordinates:feature.coordinates) as number[];
|
|
98
|
+
var coordinates = feature.version === 'GAODE2.x' ? feature.originCoordinates : feature.coordinates; // const coordinates = feature.coordinates as number[];
|
|
99
|
+
// const coordinates = feature.originCoordinates as number[];
|
|
100
|
+
|
|
92
101
|
return [coordinates[0], coordinates[1], 0];
|
|
93
102
|
}
|
|
94
103
|
}
|
|
@@ -99,5 +108,4 @@ var HexagonModel = function (_BaseModel) {
|
|
|
99
108
|
return HexagonModel;
|
|
100
109
|
}(BaseModel);
|
|
101
110
|
|
|
102
|
-
export { HexagonModel as default };
|
|
103
|
-
//# sourceMappingURL=hexagon.js.map
|
|
111
|
+
export { HexagonModel as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import GridModel from
|
|
2
|
-
import Grid3DModel from
|
|
3
|
-
import HeatMapModel from
|
|
4
|
-
import HexagonModel from
|
|
1
|
+
import GridModel from "./grid";
|
|
2
|
+
import Grid3DModel from "./grid3d";
|
|
3
|
+
import HeatMapModel from "./heatmap";
|
|
4
|
+
import HexagonModel from "./hexagon";
|
|
5
5
|
var HeatMapModels = {
|
|
6
6
|
heatmap: HeatMapModel,
|
|
7
7
|
heatmap3d: HeatMapModel,
|
|
@@ -9,5 +9,4 @@ var HeatMapModels = {
|
|
|
9
9
|
grid3d: Grid3DModel,
|
|
10
10
|
hexagon: HexagonModel
|
|
11
11
|
};
|
|
12
|
-
export default HeatMapModels;
|
|
13
|
-
//# sourceMappingURL=index.js.map
|
|
12
|
+
export default HeatMapModels;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
precision highp float;
|
|
2
|
+
// 多边形顶点坐标
|
|
3
|
+
attribute vec3 a_Position;
|
|
4
|
+
// 多边形经纬度坐标
|
|
5
|
+
attribute vec3 a_Pos;
|
|
6
|
+
attribute float a_Size;
|
|
7
|
+
attribute vec4 a_Color;
|
|
8
|
+
uniform vec2 u_radius;
|
|
9
|
+
uniform float u_coverage: 0.9;
|
|
10
|
+
uniform float u_angle: 0;
|
|
11
|
+
uniform mat4 u_ModelMatrix;
|
|
12
|
+
uniform mat4 u_Mvp;
|
|
13
|
+
varying vec4 v_color;
|
|
14
|
+
|
|
15
|
+
uniform vec2 u_SceneCenterMKT;
|
|
16
|
+
|
|
17
|
+
#pragma include "projection"
|
|
18
|
+
#pragma include "project"
|
|
19
|
+
#pragma include "picking"
|
|
20
|
+
|
|
21
|
+
void main() {
|
|
22
|
+
v_color = a_Color;
|
|
23
|
+
|
|
24
|
+
mat2 rotationMatrix = mat2(cos(u_angle), sin(u_angle), -sin(u_angle), cos(u_angle));
|
|
25
|
+
vec2 offset = a_Position.xy * u_radius * rotationMatrix * u_coverage ;
|
|
26
|
+
// vec2 lnglat = unProjectFlat(a_Pos.xy + offset);
|
|
27
|
+
// vec4 project_pos = project_position(vec4(lnglat, 0, 1.0));
|
|
28
|
+
// gl_Position = project_common_position_to_clipspace(project_pos);
|
|
29
|
+
|
|
30
|
+
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
|
|
31
|
+
vec2 lnglat = unProjectFlat(a_Pos.xy + offset);
|
|
32
|
+
vec2 customLnglat = customProject(lnglat) - u_SceneCenterMKT; // 将经纬度转换为高德2.0需要的平面坐标
|
|
33
|
+
vec4 project_pos = project_position(vec4(customLnglat, 0, 1.0));
|
|
34
|
+
gl_Position = u_Mvp * (project_pos);
|
|
35
|
+
} else {
|
|
36
|
+
vec2 lnglat = unProjectFlat(a_Pos.xy + offset);
|
|
37
|
+
vec4 project_pos = project_position(vec4(lnglat, 0, 1.0));
|
|
38
|
+
gl_Position = project_common_position_to_clipspace(project_pos);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
setPickingColor(a_PickingColor);
|
|
42
|
+
}
|