@antv/l7-layers 2.10.6 → 2.10.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/Geometry/index.d.ts +2 -3
- package/es/Geometry/index.js +27 -17
- package/es/Geometry/models/billboard.d.ts +2 -2
- package/es/Geometry/models/billboard.js +77 -37
- package/es/Geometry/models/plane.d.ts +2 -2
- package/es/Geometry/models/plane.js +80 -40
- package/es/Geometry/models/sprite.d.ts +2 -2
- package/es/Geometry/models/sprite.js +83 -45
- package/es/canvas/index.d.ts +2 -3
- package/es/canvas/index.js +29 -19
- package/es/canvas/models/canvas.d.ts +2 -2
- package/es/canvas/models/canvas.js +54 -15
- package/es/citybuliding/building.d.ts +2 -3
- package/es/citybuliding/building.js +26 -17
- package/es/citybuliding/models/build.d.ts +2 -2
- package/es/citybuliding/models/build.js +70 -25
- package/es/core/BaseLayer.d.ts +22 -18
- package/es/core/BaseLayer.js +387 -266
- package/es/core/BaseModel.d.ts +2 -2
- package/es/core/BaseModel.js +47 -6
- package/es/core/LayerPickService.d.ts +12 -0
- package/es/core/LayerPickService.js +165 -0
- package/es/core/TextureService.d.ts +14 -0
- package/es/core/TextureService.js +67 -0
- package/es/core/triangulation.js +8 -1
- package/es/earth/index.d.ts +2 -2
- package/es/earth/index.js +28 -9
- package/es/earth/models/atmosphere.d.ts +2 -2
- package/es/earth/models/atmosphere.js +67 -22
- package/es/earth/models/base.d.ts +2 -2
- package/es/earth/models/base.js +89 -43
- package/es/earth/models/bloomsphere.d.ts +2 -2
- package/es/earth/models/bloomsphere.js +67 -22
- package/es/heatmap/index.d.ts +2 -3
- package/es/heatmap/index.js +33 -24
- package/es/heatmap/models/grid.d.ts +2 -2
- package/es/heatmap/models/grid.js +68 -27
- package/es/heatmap/models/grid3d.d.ts +2 -2
- package/es/heatmap/models/grid3d.js +70 -29
- package/es/heatmap/models/heatmap.d.ts +2 -2
- package/es/heatmap/models/heatmap.js +40 -14
- package/es/heatmap/models/hexagon.d.ts +2 -2
- package/es/heatmap/models/hexagon.js +69 -28
- package/es/heatmap/shaders/hexagon_3d_vert.glsl +2 -13
- package/es/image/index.d.ts +3 -4
- package/es/image/index.js +29 -34
- package/es/image/models/image.d.ts +2 -2
- package/es/image/models/image.js +117 -67
- package/es/image/models/index.d.ts +1 -1
- package/es/image/models/index.js +1 -5
- package/es/image/shaders/dataImage_frag.glsl +10 -16
- package/es/index.d.ts +2 -2
- package/es/index.js +2 -2
- package/es/line/index.d.ts +5 -4
- package/es/line/index.js +51 -25
- package/es/line/models/arc.d.ts +2 -2
- package/es/line/models/arc.js +73 -38
- package/es/line/models/arc_3d.d.ts +2 -2
- package/es/line/models/arc_3d.js +69 -34
- package/es/line/models/earthArc_3d.d.ts +2 -2
- package/es/line/models/earthArc_3d.js +72 -37
- package/es/line/models/great_circle.d.ts +2 -2
- package/es/line/models/great_circle.js +70 -29
- package/es/line/models/half.d.ts +2 -2
- package/es/line/models/half.js +40 -17
- package/es/line/models/index.d.ts +1 -1
- package/es/line/models/index.js +0 -2
- package/es/line/models/line.d.ts +2 -2
- package/es/line/models/line.js +79 -47
- package/es/line/models/linearline.d.ts +2 -2
- package/es/line/models/linearline.js +70 -31
- package/es/line/models/simpleLine.d.ts +2 -2
- package/es/line/models/simpleLine.js +71 -34
- package/es/line/models/simpleTileLine.d.ts +2 -2
- package/es/line/models/simpleTileLine.js +70 -30
- package/es/line/models/tile.d.ts +2 -2
- package/es/line/models/tile.js +40 -17
- package/es/line/models/wall.d.ts +2 -2
- package/es/line/models/wall.js +67 -22
- package/es/mask/index.d.ts +2 -4
- package/es/mask/index.js +27 -97
- package/es/mask/models/fill.d.ts +2 -2
- package/es/mask/models/fill.js +40 -16
- package/es/mask/models/index.d.ts +1 -1
- package/es/mask/models/index.js +1 -3
- package/es/plugins/DataMappingPlugin.d.ts +0 -2
- package/es/plugins/DataMappingPlugin.js +90 -152
- package/es/plugins/DataSourcePlugin.js +67 -30
- package/es/plugins/FeatureScalePlugin.d.ts +0 -1
- package/es/plugins/FeatureScalePlugin.js +85 -61
- package/es/plugins/LayerModelPlugin.d.ts +2 -2
- package/es/plugins/LayerModelPlugin.js +121 -37
- package/es/plugins/LayerStylePlugin.js +1 -6
- package/es/plugins/MultiPassRendererPlugin.js +1 -1
- package/es/plugins/PixelPickingPlugin.js +1 -1
- package/es/plugins/RegisterStyleAttributePlugin.js +1 -16
- package/es/plugins/UpdateModelPlugin.js +3 -0
- package/es/plugins/UpdateStyleAttributePlugin.js +3 -6
- package/es/point/index.d.ts +4 -4
- package/es/point/index.js +55 -23
- package/es/point/models/earthExtrude.d.ts +2 -2
- package/es/point/models/earthExtrude.js +73 -30
- package/es/point/models/earthFill.d.ts +2 -2
- package/es/point/models/earthFill.js +66 -21
- package/es/point/models/extrude.d.ts +2 -2
- package/es/point/models/extrude.js +40 -17
- package/es/point/models/fill.d.ts +2 -2
- package/es/point/models/fill.js +43 -20
- package/es/point/models/fillmage.d.ts +2 -2
- package/es/point/models/fillmage.js +82 -43
- package/es/point/models/image.d.ts +2 -2
- package/es/point/models/image.js +72 -31
- package/es/point/models/index.d.ts +1 -1
- package/es/point/models/index.js +0 -2
- package/es/point/models/normal.d.ts +2 -2
- package/es/point/models/normal.js +71 -30
- package/es/point/models/radar.d.ts +2 -2
- package/es/point/models/radar.js +75 -35
- package/es/point/models/simplePoint.d.ts +2 -2
- package/es/point/models/simplePoint.js +70 -29
- package/es/point/models/text.d.ts +3 -2
- package/es/point/models/text.js +185 -112
- package/es/point/models/tile.d.ts +2 -2
- package/es/point/models/tile.js +77 -35
- package/es/point/models/tileText.d.ts +2 -2
- package/es/point/models/tileText.js +151 -116
- package/es/polygon/index.d.ts +2 -3
- package/es/polygon/index.js +27 -24
- package/es/polygon/models/extrude.d.ts +2 -2
- package/es/polygon/models/extrude.js +69 -32
- package/es/polygon/models/fill.d.ts +2 -2
- package/es/polygon/models/fill.js +76 -43
- package/es/polygon/models/index.d.ts +1 -1
- package/es/polygon/models/index.js +0 -2
- package/es/polygon/models/ocean.d.ts +2 -2
- package/es/polygon/models/ocean.js +69 -28
- package/es/polygon/models/tile.d.ts +2 -2
- package/es/polygon/models/tile.js +70 -30
- package/es/polygon/models/water.d.ts +2 -2
- package/es/polygon/models/water.js +69 -28
- package/es/polygon/shaders/extrude/polygon_extrude_frag.glsl +1 -2
- package/es/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +1 -2
- package/es/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +1 -2
- package/es/raster/index.d.ts +2 -3
- package/es/raster/index.js +30 -20
- package/es/raster/models/index.d.ts +1 -1
- package/es/raster/models/index.js +2 -2
- package/es/raster/models/raster.d.ts +2 -2
- package/es/raster/models/raster.js +39 -28
- package/es/raster/models/rasterRgb.d.ts +7 -8
- package/es/raster/models/rasterRgb.js +75 -45
- package/es/{image/models/tileDataImage.d.ts → raster/models/rasterTerrainRgb.d.ts} +3 -3
- package/es/raster/models/rasterTerrainRgb.js +184 -0
- package/es/raster/models/rasterTile.d.ts +2 -2
- package/es/raster/models/rasterTile.js +78 -37
- package/es/raster/shaders/raster_2d_frag.glsl +2 -38
- package/es/raster/shaders/raster_rgb_frag.glsl +10 -4
- package/es/raster/shaders/raster_terrain_rgb_frag.glsl +31 -0
- package/es/raster/shaders/rater_terrain_rgb_vert.glsl +17 -0
- package/es/tile/interaction/getRasterData.d.ts +2 -2
- package/es/tile/interaction/utils.js +3 -11
- package/es/tile/interface.d.ts +5 -4
- package/es/tile/manager/base.d.ts +17 -12
- package/es/tile/manager/base.js +212 -47
- package/es/tile/service/TileLayerService.d.ts +34 -0
- package/es/tile/service/TileLayerService.js +220 -0
- package/es/tile/service/TilePickService.d.ts +26 -0
- package/es/tile/service/TilePickService.js +174 -0
- package/es/tile/service/TileSourceService.d.ts +7 -0
- package/es/tile/service/TileSourceService.js +39 -0
- package/es/tile/style/constants.d.ts +1 -13
- package/es/tile/style/constants.js +6 -15
- package/es/tile/style/utils.d.ts +1 -8
- package/es/tile/style/utils.js +0 -126
- package/es/tile/tileFactory/DebugTile.d.ts +16 -0
- package/es/tile/tileFactory/DebugTile.js +100 -0
- package/es/tile/tileFactory/ImageTile.d.ts +14 -0
- package/es/tile/tileFactory/ImageTile.js +89 -0
- package/es/tile/tileFactory/MaskTile.d.ts +18 -0
- package/es/tile/tileFactory/MaskTile.js +105 -0
- package/es/tile/tileFactory/RasterRGBTile.d.ts +11 -0
- package/es/tile/tileFactory/RasterRGBTile.js +98 -0
- package/es/tile/tileFactory/RasterTerrainRGBTile.d.ts +14 -0
- package/es/tile/tileFactory/RasterTerrainRGBTile.js +89 -0
- package/es/tile/tileFactory/RasterTile.d.ts +18 -0
- package/es/tile/tileFactory/RasterTile.js +133 -0
- package/es/tile/tileFactory/Tile.d.ts +34 -0
- package/es/tile/tileFactory/Tile.js +161 -0
- package/es/tile/tileFactory/VectorTile.d.ts +27 -0
- package/es/tile/tileFactory/VectorTile.js +198 -0
- package/es/tile/tileFactory/index.d.ts +11 -4
- package/es/tile/tileFactory/index.js +34 -23
- package/es/tile/tileFactory/layers/{rasterDataLayer.d.ts → RasterDataLayer.d.ts} +3 -3
- package/es/tile/tileFactory/layers/{rasterDataLayer.js → RasterDataLayer.js} +34 -22
- package/es/tile/tileFactory/layers/{tileTest.d.ts → TileDebugLayer.d.ts} +2 -2
- package/es/tile/tileFactory/layers/{tileTest.js → TileDebugLayer.js} +23 -10
- package/es/tile/tileFactory/util.d.ts +5 -0
- package/es/tile/tileFactory/util.js +21 -0
- package/es/tile/tileLayer/BaseLayer.d.ts +45 -0
- package/es/tile/tileLayer/BaseLayer.js +348 -0
- package/es/tile/utils.d.ts +1 -11
- package/es/tile/utils.js +0 -129
- package/es/utils/dataMappingStyle.d.ts +4 -4
- package/es/utils/dataMappingStyle.js +16 -18
- package/es/utils/layerData.js +5 -11
- package/es/wind/index.d.ts +2 -3
- package/es/wind/index.js +27 -17
- package/es/wind/models/wind.d.ts +2 -2
- package/es/wind/models/wind.js +123 -104
- package/lib/Geometry/index.js +29 -17
- package/lib/Geometry/models/billboard.js +79 -37
- package/lib/Geometry/models/plane.js +82 -40
- package/lib/Geometry/models/sprite.js +85 -45
- package/lib/canvas/index.js +31 -19
- package/lib/canvas/models/canvas.js +56 -15
- package/lib/citybuliding/building.js +28 -17
- package/lib/citybuliding/models/build.js +72 -25
- package/lib/core/BaseLayer.js +388 -261
- package/lib/core/BaseModel.js +48 -6
- package/lib/core/LayerPickService.js +179 -0
- package/lib/core/TextureService.js +77 -0
- package/lib/core/triangulation.js +8 -1
- package/lib/earth/index.js +30 -9
- package/lib/earth/models/atmosphere.js +69 -22
- package/lib/earth/models/base.js +90 -42
- package/lib/earth/models/bloomsphere.js +69 -22
- package/lib/heatmap/index.js +35 -24
- package/lib/heatmap/models/grid.js +70 -27
- package/lib/heatmap/models/grid3d.js +72 -29
- package/lib/heatmap/models/heatmap.js +40 -14
- package/lib/heatmap/models/hexagon.js +71 -28
- package/lib/heatmap/shaders/hexagon_3d_vert.glsl +2 -13
- package/lib/image/index.js +31 -34
- package/lib/image/models/image.js +119 -67
- package/lib/image/models/index.js +1 -7
- package/lib/image/shaders/dataImage_frag.glsl +10 -16
- package/lib/index.js +5 -5
- package/lib/line/index.js +53 -26
- package/lib/line/models/arc.js +75 -38
- package/lib/line/models/arc_3d.js +71 -34
- package/lib/line/models/earthArc_3d.js +74 -37
- package/lib/line/models/great_circle.js +72 -29
- package/lib/line/models/half.js +40 -17
- package/lib/line/models/index.js +0 -3
- package/lib/line/models/line.js +81 -47
- package/lib/line/models/linearline.js +72 -31
- package/lib/line/models/simpleLine.js +73 -34
- package/lib/line/models/simpleTileLine.js +72 -30
- package/lib/line/models/tile.js +40 -17
- package/lib/line/models/wall.js +69 -22
- package/lib/mask/index.js +28 -99
- package/lib/mask/models/fill.js +40 -16
- package/lib/mask/models/index.js +1 -4
- package/lib/plugins/DataMappingPlugin.js +91 -149
- package/lib/plugins/DataSourcePlugin.js +69 -30
- package/lib/plugins/FeatureScalePlugin.js +87 -61
- package/lib/plugins/LayerModelPlugin.js +128 -41
- package/lib/plugins/LayerStylePlugin.js +1 -6
- package/lib/plugins/MultiPassRendererPlugin.js +1 -1
- package/lib/plugins/PixelPickingPlugin.js +1 -1
- package/lib/plugins/RegisterStyleAttributePlugin.js +1 -16
- package/lib/plugins/UpdateModelPlugin.js +3 -0
- package/lib/plugins/UpdateStyleAttributePlugin.js +3 -6
- package/lib/point/index.js +56 -24
- package/lib/point/models/earthExtrude.js +75 -30
- package/lib/point/models/earthFill.js +68 -21
- package/lib/point/models/extrude.js +40 -17
- package/lib/point/models/fill.js +44 -21
- package/lib/point/models/fillmage.js +84 -43
- package/lib/point/models/image.js +74 -31
- package/lib/point/models/index.js +0 -3
- package/lib/point/models/normal.js +73 -30
- package/lib/point/models/radar.js +77 -35
- package/lib/point/models/simplePoint.js +72 -29
- package/lib/point/models/text.js +185 -111
- package/lib/point/models/tile.js +79 -35
- package/lib/point/models/tileText.js +151 -115
- package/lib/polygon/index.js +29 -25
- package/lib/polygon/models/extrude.js +71 -32
- package/lib/polygon/models/fill.js +78 -43
- package/lib/polygon/models/index.js +0 -3
- package/lib/polygon/models/ocean.js +71 -28
- package/lib/polygon/models/tile.js +72 -30
- package/lib/polygon/models/water.js +71 -28
- package/lib/polygon/shaders/extrude/polygon_extrude_frag.glsl +1 -2
- package/lib/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +1 -2
- package/lib/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +1 -2
- package/lib/raster/index.js +32 -20
- package/lib/raster/models/index.js +3 -3
- package/lib/raster/models/raster.js +39 -29
- package/lib/raster/models/rasterRgb.js +78 -43
- package/lib/raster/models/rasterTerrainRgb.js +200 -0
- package/lib/raster/models/rasterTile.js +80 -37
- package/lib/raster/shaders/raster_2d_frag.glsl +2 -38
- package/lib/raster/shaders/raster_rgb_frag.glsl +10 -4
- package/lib/raster/shaders/raster_terrain_rgb_frag.glsl +31 -0
- package/lib/raster/shaders/rater_terrain_rgb_vert.glsl +17 -0
- package/lib/tile/interaction/utils.js +3 -11
- package/lib/tile/manager/base.js +213 -47
- package/lib/tile/service/TileLayerService.js +233 -0
- package/lib/tile/service/TilePickService.js +190 -0
- package/lib/tile/service/TileSourceService.js +59 -0
- package/lib/tile/style/constants.js +8 -19
- package/lib/tile/style/utils.js +0 -140
- package/lib/tile/tileFactory/DebugTile.js +115 -0
- package/lib/tile/tileFactory/ImageTile.js +104 -0
- package/lib/tile/tileFactory/MaskTile.js +120 -0
- package/lib/tile/tileFactory/RasterRGBTile.js +112 -0
- package/lib/tile/tileFactory/RasterTerrainRGBTile.js +104 -0
- package/lib/tile/tileFactory/RasterTile.js +149 -0
- package/lib/tile/tileFactory/Tile.js +171 -0
- package/lib/tile/tileFactory/VectorTile.js +214 -0
- package/lib/tile/tileFactory/index.js +46 -23
- package/lib/tile/tileFactory/layers/{rasterDataLayer.js → RasterDataLayer.js} +36 -22
- package/lib/tile/tileFactory/layers/{tileTest.js → TileDebugLayer.js} +24 -11
- package/lib/tile/tileFactory/util.js +35 -0
- package/lib/tile/tileLayer/BaseLayer.js +363 -0
- package/lib/tile/utils.js +0 -148
- package/lib/utils/dataMappingStyle.js +18 -20
- package/lib/utils/layerData.js +4 -10
- package/lib/wind/index.js +29 -17
- package/lib/wind/models/wind.js +125 -104
- package/package.json +7 -7
- package/es/heatmap/shaders/hexagon_3d_frag.glsl +0 -0
- package/es/image/models/dataImage.d.ts +0 -13
- package/es/image/models/dataImage.js +0 -186
- package/es/image/models/tileDataImage.js +0 -160
- package/es/raster/raster.d.ts +0 -21
- package/es/raster/raster.js +0 -161
- package/es/tile/interaction/TilePickService.d.ts +0 -16
- package/es/tile/interaction/TilePickService.js +0 -129
- package/es/tile/manager/layerManager.d.ts +0 -19
- package/es/tile/manager/layerManager.js +0 -254
- package/es/tile/manager/mapLayerManager.d.ts +0 -7
- package/es/tile/manager/mapLayerManager.js +0 -119
- package/es/tile/models/tileModel.d.ts +0 -10
- package/es/tile/models/tileModel.js +0 -81
- package/es/tile/render/TileRenderService.d.ts +0 -10
- package/es/tile/render/TileRenderService.js +0 -68
- package/es/tile/style/TileStyleService.d.ts +0 -17
- package/es/tile/style/TileStyleService.js +0 -118
- package/es/tile/tileFactory/base.d.ts +0 -45
- package/es/tile/tileFactory/base.js +0 -403
- package/es/tile/tileFactory/layers/vectorLayer.d.ts +0 -30
- package/es/tile/tileFactory/layers/vectorLayer.js +0 -253
- package/es/tile/tileFactory/line.d.ts +0 -12
- package/es/tile/tileFactory/line.js +0 -59
- package/es/tile/tileFactory/mask.d.ts +0 -12
- package/es/tile/tileFactory/mask.js +0 -60
- package/es/tile/tileFactory/point.d.ts +0 -12
- package/es/tile/tileFactory/point.js +0 -60
- package/es/tile/tileFactory/polygon.d.ts +0 -12
- package/es/tile/tileFactory/polygon.js +0 -59
- package/es/tile/tileFactory/raster.d.ts +0 -12
- package/es/tile/tileFactory/raster.js +0 -55
- package/es/tile/tileFactory/rasterData.d.ts +0 -12
- package/es/tile/tileFactory/rasterData.js +0 -81
- package/es/tile/tileFactory/test.d.ts +0 -12
- package/es/tile/tileFactory/test.js +0 -94
- package/es/tile/tileLayer/MapTileLayer.d.ts +0 -6
- package/es/tile/tileLayer/MapTileLayer.js +0 -48
- package/es/tile/tileLayer/TileLayer.d.ts +0 -22
- package/es/tile/tileLayer/TileLayer.js +0 -198
- package/es/tile/tileLayer/base.d.ts +0 -33
- package/es/tile/tileLayer/base.js +0 -212
- package/lib/heatmap/shaders/hexagon_3d_frag.glsl +0 -0
- package/lib/image/models/dataImage.js +0 -201
- package/lib/image/models/tileDataImage.js +0 -174
- package/lib/raster/raster.js +0 -178
- package/lib/tile/interaction/TilePickService.js +0 -143
- package/lib/tile/manager/layerManager.js +0 -275
- package/lib/tile/manager/mapLayerManager.js +0 -134
- package/lib/tile/models/tileModel.js +0 -94
- package/lib/tile/render/TileRenderService.js +0 -78
- package/lib/tile/style/TileStyleService.js +0 -133
- package/lib/tile/tileFactory/base.js +0 -427
- package/lib/tile/tileFactory/layers/vectorLayer.js +0 -268
- package/lib/tile/tileFactory/line.js +0 -70
- package/lib/tile/tileFactory/mask.js +0 -71
- package/lib/tile/tileFactory/point.js +0 -71
- package/lib/tile/tileFactory/polygon.js +0 -70
- package/lib/tile/tileFactory/raster.js +0 -68
- package/lib/tile/tileFactory/rasterData.js +0 -93
- package/lib/tile/tileFactory/test.js +0 -106
- package/lib/tile/tileLayer/MapTileLayer.js +0 -63
- package/lib/tile/tileLayer/TileLayer.js +0 -215
- package/lib/tile/tileLayer/base.js +0 -225
package/es/core/BaseLayer.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
2
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
3
3
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
4
4
|
import _initializerDefineProperty from "@babel/runtime/helpers/esm/initializerDefineProperty";
|
|
5
5
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
@@ -29,17 +29,19 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
29
29
|
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; } }
|
|
30
30
|
|
|
31
31
|
// @ts-ignore
|
|
32
|
-
import { SyncBailHook, SyncHook
|
|
32
|
+
import { AsyncSeriesBailHook, AsyncWaterfallHook, SyncBailHook, SyncHook } from '@antv/async-hook';
|
|
33
33
|
import { BlendType, lazyInject, TYPES } from '@antv/l7-core';
|
|
34
34
|
import Source from '@antv/l7-source';
|
|
35
35
|
import { encodePickingColor, WorkerSourceMap } from '@antv/l7-utils';
|
|
36
36
|
import { EventEmitter } from 'eventemitter3';
|
|
37
37
|
import { isFunction, isObject, isUndefined } from 'lodash';
|
|
38
38
|
import { BlendTypes } from "../utils/blend";
|
|
39
|
-
import {
|
|
39
|
+
import { styleDataMapping } from "../utils/dataMappingStyle";
|
|
40
40
|
import { calculateData } from "../utils/layerData";
|
|
41
41
|
import { createMultiPassRenderer, normalizePasses } from "../utils/multiPassRender";
|
|
42
42
|
import { updateShape } from "../utils/updateShape";
|
|
43
|
+
import LayerPickService from "./LayerPickService";
|
|
44
|
+
import TextureService from "./TextureService";
|
|
43
45
|
/**
|
|
44
46
|
* 分配 layer id
|
|
45
47
|
*/
|
|
@@ -53,12 +55,10 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
53
55
|
// 生命周期钩子
|
|
54
56
|
// 待渲染 model 列表
|
|
55
57
|
// 用于保存子图层对象
|
|
56
|
-
// Tip: 用于标识矢量图层
|
|
57
58
|
|
|
58
59
|
/**
|
|
59
60
|
* 待更新样式属性,在初始化阶段完成注册
|
|
60
61
|
*/
|
|
61
|
-
// Tip: layer 保底颜色
|
|
62
62
|
// private pickingPassRender: IPass<'pixelPicking'>;
|
|
63
63
|
function BaseLayer() {
|
|
64
64
|
var _this;
|
|
@@ -109,10 +109,10 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
109
109
|
});
|
|
110
110
|
|
|
111
111
|
_defineProperty(_assertThisInitialized(_this), "hooks", {
|
|
112
|
-
init: new
|
|
112
|
+
init: new AsyncSeriesBailHook(),
|
|
113
113
|
afterInit: new SyncBailHook(),
|
|
114
114
|
beforeRender: new SyncBailHook(),
|
|
115
|
-
beforeRenderData: new
|
|
115
|
+
beforeRenderData: new AsyncWaterfallHook(),
|
|
116
116
|
afterRender: new SyncHook(),
|
|
117
117
|
beforePickingEncode: new SyncHook(),
|
|
118
118
|
afterPickingEncode: new SyncHook(),
|
|
@@ -126,14 +126,12 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
126
126
|
|
|
127
127
|
_defineProperty(_assertThisInitialized(_this), "models", []);
|
|
128
128
|
|
|
129
|
-
_defineProperty(_assertThisInitialized(_this), "
|
|
129
|
+
_defineProperty(_assertThisInitialized(_this), "startInit", false);
|
|
130
130
|
|
|
131
131
|
_defineProperty(_assertThisInitialized(_this), "layerChildren", []);
|
|
132
132
|
|
|
133
133
|
_defineProperty(_assertThisInitialized(_this), "masks", []);
|
|
134
134
|
|
|
135
|
-
_defineProperty(_assertThisInitialized(_this), "isVector", false);
|
|
136
|
-
|
|
137
135
|
_initializerDefineProperty(_assertThisInitialized(_this), "configService", _descriptor, _assertThisInitialized(_this));
|
|
138
136
|
|
|
139
137
|
_defineProperty(_assertThisInitialized(_this), "animateOptions", {
|
|
@@ -148,8 +146,6 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
148
146
|
|
|
149
147
|
_defineProperty(_assertThisInitialized(_this), "animateStatus", false);
|
|
150
148
|
|
|
151
|
-
_defineProperty(_assertThisInitialized(_this), "bottomColor", 'rgba(0, 0, 0, 0)');
|
|
152
|
-
|
|
153
149
|
_defineProperty(_assertThisInitialized(_this), "isDestroyed", false);
|
|
154
150
|
|
|
155
151
|
_defineProperty(_assertThisInitialized(_this), "encodeDataLength", 0);
|
|
@@ -163,12 +159,17 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
163
159
|
_this.fitBounds(layerConfig.fitBoundsOptions);
|
|
164
160
|
}
|
|
165
161
|
|
|
166
|
-
_this.
|
|
162
|
+
var autoRender = _this.layerSource.getSourceCfg().autoRender;
|
|
163
|
+
|
|
164
|
+
if (autoRender) {
|
|
165
|
+
_this.reRender();
|
|
166
|
+
}
|
|
167
167
|
});
|
|
168
168
|
|
|
169
169
|
_this.name = config.name || _this.id;
|
|
170
170
|
_this.zIndex = config.zIndex || 0;
|
|
171
|
-
_this.rawConfig = config;
|
|
171
|
+
_this.rawConfig = config; // this.parent = this;
|
|
172
|
+
|
|
172
173
|
return _this;
|
|
173
174
|
}
|
|
174
175
|
|
|
@@ -211,12 +212,12 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
211
212
|
}
|
|
212
213
|
});
|
|
213
214
|
|
|
214
|
-
if (!this.
|
|
215
|
+
if (!this.startInit) {
|
|
215
216
|
this.needUpdateConfig = _objectSpread(_objectSpread({}, this.needUpdateConfig), configToUpdate);
|
|
216
217
|
} else {
|
|
217
218
|
var sceneId = this.container.get(TYPES.SceneID); // @ts-ignore
|
|
218
219
|
|
|
219
|
-
|
|
220
|
+
styleDataMapping(configToUpdate, this); // 处理 style 中进行数据映射的属性字段
|
|
220
221
|
|
|
221
222
|
this.configService.setLayerConfig(sceneId, this.id, _objectSpread(_objectSpread(_objectSpread({}, this.configService.getLayerConfig(this.id)), this.needUpdateConfig), configToUpdate));
|
|
222
223
|
this.needUpdateConfig = {};
|
|
@@ -240,16 +241,6 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
240
241
|
value: function getContainer() {
|
|
241
242
|
return this.container;
|
|
242
243
|
}
|
|
243
|
-
}, {
|
|
244
|
-
key: "setBottomColor",
|
|
245
|
-
value: function setBottomColor(color) {
|
|
246
|
-
this.bottomColor = color;
|
|
247
|
-
}
|
|
248
|
-
}, {
|
|
249
|
-
key: "getBottomColor",
|
|
250
|
-
value: function getBottomColor() {
|
|
251
|
-
return this.bottomColor;
|
|
252
|
-
}
|
|
253
244
|
}, {
|
|
254
245
|
key: "addPlugin",
|
|
255
246
|
value: function addPlugin(plugin) {
|
|
@@ -258,105 +249,133 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
258
249
|
}
|
|
259
250
|
}, {
|
|
260
251
|
key: "init",
|
|
261
|
-
value: function
|
|
262
|
-
var
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
252
|
+
value: function () {
|
|
253
|
+
var _init = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
254
|
+
var _this3 = this;
|
|
255
|
+
|
|
256
|
+
var sceneId, _this$getLayerConfig, enableMultiPassRenderer, passes, _iterator, _step, plugin;
|
|
257
|
+
|
|
258
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
259
|
+
while (1) {
|
|
260
|
+
switch (_context.prev = _context.next) {
|
|
261
|
+
case 0:
|
|
262
|
+
// 设置配置项
|
|
263
|
+
sceneId = this.container.get(TYPES.SceneID);
|
|
264
|
+
this.startInit = true; // 初始化图层配置项
|
|
265
|
+
// const { enableMultiPassRenderer = false } = this.rawConfig;
|
|
266
|
+
// this.configService.setLayerConfig(sceneId, this.id, {
|
|
267
|
+
// enableMultiPassRenderer,
|
|
268
|
+
// });
|
|
269
|
+
|
|
270
|
+
this.configService.setLayerConfig(sceneId, this.id, this.rawConfig);
|
|
271
|
+
this.layerType = this.rawConfig.layerType; // 全局容器服务
|
|
272
|
+
// 场景容器服务
|
|
273
|
+
|
|
274
|
+
this.iconService = this.container.get(TYPES.IIconService);
|
|
275
|
+
this.fontService = this.container.get(TYPES.IFontService);
|
|
276
|
+
this.rendererService = this.container.get(TYPES.IRendererService);
|
|
277
|
+
this.layerService = this.container.get(TYPES.ILayerService);
|
|
278
|
+
this.interactionService = this.container.get(TYPES.IInteractionService);
|
|
279
|
+
this.pickingService = this.container.get(TYPES.IPickingService);
|
|
280
|
+
this.mapService = this.container.get(TYPES.IMapService);
|
|
281
|
+
_this$getLayerConfig = this.getLayerConfig(), enableMultiPassRenderer = _this$getLayerConfig.enableMultiPassRenderer, passes = _this$getLayerConfig.passes;
|
|
282
|
+
|
|
283
|
+
if (enableMultiPassRenderer && passes !== null && passes !== void 0 && passes.length && passes.length > 0) {
|
|
284
|
+
// Tip: 兼容 multiPassRender 在 amap1 时存在的图层不同步问题 zoom
|
|
285
|
+
this.mapService.on('mapAfterFrameChange', function () {
|
|
286
|
+
_this3.renderLayers();
|
|
287
|
+
});
|
|
288
|
+
}
|
|
293
289
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
290
|
+
this.cameraService = this.container.get(TYPES.ICameraService);
|
|
291
|
+
this.coordinateService = this.container.get(TYPES.ICoordinateSystemService);
|
|
292
|
+
this.shaderModuleService = this.container.get(TYPES.IShaderModuleService);
|
|
293
|
+
this.postProcessingPassFactory = this.container.get(TYPES.IFactoryPostProcessingPass);
|
|
294
|
+
this.normalPassFactory = this.container.get(TYPES.IFactoryNormalPass); // 图层容器服务
|
|
295
|
+
|
|
296
|
+
this.styleAttributeService = this.container.get(TYPES.IStyleAttributeService);
|
|
297
|
+
|
|
298
|
+
if (enableMultiPassRenderer) {
|
|
299
|
+
// 按需初始化 瓦片频繁报错
|
|
300
|
+
this.multiPassRenderer = this.container.get(TYPES.IMultiPassRenderer);
|
|
301
|
+
this.multiPassRenderer.setLayer(this);
|
|
302
|
+
} // 完成样式服务注册完成前添加的属性
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
this.pendingStyleAttributes.forEach(function (_ref2) {
|
|
306
|
+
var attributeName = _ref2.attributeName,
|
|
307
|
+
attributeField = _ref2.attributeField,
|
|
308
|
+
attributeValues = _ref2.attributeValues,
|
|
309
|
+
updateOptions = _ref2.updateOptions;
|
|
310
|
+
|
|
311
|
+
_this3.styleAttributeService.updateStyleAttribute(attributeName, {
|
|
312
|
+
// @ts-ignore
|
|
313
|
+
scale: _objectSpread({
|
|
314
|
+
field: attributeField
|
|
315
|
+
}, _this3.splitValuesAndCallbackInAttribute( // @ts-ignore
|
|
316
|
+
attributeValues, // @ts-ignore
|
|
317
|
+
_this3.getLayerConfig()[attributeName]))
|
|
318
|
+
}, // @ts-ignore
|
|
319
|
+
updateOptions);
|
|
320
|
+
});
|
|
321
|
+
this.pendingStyleAttributes = []; // 获取插件集
|
|
322
|
+
|
|
323
|
+
this.plugins = this.container.getAll(TYPES.ILayerPlugin); // 完成插件注册,传入场景和图层容器内的服务
|
|
324
|
+
|
|
325
|
+
_iterator = _createForOfIteratorHelper(this.plugins);
|
|
326
|
+
|
|
327
|
+
try {
|
|
328
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
329
|
+
plugin = _step.value;
|
|
330
|
+
plugin.apply(this, {
|
|
331
|
+
rendererService: this.rendererService,
|
|
332
|
+
mapService: this.mapService,
|
|
333
|
+
styleAttributeService: this.styleAttributeService,
|
|
334
|
+
normalPassFactory: this.normalPassFactory,
|
|
335
|
+
postProcessingPassFactory: this.postProcessingPassFactory
|
|
336
|
+
});
|
|
337
|
+
} // 初始化其他服务
|
|
338
|
+
|
|
339
|
+
} catch (err) {
|
|
340
|
+
_iterator.e(err);
|
|
341
|
+
} finally {
|
|
342
|
+
_iterator.f();
|
|
343
|
+
}
|
|
299
344
|
|
|
300
|
-
|
|
301
|
-
this.multiPassRenderer = this.container.get(TYPES.IMultiPassRenderer);
|
|
302
|
-
this.multiPassRenderer.setLayer(this); // 完成样式服务注册完成前添加的属性
|
|
345
|
+
this.layerPickService = new LayerPickService(this); // 颜色纹理服务
|
|
303
346
|
|
|
304
|
-
|
|
305
|
-
var attributeName = _ref2.attributeName,
|
|
306
|
-
attributeField = _ref2.attributeField,
|
|
307
|
-
attributeValues = _ref2.attributeValues,
|
|
308
|
-
updateOptions = _ref2.updateOptions;
|
|
347
|
+
this.textureService = new TextureService(this); // 触发 init 生命周期插件
|
|
309
348
|
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
scale: _objectSpread({
|
|
313
|
-
field: attributeField
|
|
314
|
-
}, _this3.splitValuesAndCallbackInAttribute( // @ts-ignore
|
|
315
|
-
attributeValues, // @ts-ignore
|
|
316
|
-
_this3.getLayerConfig()[attributeName]))
|
|
317
|
-
}, // @ts-ignore
|
|
318
|
-
updateOptions);
|
|
319
|
-
});
|
|
320
|
-
this.pendingStyleAttributes = []; // 获取插件集
|
|
321
|
-
|
|
322
|
-
this.plugins = this.container.getAll(TYPES.ILayerPlugin); // 完成插件注册,传入场景和图层容器内的服务
|
|
323
|
-
|
|
324
|
-
var _iterator = _createForOfIteratorHelper(this.plugins),
|
|
325
|
-
_step;
|
|
326
|
-
|
|
327
|
-
try {
|
|
328
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
329
|
-
var plugin = _step.value;
|
|
330
|
-
plugin.apply(this, {
|
|
331
|
-
rendererService: this.rendererService,
|
|
332
|
-
mapService: this.mapService,
|
|
333
|
-
styleAttributeService: this.styleAttributeService,
|
|
334
|
-
normalPassFactory: this.normalPassFactory,
|
|
335
|
-
postProcessingPassFactory: this.postProcessingPassFactory
|
|
336
|
-
});
|
|
337
|
-
} // 触发 init 生命周期插件
|
|
338
|
-
|
|
339
|
-
} catch (err) {
|
|
340
|
-
_iterator.e(err);
|
|
341
|
-
} finally {
|
|
342
|
-
_iterator.f();
|
|
343
|
-
}
|
|
349
|
+
_context.next = 29;
|
|
350
|
+
return this.hooks.init.promise();
|
|
344
351
|
|
|
345
|
-
|
|
346
|
-
|
|
352
|
+
case 29:
|
|
353
|
+
this.inited = true; // 触发初始化完成事件;
|
|
347
354
|
|
|
348
|
-
|
|
355
|
+
this.emit('inited', {
|
|
356
|
+
target: this,
|
|
357
|
+
type: 'inited'
|
|
358
|
+
});
|
|
359
|
+
this.emit('add', {
|
|
360
|
+
target: this,
|
|
361
|
+
type: 'add'
|
|
362
|
+
});
|
|
363
|
+
this.hooks.afterInit.call();
|
|
349
364
|
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
365
|
+
case 33:
|
|
366
|
+
case "end":
|
|
367
|
+
return _context.stop();
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
}, _callee, this);
|
|
371
|
+
}));
|
|
372
|
+
|
|
373
|
+
function init() {
|
|
374
|
+
return _init.apply(this, arguments);
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
return init;
|
|
378
|
+
}()
|
|
360
379
|
}, {
|
|
361
380
|
key: "updateModelData",
|
|
362
381
|
value: function updateModelData(data) {
|
|
@@ -390,6 +409,11 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
390
409
|
};
|
|
391
410
|
}
|
|
392
411
|
}
|
|
412
|
+
}, {
|
|
413
|
+
key: "setLayerPickService",
|
|
414
|
+
value: function setLayerPickService(layerPickService) {
|
|
415
|
+
this.layerPickService = layerPickService;
|
|
416
|
+
}
|
|
393
417
|
}, {
|
|
394
418
|
key: "calculateEncodeData",
|
|
395
419
|
value: function calculateEncodeData(data, option) {
|
|
@@ -407,8 +431,7 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
407
431
|
}, {
|
|
408
432
|
key: "prepareBuildModel",
|
|
409
433
|
value: function prepareBuildModel() {
|
|
410
|
-
this.
|
|
411
|
-
this.updateLayerConfig(_objectSpread(_objectSpread({}, this.getDefaultConfig()), this.rawConfig)); // 启动动画
|
|
434
|
+
this.updateLayerConfig(_objectSpread(_objectSpread(_objectSpread({}, this.getDefaultConfig()), this.rawConfig), this.needUpdateConfig)); // 启动动画
|
|
412
435
|
|
|
413
436
|
var _this$getLayerConfig2 = this.getLayerConfig(),
|
|
414
437
|
animateOption = _this$getLayerConfig2.animateOption;
|
|
@@ -504,7 +527,8 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
504
527
|
// 判断是否为source
|
|
505
528
|
this.setSource(data);
|
|
506
529
|
return this;
|
|
507
|
-
}
|
|
530
|
+
} // 设置source 配置
|
|
531
|
+
|
|
508
532
|
|
|
509
533
|
this.sourceOption = {
|
|
510
534
|
data: data,
|
|
@@ -527,8 +551,6 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
527
551
|
if (!currentSource) {
|
|
528
552
|
// 执行 setData 的时候 source 还不存在(还未执行 addLayer)
|
|
529
553
|
_this4.source(new Source(data, options));
|
|
530
|
-
|
|
531
|
-
_this4.sourceEvent();
|
|
532
554
|
} else {
|
|
533
555
|
_this4.layerSource.setData(data, options);
|
|
534
556
|
} // this.layerSource.setData(data, options);
|
|
@@ -543,8 +565,6 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
543
565
|
value: function style(options) {
|
|
544
566
|
var _this5 = this;
|
|
545
567
|
|
|
546
|
-
var lastConfig = this.getLayerConfig();
|
|
547
|
-
|
|
548
568
|
var passes = options.passes,
|
|
549
569
|
rest = _objectWithoutProperties(options, _excluded); // passes 特殊处理
|
|
550
570
|
|
|
@@ -564,16 +584,16 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
564
584
|
if (this.container) {
|
|
565
585
|
this.updateLayerConfig(this.rawConfig);
|
|
566
586
|
this.styleNeedUpdate = true;
|
|
567
|
-
} //
|
|
587
|
+
} // TODO style model 更新
|
|
588
|
+
// @ts-ignore
|
|
589
|
+
// if (lastConfig && lastConfig.mask === true && options.mask === false) {
|
|
590
|
+
// this.clearModels();
|
|
591
|
+
// this.layerModel.buildModels((models) => {
|
|
592
|
+
// this.models = models;
|
|
593
|
+
// });
|
|
594
|
+
// }
|
|
568
595
|
|
|
569
596
|
|
|
570
|
-
if (lastConfig && lastConfig.mask === true && options.mask === false) {
|
|
571
|
-
this.clearModels();
|
|
572
|
-
this.layerModel.buildModels(function (models) {
|
|
573
|
-
_this5.models = models;
|
|
574
|
-
});
|
|
575
|
-
}
|
|
576
|
-
|
|
577
597
|
return this;
|
|
578
598
|
}
|
|
579
599
|
}, {
|
|
@@ -607,6 +627,8 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
607
627
|
return this;
|
|
608
628
|
}
|
|
609
629
|
|
|
630
|
+
this.layerService.beforeRenderData(this);
|
|
631
|
+
|
|
610
632
|
if (this.encodeDataLength <= 0 && !this.forceRender) {
|
|
611
633
|
return this;
|
|
612
634
|
} // Tip: this.getEncodedData().length !== 0 这个判断是为了解决在 2.5.x 引入数据纹理后产生的 空数据渲染导致 texture 超出上限问题
|
|
@@ -622,29 +644,29 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
622
644
|
}, {
|
|
623
645
|
key: "renderMultiPass",
|
|
624
646
|
value: function () {
|
|
625
|
-
var _renderMultiPass = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
626
|
-
return _regeneratorRuntime.wrap(function
|
|
647
|
+
var _renderMultiPass = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
648
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
627
649
|
while (1) {
|
|
628
|
-
switch (
|
|
650
|
+
switch (_context2.prev = _context2.next) {
|
|
629
651
|
case 0:
|
|
630
652
|
if (!(this.encodeDataLength <= 0 && !this.forceRender)) {
|
|
631
|
-
|
|
653
|
+
_context2.next = 2;
|
|
632
654
|
break;
|
|
633
655
|
}
|
|
634
656
|
|
|
635
|
-
return
|
|
657
|
+
return _context2.abrupt("return");
|
|
636
658
|
|
|
637
659
|
case 2:
|
|
638
660
|
if (!(this.multiPassRenderer && this.multiPassRenderer.getRenderFlag())) {
|
|
639
|
-
|
|
661
|
+
_context2.next = 7;
|
|
640
662
|
break;
|
|
641
663
|
}
|
|
642
664
|
|
|
643
|
-
|
|
665
|
+
_context2.next = 5;
|
|
644
666
|
return this.multiPassRenderer.render();
|
|
645
667
|
|
|
646
668
|
case 5:
|
|
647
|
-
|
|
669
|
+
_context2.next = 8;
|
|
648
670
|
break;
|
|
649
671
|
|
|
650
672
|
case 7:
|
|
@@ -657,10 +679,10 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
657
679
|
|
|
658
680
|
case 8:
|
|
659
681
|
case "end":
|
|
660
|
-
return
|
|
682
|
+
return _context2.stop();
|
|
661
683
|
}
|
|
662
684
|
}
|
|
663
|
-
},
|
|
685
|
+
}, _callee2, this);
|
|
664
686
|
}));
|
|
665
687
|
|
|
666
688
|
function renderMultiPass() {
|
|
@@ -849,7 +871,7 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
849
871
|
_this$getLayerConfig5 = _this$getLayerConfig3.maxZoom,
|
|
850
872
|
maxZoom = _this$getLayerConfig5 === void 0 ? Infinity : _this$getLayerConfig5;
|
|
851
873
|
|
|
852
|
-
return !!visible && zoom >= minZoom && zoom
|
|
874
|
+
return !!visible && zoom >= minZoom && zoom < maxZoom;
|
|
853
875
|
}
|
|
854
876
|
}, {
|
|
855
877
|
key: "setMultiPass",
|
|
@@ -979,7 +1001,8 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
979
1001
|
this.hooks.beforeDestroy.call(); // 清除sources事件
|
|
980
1002
|
|
|
981
1003
|
this.layerSource.off('update', this.sourceEvent);
|
|
982
|
-
(_this$multiPassRender = this.multiPassRenderer) === null || _this$multiPassRender === void 0 ? void 0 : _this$multiPassRender.destroy();
|
|
1004
|
+
(_this$multiPassRender = this.multiPassRenderer) === null || _this$multiPassRender === void 0 ? void 0 : _this$multiPassRender.destroy();
|
|
1005
|
+
this.textureService.destroy(); // 清除所有属性以及关联的 vao == 销毁所有 => model this.models.forEach((model) => model.destroy());
|
|
983
1006
|
|
|
984
1007
|
this.styleAttributeService.clearAllAttributes(); // 执行每个图层单独的 clearModels 方法 (清除一些额外的 texture、program、buffer 等)
|
|
985
1008
|
|
|
@@ -1024,13 +1047,14 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
1024
1047
|
return !!(this.styleAttributeService.getLayerStyleAttributes() || []).filter(function (attribute) {
|
|
1025
1048
|
return attribute.needRescale || attribute.needRemapping || attribute.needRegenerateVertices;
|
|
1026
1049
|
}).length;
|
|
1027
|
-
}
|
|
1050
|
+
} // 外部初始化Source
|
|
1051
|
+
|
|
1028
1052
|
}, {
|
|
1029
1053
|
key: "setSource",
|
|
1030
1054
|
value: function setSource(source) {
|
|
1031
1055
|
var _this8 = this;
|
|
1032
1056
|
|
|
1033
|
-
//
|
|
1057
|
+
// 解除原 sources 事件
|
|
1034
1058
|
if (this.layerSource) {
|
|
1035
1059
|
this.layerSource.off('update', this.sourceEvent);
|
|
1036
1060
|
}
|
|
@@ -1041,15 +1065,16 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
1041
1065
|
if (this.inited && this.layerSource.cluster) {
|
|
1042
1066
|
var zoom = this.mapService.getZoom();
|
|
1043
1067
|
this.layerSource.updateClusterData(zoom);
|
|
1044
|
-
}
|
|
1045
|
-
|
|
1068
|
+
}
|
|
1046
1069
|
|
|
1047
1070
|
if (this.layerSource.inited) {
|
|
1048
1071
|
this.sourceEvent();
|
|
1049
1072
|
} // this.layerSource.inited 为 true update 事件不会再触发
|
|
1050
1073
|
|
|
1051
1074
|
|
|
1052
|
-
this.layerSource.on('update', function () {
|
|
1075
|
+
this.layerSource.on('update', function (_ref3) {
|
|
1076
|
+
var type = _ref3.type;
|
|
1077
|
+
|
|
1053
1078
|
if (_this8.coordCenter === undefined) {
|
|
1054
1079
|
var _this8$mapService;
|
|
1055
1080
|
|
|
@@ -1061,13 +1086,45 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
1061
1086
|
}
|
|
1062
1087
|
}
|
|
1063
1088
|
|
|
1064
|
-
|
|
1089
|
+
if (type === 'update') {
|
|
1090
|
+
// source 初始化不需要处理
|
|
1091
|
+
_this8.sourceEvent();
|
|
1092
|
+
}
|
|
1065
1093
|
});
|
|
1094
|
+
} // layer 初始化source
|
|
1095
|
+
|
|
1096
|
+
}, {
|
|
1097
|
+
key: "initSource",
|
|
1098
|
+
value: function initSource(source) {
|
|
1099
|
+
this.layerSource = source;
|
|
1100
|
+
this.clusterZoom = 0;
|
|
1101
|
+
this.addSourceEvent();
|
|
1066
1102
|
}
|
|
1067
1103
|
}, {
|
|
1068
1104
|
key: "getSource",
|
|
1069
1105
|
value: function getSource() {
|
|
1070
1106
|
return this.layerSource;
|
|
1107
|
+
} // 注册source 更新事件
|
|
1108
|
+
|
|
1109
|
+
}, {
|
|
1110
|
+
key: "addSourceEvent",
|
|
1111
|
+
value: function addSourceEvent() {
|
|
1112
|
+
var _this9 = this;
|
|
1113
|
+
|
|
1114
|
+
this.layerSource.on('update', function () {
|
|
1115
|
+
if (_this9.coordCenter === undefined) {
|
|
1116
|
+
var _this9$mapService;
|
|
1117
|
+
|
|
1118
|
+
var layerCenter = _this9.layerSource.center;
|
|
1119
|
+
_this9.coordCenter = layerCenter;
|
|
1120
|
+
|
|
1121
|
+
if ((_this9$mapService = _this9.mapService) !== null && _this9$mapService !== void 0 && _this9$mapService.setCoordCenter) {
|
|
1122
|
+
_this9.mapService.setCoordCenter(layerCenter);
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1126
|
+
_this9.sourceEvent();
|
|
1127
|
+
});
|
|
1071
1128
|
}
|
|
1072
1129
|
}, {
|
|
1073
1130
|
key: "getScaleOptions",
|
|
@@ -1146,9 +1203,9 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
1146
1203
|
}
|
|
1147
1204
|
}, {
|
|
1148
1205
|
key: "pick",
|
|
1149
|
-
value: function pick(
|
|
1150
|
-
var x =
|
|
1151
|
-
y =
|
|
1206
|
+
value: function pick(_ref7) {
|
|
1207
|
+
var x = _ref7.x,
|
|
1208
|
+
y = _ref7.y;
|
|
1152
1209
|
this.interactionService.triggerHover({
|
|
1153
1210
|
x: x,
|
|
1154
1211
|
y: y
|
|
@@ -1161,76 +1218,79 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
1161
1218
|
}
|
|
1162
1219
|
}, {
|
|
1163
1220
|
key: "buildLayerModel",
|
|
1164
|
-
value: function
|
|
1165
|
-
var
|
|
1221
|
+
value: function () {
|
|
1222
|
+
var _buildLayerModel = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(options) {
|
|
1223
|
+
var _this10 = this;
|
|
1166
1224
|
|
|
1167
|
-
|
|
1168
|
-
vertexShader = options.vertexShader,
|
|
1169
|
-
fragmentShader = options.fragmentShader,
|
|
1170
|
-
triangulation = options.triangulation,
|
|
1171
|
-
segmentNumber = options.segmentNumber,
|
|
1172
|
-
_options$workerEnable = options.workerEnabled,
|
|
1173
|
-
workerEnabled = _options$workerEnable === void 0 ? false : _options$workerEnable,
|
|
1174
|
-
workerOptions = options.workerOptions,
|
|
1175
|
-
rest = _objectWithoutProperties(options, _excluded2);
|
|
1176
|
-
|
|
1177
|
-
this.shaderModuleService.registerModule(moduleName, {
|
|
1178
|
-
vs: vertexShader,
|
|
1179
|
-
fs: fragmentShader
|
|
1180
|
-
});
|
|
1225
|
+
var moduleName, vertexShader, fragmentShader, triangulation, segmentNumber, _options$workerEnable, workerEnabled, workerOptions, rest, _this$shaderModuleSer, vs, fs, uniforms, createModel;
|
|
1181
1226
|
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
1228
|
+
while (1) {
|
|
1229
|
+
switch (_context3.prev = _context3.next) {
|
|
1230
|
+
case 0:
|
|
1231
|
+
moduleName = options.moduleName, vertexShader = options.vertexShader, fragmentShader = options.fragmentShader, triangulation = options.triangulation, segmentNumber = options.segmentNumber, _options$workerEnable = options.workerEnabled, workerEnabled = _options$workerEnable === void 0 ? false : _options$workerEnable, workerOptions = options.workerOptions, rest = _objectWithoutProperties(options, _excluded2);
|
|
1232
|
+
this.shaderModuleService.registerModule(moduleName, {
|
|
1233
|
+
vs: vertexShader,
|
|
1234
|
+
fs: fragmentShader
|
|
1235
|
+
});
|
|
1236
|
+
_this$shaderModuleSer = this.shaderModuleService.getModule(moduleName), vs = _this$shaderModuleSer.vs, fs = _this$shaderModuleSer.fs, uniforms = _this$shaderModuleSer.uniforms;
|
|
1237
|
+
createModel = this.rendererService.createModel;
|
|
1238
|
+
return _context3.abrupt("return", new Promise(function (resolve, reject) {
|
|
1239
|
+
// filter supported worker & worker enabled layer
|
|
1240
|
+
if (workerOptions && workerOptions.modelType in WorkerSourceMap && workerEnabled) {
|
|
1241
|
+
_this10.styleAttributeService.createAttributesAndIndicesAscy(_this10.encodedData, segmentNumber, workerOptions).then(function (_ref8) {
|
|
1242
|
+
var attributes = _ref8.attributes,
|
|
1243
|
+
elements = _ref8.elements;
|
|
1244
|
+
var m = createModel(_objectSpread({
|
|
1245
|
+
attributes: attributes,
|
|
1246
|
+
uniforms: uniforms,
|
|
1247
|
+
fs: fs,
|
|
1248
|
+
vs: vs,
|
|
1249
|
+
elements: elements,
|
|
1250
|
+
blend: BlendTypes[BlendType.normal]
|
|
1251
|
+
}, rest));
|
|
1252
|
+
resolve(m);
|
|
1253
|
+
}).catch(function (err) {
|
|
1254
|
+
return reject(err);
|
|
1255
|
+
});
|
|
1256
|
+
} else {
|
|
1257
|
+
var _this10$styleAttribut = _this10.styleAttributeService.createAttributesAndIndices(_this10.encodedData, triangulation, segmentNumber),
|
|
1258
|
+
attributes = _this10$styleAttribut.attributes,
|
|
1259
|
+
elements = _this10$styleAttribut.elements,
|
|
1260
|
+
count = _this10$styleAttribut.count;
|
|
1261
|
+
|
|
1262
|
+
var modelOptions = _objectSpread({
|
|
1263
|
+
attributes: attributes,
|
|
1264
|
+
uniforms: uniforms,
|
|
1265
|
+
fs: fs,
|
|
1266
|
+
vs: vs,
|
|
1267
|
+
elements: elements,
|
|
1268
|
+
blend: BlendTypes[BlendType.normal]
|
|
1269
|
+
}, rest);
|
|
1270
|
+
|
|
1271
|
+
if (count) {
|
|
1272
|
+
modelOptions.count = count;
|
|
1273
|
+
}
|
|
1274
|
+
|
|
1275
|
+
var m = createModel(modelOptions);
|
|
1276
|
+
resolve(m);
|
|
1277
|
+
}
|
|
1278
|
+
}));
|
|
1227
1279
|
|
|
1228
|
-
|
|
1229
|
-
|
|
1280
|
+
case 5:
|
|
1281
|
+
case "end":
|
|
1282
|
+
return _context3.stop();
|
|
1283
|
+
}
|
|
1230
1284
|
}
|
|
1231
|
-
});
|
|
1232
|
-
});
|
|
1233
|
-
|
|
1285
|
+
}, _callee3, this);
|
|
1286
|
+
}));
|
|
1287
|
+
|
|
1288
|
+
function buildLayerModel(_x) {
|
|
1289
|
+
return _buildLayerModel.apply(this, arguments);
|
|
1290
|
+
}
|
|
1291
|
+
|
|
1292
|
+
return buildLayerModel;
|
|
1293
|
+
}()
|
|
1234
1294
|
}, {
|
|
1235
1295
|
key: "createAttributes",
|
|
1236
1296
|
value: function createAttributes(options) {
|
|
@@ -1272,11 +1332,6 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
1272
1332
|
}, {
|
|
1273
1333
|
key: "needPick",
|
|
1274
1334
|
value: function needPick(type) {
|
|
1275
|
-
// 地图图层的判断
|
|
1276
|
-
if (this.rawConfig.usage === 'basemap') {
|
|
1277
|
-
return false;
|
|
1278
|
-
}
|
|
1279
|
-
|
|
1280
1335
|
var _this$getLayerConfig10 = this.getLayerConfig(),
|
|
1281
1336
|
_this$getLayerConfig11 = _this$getLayerConfig10.enableHighlight,
|
|
1282
1337
|
enableHighlight = _this$getLayerConfig11 === void 0 ? true : _this$getLayerConfig11,
|
|
@@ -1298,34 +1353,73 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
1298
1353
|
}
|
|
1299
1354
|
}, {
|
|
1300
1355
|
key: "buildModels",
|
|
1301
|
-
value: function
|
|
1302
|
-
|
|
1303
|
-
|
|
1356
|
+
value: function () {
|
|
1357
|
+
var _buildModels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
1358
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
1359
|
+
while (1) {
|
|
1360
|
+
switch (_context4.prev = _context4.next) {
|
|
1361
|
+
case 0:
|
|
1362
|
+
throw new Error('Method not implemented.');
|
|
1363
|
+
|
|
1364
|
+
case 1:
|
|
1365
|
+
case "end":
|
|
1366
|
+
return _context4.stop();
|
|
1367
|
+
}
|
|
1368
|
+
}
|
|
1369
|
+
}, _callee4);
|
|
1370
|
+
}));
|
|
1371
|
+
|
|
1372
|
+
function buildModels() {
|
|
1373
|
+
return _buildModels.apply(this, arguments);
|
|
1374
|
+
}
|
|
1375
|
+
|
|
1376
|
+
return buildModels;
|
|
1377
|
+
}()
|
|
1304
1378
|
}, {
|
|
1305
1379
|
key: "rebuildModels",
|
|
1306
|
-
value: function
|
|
1307
|
-
|
|
1308
|
-
|
|
1380
|
+
value: function () {
|
|
1381
|
+
var _rebuildModels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
|
|
1382
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
1383
|
+
while (1) {
|
|
1384
|
+
switch (_context5.prev = _context5.next) {
|
|
1385
|
+
case 0:
|
|
1386
|
+
_context5.next = 2;
|
|
1387
|
+
return this.buildModels();
|
|
1388
|
+
|
|
1389
|
+
case 2:
|
|
1390
|
+
case "end":
|
|
1391
|
+
return _context5.stop();
|
|
1392
|
+
}
|
|
1393
|
+
}
|
|
1394
|
+
}, _callee5, this);
|
|
1395
|
+
}));
|
|
1396
|
+
|
|
1397
|
+
function rebuildModels() {
|
|
1398
|
+
return _rebuildModels.apply(this, arguments);
|
|
1399
|
+
}
|
|
1400
|
+
|
|
1401
|
+
return rebuildModels;
|
|
1402
|
+
}()
|
|
1309
1403
|
}, {
|
|
1310
1404
|
key: "renderMulPass",
|
|
1311
1405
|
value: function () {
|
|
1312
|
-
var _renderMulPass = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1313
|
-
return _regeneratorRuntime.wrap(function
|
|
1406
|
+
var _renderMulPass = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(multiPassRenderer) {
|
|
1407
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
1314
1408
|
while (1) {
|
|
1315
|
-
switch (
|
|
1409
|
+
switch (_context6.prev = _context6.next) {
|
|
1316
1410
|
case 0:
|
|
1317
|
-
|
|
1411
|
+
_context6.next = 2;
|
|
1318
1412
|
return multiPassRenderer.render();
|
|
1319
1413
|
|
|
1320
1414
|
case 2:
|
|
1321
1415
|
case "end":
|
|
1322
|
-
return
|
|
1416
|
+
return _context6.stop();
|
|
1323
1417
|
}
|
|
1324
1418
|
}
|
|
1325
|
-
},
|
|
1419
|
+
}, _callee6);
|
|
1326
1420
|
}));
|
|
1327
1421
|
|
|
1328
|
-
function renderMulPass(
|
|
1422
|
+
function renderMulPass(_x2) {
|
|
1329
1423
|
return _renderMulPass.apply(this, arguments);
|
|
1330
1424
|
}
|
|
1331
1425
|
|
|
@@ -1334,34 +1428,35 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
1334
1428
|
}, {
|
|
1335
1429
|
key: "renderModels",
|
|
1336
1430
|
value: function renderModels(isPicking) {
|
|
1337
|
-
var
|
|
1431
|
+
var _this11 = this;
|
|
1338
1432
|
|
|
1339
1433
|
// TODO: this.getEncodedData().length > 0 这个判断是为了解决在 2.5.x 引入数据纹理后产生的 空数据渲染导致 texture 超出上限问题
|
|
1340
1434
|
if (this.encodeDataLength <= 0 && !this.forceRender) {
|
|
1341
1435
|
return this;
|
|
1342
1436
|
}
|
|
1343
1437
|
|
|
1344
|
-
|
|
1345
|
-
this.layerModel.buildModels(function (models) {
|
|
1346
|
-
_this10.models = models;
|
|
1347
|
-
|
|
1348
|
-
_this10.hooks.beforeRender.call();
|
|
1349
|
-
|
|
1350
|
-
_this10.layerModelNeedUpdate = false;
|
|
1351
|
-
});
|
|
1352
|
-
}
|
|
1353
|
-
|
|
1438
|
+
this.hooks.beforeRender.call();
|
|
1354
1439
|
this.models.forEach(function (model) {
|
|
1355
1440
|
model.draw({
|
|
1356
|
-
uniforms:
|
|
1441
|
+
uniforms: _this11.layerModel.getUninforms()
|
|
1357
1442
|
}, isPicking);
|
|
1358
1443
|
});
|
|
1444
|
+
this.hooks.afterRender.call();
|
|
1359
1445
|
return this;
|
|
1360
1446
|
}
|
|
1361
1447
|
}, {
|
|
1362
1448
|
key: "updateStyleAttribute",
|
|
1363
1449
|
value: function updateStyleAttribute(type, field, values, updateOptions) {
|
|
1364
|
-
|
|
1450
|
+
// 存储 Attribute
|
|
1451
|
+
if (['color', 'size', 'texture', 'rotate', 'filter', 'label', 'shape'].indexOf(type) !== -1) {
|
|
1452
|
+
this.configService.setAttributeConfig(this.id, _defineProperty({}, type, {
|
|
1453
|
+
field: field,
|
|
1454
|
+
values: values
|
|
1455
|
+
}));
|
|
1456
|
+
}
|
|
1457
|
+
|
|
1458
|
+
if (!this.startInit) {
|
|
1459
|
+
// 开始初始化执行
|
|
1365
1460
|
this.pendingStyleAttributes.push({
|
|
1366
1461
|
attributeName: type,
|
|
1367
1462
|
attributeField: field,
|
|
@@ -1380,6 +1475,11 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
1380
1475
|
updateOptions);
|
|
1381
1476
|
}
|
|
1382
1477
|
}
|
|
1478
|
+
}, {
|
|
1479
|
+
key: "getLayerAttributeConfig",
|
|
1480
|
+
value: function getLayerAttributeConfig() {
|
|
1481
|
+
return this.configService.getAttributeConfig(this.id);
|
|
1482
|
+
}
|
|
1383
1483
|
}, {
|
|
1384
1484
|
key: "getShaderPickStat",
|
|
1385
1485
|
value: function getShaderPickStat() {
|
|
@@ -1395,6 +1495,13 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
1395
1495
|
key: "setEarthTime",
|
|
1396
1496
|
value: function setEarthTime(time) {
|
|
1397
1497
|
console.warn('empty fn');
|
|
1498
|
+
} // 数据处理 在数据进行 mapping 生成 encodeData 之前对数据进行处理
|
|
1499
|
+
// 在各个 layer 中继承
|
|
1500
|
+
|
|
1501
|
+
}, {
|
|
1502
|
+
key: "processData",
|
|
1503
|
+
value: function processData(filterData) {
|
|
1504
|
+
return filterData;
|
|
1398
1505
|
}
|
|
1399
1506
|
}, {
|
|
1400
1507
|
key: "getModelType",
|
|
@@ -1407,23 +1514,37 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
1407
1514
|
return {};
|
|
1408
1515
|
}
|
|
1409
1516
|
}, {
|
|
1410
|
-
key: "
|
|
1411
|
-
value: function
|
|
1412
|
-
var
|
|
1517
|
+
key: "initLayerModels",
|
|
1518
|
+
value: function () {
|
|
1519
|
+
var _initLayerModels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
|
|
1520
|
+
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
1521
|
+
while (1) {
|
|
1522
|
+
switch (_context7.prev = _context7.next) {
|
|
1523
|
+
case 0:
|
|
1524
|
+
this.models.forEach(function (model) {
|
|
1525
|
+
return model.destroy();
|
|
1526
|
+
});
|
|
1527
|
+
this.models = [];
|
|
1528
|
+
_context7.next = 4;
|
|
1529
|
+
return this.layerModel.initModels();
|
|
1413
1530
|
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
});
|
|
1417
|
-
this.models = [];
|
|
1418
|
-
this.models = models;
|
|
1419
|
-
this.emit('modelLoaded', null);
|
|
1420
|
-
this.modelLoaded = true; // Tip: setTimeout 用于延迟绘制,可以让拖动图层时连续的 setData 更加平滑 - L7Draw
|
|
1531
|
+
case 4:
|
|
1532
|
+
this.models = _context7.sent;
|
|
1421
1533
|
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1534
|
+
case 5:
|
|
1535
|
+
case "end":
|
|
1536
|
+
return _context7.stop();
|
|
1537
|
+
}
|
|
1538
|
+
}
|
|
1539
|
+
}, _callee7, this);
|
|
1540
|
+
}));
|
|
1541
|
+
|
|
1542
|
+
function initLayerModels() {
|
|
1543
|
+
return _initLayerModels.apply(this, arguments);
|
|
1544
|
+
}
|
|
1545
|
+
|
|
1546
|
+
return initLayerModels;
|
|
1547
|
+
}()
|
|
1427
1548
|
}, {
|
|
1428
1549
|
key: "reRender",
|
|
1429
1550
|
value: function reRender() {
|