@antv/l7-layers 2.17.4 → 2.17.6
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
|
@@ -8,120 +8,86 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConst
|
|
|
8
8
|
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
9
9
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
10
10
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
11
|
-
|
|
12
11
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
13
|
-
|
|
14
12
|
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; } }
|
|
15
|
-
|
|
16
13
|
import BaseModel from "../../core/BaseModel";
|
|
17
14
|
import { CanvasUpdateType } from "../../core/interface";
|
|
18
|
-
|
|
19
15
|
var CanvaModel = /*#__PURE__*/function (_BaseModel) {
|
|
20
16
|
_inherits(CanvaModel, _BaseModel);
|
|
21
|
-
|
|
22
17
|
var _super = _createSuper(CanvaModel);
|
|
23
|
-
|
|
24
18
|
function CanvaModel() {
|
|
25
19
|
var _this;
|
|
26
|
-
|
|
27
20
|
_classCallCheck(this, CanvaModel);
|
|
28
|
-
|
|
29
21
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
30
22
|
args[_key] = arguments[_key];
|
|
31
23
|
}
|
|
32
|
-
|
|
33
24
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
34
|
-
|
|
35
25
|
_defineProperty(_assertThisInitialized(_this), "updateMode", CanvasUpdateType.ALWAYS);
|
|
36
|
-
|
|
37
26
|
_defineProperty(_assertThisInitialized(_this), "renderUpdate", function () {
|
|
38
27
|
var _ref = _this.layer.getLayerConfig(),
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
28
|
+
_ref$zIndex = _ref.zIndex,
|
|
29
|
+
zIndex = _ref$zIndex === void 0 ? 10 : _ref$zIndex,
|
|
30
|
+
_ref$update = _ref.update,
|
|
31
|
+
update = _ref$update === void 0 ? CanvasUpdateType.ALWAYS : _ref$update,
|
|
32
|
+
_ref$animateOption = _ref.animateOption,
|
|
33
|
+
animateOption = _ref$animateOption === void 0 ? {
|
|
34
|
+
enable: false,
|
|
35
|
+
duration: 20
|
|
36
|
+
} : _ref$animateOption;
|
|
49
37
|
if (+_this.canvas.style.zIndex === zIndex) {
|
|
50
38
|
_this.canvas.style.zIndex = zIndex + '';
|
|
51
39
|
}
|
|
52
|
-
|
|
53
40
|
if (_this.updateMode !== update) {
|
|
54
41
|
_this.updateMode = update;
|
|
55
|
-
|
|
56
42
|
_this.unBindListener();
|
|
57
|
-
|
|
58
43
|
_this.bindListener();
|
|
59
44
|
}
|
|
60
|
-
|
|
61
45
|
if (_this.updateMode === CanvasUpdateType.ALWAYS && animateOption.enable) {
|
|
62
46
|
_this.renderCanvas();
|
|
63
47
|
}
|
|
64
48
|
});
|
|
65
|
-
|
|
66
49
|
_defineProperty(_assertThisInitialized(_this), "unBindListener", function () {
|
|
67
50
|
_this.mapService.off('mapchange', _this.renderCanvas);
|
|
68
|
-
|
|
69
51
|
_this.mapService.off('zoomstart', _this.clearCanvas);
|
|
70
|
-
|
|
71
52
|
_this.mapService.off('zoomend', _this.renderCanvas);
|
|
72
|
-
|
|
73
53
|
_this.mapService.off('movestart', _this.clearCanvas);
|
|
74
|
-
|
|
75
54
|
_this.mapService.off('moveend', _this.renderCanvas);
|
|
76
55
|
});
|
|
77
|
-
|
|
78
56
|
_defineProperty(_assertThisInitialized(_this), "bindListener", function () {
|
|
79
57
|
if (_this.updateMode === CanvasUpdateType.ALWAYS) {
|
|
80
58
|
_this.mapService.on('mapchange', _this.renderCanvas);
|
|
81
59
|
} else {
|
|
82
60
|
_this.mapService.on('zoomstart', _this.clearCanvas);
|
|
83
|
-
|
|
84
61
|
_this.mapService.on('zoomend', _this.renderCanvas);
|
|
85
|
-
|
|
86
62
|
_this.mapService.on('movestart', _this.clearCanvas);
|
|
87
|
-
|
|
88
63
|
_this.mapService.on('moveend', _this.renderCanvas);
|
|
89
64
|
}
|
|
90
65
|
});
|
|
91
|
-
|
|
92
66
|
_defineProperty(_assertThisInitialized(_this), "clearCanvas", function () {
|
|
93
67
|
if (_this.ctx) {
|
|
94
68
|
var _this$rendererService = _this.rendererService.getViewportSize(),
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
69
|
+
w = _this$rendererService.width,
|
|
70
|
+
h = _this$rendererService.height;
|
|
98
71
|
_this.ctx.clearRect(0, 0, w, h);
|
|
99
72
|
}
|
|
100
73
|
});
|
|
101
|
-
|
|
102
74
|
_defineProperty(_assertThisInitialized(_this), "renderCanvas", function () {
|
|
103
75
|
var _this$rendererService2 = _this.rendererService.getViewportSize(),
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
76
|
+
viewWidth = _this$rendererService2.width,
|
|
77
|
+
viewHeight = _this$rendererService2.height;
|
|
107
78
|
if (_this.prevSize[0] !== viewWidth || _this.prevSize[1] !== viewHeight) {
|
|
108
79
|
_this.prevSize = [viewWidth, viewHeight];
|
|
109
|
-
|
|
110
80
|
var size = _this.mapService.getSize();
|
|
111
|
-
|
|
112
81
|
var _size = _slicedToArray(size, 2),
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
82
|
+
width = _size[0],
|
|
83
|
+
height = _size[1];
|
|
116
84
|
_this.canvas.width = viewWidth;
|
|
117
85
|
_this.canvas.height = viewHeight;
|
|
118
86
|
_this.canvas.style.width = width + 'px';
|
|
119
87
|
_this.canvas.style.height = height + 'px';
|
|
120
88
|
}
|
|
121
|
-
|
|
122
89
|
var _ref2 = _this.layer.getLayerConfig(),
|
|
123
|
-
|
|
124
|
-
|
|
90
|
+
drawingOnCanvas = _ref2.drawingOnCanvas;
|
|
125
91
|
if (_this.ctx) {
|
|
126
92
|
drawingOnCanvas({
|
|
127
93
|
canvas: _this.canvas,
|
|
@@ -131,21 +97,17 @@ var CanvaModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
131
97
|
});
|
|
132
98
|
}
|
|
133
99
|
});
|
|
134
|
-
|
|
135
100
|
return _this;
|
|
136
101
|
}
|
|
137
|
-
|
|
138
102
|
_createClass(CanvaModel, [{
|
|
139
103
|
key: "clearModels",
|
|
140
104
|
value: function clearModels() {
|
|
141
105
|
if (this.canvas) {
|
|
142
106
|
var _this$mapService$getC;
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
107
|
+
(_this$mapService$getC = this.mapService.getContainer()) === null || _this$mapService$getC === void 0 ? void 0 : _this$mapService$getC.removeChild(this.canvas);
|
|
108
|
+
// @ts-ignore
|
|
146
109
|
this.canvas = null;
|
|
147
110
|
}
|
|
148
|
-
|
|
149
111
|
this.unBindListener();
|
|
150
112
|
}
|
|
151
113
|
}, {
|
|
@@ -153,51 +115,40 @@ var CanvaModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
153
115
|
value: function () {
|
|
154
116
|
var _initModels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
155
117
|
var _ref3, _ref3$update, update;
|
|
156
|
-
|
|
157
118
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
158
|
-
while (1) {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
case "end":
|
|
171
|
-
return _context.stop();
|
|
172
|
-
}
|
|
119
|
+
while (1) switch (_context.prev = _context.next) {
|
|
120
|
+
case 0:
|
|
121
|
+
_ref3 = this.layer.getLayerConfig(), _ref3$update = _ref3.update, update = _ref3$update === void 0 ? CanvasUpdateType.ALWAYS : _ref3$update;
|
|
122
|
+
this.updateMode = update;
|
|
123
|
+
this.initCanvas();
|
|
124
|
+
this.renderCanvas();
|
|
125
|
+
this.bindListener();
|
|
126
|
+
this.mapService.getContainer();
|
|
127
|
+
return _context.abrupt("return", []);
|
|
128
|
+
case 7:
|
|
129
|
+
case "end":
|
|
130
|
+
return _context.stop();
|
|
173
131
|
}
|
|
174
132
|
}, _callee, this);
|
|
175
133
|
}));
|
|
176
|
-
|
|
177
134
|
function initModels() {
|
|
178
135
|
return _initModels.apply(this, arguments);
|
|
179
136
|
}
|
|
180
|
-
|
|
181
137
|
return initModels;
|
|
182
138
|
}()
|
|
183
139
|
}, {
|
|
184
140
|
key: "initCanvas",
|
|
185
141
|
value: function initCanvas() {
|
|
186
142
|
var _this$mapService$getC2;
|
|
187
|
-
|
|
188
143
|
var _ref4 = this.layer.getLayerConfig(),
|
|
189
|
-
|
|
190
|
-
|
|
144
|
+
zIndex = _ref4.zIndex;
|
|
191
145
|
var size = this.mapService.getSize();
|
|
192
|
-
|
|
193
146
|
var _size2 = _slicedToArray(size, 2),
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
147
|
+
width = _size2[0],
|
|
148
|
+
height = _size2[1];
|
|
197
149
|
var _this$rendererService3 = this.rendererService.getViewportSize(),
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
150
|
+
viewWidth = _this$rendererService3.width,
|
|
151
|
+
viewHeight = _this$rendererService3.height;
|
|
201
152
|
this.prevSize = [viewWidth, viewHeight];
|
|
202
153
|
var canvas = document.createElement('canvas');
|
|
203
154
|
this.canvas = canvas;
|
|
@@ -219,23 +170,18 @@ var CanvaModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
219
170
|
value: function () {
|
|
220
171
|
var _buildModels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
221
172
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
222
|
-
while (1) {
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
case "end":
|
|
229
|
-
return _context2.stop();
|
|
230
|
-
}
|
|
173
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
174
|
+
case 0:
|
|
175
|
+
return _context2.abrupt("return", this.initModels());
|
|
176
|
+
case 1:
|
|
177
|
+
case "end":
|
|
178
|
+
return _context2.stop();
|
|
231
179
|
}
|
|
232
180
|
}, _callee2, this);
|
|
233
181
|
}));
|
|
234
|
-
|
|
235
182
|
function buildModels() {
|
|
236
183
|
return _buildModels.apply(this, arguments);
|
|
237
184
|
}
|
|
238
|
-
|
|
239
185
|
return buildModels;
|
|
240
186
|
}()
|
|
241
187
|
}, {
|
|
@@ -244,8 +190,6 @@ var CanvaModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
244
190
|
return;
|
|
245
191
|
}
|
|
246
192
|
}]);
|
|
247
|
-
|
|
248
193
|
return CanvaModel;
|
|
249
194
|
}(BaseModel);
|
|
250
|
-
|
|
251
195
|
export { CanvaModel as default };
|
|
@@ -7,59 +7,42 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConst
|
|
|
7
7
|
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
8
8
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
9
9
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
10
|
-
|
|
11
10
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
12
|
-
|
|
13
11
|
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; } }
|
|
14
|
-
|
|
15
12
|
import BaseLayer from "../core/BaseLayer";
|
|
16
13
|
import CityBuildModel from "./models/build";
|
|
17
|
-
|
|
18
14
|
var CityBuildingLayer = /*#__PURE__*/function (_BaseLayer) {
|
|
19
15
|
_inherits(CityBuildingLayer, _BaseLayer);
|
|
20
|
-
|
|
21
16
|
var _super = _createSuper(CityBuildingLayer);
|
|
22
|
-
|
|
23
17
|
function CityBuildingLayer() {
|
|
24
18
|
var _this;
|
|
25
|
-
|
|
26
19
|
_classCallCheck(this, CityBuildingLayer);
|
|
27
|
-
|
|
28
20
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
29
21
|
args[_key] = arguments[_key];
|
|
30
22
|
}
|
|
31
|
-
|
|
32
23
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
33
|
-
|
|
34
24
|
_defineProperty(_assertThisInitialized(_this), "type", 'CityBuildingLayer');
|
|
35
|
-
|
|
36
25
|
return _this;
|
|
37
26
|
}
|
|
38
|
-
|
|
39
27
|
_createClass(CityBuildingLayer, [{
|
|
40
28
|
key: "buildModels",
|
|
41
29
|
value: function () {
|
|
42
30
|
var _buildModels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
43
31
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
44
|
-
while (1) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
case "end":
|
|
53
|
-
return _context.stop();
|
|
54
|
-
}
|
|
32
|
+
while (1) switch (_context.prev = _context.next) {
|
|
33
|
+
case 0:
|
|
34
|
+
this.layerModel = new CityBuildModel(this);
|
|
35
|
+
_context.next = 3;
|
|
36
|
+
return this.initLayerModels();
|
|
37
|
+
case 3:
|
|
38
|
+
case "end":
|
|
39
|
+
return _context.stop();
|
|
55
40
|
}
|
|
56
41
|
}, _callee, this);
|
|
57
42
|
}));
|
|
58
|
-
|
|
59
43
|
function buildModels() {
|
|
60
44
|
return _buildModels.apply(this, arguments);
|
|
61
45
|
}
|
|
62
|
-
|
|
63
46
|
return buildModels;
|
|
64
47
|
}()
|
|
65
48
|
}, {
|
|
@@ -75,8 +58,6 @@ var CityBuildingLayer = /*#__PURE__*/function (_BaseLayer) {
|
|
|
75
58
|
return 'citybuilding';
|
|
76
59
|
}
|
|
77
60
|
}]);
|
|
78
|
-
|
|
79
61
|
return CityBuildingLayer;
|
|
80
62
|
}(BaseLayer);
|
|
81
|
-
|
|
82
63
|
export { CityBuildingLayer as default };
|
|
@@ -6,56 +6,45 @@ import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
|
6
6
|
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
|
|
7
7
|
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
8
8
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
9
|
-
|
|
10
9
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
11
|
-
|
|
12
10
|
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; } }
|
|
13
|
-
|
|
14
11
|
import { AttributeType, gl } from '@antv/l7-core';
|
|
15
12
|
import { rgb2arr } from '@antv/l7-utils';
|
|
16
13
|
import BaseModel from "../../core/BaseModel";
|
|
17
14
|
import { PolygonExtrudeTriangulation } from "../../core/triangulation";
|
|
18
|
-
|
|
19
15
|
/* babel-plugin-inline-import '../shaders/build_frag.glsl' */
|
|
20
16
|
var buildFrag = "uniform float u_opacity: 1.0;\nuniform vec4 u_baseColor : [ 1.0, 0, 0, 1.0 ];\nuniform vec4 u_brightColor : [ 1.0, 0, 0, 1.0 ];\nuniform vec4 u_windowColor : [ 1.0, 0, 0, 1.0 ];\nuniform float u_near : 0;\nuniform float u_far : 1;\nvarying vec4 v_Color;\nvarying vec2 v_texCoord;\nuniform float u_Zoom : 1;\nuniform float u_time;\n\nuniform float u_circleSweep;\nuniform float u_cityMinSize;\nuniform vec3 u_circleSweepColor;\nuniform float u_circleSweepSpeed;\n\nvarying float v_worldDis;\n\n#pragma include \"picking\"\n\nvec3 getWindowColor(float n, float hot, vec3 brightColor, vec3 darkColor) {\n float s = step(hot, n);\n vec3 color = mix(brightColor,vec3(0.9,0.9,1.0),n);\n\n return mix(darkColor, color, s);\n}\nfloat random (vec2 st) {\n return fract(sin(dot(st.xy, vec2(12.9898,78.233)))* 43758.5453123);\n}\n\nfloat LinearizeDepth()\n{\n float z = gl_FragCoord.z * 2.0 - 1.0;\n return (2.0 * u_near * u_far) / (u_far + u_near - z * (u_far - u_near));\n}\n\nvec3 fog(vec3 color, vec3 fogColor, float depth){\n float fogFactor=clamp(depth,0.0,1.0);\n vec3 output_color=mix(fogColor,color,fogFactor);\n return output_color;\n}\n\nfloat sdRect(vec2 p, vec2 sz) {\n vec2 d = abs(p) - sz;\n float outside = length(max(d, 0.));\n float inside = min(max(d.x, d.y), 0.);\n return outside + inside;\n}\n\nvoid main() {\n gl_FragColor = v_Color;\n vec3 baseColor = u_baseColor.xyz;\n vec3 brightColor = u_brightColor.xyz;\n vec3 windowColor = u_windowColor.xyz;\n float targetColId = 5.;\n float depth = 1.0 - LinearizeDepth() / u_far * u_Zoom;\n vec3 fogColor = vec3(23.0/255.0,31.0/255.0,51.0/255.0);\n if(v_texCoord.x < 0.) { //\u9876\u90E8\u989C\u8272\n vec3 foggedColor = fog(baseColor.xyz + vec3(0.12*0.9,0.2*0.9,0.3*0.9),fogColor,depth);\n gl_FragColor = vec4( foggedColor, v_Color.w);\n }else { // \u4FA7\u9762\u989C\u8272\n vec2 st = v_texCoord;\n vec2 UvScale = v_texCoord;\n float tStep = min(0.08,max(0.05* (18.0-u_Zoom),0.02));\n float tStart = 0.25 * tStep;\n float tEnd = 0.75 * tStep;\n float u = mod(UvScale.x, tStep);\n float v = mod(UvScale.y, tStep);\n float ux = floor(UvScale.x/tStep);\n float uy = floor(UvScale.y/tStep);\n float n = random(vec2(ux,uy));\n float lightP = u_time;\n float head = 1.0- step(0.005,st.y);\n /*step3*/\n // \u5C06\u7A97\u6237\u989C\u8272\u548C\u5899\u9762\u989C\u8272\u533A\u522B\u5F00\u6765\n float sU = step(tStart, u) - step(tEnd, u);\n float sV = step(tStart, v) - step(tEnd, v);\n vec2 windowSize = vec2(abs(tEnd-tStart),abs(tEnd-tStart));\n float dist = sdRect(vec2(u,v), windowSize);\n float s = sU * sV;\n\n float curColId = floor(UvScale.x / tStep);\n float sCol = step(targetColId - 0.2, curColId) - step(targetColId + 0.2, curColId);\n\n float mLightP = mod(lightP, 2.);\n float sRow = step(mLightP - 0.2, st.y) - step(mLightP, st.y);\n if(ux == targetColId){\n n =0.;\n }\n float timeP = min(0.75, abs ( sin(u_time/3.0) ) );\n float hot = smoothstep(1.0,0.0,timeP);\n vec3 color = mix(baseColor, getWindowColor(n,hot,brightColor,windowColor), s);\n //vec3 color = mix(baseColor, getWindowColor(n,hot,brightColor,windowColor), 1.0);\n float sFinal = s * sCol * sRow;\n color += mix(baseColor, brightColor, sFinal*n);\n if (st.y<0.01){\n color = baseColor;\n }\n if(head ==1.0) { // \u9876\u90E8\u4EAE\u7EBF\n color = brightColor;\n }\n color = color * v_Color.rgb;\n\n vec3 foggedColor = fog(color,fogColor,depth);\n\n gl_FragColor = vec4(foggedColor,1.0);\n }\n\n\n if(u_circleSweep > 0.0 && v_worldDis < u_cityMinSize) {\n float r = fract(((v_worldDis/u_cityMinSize) - u_time * u_circleSweepSpeed) * 2.0);\n gl_FragColor.rgb += r * r * u_circleSweepColor;\n }\n \n gl_FragColor.a *= u_opacity;\n gl_FragColor = filterColor(gl_FragColor);\n}\n";
|
|
21
|
-
|
|
22
17
|
/* babel-plugin-inline-import '../shaders/build_vert.glsl' */
|
|
23
18
|
var buildVert = "precision highp float;\n\n#define ambientRatio 0.5\n#define diffuseRatio 0.3\n#define specularRatio 0.2\n\nattribute vec4 a_Color;\nattribute vec3 a_Position;\nattribute vec3 a_Normal;\nattribute float a_Size;\nuniform mat4 u_ModelMatrix;\n\nattribute vec2 a_Uv;\nvarying vec2 v_texCoord;\n\nvarying vec4 v_Color;\nuniform mat4 u_Mvp;\n\nuniform float u_circleSweep;\nuniform vec2 u_cityCenter;\n\nvarying float v_worldDis;\n\n#pragma include \"projection\"\n#pragma include \"light\"\n#pragma include \"picking\"\n\n\nvoid main() {\n vec4 pos = vec4(a_Position.xy, a_Position.z * a_Size, 1.0);\n vec4 project_pos = project_position(pos);\n\n v_texCoord = a_Uv;\n\n if(u_circleSweep > 0.0) {\n vec2 lnglatscale = vec2(0.0);\n if(u_CoordinateSystem != COORDINATE_SYSTEM_P20_2) {\n lnglatscale = (a_Position.xy - u_cityCenter) * vec2(0.0, 0.135);\n }\n v_worldDis = length(a_Position.xy + lnglatscale - u_cityCenter);\n }\n \n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(project_pos.xyz, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n }\n\n float lightWeight = calc_lighting(pos);\n // v_Color = a_Color;\n v_Color = vec4(a_Color.rgb * lightWeight, a_Color.w);\n\n setPickingColor(a_PickingColor);\n}\n";
|
|
24
|
-
|
|
25
19
|
var CityBuildModel = /*#__PURE__*/function (_BaseModel) {
|
|
26
20
|
_inherits(CityBuildModel, _BaseModel);
|
|
27
|
-
|
|
28
21
|
var _super = _createSuper(CityBuildModel);
|
|
29
|
-
|
|
30
22
|
function CityBuildModel() {
|
|
31
23
|
_classCallCheck(this, CityBuildModel);
|
|
32
|
-
|
|
33
24
|
return _super.apply(this, arguments);
|
|
34
25
|
}
|
|
35
|
-
|
|
36
26
|
_createClass(CityBuildModel, [{
|
|
37
27
|
key: "getUninforms",
|
|
38
28
|
value: function getUninforms() {
|
|
39
29
|
var _ref = this.layer.getLayerConfig(),
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
30
|
+
_ref$opacity = _ref.opacity,
|
|
31
|
+
opacity = _ref$opacity === void 0 ? 1 : _ref$opacity,
|
|
32
|
+
_ref$baseColor = _ref.baseColor,
|
|
33
|
+
baseColor = _ref$baseColor === void 0 ? 'rgb(16,16,16)' : _ref$baseColor,
|
|
34
|
+
_ref$brightColor = _ref.brightColor,
|
|
35
|
+
brightColor = _ref$brightColor === void 0 ? 'rgb(255,176,38)' : _ref$brightColor,
|
|
36
|
+
_ref$windowColor = _ref.windowColor,
|
|
37
|
+
windowColor = _ref$windowColor === void 0 ? 'rgb(30,60,89)' : _ref$windowColor,
|
|
38
|
+
_ref$time = _ref.time,
|
|
39
|
+
time = _ref$time === void 0 ? 0 : _ref$time,
|
|
40
|
+
_ref$sweep = _ref.sweep,
|
|
41
|
+
sweep = _ref$sweep === void 0 ? {
|
|
42
|
+
enable: false,
|
|
43
|
+
sweepRadius: 1,
|
|
44
|
+
sweepColor: 'rgb(255, 255, 255)',
|
|
45
|
+
sweepSpeed: 0.4,
|
|
46
|
+
sweepCenter: this.cityCenter
|
|
47
|
+
} : _ref$sweep;
|
|
59
48
|
return {
|
|
60
49
|
u_cityCenter: sweep.sweepCenter || this.cityCenter,
|
|
61
50
|
u_cityMinSize: this.cityMinSize * sweep.sweepRadius,
|
|
@@ -74,17 +63,16 @@ var CityBuildModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
74
63
|
value: function calCityGeo() {
|
|
75
64
|
// @ts-ignore
|
|
76
65
|
var _this$layer$getSource = _slicedToArray(this.layer.getSource().extent, 4),
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
66
|
+
minLng = _this$layer$getSource[0],
|
|
67
|
+
minLat = _this$layer$getSource[1],
|
|
68
|
+
maxLng = _this$layer$getSource[2],
|
|
69
|
+
maxLat = _this$layer$getSource[3];
|
|
82
70
|
if (this.mapService.version === 'GAODE2.x') {
|
|
83
71
|
// @ts-ignore
|
|
84
|
-
this.cityCenter = this.mapService.lngLatToCoord([(maxLng + minLng) / 2, (maxLat + minLat) / 2]);
|
|
85
|
-
|
|
86
|
-
var l1 = this.mapService.lngLatToCoord([maxLng, maxLat]);
|
|
87
|
-
|
|
72
|
+
this.cityCenter = this.mapService.lngLatToCoord([(maxLng + minLng) / 2, (maxLat + minLat) / 2]);
|
|
73
|
+
// @ts-ignore
|
|
74
|
+
var l1 = this.mapService.lngLatToCoord([maxLng, maxLat]);
|
|
75
|
+
// @ts-ignore
|
|
88
76
|
var l2 = this.mapService.lngLatToCoord([minLng, minLat]);
|
|
89
77
|
this.cityMinSize = Math.sqrt(Math.pow(l1[0] - l2[0], 2) + Math.pow(l1[1] - l2[1], 2)) / 4;
|
|
90
78
|
} else {
|
|
@@ -99,25 +87,20 @@ var CityBuildModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
99
87
|
value: function () {
|
|
100
88
|
var _initModels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
101
89
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
102
|
-
while (1) {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
case "end":
|
|
111
|
-
return _context.stop();
|
|
112
|
-
}
|
|
90
|
+
while (1) switch (_context.prev = _context.next) {
|
|
91
|
+
case 0:
|
|
92
|
+
this.calCityGeo();
|
|
93
|
+
this.startModelAnimate();
|
|
94
|
+
return _context.abrupt("return", this.buildModels());
|
|
95
|
+
case 3:
|
|
96
|
+
case "end":
|
|
97
|
+
return _context.stop();
|
|
113
98
|
}
|
|
114
99
|
}, _callee, this);
|
|
115
100
|
}));
|
|
116
|
-
|
|
117
101
|
function initModels() {
|
|
118
102
|
return _initModels.apply(this, arguments);
|
|
119
103
|
}
|
|
120
|
-
|
|
121
104
|
return initModels;
|
|
122
105
|
}()
|
|
123
106
|
}, {
|
|
@@ -126,40 +109,34 @@ var CityBuildModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
126
109
|
var _buildModels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
127
110
|
var model;
|
|
128
111
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
129
|
-
while (1) {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
case 4:
|
|
152
|
-
case "end":
|
|
153
|
-
return _context2.stop();
|
|
154
|
-
}
|
|
112
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
113
|
+
case 0:
|
|
114
|
+
_context2.next = 2;
|
|
115
|
+
return this.layer.buildLayerModel({
|
|
116
|
+
moduleName: 'cityBuilding',
|
|
117
|
+
vertexShader: buildVert,
|
|
118
|
+
fragmentShader: buildFrag,
|
|
119
|
+
triangulation: PolygonExtrudeTriangulation,
|
|
120
|
+
depth: {
|
|
121
|
+
enable: true
|
|
122
|
+
},
|
|
123
|
+
cull: {
|
|
124
|
+
enable: true,
|
|
125
|
+
face: gl.BACK
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
case 2:
|
|
129
|
+
model = _context2.sent;
|
|
130
|
+
return _context2.abrupt("return", [model]);
|
|
131
|
+
case 4:
|
|
132
|
+
case "end":
|
|
133
|
+
return _context2.stop();
|
|
155
134
|
}
|
|
156
135
|
}, _callee2, this);
|
|
157
136
|
}));
|
|
158
|
-
|
|
159
137
|
function buildModels() {
|
|
160
138
|
return _buildModels.apply(this, arguments);
|
|
161
139
|
}
|
|
162
|
-
|
|
163
140
|
return buildModels;
|
|
164
141
|
}()
|
|
165
142
|
}, {
|
|
@@ -197,7 +174,7 @@ var CityBuildModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
197
174
|
size: 1,
|
|
198
175
|
update: function update(feature) {
|
|
199
176
|
var _feature$size = feature.size,
|
|
200
|
-
|
|
177
|
+
size = _feature$size === void 0 ? 10 : _feature$size;
|
|
201
178
|
return Array.isArray(size) ? [size[0]] : [size];
|
|
202
179
|
}
|
|
203
180
|
}
|
|
@@ -221,8 +198,6 @@ var CityBuildModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
221
198
|
});
|
|
222
199
|
}
|
|
223
200
|
}]);
|
|
224
|
-
|
|
225
201
|
return CityBuildModel;
|
|
226
202
|
}(BaseModel);
|
|
227
|
-
|
|
228
203
|
export { CityBuildModel as default };
|