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