@antv/l7-layers 2.16.0 → 2.16.1
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 +31 -9
- package/es/Geometry/models/billboard.js +89 -51
- package/es/Geometry/models/plane.js +143 -81
- package/es/Geometry/models/sprite.js +118 -60
- package/es/canvas/index.js +33 -10
- package/es/canvas/models/canvas.js +97 -41
- package/es/citybuliding/building.js +27 -8
- package/es/citybuliding/models/build.js +82 -57
- package/es/core/BaseLayer.js +485 -321
- package/es/core/BaseModel.js +126 -97
- package/es/core/LayerPickService.js +32 -21
- package/es/core/TextureService.js +13 -0
- package/es/core/interface.js +24 -17
- package/es/core/shape/Path.js +20 -13
- package/es/core/shape/extrude.js +31 -10
- package/es/core/triangulation.js +114 -54
- package/es/earth/index.js +33 -9
- package/es/earth/models/atmosphere.js +54 -30
- package/es/earth/models/base.js +85 -47
- package/es/earth/models/bloomsphere.js +54 -30
- package/es/earth/utils.js +13 -9
- package/es/heatmap/index.js +40 -10
- package/es/heatmap/models/grid.js +52 -28
- package/es/heatmap/models/grid3d.js +52 -28
- package/es/heatmap/models/heatmap.js +146 -91
- package/es/heatmap/models/hexagon.js +52 -28
- package/es/heatmap/triangulation.js +4 -0
- package/es/image/index.js +28 -9
- package/es/image/models/image.js +100 -66
- package/es/index.js +17 -9
- package/es/line/index.js +34 -9
- package/es/line/models/arc.js +118 -66
- package/es/line/models/arc_3d.js +108 -60
- package/es/line/models/earthArc_3d.js +111 -63
- package/es/line/models/great_circle.js +100 -56
- package/es/line/models/half.js +77 -46
- package/es/line/models/line.js +148 -94
- package/es/line/models/linearline.js +80 -45
- package/es/line/models/simpleLine.js +74 -41
- package/es/line/models/wall.js +92 -52
- package/es/mask/index.js +28 -9
- package/es/mask/models/fill.js +54 -29
- package/es/plugins/DataMappingPlugin.js +117 -80
- package/es/plugins/DataSourcePlugin.js +68 -45
- package/es/plugins/FeatureScalePlugin.js +122 -67
- package/es/plugins/LayerAnimateStylePlugin.js +5 -0
- package/es/plugins/LayerMaskPlugin.js +11 -3
- package/es/plugins/LayerModelPlugin.js +104 -67
- package/es/plugins/LayerStylePlugin.js +9 -3
- package/es/plugins/LightingPlugin.js +18 -12
- package/es/plugins/MultiPassRendererPlugin.js +16 -11
- package/es/plugins/PixelPickingPlugin.js +21 -12
- package/es/plugins/RegisterStyleAttributePlugin.js +12 -5
- package/es/plugins/ShaderUniformPlugin.js +27 -13
- package/es/plugins/UpdateModelPlugin.js +5 -0
- package/es/plugins/UpdateStyleAttributePlugin.js +11 -5
- package/es/point/index.js +77 -26
- package/es/point/models/earthExtrude.js +102 -61
- package/es/point/models/earthFill.js +87 -57
- package/es/point/models/extrude.js +101 -60
- package/es/point/models/fill.js +100 -70
- package/es/point/models/fillmage.js +107 -63
- package/es/point/models/image.js +88 -48
- package/es/point/models/index.js +2 -2
- package/es/point/models/normal.js +54 -30
- package/es/point/models/radar.js +64 -40
- package/es/point/models/simplePoint.js +69 -41
- package/es/point/models/text.js +301 -198
- package/es/point/shape/extrude.js +13 -4
- package/es/polygon/index.js +40 -11
- package/es/polygon/models/extrude.js +92 -48
- package/es/polygon/models/fill.js +88 -54
- package/es/polygon/models/index.js +2 -3
- package/es/polygon/models/ocean.js +76 -42
- package/es/polygon/models/water.js +71 -37
- package/es/raster/buffers/triangulation.js +4 -2
- package/es/raster/index.js +32 -9
- package/es/raster/models/raster.js +116 -80
- package/es/raster/models/rasterRgb.js +127 -84
- package/es/raster/models/rasterTerrainRgb.js +84 -56
- package/es/tile/interaction/getRasterData.js +20 -14
- package/es/tile/interaction/utils.js +9 -7
- package/es/tile/manager/base.js +96 -63
- package/es/tile/service/TileLayerService.js +55 -33
- package/es/tile/service/TilePickService.js +40 -26
- package/es/tile/service/TileSourceService.js +7 -3
- package/es/tile/tileFactory/DebugTile.js +46 -29
- package/es/tile/tileFactory/ImageTile.js +38 -20
- package/es/tile/tileFactory/MaskTile.js +43 -22
- package/es/tile/tileFactory/RasterRGBTile.js +42 -22
- package/es/tile/tileFactory/RasterTerrainRGBTile.js +38 -20
- package/es/tile/tileFactory/RasterTile.js +53 -30
- package/es/tile/tileFactory/Tile.js +97 -63
- package/es/tile/tileFactory/VectorTile.js +68 -41
- package/es/tile/tileFactory/index.js +11 -0
- package/es/tile/tileFactory/layers/TileDebugLayer.js +27 -6
- package/es/tile/tileFactory/util.js +3 -0
- package/es/tile/tileLayer/BaseLayer.js +146 -105
- package/es/tile/utils.js +1 -1
- package/es/utils/blend.js +2 -0
- package/es/utils/collision-index.js +16 -9
- package/es/utils/dataMappingStyle.js +18 -8
- package/es/utils/extrude_polyline.js +149 -101
- package/es/utils/grid-index.js +27 -2
- package/es/utils/identityScale.js +8 -0
- package/es/utils/layerData.js +44 -30
- package/es/utils/multiPassRender.js +13 -11
- package/es/utils/polylineNormal.js +37 -31
- package/es/utils/simpleLine.js +16 -2
- package/es/utils/stencil.js +3 -2
- package/es/utils/symbol-layout.js +53 -27
- package/es/wind/index.js +29 -9
- package/es/wind/models/utils.js +51 -26
- package/es/wind/models/wind.js +147 -101
- package/es/wind/models/windRender.js +66 -53
- package/lib/Geometry/index.js +38 -9
- package/lib/Geometry/models/billboard.js +97 -51
- package/lib/Geometry/models/index.js +5 -0
- package/lib/Geometry/models/plane.js +151 -79
- package/lib/Geometry/models/sprite.js +127 -60
- package/lib/canvas/index.js +40 -10
- package/lib/canvas/models/canvas.js +101 -41
- package/lib/canvas/models/index.js +3 -0
- package/lib/citybuliding/building.js +35 -8
- package/lib/citybuliding/models/build.js +92 -57
- package/lib/core/BaseLayer.js +479 -321
- package/lib/core/BaseModel.js +139 -97
- package/lib/core/LayerPickService.js +37 -21
- package/lib/core/TextureService.js +16 -0
- package/lib/core/interface.js +31 -21
- package/lib/core/schema.js +1 -0
- package/lib/core/shape/Path.js +31 -14
- package/lib/core/shape/extrude.js +54 -10
- package/lib/core/triangulation.js +153 -53
- package/lib/earth/index.js +43 -9
- package/lib/earth/models/atmosphere.js +63 -30
- package/lib/earth/models/base.js +90 -47
- package/lib/earth/models/bloomsphere.js +63 -30
- package/lib/earth/utils.js +31 -7
- package/lib/heatmap/index.js +48 -10
- package/lib/heatmap/models/grid.js +60 -28
- package/lib/heatmap/models/grid3d.js +60 -28
- package/lib/heatmap/models/heatmap.js +162 -91
- package/lib/heatmap/models/hexagon.js +60 -28
- package/lib/heatmap/models/index.js +6 -0
- package/lib/heatmap/triangulation.js +5 -0
- package/lib/image/index.js +36 -9
- package/lib/image/models/image.js +109 -66
- package/lib/image/models/index.js +3 -0
- package/lib/index.js +61 -7
- package/lib/line/index.js +40 -9
- package/lib/line/models/arc.js +128 -64
- package/lib/line/models/arc_3d.js +119 -58
- package/lib/line/models/earthArc_3d.js +122 -61
- package/lib/line/models/great_circle.js +111 -56
- package/lib/line/models/half.js +87 -46
- package/lib/line/models/index.js +11 -0
- package/lib/line/models/line.js +156 -92
- package/lib/line/models/linearline.js +92 -45
- package/lib/line/models/simpleLine.js +84 -41
- package/lib/line/models/wall.js +103 -52
- package/lib/mask/index.js +36 -9
- package/lib/mask/models/fill.js +63 -29
- package/lib/mask/models/index.js +3 -0
- package/lib/plugins/DataMappingPlugin.js +128 -80
- package/lib/plugins/DataSourcePlugin.js +76 -45
- package/lib/plugins/FeatureScalePlugin.js +138 -67
- package/lib/plugins/LayerAnimateStylePlugin.js +10 -0
- package/lib/plugins/LayerMaskPlugin.js +17 -4
- package/lib/plugins/LayerModelPlugin.js +113 -68
- package/lib/plugins/LayerStylePlugin.js +14 -4
- package/lib/plugins/LightingPlugin.js +25 -12
- package/lib/plugins/MultiPassRendererPlugin.js +22 -11
- package/lib/plugins/PixelPickingPlugin.js +27 -12
- package/lib/plugins/RegisterStyleAttributePlugin.js +19 -5
- package/lib/plugins/ShaderUniformPlugin.js +34 -13
- package/lib/plugins/UpdateModelPlugin.js +10 -1
- package/lib/plugins/UpdateStyleAttributePlugin.js +16 -5
- package/lib/point/index.js +83 -26
- package/lib/point/models/earthExtrude.js +113 -61
- package/lib/point/models/earthFill.js +117 -57
- package/lib/point/models/extrude.js +111 -60
- package/lib/point/models/fill.js +109 -68
- package/lib/point/models/fillmage.js +115 -61
- package/lib/point/models/image.js +98 -48
- package/lib/point/models/index.js +12 -1
- package/lib/point/models/normal.js +64 -30
- package/lib/point/models/radar.js +74 -40
- package/lib/point/models/simplePoint.js +79 -41
- package/lib/point/models/text.js +309 -198
- package/lib/point/shape/extrude.js +20 -4
- package/lib/polygon/index.js +48 -11
- package/lib/polygon/models/extrude.js +103 -48
- package/lib/polygon/models/fill.js +98 -54
- package/lib/polygon/models/index.js +14 -2
- package/lib/polygon/models/ocean.js +88 -42
- package/lib/polygon/models/water.js +82 -37
- package/lib/raster/buffers/triangulation.js +7 -3
- package/lib/raster/index.js +40 -9
- package/lib/raster/models/index.js +5 -0
- package/lib/raster/models/raster.js +125 -80
- package/lib/raster/models/rasterRgb.js +139 -84
- package/lib/raster/models/rasterTerrainRgb.js +93 -56
- package/lib/tile/interaction/getRasterData.js +25 -14
- package/lib/tile/interaction/utils.js +19 -7
- package/lib/tile/manager/base.js +104 -63
- package/lib/tile/service/TileLayerService.js +60 -33
- package/lib/tile/service/TilePickService.js +48 -26
- package/lib/tile/service/TileSourceService.js +16 -2
- package/lib/tile/style/utils.js +3 -0
- package/lib/tile/tileFactory/DebugTile.js +54 -29
- package/lib/tile/tileFactory/ImageTile.js +46 -20
- package/lib/tile/tileFactory/MaskTile.js +51 -22
- package/lib/tile/tileFactory/RasterRGBTile.js +50 -22
- package/lib/tile/tileFactory/RasterTerrainRGBTile.js +46 -20
- package/lib/tile/tileFactory/RasterTile.js +63 -30
- package/lib/tile/tileFactory/Tile.js +102 -63
- package/lib/tile/tileFactory/VectorTile.js +76 -41
- package/lib/tile/tileFactory/index.js +25 -0
- package/lib/tile/tileFactory/layers/TileDebugLayer.js +32 -6
- package/lib/tile/tileFactory/util.js +9 -0
- package/lib/tile/tileLayer/BaseLayer.js +153 -105
- package/lib/tile/utils.js +5 -1
- package/lib/utils/blend.js +5 -0
- package/lib/utils/collision-index.js +25 -9
- package/lib/utils/dataMappingStyle.js +19 -8
- package/lib/utils/extrude_polyline.js +181 -101
- package/lib/utils/grid-index.js +28 -2
- package/lib/utils/identityScale.js +9 -0
- package/lib/utils/layerData.js +49 -30
- package/lib/utils/multiPassRender.js +16 -11
- package/lib/utils/polylineNormal.js +66 -31
- package/lib/utils/simpleLine.js +21 -2
- package/lib/utils/stencil.js +4 -0
- package/lib/utils/symbol-layout.js +55 -27
- package/lib/wind/index.js +37 -9
- package/lib/wind/models/index.js +3 -0
- package/lib/wind/models/utils.js +62 -26
- package/lib/wind/models/wind.js +157 -101
- package/lib/wind/models/windRender.js +71 -53
- package/lib/wind/models/windShader.js +1 -0
- package/package.json +7 -7
|
@@ -6,7 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.colorStyleMapping = colorStyleMapping;
|
|
7
7
|
exports.floatStyleMapping = floatStyleMapping;
|
|
8
8
|
exports.styleDataMapping = styleDataMapping;
|
|
9
|
+
|
|
9
10
|
var _lodash = require("lodash");
|
|
11
|
+
|
|
10
12
|
/**
|
|
11
13
|
* 当 style 中使用的 opacity 不是常数的时候根据数据进行映射
|
|
12
14
|
* @param field
|
|
@@ -16,59 +18,66 @@ var _lodash = require("lodash");
|
|
|
16
18
|
function registerStyleAttribute(fieldName, layer, field, values, updateOptions) {
|
|
17
19
|
layer.updateStyleAttribute(fieldName, field, values, updateOptions);
|
|
18
20
|
}
|
|
19
|
-
|
|
20
21
|
/**
|
|
21
22
|
* 当样式发生变化时判断是否需要进行数据映射
|
|
22
23
|
* @param configToUpdate
|
|
23
24
|
* @param layer
|
|
24
25
|
*/
|
|
26
|
+
|
|
27
|
+
|
|
25
28
|
function styleDataMapping(configToUpdate, layer) {
|
|
26
29
|
// 瓦片图层不需要进行样式数据映射
|
|
27
30
|
if (layer.tileLayer || layer.isTileLayer) {
|
|
28
31
|
return;
|
|
29
32
|
}
|
|
33
|
+
|
|
30
34
|
if (configToUpdate.opacity) {
|
|
31
35
|
// 处理 style 中 opacity 属性的数据映射
|
|
32
36
|
floatStyleMapping('opacity', layer, configToUpdate.opacity);
|
|
33
37
|
}
|
|
38
|
+
|
|
34
39
|
if (configToUpdate.strokeWidth) {
|
|
35
40
|
// 处理 style 中 strokeWidth 属性的数据映射
|
|
36
|
-
|
|
37
41
|
floatStyleMapping('strokeWidth', layer, configToUpdate.strokeWidth);
|
|
38
42
|
}
|
|
43
|
+
|
|
39
44
|
if (configToUpdate.strokeOpacity) {
|
|
40
45
|
// 处理 style 中 strokeOpacity 属性的数据映射
|
|
41
46
|
floatStyleMapping('strokeOpacity', layer, configToUpdate.strokeOpacity);
|
|
42
47
|
}
|
|
48
|
+
|
|
43
49
|
if (configToUpdate.stroke) {
|
|
44
50
|
// 处理 style 中 stroke (strokeColor) 属性的数据映射
|
|
45
51
|
colorStyleMapping('stroke', layer, configToUpdate.stroke);
|
|
46
52
|
}
|
|
53
|
+
|
|
47
54
|
if (configToUpdate.offsets) {
|
|
48
55
|
// 处理 style 中 offsets 属性的数据映射
|
|
49
56
|
offsetStyleMapping('offsets', layer, configToUpdate.offsets);
|
|
50
57
|
}
|
|
58
|
+
|
|
51
59
|
if (configToUpdate.textOffset) {
|
|
52
60
|
// 处理 style 中 textOffset 属性的数据映射
|
|
53
61
|
offsetStyleMapping('textOffset', layer, configToUpdate.textOffset);
|
|
54
62
|
}
|
|
63
|
+
|
|
55
64
|
if (configToUpdate.thetaOffset) {
|
|
56
65
|
// 处理 style 中 thetaOffset 属性的数据映射
|
|
57
66
|
floatStyleMapping('thetaOffset', layer, configToUpdate.thetaOffset);
|
|
58
67
|
}
|
|
59
68
|
}
|
|
60
|
-
|
|
61
69
|
/**
|
|
62
70
|
* 根据传入参数 float 的类型和值做相应的操作
|
|
63
71
|
*/
|
|
72
|
+
|
|
73
|
+
|
|
64
74
|
function floatStyleMapping(fieldName, layer, styleFloat) {
|
|
65
75
|
if ((0, _lodash.isString)(styleFloat)) {
|
|
66
76
|
// 如果传入的 styleFloat 是 string 类型,那么就认为其对应的是传入数据的字段
|
|
67
77
|
registerStyleAttribute(fieldName, layer, styleFloat, function (value) {
|
|
68
78
|
return value;
|
|
69
79
|
});
|
|
70
|
-
} else if ((0, _lodash.isNumber)(styleFloat)) {
|
|
71
|
-
// 传入 number、默认值处理
|
|
80
|
+
} else if ((0, _lodash.isNumber)(styleFloat)) {// 传入 number、默认值处理
|
|
72
81
|
// registerStyleAttribute(fieldName, layer, [styleFloat], undefined);
|
|
73
82
|
} else if (Array.isArray(styleFloat) && styleFloat.length === 2) {
|
|
74
83
|
// 传入的 styleFloat 是长度为 2 的数组
|
|
@@ -93,6 +102,8 @@ function floatStyleMapping(fieldName, layer, styleFloat) {
|
|
|
93
102
|
* @param layer
|
|
94
103
|
* @param styleOffsets
|
|
95
104
|
*/
|
|
105
|
+
|
|
106
|
+
|
|
96
107
|
function offsetStyleMapping(fieldName, layer, styleOffsets) {
|
|
97
108
|
if ((0, _lodash.isString)(styleOffsets)) {
|
|
98
109
|
// 如果传入的 styleOffsets 是 string 类型,那么就认为其对应的是传入数据的字段
|
|
@@ -110,16 +121,16 @@ function offsetStyleMapping(fieldName, layer, styleOffsets) {
|
|
|
110
121
|
registerStyleAttribute(fieldName, layer, [0, 0], undefined);
|
|
111
122
|
}
|
|
112
123
|
}
|
|
113
|
-
|
|
114
124
|
/**
|
|
115
125
|
* 根据传入参数 stroke / color 的类型和值做相应的操作
|
|
116
126
|
* @param fieldName
|
|
117
127
|
* @param layer
|
|
118
128
|
* @param styleColor
|
|
119
129
|
*/
|
|
130
|
+
|
|
131
|
+
|
|
120
132
|
function colorStyleMapping(fieldName, layer, styleColor) {
|
|
121
|
-
if ((0, _lodash.isString)(styleColor)) {
|
|
122
|
-
// 如果传入的 styleColor 是 string 类型,那么就认为其是颜色值
|
|
133
|
+
if ((0, _lodash.isString)(styleColor)) {// 如果传入的 styleColor 是 string 类型,那么就认为其是颜色值
|
|
123
134
|
// registerStyleAttribute(fieldName, layer, styleColor, undefined);
|
|
124
135
|
} else if (Array.isArray(styleColor) && styleColor.length === 2) {
|
|
125
136
|
// 传入的 styleColor 是长度为 2 的数组
|