@antv/l7-layers 2.10.1 → 2.10.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/Geometry/index.d.ts +2 -3
- package/es/Geometry/index.js +34 -24
- package/es/Geometry/models/billboard.d.ts +2 -2
- package/es/Geometry/models/billboard.js +85 -45
- package/es/Geometry/models/plane.d.ts +2 -2
- package/es/Geometry/models/plane.js +89 -49
- package/es/Geometry/models/sprite.d.ts +2 -2
- package/es/Geometry/models/sprite.js +92 -54
- package/es/canvas/index.d.ts +3 -4
- package/es/canvas/index.js +42 -31
- package/es/canvas/models/canvas.d.ts +2 -2
- package/es/canvas/models/canvas.js +62 -23
- package/es/citybuliding/building.d.ts +2 -3
- package/es/citybuliding/building.js +33 -24
- package/es/citybuliding/models/build.d.ts +2 -2
- package/es/citybuliding/models/build.js +76 -31
- package/es/core/BaseLayer.d.ts +21 -18
- package/es/core/BaseLayer.js +407 -286
- package/es/core/BaseModel.d.ts +2 -2
- package/es/core/BaseModel.js +54 -13
- package/es/core/LayerPickService.d.ts +9 -0
- package/es/core/LayerPickService.js +85 -0
- package/es/core/shape/Path.js +1 -1
- package/es/core/shape/extrude.js +1 -1
- package/es/core/triangulation.js +10 -3
- package/es/earth/index.d.ts +3 -3
- package/es/earth/index.js +35 -16
- package/es/earth/models/atmosphere.d.ts +2 -2
- package/es/earth/models/atmosphere.js +72 -27
- package/es/earth/models/base.d.ts +2 -2
- package/es/earth/models/base.js +96 -50
- package/es/earth/models/bloomsphere.d.ts +2 -2
- package/es/earth/models/bloomsphere.js +72 -27
- package/es/earth/utils.js +1 -1
- package/es/heatmap/index.d.ts +2 -3
- package/es/heatmap/index.js +40 -29
- package/es/heatmap/models/grid.d.ts +2 -2
- package/es/heatmap/models/grid.js +73 -32
- package/es/heatmap/models/grid3d.d.ts +2 -2
- package/es/heatmap/models/grid3d.js +74 -33
- package/es/heatmap/models/heatmap.d.ts +2 -2
- package/es/heatmap/models/heatmap.js +48 -22
- package/es/heatmap/models/hexagon.d.ts +2 -2
- package/es/heatmap/models/hexagon.js +74 -33
- package/es/image/index.d.ts +2 -3
- package/es/image/index.js +34 -24
- package/es/image/models/dataImage.d.ts +2 -2
- package/es/image/models/dataImage.js +98 -59
- package/es/image/models/image.d.ts +2 -2
- package/es/image/models/image.js +113 -72
- package/es/image/models/tileDataImage.d.ts +2 -2
- package/es/image/models/tileDataImage.js +89 -48
- 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 +58 -32
- package/es/line/models/arc.d.ts +2 -2
- package/es/line/models/arc.js +80 -45
- package/es/line/models/arc_3d.d.ts +2 -2
- package/es/line/models/arc_3d.js +76 -41
- package/es/line/models/earthArc_3d.d.ts +2 -2
- package/es/line/models/earthArc_3d.js +79 -44
- package/es/line/models/great_circle.d.ts +2 -2
- package/es/line/models/great_circle.js +77 -36
- package/es/line/models/half.d.ts +2 -2
- package/es/line/models/half.js +46 -23
- 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 +86 -54
- package/es/line/models/linearline.d.ts +2 -2
- package/es/line/models/linearline.js +77 -38
- package/es/line/models/simpleLine.d.ts +2 -2
- package/es/line/models/simpleLine.js +76 -39
- package/es/line/models/simpleTileLine.d.ts +2 -2
- package/es/line/models/simpleTileLine.js +75 -35
- package/es/line/models/tile.d.ts +2 -2
- package/es/line/models/tile.js +46 -23
- package/es/line/models/wall.d.ts +2 -2
- package/es/line/models/wall.js +74 -29
- package/es/mask/index.d.ts +2 -4
- package/es/mask/index.js +34 -104
- package/es/mask/models/fill.d.ts +2 -2
- package/es/mask/models/fill.js +46 -22
- 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 +97 -156
- package/es/plugins/DataSourcePlugin.js +74 -27
- package/es/plugins/FeatureScalePlugin.d.ts +0 -1
- package/es/plugins/FeatureScalePlugin.js +89 -65
- package/es/plugins/LayerAnimateStylePlugin.js +9 -6
- package/es/plugins/LayerModelPlugin.d.ts +2 -2
- package/es/plugins/LayerModelPlugin.js +123 -39
- package/es/plugins/LayerStylePlugin.js +3 -8
- package/es/plugins/LightingPlugin.js +4 -4
- package/es/plugins/MultiPassRendererPlugin.js +3 -3
- package/es/plugins/PixelPickingPlugin.js +3 -3
- package/es/plugins/RegisterStyleAttributePlugin.js +6 -19
- package/es/plugins/ShaderUniformPlugin.js +13 -8
- package/es/plugins/UpdateModelPlugin.js +5 -2
- package/es/plugins/UpdateStyleAttributePlugin.js +9 -10
- package/es/point/index.d.ts +4 -4
- package/es/point/index.js +62 -30
- package/es/point/models/earthExtrude.d.ts +2 -2
- package/es/point/models/earthExtrude.js +80 -37
- package/es/point/models/earthFill.d.ts +2 -2
- package/es/point/models/earthFill.js +73 -28
- package/es/point/models/extrude.d.ts +2 -2
- package/es/point/models/extrude.js +48 -25
- package/es/point/models/fill.d.ts +2 -2
- package/es/point/models/fill.js +51 -28
- package/es/point/models/fillmage.d.ts +2 -2
- package/es/point/models/fillmage.js +90 -51
- package/es/point/models/image.d.ts +2 -2
- package/es/point/models/image.js +79 -38
- 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 +77 -36
- package/es/point/models/radar.d.ts +2 -2
- package/es/point/models/radar.js +83 -43
- package/es/point/models/simplePoint.d.ts +2 -2
- package/es/point/models/simplePoint.js +76 -35
- package/es/point/models/text.d.ts +3 -2
- package/es/point/models/text.js +192 -119
- package/es/point/models/tile.d.ts +2 -2
- package/es/point/models/tile.js +82 -40
- package/es/point/models/tileText.d.ts +2 -2
- package/es/point/models/tileText.js +160 -125
- package/es/point/shape/extrude.js +1 -1
- package/es/polygon/index.d.ts +2 -3
- package/es/polygon/index.js +34 -31
- package/es/polygon/models/extrude.d.ts +2 -2
- package/es/polygon/models/extrude.js +72 -35
- package/es/polygon/models/fill.d.ts +2 -2
- package/es/polygon/models/fill.js +81 -48
- 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 +75 -34
- package/es/polygon/models/tile.d.ts +2 -2
- package/es/polygon/models/tile.js +75 -35
- package/es/polygon/models/water.d.ts +2 -2
- package/es/polygon/models/water.js +75 -34
- package/es/raster/index.d.ts +3 -4
- package/es/raster/index.js +35 -29
- package/es/raster/models/index.d.ts +1 -1
- package/es/raster/models/index.js +1 -3
- package/es/raster/models/raster.d.ts +2 -2
- package/es/raster/models/raster.js +42 -19
- package/es/raster/models/rasterRgb.d.ts +2 -2
- package/es/raster/models/rasterRgb.js +44 -21
- package/es/raster/models/rasterTile.d.ts +2 -2
- package/es/raster/models/rasterTile.js +82 -41
- package/es/raster/raster.d.ts +1 -1
- package/es/raster/raster.js +51 -31
- package/es/tile/interaction/getRasterData.d.ts +2 -2
- package/es/tile/interaction/getRasterData.js +1 -1
- package/es/tile/interaction/utils.js +4 -12
- package/es/tile/interface.d.ts +5 -4
- package/es/tile/manager/base.d.ts +17 -12
- package/es/tile/manager/base.js +216 -51
- package/es/tile/service/TileLayerService.d.ts +33 -0
- package/es/tile/service/TileLayerService.js +172 -0
- package/es/tile/service/TilePickService.d.ts +22 -0
- package/es/tile/service/TilePickService.js +148 -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 +1 -127
- 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 +17 -0
- package/es/tile/tileFactory/MaskTile.js +98 -0
- package/es/tile/tileFactory/RasterRGBTile.d.ts +16 -0
- package/es/tile/tileFactory/RasterRGBTile.js +91 -0
- package/es/tile/tileFactory/RasterTile.d.ts +27 -0
- package/es/tile/tileFactory/RasterTile.js +186 -0
- package/es/tile/tileFactory/Tile.d.ts +34 -0
- package/es/tile/tileFactory/Tile.js +199 -0
- package/es/tile/tileFactory/VectorTile.d.ts +20 -0
- package/es/tile/tileFactory/VectorTile.js +152 -0
- package/es/tile/tileFactory/index.d.ts +10 -4
- package/es/tile/tileFactory/index.js +30 -23
- package/es/tile/tileFactory/layers/{rasterDataLayer.d.ts → RasterDataLayer.d.ts} +3 -3
- package/es/tile/tileFactory/layers/{rasterDataLayer.js → RasterDataLayer.js} +40 -28
- package/es/tile/tileFactory/layers/{tileTest.d.ts → TileDebugLayer.d.ts} +2 -2
- package/es/tile/tileFactory/layers/{tileTest.js → TileDebugLayer.js} +30 -17
- package/es/tile/tileFactory/util.d.ts +6 -0
- package/es/tile/tileFactory/util.js +33 -0
- package/es/tile/tileLayer/BaseLayer.d.ts +46 -0
- package/es/tile/tileLayer/BaseLayer.js +358 -0
- package/es/tile/utils.d.ts +1 -11
- package/es/tile/utils.js +0 -127
- package/es/utils/blend.js +1 -1
- package/es/utils/collision-index.js +4 -4
- package/es/utils/dataMappingStyle.d.ts +4 -4
- package/es/utils/dataMappingStyle.js +19 -19
- package/es/utils/extrude_polyline.js +5 -5
- package/es/utils/grid-index.js +3 -3
- package/es/utils/layerData.js +5 -11
- package/es/utils/multiPassRender.js +1 -1
- package/es/utils/polylineNormal.js +1 -1
- package/es/utils/simpleLine.js +3 -3
- package/es/wind/index.d.ts +2 -3
- package/es/wind/index.js +34 -24
- package/es/wind/models/wind.d.ts +2 -2
- package/es/wind/models/wind.js +130 -111
- package/es/wind/models/windRender.js +3 -3
- 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 +37 -24
- 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 +395 -269
- package/lib/core/BaseModel.js +48 -6
- package/lib/core/LayerPickService.js +96 -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 -22
- package/lib/heatmap/models/grid.js +70 -27
- package/lib/heatmap/models/grid3d.js +71 -28
- package/lib/heatmap/models/heatmap.js +40 -14
- package/lib/heatmap/models/hexagon.js +71 -28
- package/lib/image/index.js +29 -17
- package/lib/image/models/dataImage.js +95 -54
- package/lib/image/models/image.js +110 -67
- package/lib/image/models/tileDataImage.js +86 -43
- 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 -146
- package/lib/plugins/DataSourcePlugin.js +79 -30
- package/lib/plugins/FeatureScalePlugin.js +87 -61
- package/lib/plugins/LayerAnimateStylePlugin.js +6 -3
- 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 +4 -17
- package/lib/plugins/ShaderUniformPlugin.js +7 -2
- package/lib/plugins/UpdateModelPlugin.js +3 -0
- package/lib/plugins/UpdateStyleAttributePlugin.js +7 -8
- 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 +183 -109
- 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 +68 -29
- 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/raster/index.js +30 -22
- package/lib/raster/models/index.js +1 -4
- package/lib/raster/models/raster.js +36 -13
- package/lib/raster/models/rasterRgb.js +36 -13
- package/lib/raster/models/rasterTile.js +79 -36
- package/lib/raster/raster.js +44 -22
- package/lib/tile/interaction/utils.js +3 -11
- package/lib/tile/manager/base.js +213 -47
- package/lib/tile/service/TileLayerService.js +185 -0
- package/lib/tile/service/TilePickService.js +162 -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 +113 -0
- package/lib/tile/tileFactory/RasterRGBTile.js +106 -0
- package/lib/tile/tileFactory/RasterTile.js +205 -0
- package/lib/tile/tileFactory/Tile.js +210 -0
- package/lib/tile/tileFactory/VectorTile.js +167 -0
- package/lib/tile/tileFactory/index.js +42 -24
- package/lib/tile/tileFactory/layers/{rasterDataLayer.js → RasterDataLayer.js} +35 -21
- package/lib/tile/tileFactory/layers/{tileTest.js → TileDebugLayer.js} +24 -11
- package/lib/tile/tileFactory/util.js +48 -0
- package/lib/tile/tileLayer/BaseLayer.js +373 -0
- package/lib/tile/utils.js +0 -146
- package/lib/utils/dataMappingStyle.js +21 -21
- 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/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/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,16 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
4
|
-
import _initializerDefineProperty from "@babel/runtime/helpers/initializerDefineProperty";
|
|
5
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
6
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
7
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
8
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
9
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
10
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
11
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
12
|
-
import _applyDecoratedDescriptor from "@babel/runtime/helpers/applyDecoratedDescriptor";
|
|
13
|
-
import _initializerWarningHelper from "@babel/runtime/helpers/initializerWarningHelper";
|
|
1
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
3
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
4
|
+
import _initializerDefineProperty from "@babel/runtime/helpers/esm/initializerDefineProperty";
|
|
5
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
6
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
7
|
+
import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
|
|
8
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
9
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
|
|
10
|
+
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
11
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
12
|
+
import _applyDecoratedDescriptor from "@babel/runtime/helpers/esm/applyDecoratedDescriptor";
|
|
13
|
+
import _initializerWarningHelper from "@babel/runtime/helpers/esm/initializerWarningHelper";
|
|
14
14
|
var _excluded = ["passes"],
|
|
15
15
|
_excluded2 = ["moduleName", "vertexShader", "fragmentShader", "triangulation", "segmentNumber", "workerEnabled", "workerOptions"];
|
|
16
16
|
|
|
@@ -29,17 +29,18 @@ 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";
|
|
43
44
|
/**
|
|
44
45
|
* 分配 layer id
|
|
45
46
|
*/
|
|
@@ -53,12 +54,10 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
53
54
|
// 生命周期钩子
|
|
54
55
|
// 待渲染 model 列表
|
|
55
56
|
// 用于保存子图层对象
|
|
56
|
-
// Tip: 用于标识矢量图层
|
|
57
57
|
|
|
58
58
|
/**
|
|
59
59
|
* 待更新样式属性,在初始化阶段完成注册
|
|
60
60
|
*/
|
|
61
|
-
// Tip: layer 保底颜色
|
|
62
61
|
// private pickingPassRender: IPass<'pixelPicking'>;
|
|
63
62
|
function BaseLayer() {
|
|
64
63
|
var _this;
|
|
@@ -109,10 +108,10 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
109
108
|
});
|
|
110
109
|
|
|
111
110
|
_defineProperty(_assertThisInitialized(_this), "hooks", {
|
|
112
|
-
init: new
|
|
111
|
+
init: new AsyncSeriesBailHook(),
|
|
113
112
|
afterInit: new SyncBailHook(),
|
|
114
113
|
beforeRender: new SyncBailHook(),
|
|
115
|
-
beforeRenderData: new
|
|
114
|
+
beforeRenderData: new AsyncWaterfallHook(),
|
|
116
115
|
afterRender: new SyncHook(),
|
|
117
116
|
beforePickingEncode: new SyncHook(),
|
|
118
117
|
afterPickingEncode: new SyncHook(),
|
|
@@ -126,14 +125,12 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
126
125
|
|
|
127
126
|
_defineProperty(_assertThisInitialized(_this), "models", []);
|
|
128
127
|
|
|
129
|
-
_defineProperty(_assertThisInitialized(_this), "
|
|
128
|
+
_defineProperty(_assertThisInitialized(_this), "startInit", false);
|
|
130
129
|
|
|
131
130
|
_defineProperty(_assertThisInitialized(_this), "layerChildren", []);
|
|
132
131
|
|
|
133
132
|
_defineProperty(_assertThisInitialized(_this), "masks", []);
|
|
134
133
|
|
|
135
|
-
_defineProperty(_assertThisInitialized(_this), "isVector", false);
|
|
136
|
-
|
|
137
134
|
_initializerDefineProperty(_assertThisInitialized(_this), "configService", _descriptor, _assertThisInitialized(_this));
|
|
138
135
|
|
|
139
136
|
_defineProperty(_assertThisInitialized(_this), "animateOptions", {
|
|
@@ -148,8 +145,6 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
148
145
|
|
|
149
146
|
_defineProperty(_assertThisInitialized(_this), "animateStatus", false);
|
|
150
147
|
|
|
151
|
-
_defineProperty(_assertThisInitialized(_this), "bottomColor", 'rgba(0, 0, 0, 0)');
|
|
152
|
-
|
|
153
148
|
_defineProperty(_assertThisInitialized(_this), "isDestroyed", false);
|
|
154
149
|
|
|
155
150
|
_defineProperty(_assertThisInitialized(_this), "encodeDataLength", 0);
|
|
@@ -163,12 +158,17 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
163
158
|
_this.fitBounds(layerConfig.fitBoundsOptions);
|
|
164
159
|
}
|
|
165
160
|
|
|
166
|
-
_this.
|
|
161
|
+
var autoRender = _this.layerSource.getSourceCfg().autoRender;
|
|
162
|
+
|
|
163
|
+
if (autoRender) {
|
|
164
|
+
_this.reRender();
|
|
165
|
+
}
|
|
167
166
|
});
|
|
168
167
|
|
|
169
168
|
_this.name = config.name || _this.id;
|
|
170
169
|
_this.zIndex = config.zIndex || 0;
|
|
171
|
-
_this.rawConfig = config;
|
|
170
|
+
_this.rawConfig = config; // this.parent = this;
|
|
171
|
+
|
|
172
172
|
return _this;
|
|
173
173
|
}
|
|
174
174
|
|
|
@@ -211,12 +211,12 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
211
211
|
}
|
|
212
212
|
});
|
|
213
213
|
|
|
214
|
-
if (!this.
|
|
214
|
+
if (!this.startInit) {
|
|
215
215
|
this.needUpdateConfig = _objectSpread(_objectSpread({}, this.needUpdateConfig), configToUpdate);
|
|
216
216
|
} else {
|
|
217
217
|
var sceneId = this.container.get(TYPES.SceneID); // @ts-ignore
|
|
218
218
|
|
|
219
|
-
|
|
219
|
+
styleDataMapping(configToUpdate, this); // 处理 style 中进行数据映射的属性字段
|
|
220
220
|
|
|
221
221
|
this.configService.setLayerConfig(sceneId, this.id, _objectSpread(_objectSpread(_objectSpread({}, this.configService.getLayerConfig(this.id)), this.needUpdateConfig), configToUpdate));
|
|
222
222
|
this.needUpdateConfig = {};
|
|
@@ -240,16 +240,6 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
240
240
|
value: function getContainer() {
|
|
241
241
|
return this.container;
|
|
242
242
|
}
|
|
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
243
|
}, {
|
|
254
244
|
key: "addPlugin",
|
|
255
245
|
value: function addPlugin(plugin) {
|
|
@@ -258,105 +248,131 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
258
248
|
}
|
|
259
249
|
}, {
|
|
260
250
|
key: "init",
|
|
261
|
-
value: function
|
|
262
|
-
var
|
|
263
|
-
|
|
264
|
-
// 设置配置项
|
|
265
|
-
var sceneId = this.container.get(TYPES.SceneID); // 初始化图层配置项
|
|
266
|
-
// const { enableMultiPassRenderer = false } = this.rawConfig;
|
|
267
|
-
// this.configService.setLayerConfig(sceneId, this.id, {
|
|
268
|
-
// enableMultiPassRenderer,
|
|
269
|
-
// });
|
|
270
|
-
|
|
271
|
-
this.configService.setLayerConfig(sceneId, this.id, this.rawConfig);
|
|
272
|
-
this.layerType = this.rawConfig.layerType; // 全局容器服务
|
|
273
|
-
// 场景容器服务
|
|
274
|
-
|
|
275
|
-
this.iconService = this.container.get(TYPES.IIconService);
|
|
276
|
-
this.fontService = this.container.get(TYPES.IFontService);
|
|
277
|
-
this.rendererService = this.container.get(TYPES.IRendererService);
|
|
278
|
-
this.layerService = this.container.get(TYPES.ILayerService);
|
|
279
|
-
this.interactionService = this.container.get(TYPES.IInteractionService);
|
|
280
|
-
this.pickingService = this.container.get(TYPES.IPickingService);
|
|
281
|
-
this.mapService = this.container.get(TYPES.IMapService);
|
|
282
|
-
|
|
283
|
-
var _this$getLayerConfig = this.getLayerConfig(),
|
|
284
|
-
enableMultiPassRenderer = _this$getLayerConfig.enableMultiPassRenderer,
|
|
285
|
-
passes = _this$getLayerConfig.passes;
|
|
286
|
-
|
|
287
|
-
if (enableMultiPassRenderer && passes !== null && passes !== void 0 && passes.length && passes.length > 0) {
|
|
288
|
-
// Tip: 兼容 multiPassRender 在 amap1 时存在的图层不同步问题 zoom
|
|
289
|
-
this.mapService.on('mapAfterFrameChange', function () {
|
|
290
|
-
_this3.renderLayers();
|
|
291
|
-
});
|
|
292
|
-
}
|
|
251
|
+
value: function () {
|
|
252
|
+
var _init = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
253
|
+
var _this3 = this;
|
|
293
254
|
|
|
294
|
-
|
|
295
|
-
this.coordinateService = this.container.get(TYPES.ICoordinateSystemService);
|
|
296
|
-
this.shaderModuleService = this.container.get(TYPES.IShaderModuleService);
|
|
297
|
-
this.postProcessingPassFactory = this.container.get(TYPES.IFactoryPostProcessingPass);
|
|
298
|
-
this.normalPassFactory = this.container.get(TYPES.IFactoryNormalPass); // 图层容器服务
|
|
255
|
+
var sceneId, _this$getLayerConfig, enableMultiPassRenderer, passes, _iterator, _step, plugin;
|
|
299
256
|
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
257
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
258
|
+
while (1) {
|
|
259
|
+
switch (_context.prev = _context.next) {
|
|
260
|
+
case 0:
|
|
261
|
+
// 设置配置项
|
|
262
|
+
sceneId = this.container.get(TYPES.SceneID);
|
|
263
|
+
this.startInit = true; // 初始化图层配置项
|
|
264
|
+
// const { enableMultiPassRenderer = false } = this.rawConfig;
|
|
265
|
+
// this.configService.setLayerConfig(sceneId, this.id, {
|
|
266
|
+
// enableMultiPassRenderer,
|
|
267
|
+
// });
|
|
268
|
+
|
|
269
|
+
this.configService.setLayerConfig(sceneId, this.id, this.rawConfig);
|
|
270
|
+
this.layerType = this.rawConfig.layerType; // 全局容器服务
|
|
271
|
+
// 场景容器服务
|
|
272
|
+
|
|
273
|
+
this.iconService = this.container.get(TYPES.IIconService);
|
|
274
|
+
this.fontService = this.container.get(TYPES.IFontService);
|
|
275
|
+
this.rendererService = this.container.get(TYPES.IRendererService);
|
|
276
|
+
this.layerService = this.container.get(TYPES.ILayerService);
|
|
277
|
+
this.interactionService = this.container.get(TYPES.IInteractionService);
|
|
278
|
+
this.pickingService = this.container.get(TYPES.IPickingService);
|
|
279
|
+
this.mapService = this.container.get(TYPES.IMapService);
|
|
280
|
+
_this$getLayerConfig = this.getLayerConfig(), enableMultiPassRenderer = _this$getLayerConfig.enableMultiPassRenderer, passes = _this$getLayerConfig.passes;
|
|
281
|
+
|
|
282
|
+
if (enableMultiPassRenderer && passes !== null && passes !== void 0 && passes.length && passes.length > 0) {
|
|
283
|
+
// Tip: 兼容 multiPassRender 在 amap1 时存在的图层不同步问题 zoom
|
|
284
|
+
this.mapService.on('mapAfterFrameChange', function () {
|
|
285
|
+
_this3.renderLayers();
|
|
286
|
+
});
|
|
287
|
+
}
|
|
303
288
|
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
289
|
+
this.cameraService = this.container.get(TYPES.ICameraService);
|
|
290
|
+
this.coordinateService = this.container.get(TYPES.ICoordinateSystemService);
|
|
291
|
+
this.shaderModuleService = this.container.get(TYPES.IShaderModuleService);
|
|
292
|
+
this.postProcessingPassFactory = this.container.get(TYPES.IFactoryPostProcessingPass);
|
|
293
|
+
this.normalPassFactory = this.container.get(TYPES.IFactoryNormalPass); // 图层容器服务
|
|
294
|
+
|
|
295
|
+
this.styleAttributeService = this.container.get(TYPES.IStyleAttributeService);
|
|
296
|
+
|
|
297
|
+
if (enableMultiPassRenderer) {
|
|
298
|
+
// 按需初始化 瓦片频繁报错
|
|
299
|
+
this.multiPassRenderer = this.container.get(TYPES.IMultiPassRenderer);
|
|
300
|
+
this.multiPassRenderer.setLayer(this);
|
|
301
|
+
} // 完成样式服务注册完成前添加的属性
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
this.pendingStyleAttributes.forEach(function (_ref2) {
|
|
305
|
+
var attributeName = _ref2.attributeName,
|
|
306
|
+
attributeField = _ref2.attributeField,
|
|
307
|
+
attributeValues = _ref2.attributeValues,
|
|
308
|
+
updateOptions = _ref2.updateOptions;
|
|
309
|
+
|
|
310
|
+
_this3.styleAttributeService.updateStyleAttribute(attributeName, {
|
|
311
|
+
// @ts-ignore
|
|
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
|
+
_iterator = _createForOfIteratorHelper(this.plugins);
|
|
325
|
+
|
|
326
|
+
try {
|
|
327
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
328
|
+
plugin = _step.value;
|
|
329
|
+
plugin.apply(this, {
|
|
330
|
+
rendererService: this.rendererService,
|
|
331
|
+
mapService: this.mapService,
|
|
332
|
+
styleAttributeService: this.styleAttributeService,
|
|
333
|
+
normalPassFactory: this.normalPassFactory,
|
|
334
|
+
postProcessingPassFactory: this.postProcessingPassFactory
|
|
335
|
+
});
|
|
336
|
+
} // 初始化其他服务
|
|
337
|
+
|
|
338
|
+
} catch (err) {
|
|
339
|
+
_iterator.e(err);
|
|
340
|
+
} finally {
|
|
341
|
+
_iterator.f();
|
|
342
|
+
}
|
|
309
343
|
|
|
310
|
-
|
|
311
|
-
// @ts-ignore
|
|
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
|
-
}
|
|
344
|
+
this.layerPickService = new LayerPickService(this); // 触发 init 生命周期插件
|
|
344
345
|
|
|
345
|
-
|
|
346
|
-
|
|
346
|
+
_context.next = 28;
|
|
347
|
+
return this.hooks.init.promise();
|
|
347
348
|
|
|
348
|
-
|
|
349
|
+
case 28:
|
|
350
|
+
this.inited = true; // 触发初始化完成事件;
|
|
349
351
|
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
352
|
+
this.emit('inited', {
|
|
353
|
+
target: this,
|
|
354
|
+
type: 'inited'
|
|
355
|
+
});
|
|
356
|
+
this.emit('add', {
|
|
357
|
+
target: this,
|
|
358
|
+
type: 'add'
|
|
359
|
+
});
|
|
360
|
+
this.hooks.afterInit.call();
|
|
361
|
+
|
|
362
|
+
case 32:
|
|
363
|
+
case "end":
|
|
364
|
+
return _context.stop();
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
}, _callee, this);
|
|
368
|
+
}));
|
|
369
|
+
|
|
370
|
+
function init() {
|
|
371
|
+
return _init.apply(this, arguments);
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
return init;
|
|
375
|
+
}()
|
|
360
376
|
}, {
|
|
361
377
|
key: "updateModelData",
|
|
362
378
|
value: function updateModelData(data) {
|
|
@@ -390,6 +406,11 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
390
406
|
};
|
|
391
407
|
}
|
|
392
408
|
}
|
|
409
|
+
}, {
|
|
410
|
+
key: "setLayerPickService",
|
|
411
|
+
value: function setLayerPickService(layerPickService) {
|
|
412
|
+
this.layerPickService = layerPickService;
|
|
413
|
+
}
|
|
393
414
|
}, {
|
|
394
415
|
key: "calculateEncodeData",
|
|
395
416
|
value: function calculateEncodeData(data, option) {
|
|
@@ -407,8 +428,7 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
407
428
|
}, {
|
|
408
429
|
key: "prepareBuildModel",
|
|
409
430
|
value: function prepareBuildModel() {
|
|
410
|
-
this.
|
|
411
|
-
this.updateLayerConfig(_objectSpread(_objectSpread({}, this.getDefaultConfig()), this.rawConfig)); // 启动动画
|
|
431
|
+
this.updateLayerConfig(_objectSpread(_objectSpread(_objectSpread({}, this.getDefaultConfig()), this.rawConfig), this.needUpdateConfig)); // 启动动画
|
|
412
432
|
|
|
413
433
|
var _this$getLayerConfig2 = this.getLayerConfig(),
|
|
414
434
|
animateOption = _this$getLayerConfig2.animateOption;
|
|
@@ -504,7 +524,8 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
504
524
|
// 判断是否为source
|
|
505
525
|
this.setSource(data);
|
|
506
526
|
return this;
|
|
507
|
-
}
|
|
527
|
+
} // 设置source 配置
|
|
528
|
+
|
|
508
529
|
|
|
509
530
|
this.sourceOption = {
|
|
510
531
|
data: data,
|
|
@@ -527,8 +548,6 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
527
548
|
if (!currentSource) {
|
|
528
549
|
// 执行 setData 的时候 source 还不存在(还未执行 addLayer)
|
|
529
550
|
_this4.source(new Source(data, options));
|
|
530
|
-
|
|
531
|
-
_this4.sourceEvent();
|
|
532
551
|
} else {
|
|
533
552
|
_this4.layerSource.setData(data, options);
|
|
534
553
|
} // this.layerSource.setData(data, options);
|
|
@@ -543,8 +562,6 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
543
562
|
value: function style(options) {
|
|
544
563
|
var _this5 = this;
|
|
545
564
|
|
|
546
|
-
var lastConfig = this.getLayerConfig();
|
|
547
|
-
|
|
548
565
|
var passes = options.passes,
|
|
549
566
|
rest = _objectWithoutProperties(options, _excluded); // passes 特殊处理
|
|
550
567
|
|
|
@@ -564,16 +581,16 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
564
581
|
if (this.container) {
|
|
565
582
|
this.updateLayerConfig(this.rawConfig);
|
|
566
583
|
this.styleNeedUpdate = true;
|
|
567
|
-
} //
|
|
584
|
+
} // TODO style model 更新
|
|
585
|
+
// @ts-ignore
|
|
586
|
+
// if (lastConfig && lastConfig.mask === true && options.mask === false) {
|
|
587
|
+
// this.clearModels();
|
|
588
|
+
// this.layerModel.buildModels((models) => {
|
|
589
|
+
// this.models = models;
|
|
590
|
+
// });
|
|
591
|
+
// }
|
|
568
592
|
|
|
569
593
|
|
|
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
594
|
return this;
|
|
578
595
|
}
|
|
579
596
|
}, {
|
|
@@ -607,7 +624,12 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
607
624
|
return this;
|
|
608
625
|
}
|
|
609
626
|
|
|
610
|
-
|
|
627
|
+
this.layerService.beforeRenderData(this);
|
|
628
|
+
|
|
629
|
+
if (this.encodeDataLength <= 0 && !this.forceRender) {
|
|
630
|
+
return this;
|
|
631
|
+
} // Tip: this.getEncodedData().length !== 0 这个判断是为了解决在 2.5.x 引入数据纹理后产生的 空数据渲染导致 texture 超出上限问题
|
|
632
|
+
|
|
611
633
|
|
|
612
634
|
this.renderModels();
|
|
613
635
|
return this;
|
|
@@ -619,32 +641,24 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
619
641
|
}, {
|
|
620
642
|
key: "renderMultiPass",
|
|
621
643
|
value: function () {
|
|
622
|
-
var _renderMultiPass = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
623
|
-
return _regeneratorRuntime.wrap(function
|
|
644
|
+
var _renderMultiPass = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
645
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
624
646
|
while (1) {
|
|
625
|
-
switch (
|
|
647
|
+
switch (_context2.prev = _context2.next) {
|
|
626
648
|
case 0:
|
|
627
|
-
if (!(this.encodeDataLength <= 0 && !this.forceRender)) {
|
|
628
|
-
_context.next = 2;
|
|
629
|
-
break;
|
|
630
|
-
}
|
|
631
|
-
|
|
632
|
-
return _context.abrupt("return");
|
|
633
|
-
|
|
634
|
-
case 2:
|
|
635
649
|
if (!(this.multiPassRenderer && this.multiPassRenderer.getRenderFlag())) {
|
|
636
|
-
|
|
650
|
+
_context2.next = 5;
|
|
637
651
|
break;
|
|
638
652
|
}
|
|
639
653
|
|
|
640
|
-
|
|
654
|
+
_context2.next = 3;
|
|
641
655
|
return this.multiPassRenderer.render();
|
|
642
656
|
|
|
643
|
-
case
|
|
644
|
-
|
|
657
|
+
case 3:
|
|
658
|
+
_context2.next = 6;
|
|
645
659
|
break;
|
|
646
660
|
|
|
647
|
-
case
|
|
661
|
+
case 5:
|
|
648
662
|
if (this.multiPassRenderer) {
|
|
649
663
|
// renderPass 触发的渲染
|
|
650
664
|
this.renderModels();
|
|
@@ -652,12 +666,12 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
652
666
|
this.renderModels();
|
|
653
667
|
}
|
|
654
668
|
|
|
655
|
-
case
|
|
669
|
+
case 6:
|
|
656
670
|
case "end":
|
|
657
|
-
return
|
|
671
|
+
return _context2.stop();
|
|
658
672
|
}
|
|
659
673
|
}
|
|
660
|
-
},
|
|
674
|
+
}, _callee2, this);
|
|
661
675
|
}));
|
|
662
676
|
|
|
663
677
|
function renderMultiPass() {
|
|
@@ -1021,13 +1035,14 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
1021
1035
|
return !!(this.styleAttributeService.getLayerStyleAttributes() || []).filter(function (attribute) {
|
|
1022
1036
|
return attribute.needRescale || attribute.needRemapping || attribute.needRegenerateVertices;
|
|
1023
1037
|
}).length;
|
|
1024
|
-
}
|
|
1038
|
+
} // 外部初始化Source
|
|
1039
|
+
|
|
1025
1040
|
}, {
|
|
1026
1041
|
key: "setSource",
|
|
1027
1042
|
value: function setSource(source) {
|
|
1028
1043
|
var _this8 = this;
|
|
1029
1044
|
|
|
1030
|
-
//
|
|
1045
|
+
// 解除原 sources 事件
|
|
1031
1046
|
if (this.layerSource) {
|
|
1032
1047
|
this.layerSource.off('update', this.sourceEvent);
|
|
1033
1048
|
}
|
|
@@ -1038,30 +1053,66 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
1038
1053
|
if (this.inited && this.layerSource.cluster) {
|
|
1039
1054
|
var zoom = this.mapService.getZoom();
|
|
1040
1055
|
this.layerSource.updateClusterData(zoom);
|
|
1041
|
-
}
|
|
1042
|
-
|
|
1056
|
+
}
|
|
1043
1057
|
|
|
1044
1058
|
if (this.layerSource.inited) {
|
|
1045
1059
|
this.sourceEvent();
|
|
1046
1060
|
} // this.layerSource.inited 为 true update 事件不会再触发
|
|
1047
1061
|
|
|
1048
1062
|
|
|
1049
|
-
this.layerSource.on('update', function () {
|
|
1063
|
+
this.layerSource.on('update', function (_ref3) {
|
|
1064
|
+
var type = _ref3.type;
|
|
1065
|
+
|
|
1050
1066
|
if (_this8.coordCenter === undefined) {
|
|
1051
1067
|
var _this8$mapService;
|
|
1052
1068
|
|
|
1053
1069
|
var layerCenter = _this8.layerSource.center;
|
|
1054
1070
|
_this8.coordCenter = layerCenter;
|
|
1055
|
-
|
|
1071
|
+
|
|
1072
|
+
if ((_this8$mapService = _this8.mapService) !== null && _this8$mapService !== void 0 && _this8$mapService.setCoordCenter) {
|
|
1073
|
+
_this8.mapService.setCoordCenter(layerCenter);
|
|
1074
|
+
}
|
|
1056
1075
|
}
|
|
1057
1076
|
|
|
1058
|
-
|
|
1077
|
+
if (type === 'update') {
|
|
1078
|
+
// source 初始化不需要处理
|
|
1079
|
+
_this8.sourceEvent();
|
|
1080
|
+
}
|
|
1059
1081
|
});
|
|
1082
|
+
} // layer 初始化source
|
|
1083
|
+
|
|
1084
|
+
}, {
|
|
1085
|
+
key: "initSource",
|
|
1086
|
+
value: function initSource(source) {
|
|
1087
|
+
this.layerSource = source;
|
|
1088
|
+
this.clusterZoom = 0;
|
|
1089
|
+
this.addSourceEvent();
|
|
1060
1090
|
}
|
|
1061
1091
|
}, {
|
|
1062
1092
|
key: "getSource",
|
|
1063
1093
|
value: function getSource() {
|
|
1064
1094
|
return this.layerSource;
|
|
1095
|
+
} // 注册source 更新事件
|
|
1096
|
+
|
|
1097
|
+
}, {
|
|
1098
|
+
key: "addSourceEvent",
|
|
1099
|
+
value: function addSourceEvent() {
|
|
1100
|
+
var _this9 = this;
|
|
1101
|
+
|
|
1102
|
+
this.layerSource.on('update', function () {
|
|
1103
|
+
if (_this9.coordCenter === undefined) {
|
|
1104
|
+
var _this9$mapService;
|
|
1105
|
+
|
|
1106
|
+
var layerCenter = _this9.layerSource.center;
|
|
1107
|
+
_this9.coordCenter = layerCenter;
|
|
1108
|
+
|
|
1109
|
+
if ((_this9$mapService = _this9.mapService) !== null && _this9$mapService !== void 0 && _this9$mapService.setCoordCenter) {
|
|
1110
|
+
_this9.mapService.setCoordCenter(layerCenter);
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
|
|
1114
|
+
_this9.sourceEvent();
|
|
1115
|
+
});
|
|
1065
1116
|
}
|
|
1066
1117
|
}, {
|
|
1067
1118
|
key: "getScaleOptions",
|
|
@@ -1140,9 +1191,9 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
1140
1191
|
}
|
|
1141
1192
|
}, {
|
|
1142
1193
|
key: "pick",
|
|
1143
|
-
value: function pick(
|
|
1144
|
-
var x =
|
|
1145
|
-
y =
|
|
1194
|
+
value: function pick(_ref7) {
|
|
1195
|
+
var x = _ref7.x,
|
|
1196
|
+
y = _ref7.y;
|
|
1146
1197
|
this.interactionService.triggerHover({
|
|
1147
1198
|
x: x,
|
|
1148
1199
|
y: y
|
|
@@ -1155,76 +1206,79 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
1155
1206
|
}
|
|
1156
1207
|
}, {
|
|
1157
1208
|
key: "buildLayerModel",
|
|
1158
|
-
value: function
|
|
1159
|
-
var
|
|
1209
|
+
value: function () {
|
|
1210
|
+
var _buildLayerModel = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(options) {
|
|
1211
|
+
var _this10 = this;
|
|
1160
1212
|
|
|
1161
|
-
|
|
1162
|
-
vertexShader = options.vertexShader,
|
|
1163
|
-
fragmentShader = options.fragmentShader,
|
|
1164
|
-
triangulation = options.triangulation,
|
|
1165
|
-
segmentNumber = options.segmentNumber,
|
|
1166
|
-
_options$workerEnable = options.workerEnabled,
|
|
1167
|
-
workerEnabled = _options$workerEnable === void 0 ? false : _options$workerEnable,
|
|
1168
|
-
workerOptions = options.workerOptions,
|
|
1169
|
-
rest = _objectWithoutProperties(options, _excluded2);
|
|
1170
|
-
|
|
1171
|
-
this.shaderModuleService.registerModule(moduleName, {
|
|
1172
|
-
vs: vertexShader,
|
|
1173
|
-
fs: fragmentShader
|
|
1174
|
-
});
|
|
1213
|
+
var moduleName, vertexShader, fragmentShader, triangulation, segmentNumber, _options$workerEnable, workerEnabled, workerOptions, rest, _this$shaderModuleSer, vs, fs, uniforms, createModel;
|
|
1175
1214
|
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
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
|
-
|
|
1215
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
1216
|
+
while (1) {
|
|
1217
|
+
switch (_context3.prev = _context3.next) {
|
|
1218
|
+
case 0:
|
|
1219
|
+
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);
|
|
1220
|
+
this.shaderModuleService.registerModule(moduleName, {
|
|
1221
|
+
vs: vertexShader,
|
|
1222
|
+
fs: fragmentShader
|
|
1223
|
+
});
|
|
1224
|
+
_this$shaderModuleSer = this.shaderModuleService.getModule(moduleName), vs = _this$shaderModuleSer.vs, fs = _this$shaderModuleSer.fs, uniforms = _this$shaderModuleSer.uniforms;
|
|
1225
|
+
createModel = this.rendererService.createModel;
|
|
1226
|
+
return _context3.abrupt("return", new Promise(function (resolve, reject) {
|
|
1227
|
+
// filter supported worker & worker enabled layer
|
|
1228
|
+
if (workerOptions && workerOptions.modelType in WorkerSourceMap && workerEnabled) {
|
|
1229
|
+
_this10.styleAttributeService.createAttributesAndIndicesAscy(_this10.encodedData, segmentNumber, workerOptions).then(function (_ref8) {
|
|
1230
|
+
var attributes = _ref8.attributes,
|
|
1231
|
+
elements = _ref8.elements;
|
|
1232
|
+
var m = createModel(_objectSpread({
|
|
1233
|
+
attributes: attributes,
|
|
1234
|
+
uniforms: uniforms,
|
|
1235
|
+
fs: fs,
|
|
1236
|
+
vs: vs,
|
|
1237
|
+
elements: elements,
|
|
1238
|
+
blend: BlendTypes[BlendType.normal]
|
|
1239
|
+
}, rest));
|
|
1240
|
+
resolve(m);
|
|
1241
|
+
}).catch(function (err) {
|
|
1242
|
+
return reject(err);
|
|
1243
|
+
});
|
|
1244
|
+
} else {
|
|
1245
|
+
var _this10$styleAttribut = _this10.styleAttributeService.createAttributesAndIndices(_this10.encodedData, triangulation, segmentNumber),
|
|
1246
|
+
attributes = _this10$styleAttribut.attributes,
|
|
1247
|
+
elements = _this10$styleAttribut.elements,
|
|
1248
|
+
count = _this10$styleAttribut.count;
|
|
1249
|
+
|
|
1250
|
+
var modelOptions = _objectSpread({
|
|
1251
|
+
attributes: attributes,
|
|
1252
|
+
uniforms: uniforms,
|
|
1253
|
+
fs: fs,
|
|
1254
|
+
vs: vs,
|
|
1255
|
+
elements: elements,
|
|
1256
|
+
blend: BlendTypes[BlendType.normal]
|
|
1257
|
+
}, rest);
|
|
1258
|
+
|
|
1259
|
+
if (count) {
|
|
1260
|
+
modelOptions.count = count;
|
|
1261
|
+
}
|
|
1262
|
+
|
|
1263
|
+
var m = createModel(modelOptions);
|
|
1264
|
+
resolve(m);
|
|
1265
|
+
}
|
|
1266
|
+
}));
|
|
1221
1267
|
|
|
1222
|
-
|
|
1223
|
-
|
|
1268
|
+
case 5:
|
|
1269
|
+
case "end":
|
|
1270
|
+
return _context3.stop();
|
|
1271
|
+
}
|
|
1224
1272
|
}
|
|
1225
|
-
});
|
|
1226
|
-
});
|
|
1227
|
-
|
|
1273
|
+
}, _callee3, this);
|
|
1274
|
+
}));
|
|
1275
|
+
|
|
1276
|
+
function buildLayerModel(_x) {
|
|
1277
|
+
return _buildLayerModel.apply(this, arguments);
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1280
|
+
return buildLayerModel;
|
|
1281
|
+
}()
|
|
1228
1282
|
}, {
|
|
1229
1283
|
key: "createAttributes",
|
|
1230
1284
|
value: function createAttributes(options) {
|
|
@@ -1266,9 +1320,6 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
1266
1320
|
}, {
|
|
1267
1321
|
key: "needPick",
|
|
1268
1322
|
value: function needPick(type) {
|
|
1269
|
-
// 地图图层的判断
|
|
1270
|
-
if (this.rawConfig.usage === 'basemap') return false;
|
|
1271
|
-
|
|
1272
1323
|
var _this$getLayerConfig10 = this.getLayerConfig(),
|
|
1273
1324
|
_this$getLayerConfig11 = _this$getLayerConfig10.enableHighlight,
|
|
1274
1325
|
enableHighlight = _this$getLayerConfig11 === void 0 ? true : _this$getLayerConfig11,
|
|
@@ -1290,34 +1341,73 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
1290
1341
|
}
|
|
1291
1342
|
}, {
|
|
1292
1343
|
key: "buildModels",
|
|
1293
|
-
value: function
|
|
1294
|
-
|
|
1295
|
-
|
|
1344
|
+
value: function () {
|
|
1345
|
+
var _buildModels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
1346
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
1347
|
+
while (1) {
|
|
1348
|
+
switch (_context4.prev = _context4.next) {
|
|
1349
|
+
case 0:
|
|
1350
|
+
throw new Error('Method not implemented.');
|
|
1351
|
+
|
|
1352
|
+
case 1:
|
|
1353
|
+
case "end":
|
|
1354
|
+
return _context4.stop();
|
|
1355
|
+
}
|
|
1356
|
+
}
|
|
1357
|
+
}, _callee4);
|
|
1358
|
+
}));
|
|
1359
|
+
|
|
1360
|
+
function buildModels() {
|
|
1361
|
+
return _buildModels.apply(this, arguments);
|
|
1362
|
+
}
|
|
1363
|
+
|
|
1364
|
+
return buildModels;
|
|
1365
|
+
}()
|
|
1296
1366
|
}, {
|
|
1297
1367
|
key: "rebuildModels",
|
|
1298
|
-
value: function
|
|
1299
|
-
|
|
1300
|
-
|
|
1368
|
+
value: function () {
|
|
1369
|
+
var _rebuildModels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
|
|
1370
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
1371
|
+
while (1) {
|
|
1372
|
+
switch (_context5.prev = _context5.next) {
|
|
1373
|
+
case 0:
|
|
1374
|
+
_context5.next = 2;
|
|
1375
|
+
return this.buildModels();
|
|
1376
|
+
|
|
1377
|
+
case 2:
|
|
1378
|
+
case "end":
|
|
1379
|
+
return _context5.stop();
|
|
1380
|
+
}
|
|
1381
|
+
}
|
|
1382
|
+
}, _callee5, this);
|
|
1383
|
+
}));
|
|
1384
|
+
|
|
1385
|
+
function rebuildModels() {
|
|
1386
|
+
return _rebuildModels.apply(this, arguments);
|
|
1387
|
+
}
|
|
1388
|
+
|
|
1389
|
+
return rebuildModels;
|
|
1390
|
+
}()
|
|
1301
1391
|
}, {
|
|
1302
1392
|
key: "renderMulPass",
|
|
1303
1393
|
value: function () {
|
|
1304
|
-
var _renderMulPass = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1305
|
-
return _regeneratorRuntime.wrap(function
|
|
1394
|
+
var _renderMulPass = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(multiPassRenderer) {
|
|
1395
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
1306
1396
|
while (1) {
|
|
1307
|
-
switch (
|
|
1397
|
+
switch (_context6.prev = _context6.next) {
|
|
1308
1398
|
case 0:
|
|
1309
|
-
|
|
1399
|
+
_context6.next = 2;
|
|
1310
1400
|
return multiPassRenderer.render();
|
|
1311
1401
|
|
|
1312
1402
|
case 2:
|
|
1313
1403
|
case "end":
|
|
1314
|
-
return
|
|
1404
|
+
return _context6.stop();
|
|
1315
1405
|
}
|
|
1316
1406
|
}
|
|
1317
|
-
},
|
|
1407
|
+
}, _callee6);
|
|
1318
1408
|
}));
|
|
1319
1409
|
|
|
1320
|
-
function renderMulPass(
|
|
1410
|
+
function renderMulPass(_x2) {
|
|
1321
1411
|
return _renderMulPass.apply(this, arguments);
|
|
1322
1412
|
}
|
|
1323
1413
|
|
|
@@ -1326,32 +1416,35 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
1326
1416
|
}, {
|
|
1327
1417
|
key: "renderModels",
|
|
1328
1418
|
value: function renderModels(isPicking) {
|
|
1329
|
-
var
|
|
1419
|
+
var _this11 = this;
|
|
1330
1420
|
|
|
1331
1421
|
// TODO: this.getEncodedData().length > 0 这个判断是为了解决在 2.5.x 引入数据纹理后产生的 空数据渲染导致 texture 超出上限问题
|
|
1332
|
-
if (this.encodeDataLength <= 0 && !this.forceRender)
|
|
1333
|
-
|
|
1334
|
-
if (this.layerModelNeedUpdate && this.layerModel) {
|
|
1335
|
-
this.layerModel.buildModels(function (models) {
|
|
1336
|
-
_this10.models = models;
|
|
1337
|
-
|
|
1338
|
-
_this10.hooks.beforeRender.call();
|
|
1339
|
-
|
|
1340
|
-
_this10.layerModelNeedUpdate = false;
|
|
1341
|
-
});
|
|
1422
|
+
if (this.encodeDataLength <= 0 && !this.forceRender) {
|
|
1423
|
+
return this;
|
|
1342
1424
|
}
|
|
1343
1425
|
|
|
1426
|
+
this.hooks.beforeRender.call();
|
|
1344
1427
|
this.models.forEach(function (model) {
|
|
1345
1428
|
model.draw({
|
|
1346
|
-
uniforms:
|
|
1429
|
+
uniforms: _this11.layerModel.getUninforms()
|
|
1347
1430
|
}, isPicking);
|
|
1348
1431
|
});
|
|
1432
|
+
this.hooks.afterRender.call();
|
|
1349
1433
|
return this;
|
|
1350
1434
|
}
|
|
1351
1435
|
}, {
|
|
1352
1436
|
key: "updateStyleAttribute",
|
|
1353
1437
|
value: function updateStyleAttribute(type, field, values, updateOptions) {
|
|
1354
|
-
|
|
1438
|
+
// 存储 Attribute
|
|
1439
|
+
if (['color', 'size', 'texture', 'rotate', 'filter', 'label', 'shape'].indexOf(type) !== -1) {
|
|
1440
|
+
this.configService.setAttributeConfig(this.id, _defineProperty({}, type, {
|
|
1441
|
+
field: field,
|
|
1442
|
+
values: values
|
|
1443
|
+
}));
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1446
|
+
if (!this.startInit) {
|
|
1447
|
+
// 开始初始化执行
|
|
1355
1448
|
this.pendingStyleAttributes.push({
|
|
1356
1449
|
attributeName: type,
|
|
1357
1450
|
attributeField: field,
|
|
@@ -1370,6 +1463,11 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
1370
1463
|
updateOptions);
|
|
1371
1464
|
}
|
|
1372
1465
|
}
|
|
1466
|
+
}, {
|
|
1467
|
+
key: "getLayerAttributeConfig",
|
|
1468
|
+
value: function getLayerAttributeConfig() {
|
|
1469
|
+
return this.configService.getAttributeConfig(this.id);
|
|
1470
|
+
}
|
|
1373
1471
|
}, {
|
|
1374
1472
|
key: "getShaderPickStat",
|
|
1375
1473
|
value: function getShaderPickStat() {
|
|
@@ -1385,6 +1483,13 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
1385
1483
|
key: "setEarthTime",
|
|
1386
1484
|
value: function setEarthTime(time) {
|
|
1387
1485
|
console.warn('empty fn');
|
|
1486
|
+
} // 数据处理 在数据进行 mapping 生成 encodeData 之前对数据进行处理
|
|
1487
|
+
// 在各个 layer 中继承
|
|
1488
|
+
|
|
1489
|
+
}, {
|
|
1490
|
+
key: "processData",
|
|
1491
|
+
value: function processData(filterData) {
|
|
1492
|
+
return filterData;
|
|
1388
1493
|
}
|
|
1389
1494
|
}, {
|
|
1390
1495
|
key: "getModelType",
|
|
@@ -1397,27 +1502,43 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
1397
1502
|
return {};
|
|
1398
1503
|
}
|
|
1399
1504
|
}, {
|
|
1400
|
-
key: "
|
|
1401
|
-
value: function
|
|
1402
|
-
var
|
|
1505
|
+
key: "initLayerModels",
|
|
1506
|
+
value: function () {
|
|
1507
|
+
var _initLayerModels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
|
|
1508
|
+
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
1509
|
+
while (1) {
|
|
1510
|
+
switch (_context7.prev = _context7.next) {
|
|
1511
|
+
case 0:
|
|
1512
|
+
this.models.forEach(function (model) {
|
|
1513
|
+
return model.destroy();
|
|
1514
|
+
});
|
|
1515
|
+
this.models = [];
|
|
1516
|
+
_context7.next = 4;
|
|
1517
|
+
return this.layerModel.initModels();
|
|
1403
1518
|
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
});
|
|
1407
|
-
this.models = [];
|
|
1408
|
-
this.models = models;
|
|
1409
|
-
this.emit('modelLoaded', null);
|
|
1410
|
-
this.modelLoaded = true; // Tip: setTimeout 用于延迟绘制,可以让拖动图层时连续的 setData 更加平滑 - L7Draw
|
|
1519
|
+
case 4:
|
|
1520
|
+
this.models = _context7.sent;
|
|
1411
1521
|
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1522
|
+
case 5:
|
|
1523
|
+
case "end":
|
|
1524
|
+
return _context7.stop();
|
|
1525
|
+
}
|
|
1526
|
+
}
|
|
1527
|
+
}, _callee7, this);
|
|
1528
|
+
}));
|
|
1529
|
+
|
|
1530
|
+
function initLayerModels() {
|
|
1531
|
+
return _initLayerModels.apply(this, arguments);
|
|
1532
|
+
}
|
|
1533
|
+
|
|
1534
|
+
return initLayerModels;
|
|
1535
|
+
}()
|
|
1417
1536
|
}, {
|
|
1418
1537
|
key: "reRender",
|
|
1419
1538
|
value: function reRender() {
|
|
1420
|
-
this.inited
|
|
1539
|
+
if (this.inited) {
|
|
1540
|
+
this.layerService.reRender();
|
|
1541
|
+
}
|
|
1421
1542
|
}
|
|
1422
1543
|
}, {
|
|
1423
1544
|
key: "splitValuesAndCallbackInAttribute",
|