@antv/l7-layers 2.9.27-alpha.2 → 2.9.27-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/Geometry/index.js +6 -2
- package/es/Geometry/models/billboard.js +3 -7
- package/es/Geometry/models/plane.js +5 -7
- package/es/Geometry/models/sprite.js +4 -7
- package/es/canvas/index.d.ts +4 -0
- package/es/canvas/index.js +38 -2
- package/es/citybuliding/building.js +6 -2
- package/es/citybuliding/models/build.js +2 -3
- package/es/core/BaseLayer.d.ts +20 -12
- package/es/core/BaseLayer.js +61 -85
- package/es/core/BaseModel.d.ts +2 -2
- package/es/core/BaseModel.js +22 -19
- package/es/core/interface.d.ts +20 -1
- package/es/core/triangulation.d.ts +6 -0
- package/es/core/triangulation.js +64 -2
- package/es/earth/index.js +3 -1
- package/es/earth/models/atmosphere.js +4 -7
- package/es/earth/models/base.js +12 -18
- package/es/earth/models/bloomsphere.js +4 -8
- package/es/earth/shaders/atmosphere_frag.glsl +1 -1
- package/es/earth/shaders/bloomsphere_frag.glsl +1 -1
- package/es/heatmap/index.d.ts +2 -2
- package/es/heatmap/index.js +7 -5
- package/es/heatmap/models/grid.js +1 -3
- package/es/heatmap/models/grid3d.js +4 -11
- package/es/heatmap/models/heatmap.js +8 -9
- package/es/heatmap/models/hexagon.js +2 -6
- package/es/heatmap/triangulation.js +0 -1
- package/es/image/index.d.ts +1 -1
- package/es/image/index.js +10 -3
- package/es/image/models/dataImage.d.ts +1 -1
- package/es/image/models/dataImage.js +14 -39
- package/es/image/models/image.js +5 -10
- package/es/image/models/index.d.ts +1 -1
- package/es/image/models/index.js +3 -1
- package/es/image/models/tileDataImage.d.ts +19 -0
- package/es/image/models/tileDataImage.js +174 -0
- package/es/line/index.d.ts +1 -0
- package/es/line/index.js +8 -2
- package/es/line/models/arc.js +10 -10
- package/es/line/models/arc_3d.js +8 -10
- package/es/line/models/earthArc_3d.js +8 -10
- package/es/line/models/great_circle.js +7 -7
- package/es/line/models/half.js +3 -4
- package/es/line/models/line.js +10 -9
- package/es/line/models/linearline.js +3 -4
- package/es/line/models/simpleLine.js +5 -4
- package/es/line/models/simpleTileLine.d.ts +9 -0
- package/es/line/models/simpleTileLine.js +100 -0
- package/es/line/models/tile.d.ts +1 -4
- package/es/line/models/tile.js +50 -223
- package/es/line/models/wall.js +11 -47
- package/es/line/shaders/dash/arc_dash_vert.glsl +2 -0
- package/es/line/shaders/dash/line_dash_frag.glsl +1 -1
- package/es/line/shaders/line_arc2d_vert.glsl +2 -2
- package/es/line/shaders/line_arc_3d_frag.glsl +10 -10
- package/es/line/shaders/line_arc_3d_vert.glsl +5 -6
- package/es/line/shaders/line_arc_frag.glsl +9 -10
- package/es/line/shaders/line_arc_great_circle_frag.glsl +6 -6
- package/es/line/shaders/line_arc_great_circle_vert.glsl +2 -3
- package/es/line/shaders/line_arc_vert.glsl +6 -4
- package/es/line/shaders/line_bezier_vert.glsl +2 -2
- package/es/line/shaders/line_frag.glsl +5 -6
- package/es/line/shaders/line_vert.glsl +1 -1
- package/es/line/shaders/linear/arc3d_linear_frag.glsl +6 -7
- package/es/line/shaders/linear/arc3d_linear_vert.glsl +11 -12
- package/es/line/shaders/linear/arc_linear_frag.glsl +1 -1
- package/es/line/shaders/tile/line_tile_map_vert.glsl +25 -0
- package/es/line/shaders/tile/line_tile_vert.glsl +19 -177
- 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_frag.glsl → wall/wall_frag.glsl} +21 -25
- package/es/line/shaders/wall/wall_vert.glsl +77 -0
- package/es/mask/index.d.ts +1 -0
- package/es/mask/index.js +80 -5
- package/es/mask/models/fill.d.ts +2 -1
- package/es/mask/models/fill.js +13 -10
- package/es/mask/shaders/mask_vert.glsl +0 -6
- package/es/plugins/DataMappingPlugin.d.ts +4 -3
- package/es/plugins/DataMappingPlugin.js +129 -58
- package/es/plugins/DataSourcePlugin.js +3 -2
- package/es/plugins/FeatureScalePlugin.d.ts +0 -2
- package/es/plugins/FeatureScalePlugin.js +8 -51
- package/es/plugins/LayerAnimateStylePlugin.d.ts +0 -2
- package/es/plugins/LayerAnimateStylePlugin.js +7 -27
- package/es/plugins/LayerModelPlugin.js +2 -6
- package/es/plugins/LightingPlugin.js +1 -7
- package/es/plugins/MultiPassRendererPlugin.d.ts +0 -1
- package/es/plugins/MultiPassRendererPlugin.js +4 -16
- package/es/plugins/PixelPickingPlugin.d.ts +1 -1
- package/es/plugins/PixelPickingPlugin.js +8 -28
- package/es/plugins/RegisterStyleAttributePlugin.d.ts +4 -0
- package/es/plugins/RegisterStyleAttributePlugin.js +56 -5
- package/es/plugins/UpdateStyleAttributePlugin.js +2 -9
- package/es/point/index.js +9 -6
- package/es/point/models/earthExtrude.d.ts +1 -1
- package/es/point/models/earthExtrude.js +9 -14
- package/es/point/models/earthFill.js +2 -2
- package/es/point/models/extrude.d.ts +1 -1
- package/es/point/models/extrude.js +9 -12
- package/es/point/models/fill.d.ts +1 -1
- package/es/point/models/fill.js +8 -9
- package/es/point/models/fillmage.js +5 -6
- package/es/point/models/image.js +3 -3
- package/es/point/models/index.d.ts +1 -1
- package/es/point/models/index.js +3 -3
- package/es/point/models/normal.d.ts +0 -1
- package/es/point/models/normal.js +9 -62
- package/es/point/models/radar.js +5 -70
- package/es/point/models/simplePoint.d.ts +0 -1
- package/es/point/models/simplePoint.js +2 -11
- package/es/point/models/text.js +7 -10
- package/es/point/models/tile.d.ts +0 -7
- package/es/point/models/tile.js +24 -158
- package/es/point/models/tileText.d.ts +0 -4
- package/es/point/models/tileText.js +99 -188
- package/es/point/shaders/animate/wave_frag.glsl +4 -4
- package/es/point/shaders/earth/fill_vert.glsl +0 -1
- package/es/point/shaders/fill_vert.glsl +0 -1
- package/es/point/shaders/normal_frag.glsl +1 -10
- package/es/point/shaders/normal_vert.glsl +5 -60
- package/es/point/shaders/radar/radar_frag.glsl +4 -15
- package/es/point/shaders/radar/radar_vert.glsl +4 -54
- package/es/point/shaders/tile/fill_tile_frag.glsl +10 -17
- package/es/point/shaders/tile/fill_tile_vert.glsl +20 -123
- 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/polygon/index.js +6 -2
- package/es/polygon/models/extrude.js +4 -8
- package/es/polygon/models/fill.js +3 -4
- package/es/polygon/models/ocean.d.ts +0 -2
- package/es/polygon/models/ocean.js +13 -47
- package/es/polygon/models/tile.d.ts +1 -4
- package/es/polygon/models/tile.js +25 -57
- package/es/polygon/models/water.d.ts +0 -2
- package/es/polygon/models/water.js +13 -47
- package/es/polygon/shaders/polygon_frag.glsl +2 -2
- package/es/polygon/shaders/polygon_vert.glsl +2 -2
- package/es/polygon/shaders/tile/polygon_tile_map_vert.glsl +16 -0
- package/es/polygon/shaders/tile/polygon_tile_vert.glsl +20 -60
- package/es/polygon/shaders/water/polygon_ocean_frag.glsl +1 -2
- package/es/polygon/shaders/water/polygon_ocean_vert.glsl +0 -31
- package/es/polygon/shaders/water/polygon_water_frag.glsl +1 -3
- package/es/polygon/shaders/water/polygon_water_vert.glsl +0 -29
- package/es/raster/buffers/triangulation.js +1 -4
- package/es/raster/index.js +6 -2
- package/es/raster/models/raster.d.ts +1 -1
- package/es/raster/models/raster.js +6 -5
- package/es/shader/minify_frag.glsl +7 -0
- package/es/shader/minify_picking_frag.glsl +10 -0
- package/es/tile/manager/baseMapTileLayerManager.d.ts +29 -0
- package/es/tile/manager/baseMapTileLayerManager.js +207 -0
- package/es/tile/manager/tileLayerManager.d.ts +2 -2
- package/es/tile/manager/tileLayerManager.js +12 -2
- package/es/tile/manager/tilePickerManager.d.ts +2 -3
- package/es/tile/manager/tilePickerManager.js +1 -2
- package/es/tile/models/tileModel.d.ts +1 -0
- package/es/tile/models/tileModel.js +18 -2
- package/es/tile/tileFactory/base.d.ts +1 -1
- package/es/tile/tileFactory/base.js +58 -33
- package/es/tile/tileFactory/line.js +3 -0
- package/es/tile/tileFactory/point.js +3 -0
- package/es/tile/tileFactory/polygon.js +3 -0
- package/es/tile/tileFactory/raster.js +3 -0
- package/es/tile/tileFactory/rasterData.js +3 -0
- package/es/tile/tileFactory/rasterDataLayer.js +6 -2
- package/es/tile/tileFactory/test.js +26 -5
- package/es/tile/tileFactory/vectorLayer.d.ts +4 -1
- package/es/tile/tileFactory/vectorLayer.js +110 -7
- package/es/tile/tileLayer/baseMapTileLayer.d.ts +29 -0
- package/es/tile/tileLayer/baseMapTileLayer.js +188 -0
- package/es/tile/tileLayer/baseTileLayer.d.ts +4 -4
- package/es/tile/tileLayer/baseTileLayer.js +46 -75
- package/es/tile/tileTest.d.ts +1 -0
- package/es/tile/tileTest.js +3 -2
- package/es/tile/tmsMapTileLayer.d.ts +9 -0
- package/es/tile/tmsMapTileLayer.js +119 -0
- package/es/tile/tmsTileLayer.d.ts +2 -0
- package/es/tile/tmsTileLayer.js +24 -2
- package/es/tile/utils.d.ts +4 -0
- package/es/tile/utils.js +30 -0
- package/es/utils/dataMappingStyle.js +3 -0
- package/es/utils/layerData.js +2 -2
- package/es/utils/updateShape.js +2 -2
- package/es/wind/index.js +6 -2
- package/es/wind/models/wind.js +8 -8
- package/es/wind/shaders/wind_vert.glsl +1 -1
- package/lib/Geometry/index.js +6 -2
- package/lib/Geometry/models/billboard.js +3 -7
- package/lib/Geometry/models/plane.js +5 -7
- package/lib/Geometry/models/sprite.js +4 -7
- package/lib/canvas/index.js +37 -2
- package/lib/citybuliding/building.js +6 -2
- package/lib/citybuliding/models/build.js +2 -3
- package/lib/core/BaseLayer.js +61 -85
- package/lib/core/BaseModel.js +22 -19
- package/lib/core/triangulation.js +66 -2
- package/lib/earth/index.js +3 -1
- package/lib/earth/models/atmosphere.js +4 -7
- package/lib/earth/models/base.js +12 -18
- package/lib/earth/models/bloomsphere.js +4 -8
- package/lib/earth/shaders/atmosphere_frag.glsl +1 -1
- package/lib/earth/shaders/bloomsphere_frag.glsl +1 -1
- package/lib/heatmap/index.js +7 -5
- package/lib/heatmap/models/grid.js +1 -3
- package/lib/heatmap/models/grid3d.js +4 -11
- package/lib/heatmap/models/heatmap.js +8 -9
- package/lib/heatmap/models/hexagon.js +2 -6
- package/lib/heatmap/triangulation.js +0 -1
- package/lib/image/index.js +10 -3
- package/lib/image/models/dataImage.js +13 -38
- package/lib/image/models/image.js +5 -10
- package/lib/image/models/index.js +4 -1
- package/lib/image/models/tileDataImage.js +188 -0
- package/lib/line/index.js +7 -2
- package/lib/line/models/arc.js +10 -10
- package/lib/line/models/arc_3d.js +8 -10
- package/lib/line/models/earthArc_3d.js +8 -10
- package/lib/line/models/great_circle.js +7 -7
- package/lib/line/models/half.js +3 -4
- package/lib/line/models/line.js +10 -9
- package/lib/line/models/linearline.js +3 -4
- package/lib/line/models/simpleLine.js +5 -4
- package/lib/line/models/simpleTileLine.js +115 -0
- package/lib/line/models/tile.js +50 -224
- package/lib/line/models/wall.js +11 -47
- package/lib/line/shaders/dash/arc_dash_vert.glsl +2 -0
- package/lib/line/shaders/dash/line_dash_frag.glsl +1 -1
- package/lib/line/shaders/line_arc2d_vert.glsl +2 -2
- package/lib/line/shaders/line_arc_3d_frag.glsl +10 -10
- package/lib/line/shaders/line_arc_3d_vert.glsl +5 -6
- package/lib/line/shaders/line_arc_frag.glsl +9 -10
- package/lib/line/shaders/line_arc_great_circle_frag.glsl +6 -6
- package/lib/line/shaders/line_arc_great_circle_vert.glsl +2 -3
- package/lib/line/shaders/line_arc_vert.glsl +6 -4
- package/lib/line/shaders/line_bezier_vert.glsl +2 -2
- package/lib/line/shaders/line_frag.glsl +5 -6
- package/lib/line/shaders/line_vert.glsl +1 -1
- package/lib/line/shaders/linear/arc3d_linear_frag.glsl +6 -7
- package/lib/line/shaders/linear/arc3d_linear_vert.glsl +11 -12
- package/lib/line/shaders/linear/arc_linear_frag.glsl +1 -1
- package/lib/line/shaders/tile/line_tile_map_vert.glsl +25 -0
- package/lib/line/shaders/tile/line_tile_vert.glsl +19 -177
- 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_frag.glsl → wall/wall_frag.glsl} +21 -25
- package/lib/line/shaders/wall/wall_vert.glsl +77 -0
- package/lib/mask/index.js +82 -5
- package/lib/mask/models/fill.js +14 -10
- package/lib/mask/shaders/mask_vert.glsl +0 -6
- package/lib/plugins/DataMappingPlugin.js +127 -57
- package/lib/plugins/DataSourcePlugin.js +3 -2
- package/lib/plugins/FeatureScalePlugin.js +6 -50
- package/lib/plugins/LayerAnimateStylePlugin.js +6 -29
- package/lib/plugins/LayerModelPlugin.js +2 -6
- package/lib/plugins/LightingPlugin.js +1 -7
- package/lib/plugins/MultiPassRendererPlugin.js +3 -19
- package/lib/plugins/PixelPickingPlugin.js +8 -28
- package/lib/plugins/RegisterStyleAttributePlugin.js +56 -5
- package/lib/plugins/UpdateStyleAttributePlugin.js +2 -9
- package/lib/point/index.js +9 -6
- package/lib/point/models/earthExtrude.js +9 -14
- package/lib/point/models/earthFill.js +2 -2
- package/lib/point/models/extrude.js +9 -12
- package/lib/point/models/fill.js +8 -9
- package/lib/point/models/fillmage.js +5 -6
- package/lib/point/models/image.js +3 -3
- package/lib/point/models/index.js +1 -1
- package/lib/point/models/normal.js +8 -61
- package/lib/point/models/radar.js +5 -70
- package/lib/point/models/simplePoint.js +1 -10
- package/lib/point/models/text.js +7 -10
- package/lib/point/models/tile.js +23 -159
- package/lib/point/models/tileText.js +98 -187
- package/lib/point/shaders/animate/wave_frag.glsl +4 -4
- package/lib/point/shaders/earth/fill_vert.glsl +0 -1
- package/lib/point/shaders/fill_vert.glsl +0 -1
- package/lib/point/shaders/normal_frag.glsl +1 -10
- package/lib/point/shaders/normal_vert.glsl +5 -60
- package/lib/point/shaders/radar/radar_frag.glsl +4 -15
- package/lib/point/shaders/radar/radar_vert.glsl +4 -54
- package/lib/point/shaders/tile/fill_tile_frag.glsl +10 -17
- package/lib/point/shaders/tile/fill_tile_vert.glsl +20 -123
- 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/polygon/index.js +6 -2
- package/lib/polygon/models/extrude.js +4 -8
- package/lib/polygon/models/fill.js +3 -4
- package/lib/polygon/models/ocean.js +14 -47
- package/lib/polygon/models/tile.js +24 -57
- package/lib/polygon/models/water.js +14 -47
- package/lib/polygon/shaders/polygon_frag.glsl +2 -2
- package/lib/polygon/shaders/polygon_vert.glsl +2 -2
- package/lib/polygon/shaders/tile/polygon_tile_map_vert.glsl +16 -0
- package/lib/polygon/shaders/tile/polygon_tile_vert.glsl +20 -60
- package/lib/polygon/shaders/water/polygon_ocean_frag.glsl +1 -2
- package/lib/polygon/shaders/water/polygon_ocean_vert.glsl +0 -31
- package/lib/polygon/shaders/water/polygon_water_frag.glsl +1 -3
- package/lib/polygon/shaders/water/polygon_water_vert.glsl +0 -29
- package/lib/raster/buffers/triangulation.js +1 -4
- package/lib/raster/index.js +6 -2
- package/lib/raster/models/raster.js +6 -5
- package/lib/shader/minify_frag.glsl +7 -0
- package/lib/shader/minify_picking_frag.glsl +10 -0
- package/lib/tile/manager/baseMapTileLayerManager.js +222 -0
- package/lib/tile/manager/tileLayerManager.js +12 -2
- package/lib/tile/manager/tilePickerManager.js +1 -2
- package/lib/tile/models/tileModel.js +19 -2
- package/lib/tile/tileFactory/base.js +60 -33
- package/lib/tile/tileFactory/line.js +3 -0
- package/lib/tile/tileFactory/point.js +3 -0
- package/lib/tile/tileFactory/polygon.js +3 -0
- package/lib/tile/tileFactory/raster.js +3 -0
- package/lib/tile/tileFactory/rasterData.js +3 -0
- package/lib/tile/tileFactory/rasterDataLayer.js +6 -2
- package/lib/tile/tileFactory/test.js +26 -5
- package/lib/tile/tileFactory/vectorLayer.js +112 -8
- package/lib/tile/tileLayer/baseMapTileLayer.js +195 -0
- package/lib/tile/tileLayer/baseTileLayer.js +46 -75
- package/lib/tile/tileTest.js +3 -2
- package/lib/tile/tmsMapTileLayer.js +136 -0
- package/lib/tile/tmsTileLayer.js +25 -2
- package/lib/tile/utils.js +38 -0
- package/lib/utils/dataMappingStyle.js +3 -0
- package/lib/utils/layerData.js +2 -2
- package/lib/utils/updateShape.js +2 -2
- package/lib/wind/index.js +6 -2
- package/lib/wind/models/wind.js +7 -7
- package/lib/wind/shaders/wind_vert.glsl +1 -1
- package/package.json +8 -7
- package/es/line/shaders/tile/line_tile_frag.glsl +0 -79
- package/es/line/shaders/wall_vert.glsl +0 -111
- package/es/mask/shaders/mask_frag.glsl +0 -7
- package/es/polygon/shaders/tile/polygon_tile_frag.glsl +0 -12
- package/lib/line/shaders/tile/line_tile_frag.glsl +0 -79
- package/lib/line/shaders/wall_vert.glsl +0 -111
- package/lib/mask/shaders/mask_frag.glsl +0 -7
- package/lib/polygon/shaders/tile/polygon_tile_frag.glsl +0 -12
package/es/core/BaseModel.js
CHANGED
|
@@ -61,7 +61,7 @@ var BaseModel = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
61
61
|
stroke: undefined,
|
|
62
62
|
offsets: undefined
|
|
63
63
|
};
|
|
64
|
-
this.
|
|
64
|
+
this.stylePropertiesExist = {
|
|
65
65
|
hasThetaOffset: 0,
|
|
66
66
|
hasOpacity: 0,
|
|
67
67
|
hasStrokeOpacity: 0,
|
|
@@ -97,7 +97,7 @@ var BaseModel = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
97
97
|
|
|
98
98
|
this.cellLength = 0; // 清空上一次计算的 cell 的长度
|
|
99
99
|
|
|
100
|
-
this.
|
|
100
|
+
this.stylePropertiesExist = {
|
|
101
101
|
// 全量清空上一次是否需要对 style 属性进行数据映射的判断
|
|
102
102
|
hasThetaOffset: 0,
|
|
103
103
|
hasOpacity: 0,
|
|
@@ -115,13 +115,13 @@ var BaseModel = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
115
115
|
this.rowCount, // 数据纹理有几行
|
|
116
116
|
this.DATA_TEXTURE_WIDTH, // 数据纹理有几列
|
|
117
117
|
0.0, 0.0, // 1
|
|
118
|
-
this.
|
|
119
|
-
this.
|
|
120
|
-
this.
|
|
121
|
-
this.
|
|
118
|
+
this.stylePropertiesExist.hasOpacity, // cell 中是否存在 opacity
|
|
119
|
+
this.stylePropertiesExist.hasStrokeOpacity, // cell 中是否存在 strokeOpacity
|
|
120
|
+
this.stylePropertiesExist.hasStrokeWidth, // cell 中是否存在 strokeWidth
|
|
121
|
+
this.stylePropertiesExist.hasStroke, // cell 中是否存在 stroke
|
|
122
122
|
// 2
|
|
123
|
-
this.
|
|
124
|
-
this.
|
|
123
|
+
this.stylePropertiesExist.hasOffsets, // cell 中是否存在 offsets
|
|
124
|
+
this.stylePropertiesExist.hasThetaOffset, // cell 中是否存在 thetaOffset
|
|
125
125
|
0.0, 0.0, // 3
|
|
126
126
|
0.0, 0.0, 0.0, 1.0];
|
|
127
127
|
} else {
|
|
@@ -198,7 +198,7 @@ var BaseModel = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
198
198
|
attr: 'opacity',
|
|
199
199
|
count: 1
|
|
200
200
|
});
|
|
201
|
-
this.
|
|
201
|
+
this.stylePropertiesExist.hasOpacity = 1;
|
|
202
202
|
this.cellLength += 1;
|
|
203
203
|
}
|
|
204
204
|
|
|
@@ -208,7 +208,7 @@ var BaseModel = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
208
208
|
attr: 'strokeOpacity',
|
|
209
209
|
count: 1
|
|
210
210
|
});
|
|
211
|
-
this.
|
|
211
|
+
this.stylePropertiesExist.hasStrokeOpacity = 1;
|
|
212
212
|
this.cellLength += 1;
|
|
213
213
|
}
|
|
214
214
|
|
|
@@ -218,7 +218,7 @@ var BaseModel = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
218
218
|
attr: 'strokeWidth',
|
|
219
219
|
count: 1
|
|
220
220
|
});
|
|
221
|
-
this.
|
|
221
|
+
this.stylePropertiesExist.hasStrokeWidth = 1;
|
|
222
222
|
this.cellLength += 1;
|
|
223
223
|
}
|
|
224
224
|
|
|
@@ -228,7 +228,7 @@ var BaseModel = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
228
228
|
attr: 'stroke',
|
|
229
229
|
count: 4
|
|
230
230
|
});
|
|
231
|
-
this.
|
|
231
|
+
this.stylePropertiesExist.hasStroke = 1;
|
|
232
232
|
this.cellLength += 4;
|
|
233
233
|
}
|
|
234
234
|
|
|
@@ -238,7 +238,7 @@ var BaseModel = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
238
238
|
attr: 'offsets',
|
|
239
239
|
count: 2
|
|
240
240
|
});
|
|
241
|
-
this.
|
|
241
|
+
this.stylePropertiesExist.hasOffsets = 1;
|
|
242
242
|
this.cellLength += 2;
|
|
243
243
|
}
|
|
244
244
|
|
|
@@ -248,10 +248,9 @@ var BaseModel = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
248
248
|
attr: 'thetaOffset',
|
|
249
249
|
count: 1
|
|
250
250
|
});
|
|
251
|
-
this.
|
|
251
|
+
this.stylePropertiesExist.hasThetaOffset = 1;
|
|
252
252
|
this.cellLength += 1;
|
|
253
|
-
}
|
|
254
|
-
|
|
253
|
+
}
|
|
255
254
|
}
|
|
256
255
|
/**
|
|
257
256
|
* 判断变量 stroke 是否是常量值
|
|
@@ -428,20 +427,24 @@ var BaseModel = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
428
427
|
key: "needUpdate",
|
|
429
428
|
value: function needUpdate() {
|
|
430
429
|
return false;
|
|
431
|
-
}
|
|
430
|
+
} // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
431
|
+
|
|
432
432
|
}, {
|
|
433
433
|
key: "buildModels",
|
|
434
434
|
value: function buildModels(callbackModel) {
|
|
435
435
|
throw new Error('Method not implemented.');
|
|
436
|
-
}
|
|
436
|
+
} // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
437
|
+
|
|
437
438
|
}, {
|
|
438
439
|
key: "initModels",
|
|
439
440
|
value: function initModels(callbackModel) {
|
|
440
441
|
throw new Error('Method not implemented.');
|
|
441
|
-
}
|
|
442
|
+
} // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
443
|
+
|
|
442
444
|
}, {
|
|
443
445
|
key: "clearModels",
|
|
444
446
|
value: function clearModels() {
|
|
447
|
+
var refresh = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
445
448
|
return;
|
|
446
449
|
}
|
|
447
450
|
}, {
|
package/es/core/interface.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IAnimateOption, IMapService } from '@antv/l7-core';
|
|
1
|
+
import { IAnimateOption, IMapService, ITexture2D } from '@antv/l7-core';
|
|
2
2
|
import { IColorRamp, IImagedata } from '@antv/l7-utils';
|
|
3
3
|
import { styleOffset } from '../core/BaseModel';
|
|
4
4
|
import { anchorType } from '../utils/symbol-layout';
|
|
@@ -32,6 +32,9 @@ export interface IBaseLayerStyleOptions {
|
|
|
32
32
|
zIndex?: number;
|
|
33
33
|
mask?: boolean;
|
|
34
34
|
maskInside?: boolean;
|
|
35
|
+
usage?: string;
|
|
36
|
+
color?: string;
|
|
37
|
+
size?: number;
|
|
35
38
|
}
|
|
36
39
|
export interface ILineLayerStyleOptions extends IBaseLayerStyleOptions {
|
|
37
40
|
tileOrigin?: number[];
|
|
@@ -116,6 +119,7 @@ export interface IRasterTileLayerStyleOptions extends IBaseLayerStyleOptions {
|
|
|
116
119
|
}
|
|
117
120
|
export interface IMaskLayerStyleOptions extends IBaseLayerStyleOptions {
|
|
118
121
|
opacity: number;
|
|
122
|
+
color: string;
|
|
119
123
|
}
|
|
120
124
|
export interface IWindLayerStyleOptions extends IBaseLayerStyleOptions {
|
|
121
125
|
uMin?: number;
|
|
@@ -139,12 +143,27 @@ export interface IImageLayerStyleOptions extends IBaseLayerStyleOptions {
|
|
|
139
143
|
clampHigh?: boolean;
|
|
140
144
|
rampColors?: IColorRamp;
|
|
141
145
|
rampColorsData?: ImageData | IImagedata;
|
|
146
|
+
colorTexture?: ITexture2D;
|
|
142
147
|
pixelConstant?: number;
|
|
143
148
|
pixelConstantR?: number;
|
|
144
149
|
pixelConstantG?: number;
|
|
145
150
|
pixelConstantB?: number;
|
|
146
151
|
pixelConstantRGB?: number;
|
|
147
152
|
}
|
|
153
|
+
export interface ICityBuildLayerStyleOptions {
|
|
154
|
+
opacity: number;
|
|
155
|
+
baseColor: string;
|
|
156
|
+
brightColor: string;
|
|
157
|
+
windowColor: string;
|
|
158
|
+
time: number;
|
|
159
|
+
sweep: {
|
|
160
|
+
enable: boolean;
|
|
161
|
+
sweepRadius: number;
|
|
162
|
+
sweepColor: string;
|
|
163
|
+
sweepSpeed: number;
|
|
164
|
+
sweepCenter?: [number, number];
|
|
165
|
+
};
|
|
166
|
+
}
|
|
148
167
|
export interface IGeometryLayerStyleOptions extends IBaseLayerStyleOptions {
|
|
149
168
|
mapTexture?: string;
|
|
150
169
|
terrainTexture?: string;
|
|
@@ -54,6 +54,12 @@ export declare function SimpleLineTriangulation(feature: IEncodeFeature): {
|
|
|
54
54
|
size: number;
|
|
55
55
|
count: number;
|
|
56
56
|
};
|
|
57
|
+
export declare function TileSimpleLineTriangulation(feature: IEncodeFeature): {
|
|
58
|
+
vertices: any[];
|
|
59
|
+
indices: never[];
|
|
60
|
+
size: number;
|
|
61
|
+
count: number;
|
|
62
|
+
};
|
|
57
63
|
export declare function polygonTriangulation(feature: IEncodeFeature): {
|
|
58
64
|
indices: number[];
|
|
59
65
|
vertices: number[];
|
package/es/core/triangulation.js
CHANGED
|
@@ -134,6 +134,16 @@ export function SimpleLineTriangulation(feature) {
|
|
|
134
134
|
var coordinates = feature.coordinates;
|
|
135
135
|
var pos = [];
|
|
136
136
|
|
|
137
|
+
if (!Array.isArray(coordinates[0])) {
|
|
138
|
+
return {
|
|
139
|
+
vertices: [],
|
|
140
|
+
indices: [],
|
|
141
|
+
normals: [],
|
|
142
|
+
size: 6,
|
|
143
|
+
count: 0
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
|
|
137
147
|
var _getSimpleLineVertice = getSimpleLineVertices(coordinates),
|
|
138
148
|
results = _getSimpleLineVertice.results,
|
|
139
149
|
totalDistance = _getSimpleLineVertice.totalDistance;
|
|
@@ -149,6 +159,32 @@ export function SimpleLineTriangulation(feature) {
|
|
|
149
159
|
count: results.length
|
|
150
160
|
};
|
|
151
161
|
}
|
|
162
|
+
export function TileSimpleLineTriangulation(feature) {
|
|
163
|
+
var coordinates = feature.coordinates;
|
|
164
|
+
var pos = [];
|
|
165
|
+
|
|
166
|
+
if (!Array.isArray(coordinates[0])) {
|
|
167
|
+
return {
|
|
168
|
+
vertices: [],
|
|
169
|
+
indices: [],
|
|
170
|
+
size: 4,
|
|
171
|
+
count: 0
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
var _getTileSimpleLineVer = getTileSimpleLineVertices(coordinates),
|
|
176
|
+
results = _getTileSimpleLineVer.results;
|
|
177
|
+
|
|
178
|
+
results.map(function (point) {
|
|
179
|
+
pos.push(point[0], point[1], point[2], point[3]);
|
|
180
|
+
});
|
|
181
|
+
return {
|
|
182
|
+
vertices: pos,
|
|
183
|
+
indices: [],
|
|
184
|
+
size: 4,
|
|
185
|
+
count: results.length
|
|
186
|
+
};
|
|
187
|
+
}
|
|
152
188
|
|
|
153
189
|
function lineSegmentDistance(b1, a1) {
|
|
154
190
|
var dx = a1[0] - b1[0];
|
|
@@ -161,7 +197,10 @@ function pushDis(point, n) {
|
|
|
161
197
|
point.push(0);
|
|
162
198
|
}
|
|
163
199
|
|
|
164
|
-
|
|
200
|
+
if (n !== undefined) {
|
|
201
|
+
point.push(n);
|
|
202
|
+
}
|
|
203
|
+
|
|
165
204
|
return point;
|
|
166
205
|
}
|
|
167
206
|
|
|
@@ -196,6 +235,29 @@ function getSimpleLineVertices(points) {
|
|
|
196
235
|
}
|
|
197
236
|
}
|
|
198
237
|
|
|
238
|
+
function getTileSimpleLineVertices(points) {
|
|
239
|
+
if (points.length < 2) {
|
|
240
|
+
return {
|
|
241
|
+
results: points
|
|
242
|
+
};
|
|
243
|
+
} else {
|
|
244
|
+
var results = [];
|
|
245
|
+
var point = pushDis(points[0]);
|
|
246
|
+
results.push(point);
|
|
247
|
+
|
|
248
|
+
for (var i = 1; i < points.length - 1; i++) {
|
|
249
|
+
var mulPoint = pushDis(points[i]);
|
|
250
|
+
results.push(mulPoint);
|
|
251
|
+
results.push(mulPoint);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
results.push(pushDis(points[points.length - 1]));
|
|
255
|
+
return {
|
|
256
|
+
results: results
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
199
261
|
export function polygonTriangulation(feature) {
|
|
200
262
|
var coordinates = feature.coordinates;
|
|
201
263
|
var flattengeo = earcut.flatten(coordinates);
|
|
@@ -207,7 +269,7 @@ export function polygonTriangulation(feature) {
|
|
|
207
269
|
vertices: vertices,
|
|
208
270
|
size: dimensions
|
|
209
271
|
};
|
|
210
|
-
} //
|
|
272
|
+
} // 构建几何图形(带有中心点和大小)
|
|
211
273
|
|
|
212
274
|
export function polygonTriangulationWithCenter(feature) {
|
|
213
275
|
var coordinates = feature.coordinates;
|
package/es/earth/index.js
CHANGED
|
@@ -61,7 +61,9 @@ var EarthLayer = /*#__PURE__*/function (_BaseLayer) {
|
|
|
61
61
|
this.layerModel.initModels(function (models) {
|
|
62
62
|
_this2.models = models;
|
|
63
63
|
|
|
64
|
-
_this2.
|
|
64
|
+
_this2.emit('modelLoaded', null);
|
|
65
|
+
|
|
66
|
+
_this2.layerService.throttleRenderLayers();
|
|
65
67
|
});
|
|
66
68
|
}
|
|
67
69
|
/**
|
|
@@ -14,7 +14,7 @@ import BaseModel from "../../core/BaseModel";
|
|
|
14
14
|
import { earthTriangulation } from "../../core/triangulation";
|
|
15
15
|
|
|
16
16
|
/* babel-plugin-inline-import '../shaders/atmosphere_frag.glsl' */
|
|
17
|
-
var atmoSphereFrag = "\nuniform float u_opacity;\nuniform vec3 u_CameraPosition;\n\nvarying vec3 vVertexNormal;\nvarying float v_offset;\nvarying vec4 v_Color;\nvoid main() {\n \n \n // float intensity = pow(0.5 + dot(normalize(vVertexNormal), normalize(u_CameraPosition)), 3.0);\n float intensity = pow(v_offset + dot(normalize(vVertexNormal), normalize(u_CameraPosition)), 3.0);\n //
|
|
17
|
+
var atmoSphereFrag = "\nuniform float u_opacity;\nuniform vec3 u_CameraPosition;\n\nvarying vec3 vVertexNormal;\nvarying float v_offset;\nvarying vec4 v_Color;\nvoid main() {\n \n \n // float intensity = pow(0.5 + dot(normalize(vVertexNormal), normalize(u_CameraPosition)), 3.0);\n float intensity = pow(v_offset + dot(normalize(vVertexNormal), normalize(u_CameraPosition)), 3.0);\n // \u53BB\u9664\u80CC\u9762\n if(intensity > 1.0) intensity = 0.0;\n\n gl_FragColor = vec4(v_Color.rgb, v_Color.a * intensity * u_opacity);\n}\n";
|
|
18
18
|
|
|
19
19
|
/* babel-plugin-inline-import '../shaders/atmosphere_vert.glsl' */
|
|
20
20
|
var atmoSphereVert = "\nattribute vec3 a_Position;\nattribute vec3 a_Normal;\nattribute vec2 a_Uv;\nattribute vec4 a_Color;\nuniform vec3 u_CameraPosition;\nvarying float v_CamreaDistance;\n\nuniform mat4 u_ViewProjectionMatrix;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_ViewMatrix;\n\nvarying vec3 vVertexNormal;\nvarying vec4 v_Color;\nvarying float v_offset;\n\nvoid main() {\n float EARTH_RADIUS = 100.0;\n \n v_Color = a_Color;\n\n v_offset = min(((length(u_CameraPosition) - EARTH_RADIUS)/600.0) * 0.5 + 0.4, 1.0);\n vVertexNormal = a_Normal;\n\n gl_Position = u_ViewProjectionMatrix * u_ModelMatrix * vec4(a_Position, 1.0);\n}\n";
|
|
@@ -57,7 +57,7 @@ var EarthAtomSphereModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
57
57
|
// TODO: 调整图层的绘制顺序 地球大气层
|
|
58
58
|
this.layer.zIndex = -997;
|
|
59
59
|
this.layer.buildLayerModel({
|
|
60
|
-
moduleName: '
|
|
60
|
+
moduleName: 'earthAtmoSphere',
|
|
61
61
|
vertexShader: atmoSphereVert,
|
|
62
62
|
fragmentShader: atmoSphereFrag,
|
|
63
63
|
triangulation: earthTriangulation,
|
|
@@ -82,13 +82,12 @@ var EarthAtomSphereModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
82
82
|
descriptor: {
|
|
83
83
|
name: 'a_Size',
|
|
84
84
|
buffer: {
|
|
85
|
-
// give the WebGL driver a hint that this buffer may change
|
|
86
85
|
usage: gl.DYNAMIC_DRAW,
|
|
87
86
|
data: [],
|
|
88
87
|
type: gl.FLOAT
|
|
89
88
|
},
|
|
90
89
|
size: 1,
|
|
91
|
-
update: function update(feature
|
|
90
|
+
update: function update(feature) {
|
|
92
91
|
var _feature$size = feature.size,
|
|
93
92
|
size = _feature$size === void 0 ? 1 : _feature$size;
|
|
94
93
|
return Array.isArray(size) ? [size[0]] : [size];
|
|
@@ -101,7 +100,6 @@ var EarthAtomSphereModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
101
100
|
descriptor: {
|
|
102
101
|
name: 'a_Normal',
|
|
103
102
|
buffer: {
|
|
104
|
-
// give the WebGL driver a hint that this buffer may change
|
|
105
103
|
usage: gl.STATIC_DRAW,
|
|
106
104
|
data: [],
|
|
107
105
|
type: gl.FLOAT
|
|
@@ -118,13 +116,12 @@ var EarthAtomSphereModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
118
116
|
descriptor: {
|
|
119
117
|
name: 'a_Uv',
|
|
120
118
|
buffer: {
|
|
121
|
-
// give the WebGL driver a hint that this buffer may change
|
|
122
119
|
usage: gl.DYNAMIC_DRAW,
|
|
123
120
|
data: [],
|
|
124
121
|
type: gl.FLOAT
|
|
125
122
|
},
|
|
126
123
|
size: 2,
|
|
127
|
-
update: function update(feature, featureIdx, vertex
|
|
124
|
+
update: function update(feature, featureIdx, vertex) {
|
|
128
125
|
return [vertex[3], vertex[4]];
|
|
129
126
|
}
|
|
130
127
|
}
|
package/es/earth/models/base.js
CHANGED
|
@@ -54,7 +54,7 @@ var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
54
54
|
value: function getUninforms() {
|
|
55
55
|
var _this$layer$getLayerC = this.layer.getLayerConfig(),
|
|
56
56
|
animateOption = _this$layer$getLayerC.animateOption,
|
|
57
|
-
|
|
57
|
+
globalOptions = _this$layer$getLayerC.globalOptions;
|
|
58
58
|
|
|
59
59
|
if (animateOption !== null && animateOption !== void 0 && animateOption.enable) {
|
|
60
60
|
// @ts-ignore
|
|
@@ -69,13 +69,12 @@ var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
return {
|
|
72
|
-
u_ambientRatio: (
|
|
72
|
+
u_ambientRatio: (globalOptions === null || globalOptions === void 0 ? void 0 : globalOptions.ambientRatio) || 0.6,
|
|
73
73
|
// 环境光
|
|
74
|
-
u_diffuseRatio: (
|
|
74
|
+
u_diffuseRatio: (globalOptions === null || globalOptions === void 0 ? void 0 : globalOptions.diffuseRatio) || 0.4,
|
|
75
75
|
// 漫反射
|
|
76
|
-
u_specularRatio: (
|
|
76
|
+
u_specularRatio: (globalOptions === null || globalOptions === void 0 ? void 0 : globalOptions.specularRatio) || 0.1,
|
|
77
77
|
// 高光反射
|
|
78
|
-
// u_sunLight: [120, 120, 120],
|
|
79
78
|
u_sunLight: [this.sunX, this.sunY, this.sunZ],
|
|
80
79
|
u_texture: this.texture
|
|
81
80
|
};
|
|
@@ -87,7 +86,7 @@ var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
87
86
|
this.sunY = 10;
|
|
88
87
|
this.sunX = Math.cos(this.earthTime) * (this.sunRadius - this.sunY);
|
|
89
88
|
this.sunZ = Math.sin(this.earthTime) * (this.sunRadius - this.sunY);
|
|
90
|
-
this.layerService.
|
|
89
|
+
this.layerService.throttleRenderLayers();
|
|
91
90
|
}
|
|
92
91
|
}, {
|
|
93
92
|
key: "initModels",
|
|
@@ -95,10 +94,10 @@ var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
95
94
|
var _this2 = this;
|
|
96
95
|
|
|
97
96
|
var _this$layer$getLayerC2 = this.layer.getLayerConfig(),
|
|
98
|
-
|
|
97
|
+
globalOptions = _this$layer$getLayerC2.globalOptions;
|
|
99
98
|
|
|
100
|
-
if ((
|
|
101
|
-
this.setEarthTime(
|
|
99
|
+
if ((globalOptions === null || globalOptions === void 0 ? void 0 : globalOptions.earthTime) !== undefined) {
|
|
100
|
+
this.setEarthTime(globalOptions.earthTime);
|
|
102
101
|
}
|
|
103
102
|
|
|
104
103
|
var source = this.layer.getSource();
|
|
@@ -114,9 +113,7 @@ var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
114
113
|
height: imageData[0].height
|
|
115
114
|
});
|
|
116
115
|
|
|
117
|
-
_this2.layerService.
|
|
118
|
-
|
|
119
|
-
_this2.layerService.renderLayers();
|
|
116
|
+
_this2.layerService.reRender();
|
|
120
117
|
});
|
|
121
118
|
this.buildModels(callbackModel);
|
|
122
119
|
}
|
|
@@ -128,7 +125,7 @@ var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
128
125
|
}, {
|
|
129
126
|
key: "buildModels",
|
|
130
127
|
value: function buildModels(callbackModel) {
|
|
131
|
-
//
|
|
128
|
+
// Tip: 调整图层的绘制顺序 地球大气层
|
|
132
129
|
this.layer.zIndex = -998;
|
|
133
130
|
this.layer.buildLayerModel({
|
|
134
131
|
moduleName: 'earthBase',
|
|
@@ -149,20 +146,18 @@ var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
149
146
|
}, {
|
|
150
147
|
key: "registerBuiltinAttributes",
|
|
151
148
|
value: function registerBuiltinAttributes() {
|
|
152
|
-
// point layer size;
|
|
153
149
|
this.styleAttributeService.registerStyleAttribute({
|
|
154
150
|
name: 'size',
|
|
155
151
|
type: AttributeType.Attribute,
|
|
156
152
|
descriptor: {
|
|
157
153
|
name: 'a_Size',
|
|
158
154
|
buffer: {
|
|
159
|
-
// give the WebGL driver a hint that this buffer may change
|
|
160
155
|
usage: gl.DYNAMIC_DRAW,
|
|
161
156
|
data: [],
|
|
162
157
|
type: gl.FLOAT
|
|
163
158
|
},
|
|
164
159
|
size: 1,
|
|
165
|
-
update: function update(feature
|
|
160
|
+
update: function update(feature) {
|
|
166
161
|
var _feature$size = feature.size,
|
|
167
162
|
size = _feature$size === void 0 ? 1 : _feature$size;
|
|
168
163
|
return Array.isArray(size) ? [size[0]] : [size];
|
|
@@ -175,7 +170,6 @@ var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
175
170
|
descriptor: {
|
|
176
171
|
name: 'a_Normal',
|
|
177
172
|
buffer: {
|
|
178
|
-
// give the WebGL driver a hint that this buffer may change
|
|
179
173
|
usage: gl.STATIC_DRAW,
|
|
180
174
|
data: [],
|
|
181
175
|
type: gl.FLOAT
|
|
@@ -198,7 +192,7 @@ var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
198
192
|
type: gl.FLOAT
|
|
199
193
|
},
|
|
200
194
|
size: 2,
|
|
201
|
-
update: function update(feature, featureIdx, vertex
|
|
195
|
+
update: function update(feature, featureIdx, vertex) {
|
|
202
196
|
return [vertex[3], vertex[4]];
|
|
203
197
|
}
|
|
204
198
|
}
|
|
@@ -14,7 +14,7 @@ import BaseModel from "../../core/BaseModel";
|
|
|
14
14
|
import { earthOuterTriangulation } from "../../core/triangulation";
|
|
15
15
|
|
|
16
16
|
/* babel-plugin-inline-import '../shaders/bloomsphere_frag.glsl' */
|
|
17
|
-
var bloomSphereFrag = "\nuniform float u_opacity;\nuniform vec3 u_CameraPosition;\nvarying vec3 vVertexNormal;\n\nvarying vec4 v_Color;\nvoid main() {\n\n\n float intensity = - dot(normalize(vVertexNormal), normalize(u_CameraPosition));\n //
|
|
17
|
+
var bloomSphereFrag = "\nuniform float u_opacity;\nuniform vec3 u_CameraPosition;\nvarying vec3 vVertexNormal;\n\nvarying vec4 v_Color;\nvoid main() {\n\n\n float intensity = - dot(normalize(vVertexNormal), normalize(u_CameraPosition));\n // \u53BB\u9664\u80CC\u9762\n if(intensity > 1.0) intensity = 0.0;\n\n gl_FragColor = vec4(v_Color.rgb, v_Color.a * intensity * u_opacity);\n}\n";
|
|
18
18
|
|
|
19
19
|
/* babel-plugin-inline-import '../shaders/bloomsphere_vert.glsl' */
|
|
20
20
|
var bloomSphereVert = "\nattribute vec3 a_Position;\nattribute vec3 a_Normal;\nattribute vec2 a_Uv;\nattribute vec4 a_Color;\nuniform vec3 u_CameraPosition;\nuniform mat4 u_ViewProjectionMatrix;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_ViewMatrix;\n\nvarying vec3 vVertexNormal;\nvarying vec4 v_Color;\n\nvoid main() {\n v_Color = a_Color;\n\n vVertexNormal = a_Normal;\n\n gl_Position = u_ViewProjectionMatrix * u_ModelMatrix * vec4(a_Position, 1.0);\n}\n";
|
|
@@ -54,7 +54,7 @@ var EarthBloomSphereModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
54
54
|
}, {
|
|
55
55
|
key: "buildModels",
|
|
56
56
|
value: function buildModels(callbackModel) {
|
|
57
|
-
//
|
|
57
|
+
// Tip: 调整图层的绘制顺序,让它保持在地球后面(减少锯齿现象)
|
|
58
58
|
this.layer.zIndex = -999;
|
|
59
59
|
this.layer.buildLayerModel({
|
|
60
60
|
moduleName: 'earthBloom',
|
|
@@ -75,20 +75,18 @@ var EarthBloomSphereModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
75
75
|
}, {
|
|
76
76
|
key: "registerBuiltinAttributes",
|
|
77
77
|
value: function registerBuiltinAttributes() {
|
|
78
|
-
// point layer size;
|
|
79
78
|
this.styleAttributeService.registerStyleAttribute({
|
|
80
79
|
name: 'size',
|
|
81
80
|
type: AttributeType.Attribute,
|
|
82
81
|
descriptor: {
|
|
83
82
|
name: 'a_Size',
|
|
84
83
|
buffer: {
|
|
85
|
-
// give the WebGL driver a hint that this buffer may change
|
|
86
84
|
usage: gl.DYNAMIC_DRAW,
|
|
87
85
|
data: [],
|
|
88
86
|
type: gl.FLOAT
|
|
89
87
|
},
|
|
90
88
|
size: 1,
|
|
91
|
-
update: function update(feature
|
|
89
|
+
update: function update(feature) {
|
|
92
90
|
var _feature$size = feature.size,
|
|
93
91
|
size = _feature$size === void 0 ? 1 : _feature$size;
|
|
94
92
|
return Array.isArray(size) ? [size[0]] : [size];
|
|
@@ -101,7 +99,6 @@ var EarthBloomSphereModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
101
99
|
descriptor: {
|
|
102
100
|
name: 'a_Normal',
|
|
103
101
|
buffer: {
|
|
104
|
-
// give the WebGL driver a hint that this buffer may change
|
|
105
102
|
usage: gl.STATIC_DRAW,
|
|
106
103
|
data: [],
|
|
107
104
|
type: gl.FLOAT
|
|
@@ -118,13 +115,12 @@ var EarthBloomSphereModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
118
115
|
descriptor: {
|
|
119
116
|
name: 'a_Uv',
|
|
120
117
|
buffer: {
|
|
121
|
-
// give the WebGL driver a hint that this buffer may change
|
|
122
118
|
usage: gl.DYNAMIC_DRAW,
|
|
123
119
|
data: [],
|
|
124
120
|
type: gl.FLOAT
|
|
125
121
|
},
|
|
126
122
|
size: 2,
|
|
127
|
-
update: function update(feature, featureIdx, vertex
|
|
123
|
+
update: function update(feature, featureIdx, vertex) {
|
|
128
124
|
return [vertex[3], vertex[4]];
|
|
129
125
|
}
|
|
130
126
|
}
|
|
@@ -10,7 +10,7 @@ void main() {
|
|
|
10
10
|
|
|
11
11
|
// float intensity = pow(0.5 + dot(normalize(vVertexNormal), normalize(u_CameraPosition)), 3.0);
|
|
12
12
|
float intensity = pow(v_offset + dot(normalize(vVertexNormal), normalize(u_CameraPosition)), 3.0);
|
|
13
|
-
//
|
|
13
|
+
// 去除背面
|
|
14
14
|
if(intensity > 1.0) intensity = 0.0;
|
|
15
15
|
|
|
16
16
|
gl_FragColor = vec4(v_Color.rgb, v_Color.a * intensity * u_opacity);
|
package/es/heatmap/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IAttributeAndElements } from '@antv/l7-core';
|
|
2
2
|
import BaseLayer from '../core/BaseLayer';
|
|
3
3
|
import { IHeatMapLayerStyleOptions } from '../core/interface';
|
|
4
4
|
import { HeatMapModelType } from './models';
|
|
@@ -7,7 +7,7 @@ export default class HeatMapLayer extends BaseLayer<IHeatMapLayerStyleOptions> {
|
|
|
7
7
|
buildModels(): void;
|
|
8
8
|
rebuildModels(): void;
|
|
9
9
|
renderModels(): this;
|
|
10
|
-
updateModelData(data:
|
|
10
|
+
updateModelData(data: IAttributeAndElements): void;
|
|
11
11
|
protected getConfigSchema(): {
|
|
12
12
|
properties: {
|
|
13
13
|
opacity: {
|
package/es/heatmap/index.js
CHANGED
|
@@ -44,7 +44,9 @@ var HeatMapLayer = /*#__PURE__*/function (_BaseLayer) {
|
|
|
44
44
|
this.layerModel.initModels(function (models) {
|
|
45
45
|
_this2.models = models;
|
|
46
46
|
|
|
47
|
-
_this2.
|
|
47
|
+
_this2.emit('modelLoaded', null);
|
|
48
|
+
|
|
49
|
+
_this2.layerService.throttleRenderLayers();
|
|
48
50
|
});
|
|
49
51
|
}
|
|
50
52
|
}, {
|
|
@@ -53,7 +55,9 @@ var HeatMapLayer = /*#__PURE__*/function (_BaseLayer) {
|
|
|
53
55
|
var _this3 = this;
|
|
54
56
|
|
|
55
57
|
this.layerModel.buildModels(function (models) {
|
|
56
|
-
|
|
58
|
+
_this3.models = models;
|
|
59
|
+
|
|
60
|
+
_this3.emit('modelLoaded', null);
|
|
57
61
|
});
|
|
58
62
|
}
|
|
59
63
|
}, {
|
|
@@ -74,9 +78,7 @@ var HeatMapLayer = /*#__PURE__*/function (_BaseLayer) {
|
|
|
74
78
|
if (this.layerModelNeedUpdate) {
|
|
75
79
|
this.layerModel.buildModels(function (models) {
|
|
76
80
|
return _this4.models = models;
|
|
77
|
-
});
|
|
78
|
-
// this.models = this.layerModel.buildModels();
|
|
79
|
-
|
|
81
|
+
});
|
|
80
82
|
this.layerModelNeedUpdate = false;
|
|
81
83
|
}
|
|
82
84
|
|
|
@@ -86,14 +86,12 @@ var GridModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
86
86
|
descriptor: {
|
|
87
87
|
name: 'a_Pos',
|
|
88
88
|
buffer: {
|
|
89
|
-
// give the WebGL driver a hint that this buffer may change
|
|
90
89
|
usage: gl.DYNAMIC_DRAW,
|
|
91
90
|
data: [],
|
|
92
91
|
type: gl.FLOAT
|
|
93
92
|
},
|
|
94
93
|
size: 3,
|
|
95
|
-
update: function update(feature
|
|
96
|
-
// const coordinates = feature.coordinates as number[];
|
|
94
|
+
update: function update(feature) {
|
|
97
95
|
var coordinates = feature.version === 'GAODE2.x' ? feature.originCoordinates : feature.coordinates;
|
|
98
96
|
return [coordinates[0], coordinates[1], 0];
|
|
99
97
|
}
|
|
@@ -80,33 +80,29 @@ var Grid3DModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
80
80
|
}, {
|
|
81
81
|
key: "registerBuiltinAttributes",
|
|
82
82
|
value: function registerBuiltinAttributes() {
|
|
83
|
-
// point layer size;
|
|
84
83
|
this.styleAttributeService.registerStyleAttribute({
|
|
85
84
|
name: 'size',
|
|
86
85
|
type: AttributeType.Attribute,
|
|
87
86
|
descriptor: {
|
|
88
87
|
name: 'a_Size',
|
|
89
88
|
buffer: {
|
|
90
|
-
// give the WebGL driver a hint that this buffer may change
|
|
91
89
|
usage: gl.DYNAMIC_DRAW,
|
|
92
90
|
data: [],
|
|
93
91
|
type: gl.FLOAT
|
|
94
92
|
},
|
|
95
93
|
size: 1,
|
|
96
|
-
update: function update(feature
|
|
94
|
+
update: function update(feature) {
|
|
97
95
|
var size = feature.size;
|
|
98
96
|
return Array.isArray(size) ? [size[0]] : [size];
|
|
99
97
|
}
|
|
100
98
|
}
|
|
101
|
-
});
|
|
102
|
-
|
|
99
|
+
});
|
|
103
100
|
this.styleAttributeService.registerStyleAttribute({
|
|
104
101
|
name: 'normal',
|
|
105
102
|
type: AttributeType.Attribute,
|
|
106
103
|
descriptor: {
|
|
107
104
|
name: 'a_Normal',
|
|
108
105
|
buffer: {
|
|
109
|
-
// give the WebGL driver a hint that this buffer may change
|
|
110
106
|
usage: gl.STATIC_DRAW,
|
|
111
107
|
data: [],
|
|
112
108
|
type: gl.FLOAT
|
|
@@ -124,16 +120,13 @@ var Grid3DModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
124
120
|
descriptor: {
|
|
125
121
|
name: 'a_Pos',
|
|
126
122
|
buffer: {
|
|
127
|
-
// give the WebGL driver a hint that this buffer may change
|
|
128
123
|
usage: gl.DYNAMIC_DRAW,
|
|
129
124
|
data: [],
|
|
130
125
|
type: gl.FLOAT
|
|
131
126
|
},
|
|
132
127
|
size: 3,
|
|
133
|
-
update: function update(feature
|
|
134
|
-
var coordinates = feature.version === 'GAODE2.x' ? feature.originCoordinates : feature.coordinates;
|
|
135
|
-
// const coordinates = feature.originCoordinates as number[];
|
|
136
|
-
|
|
128
|
+
update: function update(feature) {
|
|
129
|
+
var coordinates = feature.version === 'GAODE2.x' ? feature.originCoordinates : feature.coordinates;
|
|
137
130
|
return [coordinates[0], coordinates[1], 0];
|
|
138
131
|
}
|
|
139
132
|
}
|