@antv/l7-layers 2.10.2 → 2.10.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/Geometry/index.d.ts +3 -2
- package/es/Geometry/index.js +24 -34
- package/es/Geometry/models/billboard.d.ts +2 -2
- package/es/Geometry/models/billboard.js +45 -85
- package/es/Geometry/models/plane.d.ts +2 -2
- package/es/Geometry/models/plane.js +49 -89
- package/es/Geometry/models/sprite.d.ts +2 -2
- package/es/Geometry/models/sprite.js +54 -92
- package/es/canvas/index.d.ts +3 -2
- package/es/canvas/index.js +26 -36
- package/es/canvas/models/canvas.d.ts +2 -2
- package/es/canvas/models/canvas.js +23 -62
- package/es/citybuliding/building.d.ts +3 -2
- package/es/citybuliding/building.js +24 -33
- package/es/citybuliding/models/build.d.ts +2 -2
- package/es/citybuliding/models/build.js +31 -76
- package/es/core/BaseLayer.d.ts +18 -21
- package/es/core/BaseLayer.js +273 -393
- package/es/core/BaseModel.d.ts +2 -2
- package/es/core/BaseModel.js +13 -54
- package/es/core/shape/Path.js +1 -1
- package/es/core/shape/extrude.js +1 -1
- package/es/core/triangulation.js +3 -10
- package/es/earth/index.d.ts +2 -2
- package/es/earth/index.js +16 -35
- package/es/earth/models/atmosphere.d.ts +2 -2
- package/es/earth/models/atmosphere.js +27 -72
- package/es/earth/models/base.d.ts +2 -2
- package/es/earth/models/base.js +50 -96
- package/es/earth/models/bloomsphere.d.ts +2 -2
- package/es/earth/models/bloomsphere.js +27 -72
- package/es/earth/utils.js +1 -1
- package/es/heatmap/index.d.ts +3 -2
- package/es/heatmap/index.js +29 -40
- package/es/heatmap/models/grid.d.ts +2 -2
- package/es/heatmap/models/grid.js +32 -73
- package/es/heatmap/models/grid3d.d.ts +2 -2
- package/es/heatmap/models/grid3d.js +33 -74
- package/es/heatmap/models/heatmap.d.ts +2 -2
- package/es/heatmap/models/heatmap.js +22 -48
- package/es/heatmap/models/hexagon.d.ts +2 -2
- package/es/heatmap/models/hexagon.js +33 -74
- package/es/image/index.d.ts +3 -2
- package/es/image/index.js +24 -34
- package/es/image/models/dataImage.d.ts +2 -2
- package/es/image/models/dataImage.js +59 -98
- package/es/image/models/image.d.ts +2 -2
- package/es/image/models/image.js +72 -113
- package/es/image/models/tileDataImage.d.ts +2 -2
- package/es/image/models/tileDataImage.js +48 -89
- 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 +32 -58
- package/es/line/models/arc.d.ts +2 -2
- package/es/line/models/arc.js +45 -80
- package/es/line/models/arc_3d.d.ts +2 -2
- package/es/line/models/arc_3d.js +41 -76
- package/es/line/models/earthArc_3d.d.ts +2 -2
- package/es/line/models/earthArc_3d.js +44 -79
- package/es/line/models/great_circle.d.ts +2 -2
- package/es/line/models/great_circle.js +36 -77
- package/es/line/models/half.d.ts +2 -2
- package/es/line/models/half.js +23 -46
- 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 +54 -86
- package/es/line/models/linearline.d.ts +2 -2
- package/es/line/models/linearline.js +38 -77
- package/es/line/models/simpleLine.d.ts +2 -2
- package/es/line/models/simpleLine.js +39 -76
- package/es/line/models/simpleTileLine.d.ts +2 -2
- package/es/line/models/simpleTileLine.js +35 -75
- package/es/line/models/tile.d.ts +2 -2
- package/es/line/models/tile.js +23 -46
- package/es/line/models/wall.d.ts +2 -2
- package/es/line/models/wall.js +29 -74
- package/es/mask/index.d.ts +4 -2
- package/es/mask/index.js +104 -34
- package/es/mask/models/fill.d.ts +2 -2
- package/es/mask/models/fill.js +22 -46
- package/es/mask/models/index.d.ts +1 -1
- package/es/mask/models/index.js +3 -1
- package/es/plugins/DataMappingPlugin.js +72 -83
- package/es/plugins/DataSourcePlugin.js +32 -68
- package/es/plugins/FeatureScalePlugin.js +48 -88
- package/es/plugins/LayerAnimateStylePlugin.js +3 -3
- package/es/plugins/LayerModelPlugin.d.ts +2 -2
- package/es/plugins/LayerModelPlugin.js +39 -126
- package/es/plugins/LayerStylePlugin.js +8 -3
- 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 +18 -3
- package/es/plugins/ShaderUniformPlugin.js +6 -6
- package/es/plugins/UpdateModelPlugin.js +2 -2
- package/es/plugins/UpdateStyleAttributePlugin.js +5 -6
- package/es/point/index.d.ts +4 -4
- package/es/point/index.js +30 -62
- package/es/point/models/earthExtrude.d.ts +2 -2
- package/es/point/models/earthExtrude.js +37 -80
- package/es/point/models/earthFill.d.ts +2 -2
- package/es/point/models/earthFill.js +28 -73
- package/es/point/models/extrude.d.ts +2 -2
- package/es/point/models/extrude.js +25 -48
- package/es/point/models/fill.d.ts +2 -2
- package/es/point/models/fill.js +28 -51
- package/es/point/models/fillmage.d.ts +2 -2
- package/es/point/models/fillmage.js +51 -90
- package/es/point/models/image.d.ts +2 -2
- package/es/point/models/image.js +38 -79
- 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 +36 -77
- package/es/point/models/radar.d.ts +2 -2
- package/es/point/models/radar.js +43 -83
- package/es/point/models/simplePoint.d.ts +2 -2
- package/es/point/models/simplePoint.js +35 -76
- package/es/point/models/text.d.ts +2 -3
- package/es/point/models/text.js +116 -173
- package/es/point/models/tile.d.ts +2 -2
- package/es/point/models/tile.js +40 -82
- package/es/point/models/tileText.d.ts +2 -2
- package/es/point/models/tileText.js +125 -160
- package/es/point/shape/extrude.js +1 -1
- package/es/polygon/index.d.ts +3 -2
- package/es/polygon/index.js +31 -34
- package/es/polygon/models/extrude.d.ts +2 -2
- package/es/polygon/models/extrude.js +38 -75
- package/es/polygon/models/fill.d.ts +2 -2
- package/es/polygon/models/fill.js +48 -81
- 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 +34 -75
- package/es/polygon/models/tile.d.ts +2 -2
- package/es/polygon/models/tile.js +35 -75
- package/es/polygon/models/water.d.ts +2 -2
- package/es/polygon/models/water.js +34 -75
- 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 +29 -35
- 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 +19 -42
- package/es/raster/models/rasterRgb.d.ts +2 -2
- package/es/raster/models/rasterRgb.js +21 -44
- package/es/raster/models/rasterTile.d.ts +2 -2
- package/es/raster/models/rasterTile.js +41 -82
- package/es/raster/raster.d.ts +1 -1
- package/es/raster/raster.js +31 -51
- 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/getRasterData.js +1 -1
- package/es/tile/interaction/utils.js +12 -4
- package/es/tile/interface.d.ts +4 -5
- package/es/tile/manager/base.d.ts +12 -17
- package/es/tile/manager/base.js +51 -216
- 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 +127 -1
- 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} +28 -40
- package/es/tile/tileFactory/layers/{TileDebugLayer.d.ts → tileTest.d.ts} +2 -2
- package/es/tile/tileFactory/layers/{TileDebugLayer.js → tileTest.js} +17 -30
- 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/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 +18 -16
- package/es/utils/extrude_polyline.js +5 -5
- package/es/utils/grid-index.js +3 -3
- package/es/utils/layerData.js +11 -5
- 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 +3 -2
- package/es/wind/index.js +24 -34
- package/es/wind/models/wind.d.ts +2 -2
- package/es/wind/models/wind.js +111 -127
- package/es/wind/models/windRender.js +3 -3
- 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 +256 -381
- 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 +64 -77
- package/lib/plugins/DataSourcePlugin.js +30 -68
- package/lib/plugins/FeatureScalePlugin.js +44 -86
- package/lib/plugins/LayerModelPlugin.js +41 -131
- 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/UpdateStyleAttributePlugin.js +3 -4
- 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 +106 -164
- 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 -122
- 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 -124
- 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 -23
- package/es/tile/tileFactory/Tile.js +0 -136
- package/es/tile/tileFactory/VectorTile.d.ts +0 -20
- package/es/tile/tileFactory/VectorTile.js +0 -158
- 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 -136
- 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 -146
- package/lib/tile/tileFactory/VectorTile.js +0 -173
- package/lib/tile/tileFactory/util.js +0 -48
- package/lib/tile/tileLayer/BaseLayer.js +0 -373
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 _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
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,18 +29,17 @@ 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 {
|
|
32
|
+
import { SyncBailHook, SyncHook, SyncWaterfallHook } 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 { handleStyleDataMapping } from "../utils/dataMappingStyle";
|
|
40
40
|
import { calculateData } from "../utils/layerData";
|
|
41
41
|
import { createMultiPassRenderer, normalizePasses } from "../utils/multiPassRender";
|
|
42
42
|
import { updateShape } from "../utils/updateShape";
|
|
43
|
-
import LayerPickService from "./LayerPickService";
|
|
44
43
|
/**
|
|
45
44
|
* 分配 layer id
|
|
46
45
|
*/
|
|
@@ -54,10 +53,12 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
54
53
|
// 生命周期钩子
|
|
55
54
|
// 待渲染 model 列表
|
|
56
55
|
// 用于保存子图层对象
|
|
56
|
+
// Tip: 用于标识矢量图层
|
|
57
57
|
|
|
58
58
|
/**
|
|
59
59
|
* 待更新样式属性,在初始化阶段完成注册
|
|
60
60
|
*/
|
|
61
|
+
// Tip: layer 保底颜色
|
|
61
62
|
// private pickingPassRender: IPass<'pixelPicking'>;
|
|
62
63
|
function BaseLayer() {
|
|
63
64
|
var _this;
|
|
@@ -108,10 +109,10 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
108
109
|
});
|
|
109
110
|
|
|
110
111
|
_defineProperty(_assertThisInitialized(_this), "hooks", {
|
|
111
|
-
init: new
|
|
112
|
+
init: new SyncBailHook(),
|
|
112
113
|
afterInit: new SyncBailHook(),
|
|
113
114
|
beforeRender: new SyncBailHook(),
|
|
114
|
-
beforeRenderData: new
|
|
115
|
+
beforeRenderData: new SyncWaterfallHook(),
|
|
115
116
|
afterRender: new SyncHook(),
|
|
116
117
|
beforePickingEncode: new SyncHook(),
|
|
117
118
|
afterPickingEncode: new SyncHook(),
|
|
@@ -125,12 +126,14 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
125
126
|
|
|
126
127
|
_defineProperty(_assertThisInitialized(_this), "models", []);
|
|
127
128
|
|
|
128
|
-
_defineProperty(_assertThisInitialized(_this), "
|
|
129
|
+
_defineProperty(_assertThisInitialized(_this), "modelLoaded", false);
|
|
129
130
|
|
|
130
131
|
_defineProperty(_assertThisInitialized(_this), "layerChildren", []);
|
|
131
132
|
|
|
132
133
|
_defineProperty(_assertThisInitialized(_this), "masks", []);
|
|
133
134
|
|
|
135
|
+
_defineProperty(_assertThisInitialized(_this), "isVector", false);
|
|
136
|
+
|
|
134
137
|
_initializerDefineProperty(_assertThisInitialized(_this), "configService", _descriptor, _assertThisInitialized(_this));
|
|
135
138
|
|
|
136
139
|
_defineProperty(_assertThisInitialized(_this), "animateOptions", {
|
|
@@ -145,6 +148,8 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
145
148
|
|
|
146
149
|
_defineProperty(_assertThisInitialized(_this), "animateStatus", false);
|
|
147
150
|
|
|
151
|
+
_defineProperty(_assertThisInitialized(_this), "bottomColor", 'rgba(0, 0, 0, 0)');
|
|
152
|
+
|
|
148
153
|
_defineProperty(_assertThisInitialized(_this), "isDestroyed", false);
|
|
149
154
|
|
|
150
155
|
_defineProperty(_assertThisInitialized(_this), "encodeDataLength", 0);
|
|
@@ -158,17 +163,12 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
158
163
|
_this.fitBounds(layerConfig.fitBoundsOptions);
|
|
159
164
|
}
|
|
160
165
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
if (autoRender) {
|
|
164
|
-
_this.reRender();
|
|
165
|
-
}
|
|
166
|
+
_this.reRender();
|
|
166
167
|
});
|
|
167
168
|
|
|
168
169
|
_this.name = config.name || _this.id;
|
|
169
170
|
_this.zIndex = config.zIndex || 0;
|
|
170
|
-
_this.rawConfig = config;
|
|
171
|
-
|
|
171
|
+
_this.rawConfig = config;
|
|
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.inited) {
|
|
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
|
+
handleStyleDataMapping(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,6 +240,16 @@ 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
|
+
}
|
|
243
253
|
}, {
|
|
244
254
|
key: "addPlugin",
|
|
245
255
|
value: function addPlugin(plugin) {
|
|
@@ -248,131 +258,105 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
248
258
|
}
|
|
249
259
|
}, {
|
|
250
260
|
key: "init",
|
|
251
|
-
value: function () {
|
|
252
|
-
var
|
|
253
|
-
|
|
254
|
-
|
|
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
|
-
// Tip: 兼容 multiPassRender 在 amap1 时存在的图层不同步问题 zoom
|
|
284
|
-
this.mapService.on('mapAfterFrameChange', function () {
|
|
285
|
-
_this3.renderLayers();
|
|
286
|
-
});
|
|
287
|
-
}
|
|
288
|
-
|
|
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
|
-
}
|
|
261
|
+
value: function init() {
|
|
262
|
+
var _this3 = this;
|
|
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
|
+
}
|
|
343
293
|
|
|
344
|
-
|
|
294
|
+
this.cameraService = this.container.get(TYPES.ICameraService);
|
|
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); // 图层容器服务
|
|
345
299
|
|
|
346
|
-
|
|
347
|
-
|
|
300
|
+
this.styleAttributeService = this.container.get(TYPES.IStyleAttributeService);
|
|
301
|
+
this.multiPassRenderer = this.container.get(TYPES.IMultiPassRenderer);
|
|
302
|
+
this.multiPassRenderer.setLayer(this); // 完成样式服务注册完成前添加的属性
|
|
348
303
|
|
|
349
|
-
|
|
350
|
-
|
|
304
|
+
this.pendingStyleAttributes.forEach(function (_ref2) {
|
|
305
|
+
var attributeName = _ref2.attributeName,
|
|
306
|
+
attributeField = _ref2.attributeField,
|
|
307
|
+
attributeValues = _ref2.attributeValues,
|
|
308
|
+
updateOptions = _ref2.updateOptions;
|
|
351
309
|
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
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
|
+
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
|
+
}
|
|
361
344
|
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
return _context.stop();
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
}, _callee, this);
|
|
368
|
-
}));
|
|
345
|
+
this.hooks.init.call(); // this.pickingPassRender = this.normalPassFactory('pixelPicking');
|
|
346
|
+
// this.pickingPassRender.init(this);
|
|
369
347
|
|
|
370
|
-
|
|
371
|
-
return _init.apply(this, arguments);
|
|
372
|
-
}
|
|
348
|
+
this.hooks.afterInit.call(); // 触发初始化完成事件;
|
|
373
349
|
|
|
374
|
-
|
|
375
|
-
|
|
350
|
+
this.emit('inited', {
|
|
351
|
+
target: this,
|
|
352
|
+
type: 'inited'
|
|
353
|
+
});
|
|
354
|
+
this.emit('add', {
|
|
355
|
+
target: this,
|
|
356
|
+
type: 'add'
|
|
357
|
+
});
|
|
358
|
+
return this;
|
|
359
|
+
}
|
|
376
360
|
}, {
|
|
377
361
|
key: "updateModelData",
|
|
378
362
|
value: function updateModelData(data) {
|
|
@@ -406,11 +390,6 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
406
390
|
};
|
|
407
391
|
}
|
|
408
392
|
}
|
|
409
|
-
}, {
|
|
410
|
-
key: "setLayerPickService",
|
|
411
|
-
value: function setLayerPickService(layerPickService) {
|
|
412
|
-
this.layerPickService = layerPickService;
|
|
413
|
-
}
|
|
414
393
|
}, {
|
|
415
394
|
key: "calculateEncodeData",
|
|
416
395
|
value: function calculateEncodeData(data, option) {
|
|
@@ -428,7 +407,8 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
428
407
|
}, {
|
|
429
408
|
key: "prepareBuildModel",
|
|
430
409
|
value: function prepareBuildModel() {
|
|
431
|
-
this.
|
|
410
|
+
this.inited = true;
|
|
411
|
+
this.updateLayerConfig(_objectSpread(_objectSpread({}, this.getDefaultConfig()), this.rawConfig)); // 启动动画
|
|
432
412
|
|
|
433
413
|
var _this$getLayerConfig2 = this.getLayerConfig(),
|
|
434
414
|
animateOption = _this$getLayerConfig2.animateOption;
|
|
@@ -524,8 +504,7 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
524
504
|
// 判断是否为source
|
|
525
505
|
this.setSource(data);
|
|
526
506
|
return this;
|
|
527
|
-
}
|
|
528
|
-
|
|
507
|
+
}
|
|
529
508
|
|
|
530
509
|
this.sourceOption = {
|
|
531
510
|
data: data,
|
|
@@ -548,6 +527,8 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
548
527
|
if (!currentSource) {
|
|
549
528
|
// 执行 setData 的时候 source 还不存在(还未执行 addLayer)
|
|
550
529
|
_this4.source(new Source(data, options));
|
|
530
|
+
|
|
531
|
+
_this4.sourceEvent();
|
|
551
532
|
} else {
|
|
552
533
|
_this4.layerSource.setData(data, options);
|
|
553
534
|
} // this.layerSource.setData(data, options);
|
|
@@ -562,6 +543,8 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
562
543
|
value: function style(options) {
|
|
563
544
|
var _this5 = this;
|
|
564
545
|
|
|
546
|
+
var lastConfig = this.getLayerConfig();
|
|
547
|
+
|
|
565
548
|
var passes = options.passes,
|
|
566
549
|
rest = _objectWithoutProperties(options, _excluded); // passes 特殊处理
|
|
567
550
|
|
|
@@ -581,15 +564,15 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
581
564
|
if (this.container) {
|
|
582
565
|
this.updateLayerConfig(this.rawConfig);
|
|
583
566
|
this.styleNeedUpdate = true;
|
|
584
|
-
} //
|
|
585
|
-
|
|
586
|
-
// if (lastConfig && lastConfig.mask === true && options.mask === false) {
|
|
587
|
-
// this.clearModels();
|
|
588
|
-
// this.layerModel.buildModels((models) => {
|
|
589
|
-
// this.models = models;
|
|
590
|
-
// });
|
|
591
|
-
// }
|
|
567
|
+
} // @ts-ignore
|
|
568
|
+
|
|
592
569
|
|
|
570
|
+
if (lastConfig && lastConfig.mask === true && options.mask === false) {
|
|
571
|
+
this.clearModels();
|
|
572
|
+
this.layerModel.buildModels(function (models) {
|
|
573
|
+
_this5.models = models;
|
|
574
|
+
});
|
|
575
|
+
}
|
|
593
576
|
|
|
594
577
|
return this;
|
|
595
578
|
}
|
|
@@ -639,29 +622,29 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
639
622
|
}, {
|
|
640
623
|
key: "renderMultiPass",
|
|
641
624
|
value: function () {
|
|
642
|
-
var _renderMultiPass = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
643
|
-
return _regeneratorRuntime.wrap(function
|
|
625
|
+
var _renderMultiPass = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
626
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
644
627
|
while (1) {
|
|
645
|
-
switch (
|
|
628
|
+
switch (_context.prev = _context.next) {
|
|
646
629
|
case 0:
|
|
647
630
|
if (!(this.encodeDataLength <= 0 && !this.forceRender)) {
|
|
648
|
-
|
|
631
|
+
_context.next = 2;
|
|
649
632
|
break;
|
|
650
633
|
}
|
|
651
634
|
|
|
652
|
-
return
|
|
635
|
+
return _context.abrupt("return");
|
|
653
636
|
|
|
654
637
|
case 2:
|
|
655
638
|
if (!(this.multiPassRenderer && this.multiPassRenderer.getRenderFlag())) {
|
|
656
|
-
|
|
639
|
+
_context.next = 7;
|
|
657
640
|
break;
|
|
658
641
|
}
|
|
659
642
|
|
|
660
|
-
|
|
643
|
+
_context.next = 5;
|
|
661
644
|
return this.multiPassRenderer.render();
|
|
662
645
|
|
|
663
646
|
case 5:
|
|
664
|
-
|
|
647
|
+
_context.next = 8;
|
|
665
648
|
break;
|
|
666
649
|
|
|
667
650
|
case 7:
|
|
@@ -674,10 +657,10 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
674
657
|
|
|
675
658
|
case 8:
|
|
676
659
|
case "end":
|
|
677
|
-
return
|
|
660
|
+
return _context.stop();
|
|
678
661
|
}
|
|
679
662
|
}
|
|
680
|
-
},
|
|
663
|
+
}, _callee, this);
|
|
681
664
|
}));
|
|
682
665
|
|
|
683
666
|
function renderMultiPass() {
|
|
@@ -1041,14 +1024,13 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
1041
1024
|
return !!(this.styleAttributeService.getLayerStyleAttributes() || []).filter(function (attribute) {
|
|
1042
1025
|
return attribute.needRescale || attribute.needRemapping || attribute.needRegenerateVertices;
|
|
1043
1026
|
}).length;
|
|
1044
|
-
}
|
|
1045
|
-
|
|
1027
|
+
}
|
|
1046
1028
|
}, {
|
|
1047
1029
|
key: "setSource",
|
|
1048
1030
|
value: function setSource(source) {
|
|
1049
1031
|
var _this8 = this;
|
|
1050
1032
|
|
|
1051
|
-
//
|
|
1033
|
+
// 清除旧 sources 事件
|
|
1052
1034
|
if (this.layerSource) {
|
|
1053
1035
|
this.layerSource.off('update', this.sourceEvent);
|
|
1054
1036
|
}
|
|
@@ -1059,7 +1041,8 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
1059
1041
|
if (this.inited && this.layerSource.cluster) {
|
|
1060
1042
|
var zoom = this.mapService.getZoom();
|
|
1061
1043
|
this.layerSource.updateClusterData(zoom);
|
|
1062
|
-
}
|
|
1044
|
+
} // source 可能会复用,会在其它layer被修改
|
|
1045
|
+
|
|
1063
1046
|
|
|
1064
1047
|
if (this.layerSource.inited) {
|
|
1065
1048
|
this.sourceEvent();
|
|
@@ -1068,52 +1051,21 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
1068
1051
|
|
|
1069
1052
|
this.layerSource.on('update', function () {
|
|
1070
1053
|
if (_this8.coordCenter === undefined) {
|
|
1071
|
-
var _this8$mapService;
|
|
1072
|
-
|
|
1073
1054
|
var layerCenter = _this8.layerSource.center;
|
|
1074
1055
|
_this8.coordCenter = layerCenter;
|
|
1075
1056
|
|
|
1076
|
-
if (
|
|
1057
|
+
if (_this8.mapService.setCoordCenter) {
|
|
1077
1058
|
_this8.mapService.setCoordCenter(layerCenter);
|
|
1078
1059
|
}
|
|
1079
1060
|
}
|
|
1080
1061
|
|
|
1081
1062
|
_this8.sourceEvent();
|
|
1082
1063
|
});
|
|
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
1064
|
}
|
|
1092
1065
|
}, {
|
|
1093
1066
|
key: "getSource",
|
|
1094
1067
|
value: function getSource() {
|
|
1095
1068
|
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
1069
|
}
|
|
1118
1070
|
}, {
|
|
1119
1071
|
key: "getScaleOptions",
|
|
@@ -1207,79 +1159,76 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
1207
1159
|
}
|
|
1208
1160
|
}, {
|
|
1209
1161
|
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;
|
|
1162
|
+
value: function buildLayerModel(options) {
|
|
1163
|
+
var _this9 = this;
|
|
1215
1164
|
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
_this10.styleAttributeService.createAttributesAndIndicesAscy(_this10.encodedData, segmentNumber, workerOptions).then(function (_ref7) {
|
|
1231
|
-
var attributes = _ref7.attributes,
|
|
1232
|
-
elements = _ref7.elements;
|
|
1233
|
-
var m = createModel(_objectSpread({
|
|
1234
|
-
attributes: attributes,
|
|
1235
|
-
uniforms: uniforms,
|
|
1236
|
-
fs: fs,
|
|
1237
|
-
vs: vs,
|
|
1238
|
-
elements: elements,
|
|
1239
|
-
blend: BlendTypes[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 = _objectSpread({
|
|
1252
|
-
attributes: attributes,
|
|
1253
|
-
uniforms: uniforms,
|
|
1254
|
-
fs: fs,
|
|
1255
|
-
vs: vs,
|
|
1256
|
-
elements: elements,
|
|
1257
|
-
blend: BlendTypes[BlendType.normal]
|
|
1258
|
-
}, rest);
|
|
1259
|
-
|
|
1260
|
-
if (count) {
|
|
1261
|
-
modelOptions.count = count;
|
|
1262
|
-
}
|
|
1263
|
-
|
|
1264
|
-
var m = createModel(modelOptions);
|
|
1265
|
-
resolve(m);
|
|
1266
|
-
}
|
|
1267
|
-
}));
|
|
1165
|
+
var moduleName = options.moduleName,
|
|
1166
|
+
vertexShader = options.vertexShader,
|
|
1167
|
+
fragmentShader = options.fragmentShader,
|
|
1168
|
+
triangulation = options.triangulation,
|
|
1169
|
+
segmentNumber = options.segmentNumber,
|
|
1170
|
+
_options$workerEnable = options.workerEnabled,
|
|
1171
|
+
workerEnabled = _options$workerEnable === void 0 ? false : _options$workerEnable,
|
|
1172
|
+
workerOptions = options.workerOptions,
|
|
1173
|
+
rest = _objectWithoutProperties(options, _excluded2);
|
|
1174
|
+
|
|
1175
|
+
this.shaderModuleService.registerModule(moduleName, {
|
|
1176
|
+
vs: vertexShader,
|
|
1177
|
+
fs: fragmentShader
|
|
1178
|
+
});
|
|
1268
1179
|
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1180
|
+
var _this$shaderModuleSer = this.shaderModuleService.getModule(moduleName),
|
|
1181
|
+
vs = _this$shaderModuleSer.vs,
|
|
1182
|
+
fs = _this$shaderModuleSer.fs,
|
|
1183
|
+
uniforms = _this$shaderModuleSer.uniforms;
|
|
1184
|
+
|
|
1185
|
+
var createModel = this.rendererService.createModel;
|
|
1186
|
+
return new Promise(function (resolve, reject) {
|
|
1187
|
+
setTimeout(function () {
|
|
1188
|
+
// filter supported worker & worker enabled layer
|
|
1189
|
+
if (workerOptions && workerOptions.modelType in WorkerSourceMap && workerEnabled) {
|
|
1190
|
+
_this9.styleAttributeService.createAttributesAndIndicesAscy(_this9.encodedData, segmentNumber, workerOptions).then(function (_ref7) {
|
|
1191
|
+
var attributes = _ref7.attributes,
|
|
1192
|
+
elements = _ref7.elements;
|
|
1193
|
+
var m = createModel(_objectSpread({
|
|
1194
|
+
attributes: attributes,
|
|
1195
|
+
uniforms: uniforms,
|
|
1196
|
+
fs: fs,
|
|
1197
|
+
vs: vs,
|
|
1198
|
+
elements: elements,
|
|
1199
|
+
blend: BlendTypes[BlendType.normal]
|
|
1200
|
+
}, rest));
|
|
1201
|
+
resolve(m);
|
|
1202
|
+
}).catch(function (err) {
|
|
1203
|
+
return reject(err);
|
|
1204
|
+
});
|
|
1205
|
+
} else {
|
|
1206
|
+
// console.log(this.encodedData[1].originCoordinates[0])
|
|
1207
|
+
// console.log(this.encodedData[1].coordinates[0])
|
|
1208
|
+
var _this9$styleAttribute = _this9.styleAttributeService.createAttributesAndIndices(_this9.encodedData, triangulation, segmentNumber),
|
|
1209
|
+
attributes = _this9$styleAttribute.attributes,
|
|
1210
|
+
elements = _this9$styleAttribute.elements,
|
|
1211
|
+
count = _this9$styleAttribute.count;
|
|
1212
|
+
|
|
1213
|
+
var modelOptions = _objectSpread({
|
|
1214
|
+
attributes: attributes,
|
|
1215
|
+
uniforms: uniforms,
|
|
1216
|
+
fs: fs,
|
|
1217
|
+
vs: vs,
|
|
1218
|
+
elements: elements,
|
|
1219
|
+
blend: BlendTypes[BlendType.normal]
|
|
1220
|
+
}, rest);
|
|
1221
|
+
|
|
1222
|
+
if (count) {
|
|
1223
|
+
modelOptions.count = count;
|
|
1272
1224
|
}
|
|
1273
|
-
}
|
|
1274
|
-
}, _callee3, this);
|
|
1275
|
-
}));
|
|
1276
1225
|
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
}
|
|
1226
|
+
var m = createModel(modelOptions);
|
|
1227
|
+
resolve(m);
|
|
1228
|
+
}
|
|
1229
|
+
});
|
|
1230
|
+
});
|
|
1231
|
+
}
|
|
1283
1232
|
}, {
|
|
1284
1233
|
key: "createAttributes",
|
|
1285
1234
|
value: function createAttributes(options) {
|
|
@@ -1321,6 +1270,11 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
1321
1270
|
}, {
|
|
1322
1271
|
key: "needPick",
|
|
1323
1272
|
value: function needPick(type) {
|
|
1273
|
+
// 地图图层的判断
|
|
1274
|
+
if (this.rawConfig.usage === 'basemap') {
|
|
1275
|
+
return false;
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1324
1278
|
var _this$getLayerConfig10 = this.getLayerConfig(),
|
|
1325
1279
|
_this$getLayerConfig11 = _this$getLayerConfig10.enableHighlight,
|
|
1326
1280
|
enableHighlight = _this$getLayerConfig11 === void 0 ? true : _this$getLayerConfig11,
|
|
@@ -1342,73 +1296,34 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
1342
1296
|
}
|
|
1343
1297
|
}, {
|
|
1344
1298
|
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
|
-
}()
|
|
1299
|
+
value: function buildModels() {
|
|
1300
|
+
throw new Error('Method not implemented.');
|
|
1301
|
+
}
|
|
1367
1302
|
}, {
|
|
1368
1303
|
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
|
-
}()
|
|
1304
|
+
value: function rebuildModels() {
|
|
1305
|
+
throw new Error('Method not implemented.');
|
|
1306
|
+
}
|
|
1392
1307
|
}, {
|
|
1393
1308
|
key: "renderMulPass",
|
|
1394
1309
|
value: function () {
|
|
1395
|
-
var _renderMulPass = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1396
|
-
return _regeneratorRuntime.wrap(function
|
|
1310
|
+
var _renderMulPass = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(multiPassRenderer) {
|
|
1311
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
1397
1312
|
while (1) {
|
|
1398
|
-
switch (
|
|
1313
|
+
switch (_context2.prev = _context2.next) {
|
|
1399
1314
|
case 0:
|
|
1400
|
-
|
|
1315
|
+
_context2.next = 2;
|
|
1401
1316
|
return multiPassRenderer.render();
|
|
1402
1317
|
|
|
1403
1318
|
case 2:
|
|
1404
1319
|
case "end":
|
|
1405
|
-
return
|
|
1320
|
+
return _context2.stop();
|
|
1406
1321
|
}
|
|
1407
1322
|
}
|
|
1408
|
-
},
|
|
1323
|
+
}, _callee2);
|
|
1409
1324
|
}));
|
|
1410
1325
|
|
|
1411
|
-
function renderMulPass(
|
|
1326
|
+
function renderMulPass(_x) {
|
|
1412
1327
|
return _renderMulPass.apply(this, arguments);
|
|
1413
1328
|
}
|
|
1414
1329
|
|
|
@@ -1417,42 +1332,33 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
1417
1332
|
}, {
|
|
1418
1333
|
key: "renderModels",
|
|
1419
1334
|
value: function renderModels(isPicking) {
|
|
1420
|
-
var
|
|
1335
|
+
var _this10 = this;
|
|
1421
1336
|
|
|
1422
1337
|
// TODO: this.getEncodedData().length > 0 这个判断是为了解决在 2.5.x 引入数据纹理后产生的 空数据渲染导致 texture 超出上限问题
|
|
1423
1338
|
if (this.encodeDataLength <= 0 && !this.forceRender) {
|
|
1424
1339
|
return this;
|
|
1425
|
-
}
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1342
|
+
if (this.layerModelNeedUpdate && this.layerModel) {
|
|
1343
|
+
this.layerModel.buildModels(function (models) {
|
|
1344
|
+
_this10.models = models;
|
|
1345
|
+
|
|
1346
|
+
_this10.hooks.beforeRender.call();
|
|
1347
|
+
|
|
1348
|
+
_this10.layerModelNeedUpdate = false;
|
|
1349
|
+
});
|
|
1350
|
+
}
|
|
1351
|
+
|
|
1437
1352
|
this.models.forEach(function (model) {
|
|
1438
1353
|
model.draw({
|
|
1439
|
-
uniforms:
|
|
1354
|
+
uniforms: _this10.layerModel.getUninforms()
|
|
1440
1355
|
}, isPicking);
|
|
1441
1356
|
});
|
|
1442
|
-
this.hooks.afterRender.call();
|
|
1443
1357
|
return this;
|
|
1444
1358
|
}
|
|
1445
1359
|
}, {
|
|
1446
1360
|
key: "updateStyleAttribute",
|
|
1447
1361
|
value: function updateStyleAttribute(type, field, values, updateOptions) {
|
|
1448
|
-
// 存储 Attribute
|
|
1449
|
-
if (['color', 'size', 'texture', 'rotate', 'filter', 'label', 'shape'].indexOf(type) !== -1) {
|
|
1450
|
-
this.configService.setAttributeConfig(this.id, _defineProperty({}, type, {
|
|
1451
|
-
field: field,
|
|
1452
|
-
values: values
|
|
1453
|
-
}));
|
|
1454
|
-
}
|
|
1455
|
-
|
|
1456
1362
|
if (!this.inited) {
|
|
1457
1363
|
this.pendingStyleAttributes.push({
|
|
1458
1364
|
attributeName: type,
|
|
@@ -1472,11 +1378,6 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
1472
1378
|
updateOptions);
|
|
1473
1379
|
}
|
|
1474
1380
|
}
|
|
1475
|
-
}, {
|
|
1476
|
-
key: "getLayerAttributeConfig",
|
|
1477
|
-
value: function getLayerAttributeConfig() {
|
|
1478
|
-
return this.configService.getAttributeConfig(this.id);
|
|
1479
|
-
}
|
|
1480
1381
|
}, {
|
|
1481
1382
|
key: "getShaderPickStat",
|
|
1482
1383
|
value: function getShaderPickStat() {
|
|
@@ -1492,13 +1393,6 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
1492
1393
|
key: "setEarthTime",
|
|
1493
1394
|
value: function setEarthTime(time) {
|
|
1494
1395
|
console.warn('empty fn');
|
|
1495
|
-
} // 数据处理 在数据进行 mapping 生成 encodeData 之前对数据进行处理
|
|
1496
|
-
// 在各个 layer 中继承
|
|
1497
|
-
|
|
1498
|
-
}, {
|
|
1499
|
-
key: "processData",
|
|
1500
|
-
value: function processData(filterData) {
|
|
1501
|
-
return filterData;
|
|
1502
1396
|
}
|
|
1503
1397
|
}, {
|
|
1504
1398
|
key: "getModelType",
|
|
@@ -1511,37 +1405,23 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
1511
1405
|
return {};
|
|
1512
1406
|
}
|
|
1513
1407
|
}, {
|
|
1514
|
-
key: "
|
|
1515
|
-
value: function () {
|
|
1516
|
-
var
|
|
1517
|
-
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
1518
|
-
while (1) {
|
|
1519
|
-
switch (_context7.prev = _context7.next) {
|
|
1520
|
-
case 0:
|
|
1521
|
-
this.models.forEach(function (model) {
|
|
1522
|
-
return model.destroy();
|
|
1523
|
-
});
|
|
1524
|
-
this.models = [];
|
|
1525
|
-
_context7.next = 4;
|
|
1526
|
-
return this.layerModel.initModels();
|
|
1527
|
-
|
|
1528
|
-
case 4:
|
|
1529
|
-
this.models = _context7.sent;
|
|
1530
|
-
|
|
1531
|
-
case 5:
|
|
1532
|
-
case "end":
|
|
1533
|
-
return _context7.stop();
|
|
1534
|
-
}
|
|
1535
|
-
}
|
|
1536
|
-
}, _callee7, this);
|
|
1537
|
-
}));
|
|
1408
|
+
key: "dispatchModelLoad",
|
|
1409
|
+
value: function dispatchModelLoad(models) {
|
|
1410
|
+
var _this11 = this;
|
|
1538
1411
|
|
|
1539
|
-
function
|
|
1540
|
-
return
|
|
1541
|
-
}
|
|
1412
|
+
this.models.forEach(function (model) {
|
|
1413
|
+
return model.destroy();
|
|
1414
|
+
});
|
|
1415
|
+
this.models = [];
|
|
1416
|
+
this.models = models;
|
|
1417
|
+
this.emit('modelLoaded', null);
|
|
1418
|
+
this.modelLoaded = true; // Tip: setTimeout 用于延迟绘制,可以让拖动图层时连续的 setData 更加平滑 - L7Draw
|
|
1542
1419
|
|
|
1543
|
-
|
|
1544
|
-
|
|
1420
|
+
setTimeout(function () {
|
|
1421
|
+
// Tip: 使用 renderLayers 而不是 throttleRenderLayers,让图层之间的 setData 更新绘制不存在延迟
|
|
1422
|
+
_this11.layerService.renderLayers();
|
|
1423
|
+
}, 32);
|
|
1424
|
+
}
|
|
1545
1425
|
}, {
|
|
1546
1426
|
key: "reRender",
|
|
1547
1427
|
value: function reRender() {
|