@antv/l7-layers 2.17.4 → 2.17.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.js +9 -31
- package/es/Geometry/models/billboard.js +51 -89
- package/es/Geometry/models/plane.js +81 -143
- package/es/Geometry/models/sprite.js +60 -118
- package/es/canvas/index.js +10 -33
- package/es/canvas/models/canvas.js +41 -97
- package/es/citybuliding/building.js +8 -27
- package/es/citybuliding/models/build.js +57 -82
- package/es/core/BaseLayer.js +325 -483
- package/es/core/BaseModel.js +51 -80
- package/es/core/CommonStyleAttribute.js +2 -5
- package/es/core/LayerPickService.js +21 -32
- package/es/core/TextureService.js +0 -13
- package/es/core/interface.js +17 -24
- package/es/core/shape/Path.js +13 -20
- package/es/core/shape/extrude.js +27 -39
- package/es/core/triangulation.js +99 -136
- package/es/earth/index.js +9 -33
- package/es/earth/models/atmosphere.js +30 -54
- package/es/earth/models/base.js +47 -85
- package/es/earth/models/bloomsphere.js +30 -54
- package/es/earth/utils.js +9 -13
- package/es/heatmap/index.js +10 -40
- package/es/heatmap/models/grid.js +28 -52
- package/es/heatmap/models/grid3d.js +28 -52
- package/es/heatmap/models/heatmap.js +92 -149
- package/es/heatmap/models/hexagon.js +28 -52
- package/es/heatmap/triangulation.js +0 -4
- package/es/image/index.js +9 -28
- package/es/image/models/image.js +66 -100
- package/es/index.js +9 -17
- package/es/line/index.js +9 -35
- package/es/line/models/arc.js +63 -112
- package/es/line/models/arc_3d.js +58 -102
- package/es/line/models/earthArc_3d.js +60 -105
- package/es/line/models/flow.js +36 -60
- package/es/line/models/great_circle.js +53 -94
- package/es/line/models/line.js +92 -144
- package/es/line/models/linearline.js +42 -74
- package/es/line/models/simpleLine.js +38 -67
- package/es/line/models/wall.js +52 -92
- package/es/line/shaders/dash/line_dash_vert.glsl +1 -2
- package/es/line/shaders/line_frag.glsl +1 -3
- package/es/line/shaders/line_vert.glsl +2 -0
- package/es/line/shaders/linear/line_linear_frag.glsl +1 -1
- package/es/mask/index.js +9 -28
- package/es/mask/models/fill.js +29 -54
- package/es/plugins/DataMappingPlugin.js +78 -114
- package/es/plugins/DataSourcePlugin.js +45 -68
- package/es/plugins/FeatureScalePlugin.js +67 -122
- package/es/plugins/LayerAnimateStylePlugin.js +0 -5
- package/es/plugins/LayerMaskPlugin.js +3 -11
- package/es/plugins/LayerModelPlugin.js +69 -118
- package/es/plugins/LayerStylePlugin.js +4 -9
- package/es/plugins/LightingPlugin.js +12 -18
- package/es/plugins/MultiPassRendererPlugin.js +11 -16
- package/es/plugins/PixelPickingPlugin.js +12 -21
- package/es/plugins/RegisterStyleAttributePlugin.js +5 -12
- package/es/plugins/ShaderUniformPlugin.js +13 -27
- package/es/plugins/UpdateModelPlugin.js +0 -5
- package/es/plugins/UpdateStyleAttributePlugin.js +5 -11
- package/es/point/index.js +26 -78
- package/es/point/models/earthExtrude.js +58 -95
- package/es/point/models/earthFill.js +52 -80
- package/es/point/models/extrude.js +57 -94
- package/es/point/models/fill.js +56 -81
- package/es/point/models/fillmage.js +60 -100
- package/es/point/models/image.js +47 -83
- package/es/point/models/index.js +2 -2
- package/es/point/models/normal.js +30 -54
- package/es/point/models/radar.js +38 -63
- package/es/point/models/simplePoint.js +38 -62
- package/es/point/models/text.js +199 -296
- package/es/point/shape/extrude.js +4 -13
- package/es/polygon/index.js +11 -41
- package/es/polygon/models/extrude.js +87 -135
- package/es/polygon/models/fill.js +50 -79
- package/es/polygon/models/index.js +3 -2
- package/es/polygon/models/ocean.js +42 -76
- package/es/polygon/models/water.js +37 -71
- package/es/raster/buffers/triangulation.js +2 -4
- package/es/raster/index.js +9 -32
- package/es/raster/models/raster.js +80 -116
- package/es/raster/models/rasterRgb.js +84 -127
- package/es/raster/models/rasterTerrainRgb.js +56 -84
- package/es/tile/interaction/getRasterData.js +14 -20
- package/es/tile/interaction/utils.js +7 -9
- package/es/tile/manager/base.js +63 -96
- package/es/tile/service/TileLayerService.js +33 -55
- package/es/tile/service/TilePickService.js +26 -40
- package/es/tile/service/TileSourceService.js +3 -7
- package/es/tile/tileFactory/DebugTile.js +29 -46
- package/es/tile/tileFactory/ImageTile.js +20 -38
- package/es/tile/tileFactory/MaskTile.js +22 -43
- package/es/tile/tileFactory/RasterRGBTile.js +22 -42
- package/es/tile/tileFactory/RasterTerrainRGBTile.js +20 -38
- package/es/tile/tileFactory/RasterTile.js +30 -53
- package/es/tile/tileFactory/Tile.js +63 -97
- package/es/tile/tileFactory/VectorTile.js +41 -68
- package/es/tile/tileFactory/index.js +0 -11
- package/es/tile/tileFactory/layers/TileDebugLayer.js +6 -27
- package/es/tile/tileFactory/util.js +0 -3
- package/es/tile/tileLayer/BaseLayer.js +105 -146
- package/es/tile/utils.js +1 -1
- package/es/utils/blend.js +0 -2
- package/es/utils/collision-index.js +9 -16
- package/es/utils/extrude_polyline.js +101 -149
- package/es/utils/grid-index.js +2 -27
- package/es/utils/identityScale.js +0 -8
- package/es/utils/layerData.js +30 -44
- package/es/utils/multiPassRender.js +11 -13
- package/es/utils/polylineNormal.js +31 -37
- package/es/utils/simpleLine.js +2 -16
- package/es/utils/stencil.js +2 -3
- package/es/utils/symbol-layout.js +27 -53
- package/es/wind/index.js +9 -29
- package/es/wind/models/utils.js +26 -51
- package/es/wind/models/wind.js +101 -147
- package/es/wind/models/windRender.js +53 -66
- package/lib/Geometry/index.js +9 -38
- package/lib/Geometry/models/billboard.js +51 -97
- package/lib/Geometry/models/index.js +0 -5
- package/lib/Geometry/models/plane.js +79 -151
- package/lib/Geometry/models/sprite.js +60 -127
- package/lib/canvas/index.js +10 -40
- package/lib/canvas/models/canvas.js +41 -101
- package/lib/canvas/models/index.js +0 -3
- package/lib/citybuliding/building.js +8 -35
- package/lib/citybuliding/models/build.js +57 -92
- package/lib/core/BaseLayer.js +325 -474
- package/lib/core/BaseModel.js +51 -90
- package/lib/core/CommonStyleAttribute.js +2 -7
- package/lib/core/LayerPickService.js +21 -37
- package/lib/core/TextureService.js +0 -16
- package/lib/core/interface.js +21 -31
- package/lib/core/schema.js +0 -1
- package/lib/core/shape/Path.js +14 -31
- package/lib/core/shape/extrude.js +27 -62
- package/lib/core/triangulation.js +98 -177
- package/lib/earth/index.js +9 -43
- package/lib/earth/models/atmosphere.js +30 -63
- package/lib/earth/models/base.js +47 -90
- package/lib/earth/models/bloomsphere.js +30 -63
- package/lib/earth/utils.js +7 -31
- package/lib/heatmap/index.js +10 -48
- package/lib/heatmap/models/grid.js +28 -60
- package/lib/heatmap/models/grid3d.js +28 -60
- package/lib/heatmap/models/heatmap.js +92 -166
- package/lib/heatmap/models/hexagon.js +28 -60
- package/lib/heatmap/models/index.js +0 -6
- package/lib/heatmap/triangulation.js +0 -5
- package/lib/image/index.js +9 -36
- package/lib/image/models/image.js +66 -109
- package/lib/image/models/index.js +0 -3
- package/lib/index.js +7 -61
- package/lib/line/index.js +9 -40
- package/lib/line/models/arc.js +61 -122
- package/lib/line/models/arc_3d.js +56 -113
- package/lib/line/models/earthArc_3d.js +58 -115
- package/lib/line/models/flow.js +36 -70
- package/lib/line/models/great_circle.js +53 -104
- package/lib/line/models/index.js +0 -11
- package/lib/line/models/line.js +90 -152
- package/lib/line/models/linearline.js +42 -86
- package/lib/line/models/simpleLine.js +38 -77
- package/lib/line/models/wall.js +52 -103
- package/lib/line/shaders/dash/line_dash_vert.glsl +1 -2
- package/lib/line/shaders/line_frag.glsl +1 -3
- package/lib/line/shaders/line_vert.glsl +2 -0
- package/lib/line/shaders/linear/line_linear_frag.glsl +1 -1
- package/lib/mask/index.js +9 -36
- package/lib/mask/models/fill.js +29 -63
- package/lib/mask/models/index.js +0 -3
- package/lib/plugins/DataMappingPlugin.js +78 -125
- package/lib/plugins/DataSourcePlugin.js +45 -76
- package/lib/plugins/FeatureScalePlugin.js +67 -138
- package/lib/plugins/LayerAnimateStylePlugin.js +0 -10
- package/lib/plugins/LayerMaskPlugin.js +4 -17
- package/lib/plugins/LayerModelPlugin.js +70 -127
- package/lib/plugins/LayerStylePlugin.js +5 -14
- package/lib/plugins/LightingPlugin.js +12 -25
- package/lib/plugins/MultiPassRendererPlugin.js +11 -22
- package/lib/plugins/PixelPickingPlugin.js +12 -27
- package/lib/plugins/RegisterStyleAttributePlugin.js +5 -19
- package/lib/plugins/ShaderUniformPlugin.js +13 -34
- package/lib/plugins/UpdateModelPlugin.js +1 -10
- package/lib/plugins/UpdateStyleAttributePlugin.js +5 -16
- package/lib/point/index.js +26 -83
- package/lib/point/models/earthExtrude.js +58 -106
- package/lib/point/models/earthFill.js +52 -110
- package/lib/point/models/extrude.js +57 -103
- package/lib/point/models/fill.js +54 -90
- package/lib/point/models/fillmage.js +58 -107
- package/lib/point/models/image.js +47 -92
- package/lib/point/models/index.js +1 -12
- package/lib/point/models/normal.js +30 -64
- package/lib/point/models/radar.js +38 -72
- package/lib/point/models/simplePoint.js +38 -72
- package/lib/point/models/text.js +199 -305
- package/lib/point/shape/extrude.js +4 -20
- package/lib/polygon/index.js +11 -48
- package/lib/polygon/models/extrude.js +87 -146
- package/lib/polygon/models/fill.js +50 -89
- package/lib/polygon/models/index.js +2 -14
- package/lib/polygon/models/ocean.js +42 -88
- package/lib/polygon/models/water.js +37 -82
- package/lib/raster/buffers/triangulation.js +3 -7
- package/lib/raster/index.js +9 -40
- package/lib/raster/models/index.js +0 -5
- package/lib/raster/models/raster.js +80 -125
- package/lib/raster/models/rasterRgb.js +84 -139
- package/lib/raster/models/rasterTerrainRgb.js +56 -93
- package/lib/tile/interaction/getRasterData.js +14 -25
- package/lib/tile/interaction/utils.js +7 -19
- package/lib/tile/manager/base.js +63 -104
- package/lib/tile/service/TileLayerService.js +33 -60
- package/lib/tile/service/TilePickService.js +26 -48
- package/lib/tile/service/TileSourceService.js +2 -16
- package/lib/tile/style/utils.js +0 -3
- package/lib/tile/tileFactory/DebugTile.js +29 -54
- package/lib/tile/tileFactory/ImageTile.js +20 -46
- package/lib/tile/tileFactory/MaskTile.js +22 -51
- package/lib/tile/tileFactory/RasterRGBTile.js +22 -50
- package/lib/tile/tileFactory/RasterTerrainRGBTile.js +20 -46
- package/lib/tile/tileFactory/RasterTile.js +30 -63
- package/lib/tile/tileFactory/Tile.js +63 -102
- package/lib/tile/tileFactory/VectorTile.js +41 -76
- package/lib/tile/tileFactory/index.js +0 -25
- package/lib/tile/tileFactory/layers/TileDebugLayer.js +6 -32
- package/lib/tile/tileFactory/util.js +0 -9
- package/lib/tile/tileLayer/BaseLayer.js +105 -153
- package/lib/tile/utils.js +1 -5
- package/lib/utils/blend.js +0 -5
- package/lib/utils/collision-index.js +9 -25
- package/lib/utils/extrude_polyline.js +101 -181
- package/lib/utils/grid-index.js +2 -28
- package/lib/utils/identityScale.js +0 -9
- package/lib/utils/layerData.js +30 -49
- package/lib/utils/multiPassRender.js +11 -16
- package/lib/utils/polylineNormal.js +31 -66
- package/lib/utils/simpleLine.js +2 -21
- package/lib/utils/stencil.js +0 -4
- package/lib/utils/symbol-layout.js +27 -55
- package/lib/wind/index.js +9 -37
- package/lib/wind/models/index.js +0 -3
- package/lib/wind/models/utils.js +26 -62
- package/lib/wind/models/wind.js +101 -157
- package/lib/wind/models/windRender.js +53 -71
- package/lib/wind/models/windShader.js +0 -1
- package/package.json +7 -7
|
@@ -1,90 +1,63 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
|
-
|
|
12
9
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
13
|
-
|
|
14
10
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
15
|
-
|
|
16
11
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
17
|
-
|
|
18
12
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
19
|
-
|
|
20
13
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
21
|
-
|
|
22
14
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
23
|
-
|
|
24
15
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
25
|
-
|
|
26
16
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
27
|
-
|
|
28
17
|
var _raster = _interopRequireDefault(require("../../raster"));
|
|
29
|
-
|
|
30
18
|
var _Tile2 = _interopRequireDefault(require("./Tile"));
|
|
31
|
-
|
|
32
19
|
var _excluded = ["rasterData"];
|
|
33
|
-
|
|
34
20
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
35
|
-
|
|
36
21
|
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; } }
|
|
37
|
-
|
|
38
22
|
var RasterTile = /*#__PURE__*/function (_Tile) {
|
|
39
23
|
(0, _inherits2.default)(RasterTile, _Tile);
|
|
40
|
-
|
|
41
24
|
var _super = _createSuper(RasterTile);
|
|
42
|
-
|
|
43
25
|
function RasterTile() {
|
|
44
26
|
(0, _classCallCheck2.default)(this, RasterTile);
|
|
45
27
|
return _super.apply(this, arguments);
|
|
46
28
|
}
|
|
47
|
-
|
|
48
29
|
(0, _createClass2.default)(RasterTile, [{
|
|
49
30
|
key: "initTileLayer",
|
|
50
31
|
value: function () {
|
|
51
32
|
var _initTileLayer = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
52
33
|
var attributes, layerOptions, sourceOptions, layer;
|
|
53
34
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
54
|
-
while (1) {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
this.isLoaded = true;
|
|
75
|
-
|
|
76
|
-
case 8:
|
|
77
|
-
case "end":
|
|
78
|
-
return _context.stop();
|
|
79
|
-
}
|
|
35
|
+
while (1) switch (_context.prev = _context.next) {
|
|
36
|
+
case 0:
|
|
37
|
+
attributes = this.parent.getLayerAttributeConfig();
|
|
38
|
+
layerOptions = this.getLayerOptions();
|
|
39
|
+
sourceOptions = this.getSourceOption();
|
|
40
|
+
layer = new _raster.default((0, _objectSpread2.default)({}, layerOptions)).source(sourceOptions.data, sourceOptions.options); // 初始化数据映射
|
|
41
|
+
// tslint:disable-next-line: no-unused-expression
|
|
42
|
+
attributes && Object.keys(attributes).forEach(function (type) {
|
|
43
|
+
var _attributes$attr, _attributes$attr2;
|
|
44
|
+
var attr = type;
|
|
45
|
+
// @ts-ignore
|
|
46
|
+
layer[attr]((_attributes$attr = attributes[attr]) === null || _attributes$attr === void 0 ? void 0 : _attributes$attr.field, (_attributes$attr2 = attributes[attr]) === null || _attributes$attr2 === void 0 ? void 0 : _attributes$attr2.values);
|
|
47
|
+
});
|
|
48
|
+
_context.next = 7;
|
|
49
|
+
return this.addLayer(layer);
|
|
50
|
+
case 7:
|
|
51
|
+
this.isLoaded = true;
|
|
52
|
+
case 8:
|
|
53
|
+
case "end":
|
|
54
|
+
return _context.stop();
|
|
80
55
|
}
|
|
81
56
|
}, _callee, this);
|
|
82
57
|
}));
|
|
83
|
-
|
|
84
58
|
function initTileLayer() {
|
|
85
59
|
return _initTileLayer.apply(this, arguments);
|
|
86
60
|
}
|
|
87
|
-
|
|
88
61
|
return initTileLayer;
|
|
89
62
|
}()
|
|
90
63
|
}, {
|
|
@@ -92,8 +65,8 @@ var RasterTile = /*#__PURE__*/function (_Tile) {
|
|
|
92
65
|
value: function getSourceOption() {
|
|
93
66
|
var rawSource = this.parent.getSource();
|
|
94
67
|
var _this$sourceTile$data = this.sourceTile.data.data,
|
|
95
|
-
|
|
96
|
-
|
|
68
|
+
rasterData = _this$sourceTile$data.rasterData,
|
|
69
|
+
res = (0, _objectWithoutProperties2.default)(_this$sourceTile$data, _excluded);
|
|
97
70
|
return {
|
|
98
71
|
data: rasterData,
|
|
99
72
|
// 栅格数
|
|
@@ -109,5 +82,4 @@ var RasterTile = /*#__PURE__*/function (_Tile) {
|
|
|
109
82
|
}]);
|
|
110
83
|
return RasterTile;
|
|
111
84
|
}(_Tile2.default);
|
|
112
|
-
|
|
113
85
|
exports.default = RasterTile;
|
|
@@ -1,86 +1,61 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
11
|
-
|
|
12
9
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
13
|
-
|
|
14
10
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
15
|
-
|
|
16
11
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
17
|
-
|
|
18
12
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
19
|
-
|
|
20
13
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
21
|
-
|
|
22
14
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
23
|
-
|
|
24
15
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
25
|
-
|
|
26
16
|
var _raster = _interopRequireDefault(require("../../raster"));
|
|
27
|
-
|
|
28
17
|
var _Tile2 = _interopRequireDefault(require("./Tile"));
|
|
29
|
-
|
|
30
18
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
31
|
-
|
|
32
19
|
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; } }
|
|
33
|
-
|
|
34
20
|
var RasterTerrainRGBTile = /*#__PURE__*/function (_Tile) {
|
|
35
21
|
(0, _inherits2.default)(RasterTerrainRGBTile, _Tile);
|
|
36
|
-
|
|
37
22
|
var _super = _createSuper(RasterTerrainRGBTile);
|
|
38
|
-
|
|
39
23
|
function RasterTerrainRGBTile() {
|
|
40
24
|
(0, _classCallCheck2.default)(this, RasterTerrainRGBTile);
|
|
41
25
|
return _super.apply(this, arguments);
|
|
42
26
|
}
|
|
43
|
-
|
|
44
27
|
(0, _createClass2.default)(RasterTerrainRGBTile, [{
|
|
45
28
|
key: "initTileLayer",
|
|
46
29
|
value: function () {
|
|
47
30
|
var _initTileLayer = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
48
31
|
var attributes, layerOptions, sourceOptions, layer;
|
|
49
32
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
50
|
-
while (1) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
this.isLoaded = true;
|
|
71
|
-
|
|
72
|
-
case 8:
|
|
73
|
-
case "end":
|
|
74
|
-
return _context.stop();
|
|
75
|
-
}
|
|
33
|
+
while (1) switch (_context.prev = _context.next) {
|
|
34
|
+
case 0:
|
|
35
|
+
attributes = this.parent.getLayerAttributeConfig();
|
|
36
|
+
layerOptions = this.getLayerOptions();
|
|
37
|
+
sourceOptions = this.getSourceOption();
|
|
38
|
+
layer = new _raster.default((0, _objectSpread2.default)({}, layerOptions)).source(sourceOptions.data, sourceOptions.options); // 初始化数据映射
|
|
39
|
+
// tslint:disable-next-line: no-unused-expression
|
|
40
|
+
attributes && Object.keys(attributes).forEach(function (type) {
|
|
41
|
+
var _attributes$attr, _attributes$attr2;
|
|
42
|
+
var attr = type;
|
|
43
|
+
// @ts-ignore
|
|
44
|
+
layer[attr]((_attributes$attr = attributes[attr]) === null || _attributes$attr === void 0 ? void 0 : _attributes$attr.field, (_attributes$attr2 = attributes[attr]) === null || _attributes$attr2 === void 0 ? void 0 : _attributes$attr2.values);
|
|
45
|
+
});
|
|
46
|
+
_context.next = 7;
|
|
47
|
+
return this.addLayer(layer);
|
|
48
|
+
case 7:
|
|
49
|
+
this.isLoaded = true;
|
|
50
|
+
case 8:
|
|
51
|
+
case "end":
|
|
52
|
+
return _context.stop();
|
|
76
53
|
}
|
|
77
54
|
}, _callee, this);
|
|
78
55
|
}));
|
|
79
|
-
|
|
80
56
|
function initTileLayer() {
|
|
81
57
|
return _initTileLayer.apply(this, arguments);
|
|
82
58
|
}
|
|
83
|
-
|
|
84
59
|
return initTileLayer;
|
|
85
60
|
}()
|
|
86
61
|
}, {
|
|
@@ -101,5 +76,4 @@ var RasterTerrainRGBTile = /*#__PURE__*/function (_Tile) {
|
|
|
101
76
|
}]);
|
|
102
77
|
return RasterTerrainRGBTile;
|
|
103
78
|
}(_Tile2.default);
|
|
104
|
-
|
|
105
79
|
exports.default = RasterTerrainRGBTile;
|
|
@@ -1,102 +1,72 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
|
-
|
|
12
9
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
13
|
-
|
|
14
10
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
15
|
-
|
|
16
11
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
17
|
-
|
|
18
12
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
19
|
-
|
|
20
13
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
21
|
-
|
|
22
14
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
23
|
-
|
|
24
15
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
25
|
-
|
|
26
16
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
27
|
-
|
|
28
17
|
var _l7Utils = require("@antv/l7-utils");
|
|
29
|
-
|
|
30
18
|
var _raster = _interopRequireDefault(require("../../raster"));
|
|
31
|
-
|
|
32
19
|
var _Tile2 = _interopRequireDefault(require("./Tile"));
|
|
33
|
-
|
|
34
20
|
var _excluded = ["rasterData"];
|
|
35
|
-
|
|
36
21
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
37
|
-
|
|
38
22
|
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; } }
|
|
39
|
-
|
|
40
23
|
var DEFAULT_COLOR_TEXTURE_OPTION = {
|
|
41
24
|
positions: [0, 1],
|
|
42
25
|
colors: ['#000', '#fff']
|
|
43
26
|
};
|
|
44
|
-
|
|
45
27
|
var RasterTile = /*#__PURE__*/function (_Tile) {
|
|
46
28
|
(0, _inherits2.default)(RasterTile, _Tile);
|
|
47
|
-
|
|
48
29
|
var _super = _createSuper(RasterTile);
|
|
49
|
-
|
|
50
30
|
function RasterTile() {
|
|
51
31
|
(0, _classCallCheck2.default)(this, RasterTile);
|
|
52
32
|
return _super.apply(this, arguments);
|
|
53
33
|
}
|
|
54
|
-
|
|
55
34
|
(0, _createClass2.default)(RasterTile, [{
|
|
56
35
|
key: "initTileLayer",
|
|
57
36
|
value: function () {
|
|
58
37
|
var _initTileLayer = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
59
38
|
var attributes, layerOptions, sourceOptions, _ref, rampColors, domain, layer;
|
|
60
|
-
|
|
61
39
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
62
|
-
while (1) {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
this.isLoaded = true;
|
|
87
|
-
|
|
88
|
-
case 10:
|
|
89
|
-
case "end":
|
|
90
|
-
return _context.stop();
|
|
91
|
-
}
|
|
40
|
+
while (1) switch (_context.prev = _context.next) {
|
|
41
|
+
case 0:
|
|
42
|
+
attributes = this.parent.getLayerAttributeConfig();
|
|
43
|
+
layerOptions = this.getLayerOptions();
|
|
44
|
+
sourceOptions = this.getSourceOption();
|
|
45
|
+
_ref = this.getLayerOptions(), rampColors = _ref.rampColors, domain = _ref.domain;
|
|
46
|
+
this.colorTexture = this.parent.textureService.getColorTexture(rampColors, domain);
|
|
47
|
+
layer = new _raster.default((0, _objectSpread2.default)((0, _objectSpread2.default)({}, layerOptions), {}, {
|
|
48
|
+
colorTexture: this.colorTexture
|
|
49
|
+
})).source(sourceOptions.data, sourceOptions.options); // 初始化数据映射
|
|
50
|
+
// tslint:disable-next-line: no-unused-expression
|
|
51
|
+
attributes && Object.keys(attributes).forEach(function (type) {
|
|
52
|
+
var _attributes$attr, _attributes$attr2;
|
|
53
|
+
var attr = type;
|
|
54
|
+
// @ts-ignore
|
|
55
|
+
layer[attr]((_attributes$attr = attributes[attr]) === null || _attributes$attr === void 0 ? void 0 : _attributes$attr.field, (_attributes$attr2 = attributes[attr]) === null || _attributes$attr2 === void 0 ? void 0 : _attributes$attr2.values);
|
|
56
|
+
});
|
|
57
|
+
_context.next = 9;
|
|
58
|
+
return this.addLayer(layer);
|
|
59
|
+
case 9:
|
|
60
|
+
this.isLoaded = true;
|
|
61
|
+
case 10:
|
|
62
|
+
case "end":
|
|
63
|
+
return _context.stop();
|
|
92
64
|
}
|
|
93
65
|
}, _callee, this);
|
|
94
66
|
}));
|
|
95
|
-
|
|
96
67
|
function initTileLayer() {
|
|
97
68
|
return _initTileLayer.apply(this, arguments);
|
|
98
69
|
}
|
|
99
|
-
|
|
100
70
|
return initTileLayer;
|
|
101
71
|
}()
|
|
102
72
|
}, {
|
|
@@ -104,8 +74,8 @@ var RasterTile = /*#__PURE__*/function (_Tile) {
|
|
|
104
74
|
value: function getSourceOption() {
|
|
105
75
|
var rawSource = this.parent.getSource();
|
|
106
76
|
var _this$sourceTile$data = this.sourceTile.data.data,
|
|
107
|
-
|
|
108
|
-
|
|
77
|
+
rasterData = _this$sourceTile$data.rasterData,
|
|
78
|
+
res = (0, _objectWithoutProperties2.default)(_this$sourceTile$data, _excluded);
|
|
109
79
|
return {
|
|
110
80
|
data: rasterData,
|
|
111
81
|
options: {
|
|
@@ -117,24 +87,22 @@ var RasterTile = /*#__PURE__*/function (_Tile) {
|
|
|
117
87
|
}
|
|
118
88
|
};
|
|
119
89
|
}
|
|
90
|
+
|
|
120
91
|
/**
|
|
121
92
|
* 用于 style 更新 colorTexture 的优化
|
|
122
93
|
* @param arg
|
|
123
94
|
*/
|
|
124
|
-
|
|
125
95
|
}, {
|
|
126
96
|
key: "styleUpdate",
|
|
127
97
|
value: function styleUpdate() {
|
|
128
98
|
var _this = this;
|
|
129
|
-
|
|
130
99
|
for (var _len = arguments.length, arg = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
131
100
|
arg[_key] = arguments[_key];
|
|
132
101
|
}
|
|
133
|
-
|
|
134
102
|
var _ref2 = arg,
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
103
|
+
_ref2$rampColors = _ref2.rampColors,
|
|
104
|
+
rampColors = _ref2$rampColors === void 0 ? DEFAULT_COLOR_TEXTURE_OPTION : _ref2$rampColors,
|
|
105
|
+
domain = _ref2.domain;
|
|
138
106
|
this.colorTexture = this.parent.textureService.getColorTexture(rampColors, domain || (0, _l7Utils.getDefaultDomain)(rampColors));
|
|
139
107
|
this.layers.forEach(function (layer) {
|
|
140
108
|
return layer.style({
|
|
@@ -152,5 +120,4 @@ var RasterTile = /*#__PURE__*/function (_Tile) {
|
|
|
152
120
|
}]);
|
|
153
121
|
return RasterTile;
|
|
154
122
|
}(_Tile2.default);
|
|
155
|
-
|
|
156
123
|
exports.default = RasterTile;
|