@antv/l7-layers 2.9.23 → 2.9.25
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/models/plane.d.ts +1 -0
- package/es/citybuliding/building.js +1 -1
- package/es/core/BaseLayer.js +10 -3
- package/es/core/interface.d.ts +26 -48
- package/es/core/interface.js +3 -0
- package/es/core/schema.d.ts +3 -3
- package/es/core/triangulation.d.ts +4 -3
- package/es/core/triangulation.js +54 -39
- package/es/heatmap/models/heatmap.js +1 -1
- package/es/image/models/image.js +7 -1
- package/es/line/index.js +4 -1
- package/es/line/models/arc.js +1 -1
- package/es/line/models/simpleLine.js +1 -1
- package/es/line/shaders/line_arc_vert.glsl +5 -3
- package/es/line/shaders/simple/simpleline_vert.glsl +1 -0
- package/es/plugins/FeatureScalePlugin.js +0 -1
- package/es/point/index.js +3 -1
- package/es/point/models/fill.js +5 -2
- package/es/point/models/fillmage.js +9 -3
- package/es/point/models/image.js +8 -2
- package/es/point/models/radar.js +2 -3
- package/es/point/models/tile.js +1 -1
- package/es/point/shaders/fill_vert.glsl +13 -6
- package/es/point/shaders/image/fillImage_vert.glsl +13 -5
- package/es/point/shaders/image_vert.glsl +17 -8
- package/es/polygon/index.js +4 -1
- package/es/raster/index.js +3 -1
- package/es/tile/manager/tileLayerManager.d.ts +3 -2
- package/es/tile/manager/tileLayerManager.js +5 -2
- package/es/tile/models/tileModel.js +4 -3
- package/es/tile/tileFactory/base.d.ts +1 -1
- package/es/tile/tileFactory/base.js +32 -5
- package/es/tile/tileFactory/vectorLayer.d.ts +3 -1
- package/es/tile/tileFactory/vectorLayer.js +22 -1
- package/es/tile/tileLayer/baseTileLayer.d.ts +1 -1
- package/es/tile/tileLayer/baseTileLayer.js +3 -2
- package/es/tile/utils.d.ts +2 -0
- package/es/tile/utils.js +5 -1
- package/lib/Geometry/index.js +114 -77
- package/lib/Geometry/models/billboard.js +232 -181
- package/lib/Geometry/models/index.js +18 -34
- package/lib/Geometry/models/plane.js +407 -278
- package/lib/Geometry/models/sprite.js +291 -189
- package/lib/canvas/index.js +101 -66
- package/lib/canvas/models/canvas.js +207 -140
- package/lib/canvas/models/index.js +12 -30
- package/lib/citybuliding/building.js +98 -63
- package/lib/citybuliding/models/build.js +192 -146
- package/lib/core/BaseLayer.js +1331 -809
- package/lib/core/BaseModel.js +457 -279
- package/lib/core/interface.js +40 -53
- package/lib/core/schema.js +21 -39
- package/lib/core/shape/Path.js +67 -79
- package/lib/core/shape/extrude.js +132 -91
- package/lib/core/triangulation.js +412 -213
- package/lib/earth/index.js +100 -62
- package/lib/earth/models/atmosphere.js +146 -112
- package/lib/earth/models/base.js +210 -150
- package/lib/earth/models/bloomsphere.js +146 -112
- package/lib/earth/utils.js +111 -91
- package/lib/heatmap/index.js +149 -92
- package/lib/heatmap/models/grid.js +118 -91
- package/lib/heatmap/models/grid3d.js +155 -123
- package/lib/heatmap/models/heatmap.js +475 -338
- package/lib/heatmap/models/hexagon.js +121 -92
- package/lib/heatmap/models/index.js +22 -37
- package/lib/heatmap/triangulation.js +31 -47
- package/lib/image/index.js +111 -74
- package/lib/image/models/dataImage.js +232 -174
- package/lib/image/models/image.js +175 -123
- package/lib/image/models/index.js +15 -32
- package/lib/index.js +263 -97
- package/lib/line/index.js +131 -83
- package/lib/line/models/arc.js +352 -237
- package/lib/line/models/arc_3d.js +334 -228
- package/lib/line/models/earthArc_3d.js +336 -228
- package/lib/line/models/great_circle.js +291 -200
- package/lib/line/models/half.js +286 -201
- package/lib/line/models/index.js +42 -50
- package/lib/line/models/line.js +428 -299
- package/lib/line/models/linearline.js +277 -203
- package/lib/line/models/simpleLine.js +239 -175
- package/lib/line/models/tile.js +348 -237
- package/lib/line/models/wall.js +327 -235
- package/lib/line/shaders/line_arc_vert.glsl +5 -3
- package/lib/line/shaders/simple/simpleline_vert.glsl +1 -0
- package/lib/mask/index.js +92 -59
- package/lib/mask/models/fill.js +134 -82
- package/lib/mask/models/index.js +12 -30
- package/lib/plugins/DataMappingPlugin.js +342 -224
- package/lib/plugins/DataSourcePlugin.js +102 -87
- package/lib/plugins/FeatureScalePlugin.js +330 -241
- package/lib/plugins/LayerAnimateStylePlugin.js +61 -55
- package/lib/plugins/LayerModelPlugin.js +80 -73
- package/lib/plugins/LayerStylePlugin.js +48 -51
- package/lib/plugins/LightingPlugin.js +80 -68
- package/lib/plugins/MultiPassRendererPlugin.js +91 -65
- package/lib/plugins/PixelPickingPlugin.js +150 -109
- package/lib/plugins/RegisterStyleAttributePlugin.js +110 -110
- package/lib/plugins/ShaderUniformPlugin.js +118 -99
- package/lib/plugins/UpdateModelPlugin.js +40 -47
- package/lib/plugins/UpdateStyleAttributePlugin.js +93 -75
- package/lib/point/index.js +226 -148
- package/lib/point/models/earthExtrude.js +279 -201
- package/lib/point/models/earthFill.js +287 -202
- package/lib/point/models/extrude.js +299 -203
- package/lib/point/models/fill.js +406 -273
- package/lib/point/models/fillmage.js +365 -252
- package/lib/point/models/image.js +241 -164
- package/lib/point/models/index.js +46 -52
- package/lib/point/models/normal.js +183 -134
- package/lib/point/models/radar.js +304 -212
- package/lib/point/models/simplePoint.js +194 -142
- package/lib/point/models/text.js +608 -385
- package/lib/point/models/tile.js +314 -223
- package/lib/point/shaders/fill_vert.glsl +13 -6
- package/lib/point/shaders/image/fillImage_vert.glsl +13 -5
- package/lib/point/shaders/image_vert.glsl +17 -8
- package/lib/point/shape/extrude.js +56 -52
- package/lib/polygon/index.js +154 -100
- package/lib/polygon/models/extrude.js +311 -223
- package/lib/polygon/models/fill.js +215 -153
- package/lib/polygon/models/index.js +46 -52
- package/lib/polygon/models/ocean.js +244 -173
- package/lib/polygon/models/tile.js +144 -100
- package/lib/polygon/models/water.js +222 -153
- package/lib/raster/buffers/triangulation.js +27 -40
- package/lib/raster/index.js +115 -74
- package/lib/raster/models/index.js +16 -33
- package/lib/raster/models/raster.js +178 -135
- package/lib/raster/raster.js +187 -132
- package/lib/tile/interface.js +4 -16
- package/lib/tile/manager/tileConfigManager.js +125 -86
- package/lib/tile/manager/tileLayerManager.js +314 -227
- package/lib/tile/manager/tilePickerManager.js +192 -123
- package/lib/tile/models/tileModel.js +71 -51
- package/lib/tile/tileFactory/base.js +433 -292
- package/lib/tile/tileFactory/index.js +51 -49
- package/lib/tile/tileFactory/line.js +65 -50
- package/lib/tile/tileFactory/point.js +65 -50
- package/lib/tile/tileFactory/polygon.js +65 -50
- package/lib/tile/tileFactory/raster.js +66 -54
- package/lib/tile/tileFactory/rasterData.js +88 -76
- package/lib/tile/tileFactory/rasterDataLayer.js +97 -62
- package/lib/tile/tileFactory/vectorLayer.js +169 -95
- package/lib/tile/tileLayer/baseTileLayer.js +420 -220
- package/lib/tile/tmsTileLayer.js +110 -67
- package/lib/tile/utils.js +113 -87
- package/lib/utils/blend.js +59 -79
- package/lib/utils/collision-index.js +107 -64
- package/lib/utils/dataMappingStyle.js +105 -60
- package/lib/utils/extrude_polyline.js +600 -398
- package/lib/utils/grid-index.js +163 -111
- package/lib/utils/layerData.js +130 -99
- package/lib/utils/multiPassRender.js +49 -41
- package/lib/utils/polylineNormal.js +148 -96
- package/lib/utils/simpleLine.js +100 -85
- package/lib/utils/symbol-layout.js +219 -116
- package/lib/utils/updateShape.js +15 -41
- package/lib/wind/index.js +109 -71
- package/lib/wind/models/index.js +12 -30
- package/lib/wind/models/utils.js +144 -105
- package/lib/wind/models/wind.js +333 -224
- package/lib/wind/models/windRender.js +329 -218
- package/lib/wind/models/windShader.js +23 -181
- package/package.json +7 -6
|
@@ -10,6 +10,8 @@ uniform mat4 u_Mvp;
|
|
|
10
10
|
uniform vec2 u_offsets;
|
|
11
11
|
|
|
12
12
|
uniform float u_opacity : 1;
|
|
13
|
+
uniform float u_raisingHeight: 0.0;
|
|
14
|
+
uniform float u_heightfixed: 0.0;
|
|
13
15
|
|
|
14
16
|
varying mat4 styleMappingMat; // 用于将在顶点着色器中计算好的样式值传递给片元
|
|
15
17
|
|
|
@@ -61,21 +63,28 @@ void main() {
|
|
|
61
63
|
}
|
|
62
64
|
|
|
63
65
|
// cal style mapping - 数据纹理映射部分的计算
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
v_color = a_Color;
|
|
67
|
+
v_uv = a_Uv;
|
|
68
|
+
vec4 project_pos = project_position(vec4(a_Position, 1.0));
|
|
67
69
|
|
|
68
|
-
// vec2 offset = project_pixel(u_offsets);
|
|
69
70
|
vec2 offset = project_pixel(textrueOffsets);
|
|
70
71
|
|
|
71
|
-
|
|
72
|
+
float raisingHeight = u_raisingHeight;
|
|
73
|
+
if(u_heightfixed < 1.0) { // false
|
|
74
|
+
raisingHeight = project_pixel(u_raisingHeight);
|
|
75
|
+
} else {
|
|
76
|
+
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
77
|
+
float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);
|
|
78
|
+
raisingHeight = u_raisingHeight * mapboxZoomScale;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
72
81
|
|
|
73
82
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
|
|
74
|
-
gl_Position = u_Mvp * vec4(
|
|
83
|
+
gl_Position = u_Mvp * vec4(project_pos.xy + offset, raisingHeight, 1.0);
|
|
75
84
|
} else {
|
|
76
|
-
gl_Position = project_common_position_to_clipspace(vec4(
|
|
85
|
+
gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, raisingHeight, 1.0));
|
|
77
86
|
}
|
|
78
|
-
gl_PointSize = a_Size * 2.0 * u_DevicePixelRatio;
|
|
79
87
|
|
|
88
|
+
gl_PointSize = a_Size * 2.0 * u_DevicePixelRatio;
|
|
80
89
|
setPickingColor(a_PickingColor);
|
|
81
90
|
}
|
|
@@ -1,74 +1,78 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
-
|
|
22
|
-
// src/point/shape/extrude.ts
|
|
23
|
-
var extrude_exports = {};
|
|
24
|
-
__export(extrude_exports, {
|
|
25
|
-
default: () => extrudePolygon,
|
|
26
|
-
fillPolygon: () => fillPolygon
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
27
7
|
});
|
|
28
|
-
|
|
29
|
-
|
|
8
|
+
exports.default = extrudePolygon;
|
|
9
|
+
exports.fillPolygon = fillPolygon;
|
|
10
|
+
|
|
11
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
12
|
+
|
|
13
|
+
var _earcut = _interopRequireDefault(require("earcut"));
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* 拉伸多边形顶点,返回拉伸后的顶点信息
|
|
17
|
+
* @param paths 路径数据组
|
|
18
|
+
* @param extrude 是否拉伸
|
|
19
|
+
*/
|
|
30
20
|
function extrudePolygon(path) {
|
|
31
|
-
|
|
32
|
-
|
|
21
|
+
var p1 = path[0][0];
|
|
22
|
+
var p2 = path[0][path[0].length - 1];
|
|
23
|
+
|
|
33
24
|
if (p1[0] === p2[0] && p1[1] === p2[1]) {
|
|
34
25
|
path[0] = path[0].slice(0, path[0].length - 1);
|
|
35
26
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
27
|
+
|
|
28
|
+
var n = path[0].length;
|
|
29
|
+
|
|
30
|
+
var flattengeo = _earcut.default.flatten(path);
|
|
31
|
+
|
|
32
|
+
var positions = [];
|
|
33
|
+
var indexArray = [];
|
|
34
|
+
var normals = []; // 设置顶部z值
|
|
35
|
+
|
|
36
|
+
for (var j = 0; j < flattengeo.vertices.length / 3; j++) {
|
|
42
37
|
flattengeo.vertices[j * 3 + 2] = 1;
|
|
43
38
|
normals.push(0, 0, 1);
|
|
44
39
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
40
|
+
|
|
41
|
+
positions.push.apply(positions, (0, _toConsumableArray2.default)(flattengeo.vertices));
|
|
42
|
+
var triangles = (0, _earcut.default)(flattengeo.vertices, flattengeo.holes, flattengeo.dimensions);
|
|
43
|
+
indexArray.push.apply(indexArray, (0, _toConsumableArray2.default)(triangles));
|
|
44
|
+
|
|
45
|
+
var _loop = function _loop(i) {
|
|
46
|
+
var prePoint = flattengeo.vertices.slice(i * 3, i * 3 + 3);
|
|
47
|
+
var nextPoint = flattengeo.vertices.slice(i * 3 + 3, i * 3 + 6);
|
|
48
|
+
|
|
51
49
|
if (nextPoint.length === 0) {
|
|
52
50
|
nextPoint = flattengeo.vertices.slice(0, 3);
|
|
53
51
|
}
|
|
54
|
-
|
|
52
|
+
|
|
53
|
+
var indexOffset = positions.length / 3;
|
|
55
54
|
positions.push(prePoint[0], prePoint[1], 1, nextPoint[0], nextPoint[1], 1, prePoint[0], prePoint[1], 0, nextPoint[0], nextPoint[1], 0);
|
|
56
|
-
indexArray.push(
|
|
55
|
+
indexArray.push.apply(indexArray, (0, _toConsumableArray2.default)([1, 2, 0, 3, 2, 1].map(function (v) {
|
|
56
|
+
return v + indexOffset;
|
|
57
|
+
})));
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
for (var i = 0; i < n; i++) {
|
|
61
|
+
_loop(i);
|
|
57
62
|
}
|
|
63
|
+
|
|
58
64
|
return {
|
|
59
|
-
positions,
|
|
65
|
+
positions: positions,
|
|
60
66
|
index: indexArray
|
|
61
67
|
};
|
|
62
68
|
}
|
|
69
|
+
|
|
63
70
|
function fillPolygon(points) {
|
|
64
|
-
|
|
65
|
-
|
|
71
|
+
var flattengeo = _earcut.default.flatten(points);
|
|
72
|
+
|
|
73
|
+
var triangles = (0, _earcut.default)(flattengeo.vertices, flattengeo.holes, flattengeo.dimensions);
|
|
66
74
|
return {
|
|
67
75
|
positions: flattengeo.vertices,
|
|
68
76
|
index: triangles
|
|
69
77
|
};
|
|
70
|
-
}
|
|
71
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
72
|
-
0 && (module.exports = {
|
|
73
|
-
fillPolygon
|
|
74
|
-
});
|
|
78
|
+
}
|
package/lib/polygon/index.js
CHANGED
|
@@ -1,108 +1,162 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
-
|
|
22
|
-
// src/polygon/index.ts
|
|
23
|
-
var polygon_exports = {};
|
|
24
|
-
__export(polygon_exports, {
|
|
25
|
-
default: () => PolygonLayer
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
26
7
|
});
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
var
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
+
|
|
12
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
+
|
|
14
|
+
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
15
|
+
|
|
16
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
17
|
+
|
|
18
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
19
|
+
|
|
20
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
21
|
+
|
|
22
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
23
|
+
|
|
24
|
+
var _BaseLayer2 = _interopRequireDefault(require("../core/BaseLayer"));
|
|
25
|
+
|
|
26
|
+
var _models = _interopRequireDefault(require("./models/"));
|
|
27
|
+
|
|
28
|
+
var _utils = require("../tile/utils");
|
|
29
|
+
|
|
30
|
+
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
|
+
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
|
+
var PolygonLayer = /*#__PURE__*/function (_BaseLayer) {
|
|
35
|
+
(0, _inherits2.default)(PolygonLayer, _BaseLayer);
|
|
36
|
+
|
|
37
|
+
var _super = _createSuper(PolygonLayer);
|
|
38
|
+
|
|
39
|
+
function PolygonLayer() {
|
|
40
|
+
var _this;
|
|
41
|
+
|
|
42
|
+
(0, _classCallCheck2.default)(this, PolygonLayer);
|
|
43
|
+
|
|
44
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
45
|
+
args[_key] = arguments[_key];
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
49
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "type", 'PolygonLayer');
|
|
50
|
+
return _this;
|
|
56
51
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
52
|
+
|
|
53
|
+
(0, _createClass2.default)(PolygonLayer, [{
|
|
54
|
+
key: "buildModels",
|
|
55
|
+
value: function buildModels() {
|
|
56
|
+
var _this2 = this;
|
|
57
|
+
|
|
58
|
+
var shape = this.getModelType();
|
|
59
|
+
this.layerModel = new _models.default[shape](this);
|
|
60
|
+
this.layerModel.initModels(function (models) {
|
|
61
|
+
_this2.models = models;
|
|
62
|
+
|
|
63
|
+
_this2.renderLayers();
|
|
64
|
+
});
|
|
61
65
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
} else if (shape === "ocean") {
|
|
71
|
-
return "ocean";
|
|
72
|
-
} else if (shape === "line") {
|
|
73
|
-
return "line";
|
|
74
|
-
} else if (shape === "tile") {
|
|
75
|
-
return "tile";
|
|
76
|
-
} else {
|
|
77
|
-
return this.getPointModelType();
|
|
66
|
+
}, {
|
|
67
|
+
key: "rebuildModels",
|
|
68
|
+
value: function rebuildModels() {
|
|
69
|
+
var _this3 = this;
|
|
70
|
+
|
|
71
|
+
this.layerModel.buildModels(function (models) {
|
|
72
|
+
return _this3.models = models;
|
|
73
|
+
});
|
|
78
74
|
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
75
|
+
}, {
|
|
76
|
+
key: "getConfigSchema",
|
|
77
|
+
value: function getConfigSchema() {
|
|
78
|
+
return {
|
|
79
|
+
properties: {
|
|
80
|
+
opacity: {
|
|
81
|
+
type: 'number',
|
|
82
|
+
minimum: 0,
|
|
83
|
+
maximum: 1
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
}, {
|
|
89
|
+
key: "getModelType",
|
|
90
|
+
value: function getModelType() {
|
|
91
|
+
var _shapeAttribute$scale;
|
|
92
|
+
|
|
93
|
+
var parserType = this.layerSource.getParserType();
|
|
94
|
+
|
|
95
|
+
if ((0, _utils.isVectorTile)(parserType)) {
|
|
96
|
+
return 'vectorpolygon';
|
|
96
97
|
}
|
|
97
|
-
|
|
98
|
-
|
|
98
|
+
|
|
99
|
+
var shapeAttribute = this.styleAttributeService.getLayerStyleAttribute('shape');
|
|
100
|
+
var shape = shapeAttribute === null || shapeAttribute === void 0 ? void 0 : (_shapeAttribute$scale = shapeAttribute.scale) === null || _shapeAttribute$scale === void 0 ? void 0 : _shapeAttribute$scale.field;
|
|
101
|
+
|
|
102
|
+
if (shape === 'fill') {
|
|
103
|
+
return 'fill';
|
|
104
|
+
} else if (shape === 'extrude') {
|
|
105
|
+
return 'extrude';
|
|
106
|
+
} else if (shape === 'water') {
|
|
107
|
+
return 'water';
|
|
108
|
+
} else if (shape === 'ocean') {
|
|
109
|
+
return 'ocean';
|
|
110
|
+
} else if (shape === 'line') {
|
|
111
|
+
return 'line';
|
|
112
|
+
} else if (shape === 'tile') {
|
|
113
|
+
return 'tile';
|
|
114
|
+
} else {
|
|
115
|
+
return this.getPointModelType();
|
|
99
116
|
}
|
|
100
|
-
|
|
101
|
-
|
|
117
|
+
}
|
|
118
|
+
}, {
|
|
119
|
+
key: "getPointModelType",
|
|
120
|
+
value: function getPointModelType() {
|
|
121
|
+
// pointlayer
|
|
122
|
+
// 2D、 3d、 shape、image、text、normal、
|
|
123
|
+
var layerData = this.getEncodedData();
|
|
124
|
+
|
|
125
|
+
var _this$getLayerConfig = this.getLayerConfig(),
|
|
126
|
+
shape2d = _this$getLayerConfig.shape2d,
|
|
127
|
+
shape3d = _this$getLayerConfig.shape3d;
|
|
128
|
+
|
|
129
|
+
var iconMap = this.iconService.getIconMap();
|
|
130
|
+
var item = layerData.find(function (fe) {
|
|
131
|
+
return fe.hasOwnProperty('shape');
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
if (!item) {
|
|
135
|
+
return 'fill';
|
|
136
|
+
} else {
|
|
137
|
+
var shape = item.shape;
|
|
138
|
+
|
|
139
|
+
if (shape === 'dot') {
|
|
140
|
+
return 'point_normal';
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
if ((shape2d === null || shape2d === void 0 ? void 0 : shape2d.indexOf(shape)) !== -1) {
|
|
144
|
+
return 'point_fill';
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
if ((shape3d === null || shape3d === void 0 ? void 0 : shape3d.indexOf(shape)) !== -1) {
|
|
148
|
+
return 'point_extrude';
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
if (iconMap.hasOwnProperty(shape)) {
|
|
152
|
+
return 'point_image';
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
return 'text';
|
|
102
156
|
}
|
|
103
|
-
return "text";
|
|
104
157
|
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
158
|
+
}]);
|
|
159
|
+
return PolygonLayer;
|
|
160
|
+
}(_BaseLayer2.default);
|
|
161
|
+
|
|
162
|
+
exports.default = PolygonLayer;
|