@antv/l7-layers 2.15.2 → 2.15.3
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 +320 -484
- package/es/core/BaseModel.js +97 -126
- 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 +10 -31
- package/es/core/triangulation.js +54 -114
- 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 +91 -146
- 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 -34
- package/es/line/models/arc.js +66 -118
- package/es/line/models/arc_3d.js +60 -108
- package/es/line/models/earthArc_3d.js +63 -111
- package/es/line/models/great_circle.js +56 -100
- package/es/line/models/half.js +46 -77
- package/es/line/models/line.js +94 -148
- package/es/line/models/linearline.js +45 -80
- package/es/line/models/simpleLine.js +41 -74
- package/es/line/models/wall.js +52 -92
- package/es/mask/index.js +9 -28
- package/es/mask/models/fill.js +29 -54
- package/es/plugins/DataMappingPlugin.js +80 -117
- 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 +67 -104
- package/es/plugins/LayerStylePlugin.js +3 -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 -77
- package/es/point/models/earthExtrude.js +61 -102
- package/es/point/models/earthFill.js +57 -87
- package/es/point/models/extrude.js +60 -101
- package/es/point/models/fill.js +70 -100
- package/es/point/models/fillmage.js +63 -107
- package/es/point/models/image.js +48 -88
- package/es/point/models/index.js +2 -2
- package/es/point/models/normal.js +30 -54
- package/es/point/models/radar.js +40 -64
- package/es/point/models/simplePoint.js +41 -69
- package/es/point/models/text.js +197 -299
- package/es/point/shape/extrude.js +4 -13
- package/es/polygon/index.js +11 -40
- package/es/polygon/models/extrude.js +48 -92
- package/es/polygon/models/fill.js +54 -88
- 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 +30 -52
- package/es/tile/service/TilePickService.js +26 -40
- package/es/tile/service/TileSourceService.js +3 -7
- package/es/tile/tileFactory/DebugTile.js +28 -45
- 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/dataMappingStyle.js +8 -18
- 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 +320 -478
- package/lib/core/BaseModel.js +97 -139
- 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 +10 -54
- package/lib/core/triangulation.js +53 -153
- 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 +91 -162
- 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 +64 -128
- package/lib/line/models/arc_3d.js +58 -119
- package/lib/line/models/earthArc_3d.js +61 -122
- package/lib/line/models/great_circle.js +56 -111
- package/lib/line/models/half.js +46 -87
- package/lib/line/models/index.js +0 -11
- package/lib/line/models/line.js +92 -156
- package/lib/line/models/linearline.js +45 -92
- package/lib/line/models/simpleLine.js +41 -84
- package/lib/line/models/wall.js +52 -103
- 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 +80 -128
- 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 +68 -113
- package/lib/plugins/LayerStylePlugin.js +4 -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 +61 -113
- package/lib/point/models/earthFill.js +57 -117
- package/lib/point/models/extrude.js +60 -111
- package/lib/point/models/fill.js +68 -109
- package/lib/point/models/fillmage.js +61 -115
- package/lib/point/models/image.js +48 -98
- package/lib/point/models/index.js +1 -12
- package/lib/point/models/normal.js +30 -64
- package/lib/point/models/radar.js +40 -74
- package/lib/point/models/simplePoint.js +41 -79
- package/lib/point/models/text.js +197 -307
- package/lib/point/shape/extrude.js +4 -20
- package/lib/polygon/index.js +11 -48
- package/lib/polygon/models/extrude.js +48 -103
- package/lib/polygon/models/fill.js +54 -98
- 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 +30 -57
- 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 +28 -53
- 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/dataMappingStyle.js +8 -19
- 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,82 +1,53 @@
|
|
|
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 _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
13
|
-
|
|
14
10
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
15
|
-
|
|
16
11
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
17
|
-
|
|
18
12
|
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
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 _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
27
|
-
|
|
28
17
|
var _l7Core = require("@antv/l7-core");
|
|
29
|
-
|
|
30
18
|
var _l7Utils = require("@antv/l7-utils");
|
|
31
|
-
|
|
32
19
|
var _lodash = require("lodash");
|
|
33
|
-
|
|
34
20
|
var _BaseModel2 = _interopRequireDefault(require("../../core/BaseModel"));
|
|
35
|
-
|
|
36
21
|
var _triangulation = require("../../core/triangulation");
|
|
37
|
-
|
|
38
22
|
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); }; }
|
|
39
|
-
|
|
40
23
|
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; } }
|
|
41
|
-
|
|
42
24
|
/* babel-plugin-inline-import '../shaders/line_arc_great_circle_frag.glsl' */
|
|
43
25
|
var line_arc_frag = "#define LineTypeSolid 0.0\n#define LineTypeDash 1.0\n#define Animate 0.0\n#define LineTexture 1.0\n\nuniform float u_opacity;\nuniform float u_textureBlend;\nuniform float u_blur : 0.9;\nuniform float u_line_type: 0.0;\n// varying vec2 v_normal;\nvarying vec4 v_dash_array;\nvarying float v_distance_ratio;\nvarying vec4 v_color;\n\nuniform float u_time;\nuniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];\n\nuniform float u_line_texture: 0.0;\nuniform sampler2D u_texture;\nuniform vec2 u_textSize;\nuniform float segmentNumber;\n\nvarying vec2 v_iconMapUV;\n\nuniform float u_linearColor: 0;\nuniform vec4 u_sourceColor;\nuniform vec4 u_targetColor;\n\nvarying mat4 styleMappingMat;\n\n#pragma include \"picking\"\n#pragma include \"project\"\n#pragma include \"projection\"\n\nvoid main() {\n float opacity = styleMappingMat[0][0];\n float animateSpeed = 0.0;\n float d_segmentIndex = styleMappingMat[3].g;\n \n // \u8BBE\u7F6E\u5F27\u7EBF\u7684\u5E95\u8272\n if(u_linearColor == 1.0) { // \u4F7F\u7528\u6E10\u53D8\u989C\u8272\n gl_FragColor = mix(u_sourceColor, u_targetColor, d_segmentIndex/segmentNumber);\n } else { // \u4F7F\u7528 color \u65B9\u6CD5\u4F20\u5165\u7684\u989C\u8272\n gl_FragColor = v_color;\n }\n\n // float blur = 1.- smoothstep(u_blur, 1., length(v_normal.xy));\n // float blur = smoothstep(1.0, u_blur, length(v_normal.xy));\n gl_FragColor.a *= opacity;\n if(u_line_type == LineTypeDash) {\n float dashLength = mod(v_distance_ratio, v_dash_array.x + v_dash_array.y + v_dash_array.z + v_dash_array.w);\n if(dashLength < v_dash_array.x || (dashLength > (v_dash_array.x + v_dash_array.y) && dashLength < v_dash_array.x + v_dash_array.y + v_dash_array.z)) {\n // \u5B9E\u7EBF\u90E8\u5206\n } else {\n // \u865A\u7EBF\u90E8\u5206\n discard;\n };\n }\n\n // \u8BBE\u7F6E\u5F27\u7EBF\u7684\u52A8\u753B\u6A21\u5F0F\n if(u_animate.x == Animate) {\n animateSpeed = u_time / u_animate.y;\n float alpha =1.0 - fract( mod(1.0- v_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + u_time / u_animate.y);\n alpha = (alpha + u_animate.w -1.0) / u_animate.w;\n alpha = smoothstep(0., 1., alpha);\n gl_FragColor.a *= alpha;\n }\n\n // \u8BBE\u7F6E\u5F27\u7EBF\u7684\u8D34\u56FE\n if(LineTexture == u_line_texture && u_line_type != LineTypeDash) { \n float arcRadio = smoothstep( 0.0, 1.0, (d_segmentIndex / (segmentNumber - 1.0)));\n // float arcRadio = d_segmentIndex / (segmentNumber - 1.0);\n float count = styleMappingMat[3].b; // \u8D34\u56FE\u5728\u5F27\u7EBF\u4E0A\u91CD\u590D\u7684\u6570\u91CF\n float u = fract(arcRadio * count - animateSpeed * count);\n // float u = fract(arcRadio * count - animateSpeed);\n if(u_animate.x == Animate) {\n u = gl_FragColor.a/opacity;\n }\n\n float v = styleMappingMat[3].a; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C\n\n vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.;\n vec4 pattern = texture2D(u_texture, uv);\n \n // \u8BBE\u7F6E\u8D34\u56FE\u548C\u5E95\u8272\u7684\u53E0\u52A0\u6A21\u5F0F\n if(u_textureBlend == 0.0) { // normal\n pattern.a = 0.0;\n gl_FragColor = filterColor(gl_FragColor + pattern);\n } else { // replace\n pattern.a *= opacity;\n if(gl_FragColor.a <= 0.0) {\n pattern.a = 0.0;\n }\n gl_FragColor = filterColor(pattern);\n }\n } else {\n gl_FragColor = filterColor(gl_FragColor);\n }\n\n // gl_FragColor = filterColor(gl_FragColor);\n}";
|
|
44
|
-
|
|
45
26
|
/* babel-plugin-inline-import '../shaders/line_arc_great_circle_vert.glsl' */
|
|
46
27
|
var line_arc2d_vert = "#define LineTypeSolid 0.0\n#define LineTypeDash 1.0\n#define Animate 0.0\n#define LineTexture 1.0\n\nattribute vec4 a_Color;\nattribute vec3 a_Position;\nattribute vec4 a_Instance;\nattribute float a_Size;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nuniform float segmentNumber;\nuniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];\nvarying vec4 v_color;\n\nvarying float v_distance_ratio;\nuniform float u_line_type: 0.0;\nuniform vec4 u_dash_array: [10.0, 5., 0, 0];\nvarying vec4 v_dash_array;\n\nuniform float u_icon_step: 100;\nuniform float u_line_texture: 0.0;\n\nattribute vec2 a_iconMapUV;\nvarying vec2 v_iconMapUV;\n\nuniform float u_opacity: 1.0;\nvarying mat4 styleMappingMat; // \u7528\u4E8E\u5C06\u5728\u9876\u70B9\u7740\u8272\u5668\u4E2D\u8BA1\u7B97\u597D\u7684\u6837\u5F0F\u503C\u4F20\u9012\u7ED9\u7247\u5143\n\n#pragma include \"styleMapping\"\n#pragma include \"styleMappingCalOpacity\"\n\n#pragma include \"projection\"\n#pragma include \"project\"\n#pragma include \"picking\"\n\nfloat maps (float value, float start1, float stop1, float start2, float stop2) {\n return start2 + (stop2 - start2) * ((value - start1) / (stop1 - start1));\n}\n\nfloat getSegmentRatio(float index) {\n return index / (segmentNumber - 1.);\n}\n\nfloat paraboloid(vec2 source, vec2 target, float ratio) {\n vec2 x = mix(source, target, ratio);\n vec2 center = mix(source, target, 0.5);\n float dSourceCenter = distance(source, center);\n float dXCenter = distance(x, center);\n return (dSourceCenter + dXCenter) * (dSourceCenter - dXCenter);\n}\n\nvec3 getPos(vec2 source, vec2 target, float segmentRatio) {\n float vertex_height = paraboloid(source, target, segmentRatio);\n\n return vec3(\n mix(source, target, segmentRatio),\n sqrt(max(0.0, vertex_height))\n );\n}\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction) {\n // normalized direction of the line\n vec2 dir_screenspace = normalize(line_clipspace);\n // rotate by 90 degrees\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n vec2 offset = dir_screenspace * offset_direction * setPickingSize(a_Size)/ 2.0;\n return offset;\n}\nvec2 getNormal(vec2 line_clipspace, float offset_direction) {\n // normalized direction of the line\n vec2 dir_screenspace = normalize(line_clipspace);\n // rotate by 90 degrees\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n return reverse_offset_normal(vec3(dir_screenspace,1.0)).xy * sign(offset_direction);\n}\nfloat getAngularDist (vec2 source, vec2 target) {\n vec2 delta = source - target;\n vec2 sin_half_delta = sin(delta / 2.0);\n float a =\n sin_half_delta.y * sin_half_delta.y +\n cos(source.y) * cos(target.y) *\n sin_half_delta.x * sin_half_delta.x;\n return 2.0 * atan(sqrt(a), sqrt(1.0 - a));\n}\n\nvec2 midPoint(vec2 source, vec2 target) {\n vec2 center = target - source;\n float r = length(center);\n float theta = atan(center.y, center.x);\n float thetaOffset = 0.314;\n float r2 = r / 2.0 / cos(thetaOffset);\n float theta2 = theta + thetaOffset;\n vec2 mid = vec2(r2*cos(theta2) + source.x, r2*sin(theta2) + source.y);\n return mid;\n}\nfloat bezier3(vec3 arr, float t) {\n float ut = 1. - t;\n return (arr.x * ut + arr.y * t) * ut + (arr.y * ut + arr.z * t) * t;\n}\n\nvec2 interpolate (vec2 source, vec2 target, float angularDist, float t) {\n // if the angularDist is PI, linear interpolation is applied. otherwise, use spherical interpolation\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n vec2 mid = midPoint(source, target);\n vec3 x = vec3(source.x, mid.x, target.x);\n vec3 y = vec3(source.y, mid.y, target.y);\n return vec2(bezier3(x ,t), bezier3(y,t));\n }else {\n if(abs(angularDist - PI) < 0.001) {\n return (1.0 - t) * source + t * target;\n }\n float a = sin((1.0 - t) * angularDist) / sin(angularDist);\n float b = sin(t * angularDist) / sin(angularDist);\n vec2 sin_source = sin(source);\n vec2 cos_source = cos(source);\n vec2 sin_target = sin(target);\n vec2 cos_target = cos(target);\n float x = a * cos_source.y * cos_source.x + b * cos_target.y * cos_target.x;\n float y = a * cos_source.y * sin_source.x + b * cos_target.y * sin_target.x;\n float z = a * sin_source.y + b * sin_target.y;\n return vec2(atan(y, x), atan(z, sqrt(x * x + y * y)));\n }\n}\n\nvoid main() {\n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\n styleMappingMat = mat4(\n 0.0, 0.0, 0.0, 0.0, // opacity - strokeOpacity - strokeWidth - empty\n 0.0, 0.0, 0.0, 0.0, // strokeR - strokeG - strokeB - strokeA\n 0.0, 0.0, 0.0, 0.0, // offsets[0] - offsets[1]\n 0.0, 0.0, 0.0, 0.0 // dataset \u6570\u636E\u96C6\n );\n\n float rowCount = u_cellTypeLayout[0][0]; // \u5F53\u524D\u7684\u6570\u636E\u7EB9\u7406\u6709\u51E0\u884C\n float columnCount = u_cellTypeLayout[0][1]; // \u5F53\u770B\u5230\u6570\u636E\u7EB9\u7406\u6709\u51E0\u5217\n float columnWidth = 1.0/columnCount; // \u5217\u5BBD\n float rowHeight = 1.0/rowCount; // \u884C\u9AD8\n float cellCount = calCellCount(); // opacity - strokeOpacity - strokeWidth - stroke - offsets\n float id = a_vertexId; // \u7B2Cn\u4E2A\u9876\u70B9\n float cellCurrentRow = floor(id * cellCount / columnCount) + 1.0; // \u8D77\u59CB\u70B9\u5728\u7B2C\u51E0\u884C\n float cellCurrentColumn = mod(id * cellCount, columnCount) + 1.0; // \u8D77\u59CB\u70B9\u5728\u7B2C\u51E0\u5217\n \n // cell \u56FA\u5B9A\u987A\u5E8F opacity -> strokeOpacity -> strokeWidth -> stroke ... \n // \u6309\u987A\u5E8F\u4ECE cell \u4E2D\u53D6\u503C\u3001\u82E5\u6CA1\u6709\u5219\u81EA\u52A8\u5F80\u4E0B\u53D6\u503C\n float textureOffset = 0.0; // \u5728 cell \u4E2D\u53D6\u503C\u7684\u504F\u79FB\u91CF\n\n vec2 opacityAndOffset = calOpacityAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);\n styleMappingMat[0][0] = opacityAndOffset.r;\n textureOffset = opacityAndOffset.g;\n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\n\n v_color = a_Color;\n vec2 source = radians(a_Instance.rg);\n vec2 target = radians(a_Instance.ba);\n float angularDist = getAngularDist(source, target);\n float segmentIndex = a_Position.x;\n float segmentRatio = getSegmentRatio(segmentIndex);\n float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\n\n if(u_line_type == LineTypeDash) {\n v_distance_ratio = segmentIndex / segmentNumber;\n vec2 s = source;\n vec2 t = target;\n \n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n s = unProjCustomCoord(source);\n t = unProjCustomCoord(target);\n }\n float total_Distance = pixelDistance(s, t) / 2.0 * PI;\n total_Distance = total_Distance*16.0; // total_Distance*16.0 \u8C03\u6574\u9ED8\u8BA4\u7684\u6548\u679C\n v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / total_Distance;\n }\n\n if(u_animate.x == Animate) {\n v_distance_ratio = segmentIndex / segmentNumber;\n }\n\n float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);\n v_distance_ratio = segmentIndex / segmentNumber;\n vec4 curr = project_position(vec4(degrees(interpolate(source, target, angularDist, segmentRatio)), 0.0, 1.0));\n vec4 next = project_position(vec4(degrees(interpolate(source, target, angularDist, nextSegmentRatio)), 0.0, 1.0));\n // v_normal = getNormal((next.xy - curr.xy) * indexDir, a_Position.y);\n vec2 offset = project_pixel(getExtrusionOffset((next.xy - curr.xy) * indexDir, a_Position.y));\n // vec4 project_pos = project_position(vec4(curr.xy, 0, 1.0));\n // gl_Position = project_common_position_to_clipspace(vec4(curr.xy + offset, curr.z, 1.0));\n\n styleMappingMat[3].g = a_Position.x; // \u8BE5\u9876\u70B9\u5728\u5F27\u7EBF\u4E0A\u7684\u5206\u6BB5\u6392\u5E8F\n if(LineTexture == u_line_texture) { // \u5F00\u542F\u8D34\u56FE\u6A21\u5F0F \n // float mapZoomScale = u_CoordinateSystem !== COORDINATE_SYSTEM_P20_2?10000000.0:1.0;\n float d_arcDistrance = length(source - target);\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20) { // amap\n d_arcDistrance = d_arcDistrance * 1000000.0;\n }\n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) { // mapbox\n d_arcDistrance = project_pixel_allmap(d_arcDistrance);\n }\n float d_pixelLen = project_pixel(u_icon_step)/8.0;\n styleMappingMat[3].b = floor(d_arcDistrance/d_pixelLen); // \u8D34\u56FE\u5728\u5F27\u7EBF\u4E0A\u91CD\u590D\u7684\u6570\u91CF\n\n float lineOffsetWidth = length(offset + offset * sign(a_Position.y)); // \u7EBF\u6A2A\u5411\u504F\u79FB\u7684\u8DDD\u79BB\n float linePixelSize = project_pixel(a_Size); // \u5B9A\u70B9\u4F4D\u7F6E\u504F\u79FB\uFF0C\u6309\u5730\u56FE\u7B49\u7EA7\u7F29\u653E\u540E\u7684\u8DDD\u79BB\n styleMappingMat[3].a = lineOffsetWidth/linePixelSize; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C\n\n v_iconMapUV = a_iconMapUV;\n }\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(curr.xy + offset, curr.z, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(curr.xy + offset, curr.z, 1.0));\n }\n setPickingColor(a_PickingColor);\n}\n\n";
|
|
47
28
|
var lineStyleObj = {
|
|
48
29
|
solid: 0.0,
|
|
49
30
|
dash: 1.0
|
|
50
31
|
};
|
|
51
|
-
|
|
52
32
|
var GreatCircleModel = /*#__PURE__*/function (_BaseModel) {
|
|
53
33
|
(0, _inherits2.default)(GreatCircleModel, _BaseModel);
|
|
54
|
-
|
|
55
34
|
var _super = _createSuper(GreatCircleModel);
|
|
56
|
-
|
|
57
35
|
function GreatCircleModel() {
|
|
58
36
|
var _this;
|
|
59
|
-
|
|
60
37
|
(0, _classCallCheck2.default)(this, GreatCircleModel);
|
|
61
|
-
|
|
62
38
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
63
39
|
args[_key] = arguments[_key];
|
|
64
40
|
}
|
|
65
|
-
|
|
66
41
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
67
42
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "updateTexture", function () {
|
|
68
43
|
var createTexture2D = _this.rendererService.createTexture2D;
|
|
69
|
-
|
|
70
44
|
if (_this.texture) {
|
|
71
45
|
_this.texture.update({
|
|
72
46
|
data: _this.iconService.getCanvas()
|
|
73
47
|
});
|
|
74
|
-
|
|
75
48
|
_this.layer.render();
|
|
76
|
-
|
|
77
49
|
return;
|
|
78
50
|
}
|
|
79
|
-
|
|
80
51
|
_this.texture = createTexture2D({
|
|
81
52
|
data: _this.iconService.getCanvas(),
|
|
82
53
|
mag: _l7Core.gl.NEAREST,
|
|
@@ -88,48 +59,42 @@ var GreatCircleModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
88
59
|
});
|
|
89
60
|
return _this;
|
|
90
61
|
}
|
|
91
|
-
|
|
92
62
|
(0, _createClass2.default)(GreatCircleModel, [{
|
|
93
63
|
key: "getUninforms",
|
|
94
64
|
value: function getUninforms() {
|
|
95
65
|
var _ref = this.layer.getLayerConfig(),
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
66
|
+
_ref$opacity = _ref.opacity,
|
|
67
|
+
opacity = _ref$opacity === void 0 ? 1 : _ref$opacity,
|
|
68
|
+
sourceColor = _ref.sourceColor,
|
|
69
|
+
targetColor = _ref.targetColor,
|
|
70
|
+
_ref$textureBlend = _ref.textureBlend,
|
|
71
|
+
textureBlend = _ref$textureBlend === void 0 ? 'normal' : _ref$textureBlend,
|
|
72
|
+
_ref$lineType = _ref.lineType,
|
|
73
|
+
lineType = _ref$lineType === void 0 ? 'solid' : _ref$lineType,
|
|
74
|
+
_ref$dashArray = _ref.dashArray,
|
|
75
|
+
dashArray = _ref$dashArray === void 0 ? [10, 5] : _ref$dashArray,
|
|
76
|
+
_ref$lineTexture = _ref.lineTexture,
|
|
77
|
+
lineTexture = _ref$lineTexture === void 0 ? false : _ref$lineTexture,
|
|
78
|
+
_ref$iconStep = _ref.iconStep,
|
|
79
|
+
iconStep = _ref$iconStep === void 0 ? 100 : _ref$iconStep,
|
|
80
|
+
_ref$segmentNumber = _ref.segmentNumber,
|
|
81
|
+
segmentNumber = _ref$segmentNumber === void 0 ? 30 : _ref$segmentNumber;
|
|
113
82
|
if (dashArray.length === 2) {
|
|
114
83
|
dashArray.push(0, 0);
|
|
115
84
|
}
|
|
116
|
-
|
|
117
85
|
if (this.rendererService.getDirty()) {
|
|
118
86
|
this.texture.bind();
|
|
119
|
-
}
|
|
120
|
-
|
|
87
|
+
}
|
|
121
88
|
|
|
89
|
+
// 转化渐变色
|
|
122
90
|
var useLinearColor = 0; // 默认不生效
|
|
123
|
-
|
|
124
91
|
var sourceColorArr = [0, 0, 0, 0];
|
|
125
92
|
var targetColorArr = [0, 0, 0, 0];
|
|
126
|
-
|
|
127
93
|
if (sourceColor && targetColor) {
|
|
128
94
|
sourceColorArr = (0, _l7Utils.rgb2arr)(sourceColor);
|
|
129
95
|
targetColorArr = (0, _l7Utils.rgb2arr)(targetColor);
|
|
130
96
|
useLinearColor = 1;
|
|
131
97
|
}
|
|
132
|
-
|
|
133
98
|
if (this.dataTextureTest && this.dataTextureNeedUpdate({
|
|
134
99
|
opacity: opacity
|
|
135
100
|
})) {
|
|
@@ -137,12 +102,10 @@ var GreatCircleModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
137
102
|
opacity: opacity
|
|
138
103
|
});
|
|
139
104
|
var encodeData = this.layer.getEncodedData();
|
|
140
|
-
|
|
141
105
|
var _this$calDataFrame = this.calDataFrame(this.cellLength, encodeData, this.cellProperties),
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
106
|
+
data = _this$calDataFrame.data,
|
|
107
|
+
width = _this$calDataFrame.width,
|
|
108
|
+
height = _this$calDataFrame.height;
|
|
146
109
|
this.rowCount = height; // 当前数据纹理有多少行
|
|
147
110
|
|
|
148
111
|
this.dataTexture = this.cellLength > 0 && data.length > 0 ? this.createTexture2D({
|
|
@@ -161,7 +124,6 @@ var GreatCircleModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
161
124
|
height: 1
|
|
162
125
|
});
|
|
163
126
|
}
|
|
164
|
-
|
|
165
127
|
return {
|
|
166
128
|
u_dataTexture: this.dataTexture,
|
|
167
129
|
// 数据纹理 - 有数据映射的时候纹理中带数据,若没有任何数据映射时纹理是 [1]
|
|
@@ -188,8 +150,7 @@ var GreatCircleModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
188
150
|
key: "getAnimateUniforms",
|
|
189
151
|
value: function getAnimateUniforms() {
|
|
190
152
|
var _ref2 = this.layer.getLayerConfig(),
|
|
191
|
-
|
|
192
|
-
|
|
153
|
+
animateOption = _ref2.animateOption;
|
|
193
154
|
return {
|
|
194
155
|
u_animate: this.animateOption2Array(animateOption),
|
|
195
156
|
u_time: this.layer.getLayerAnimateTime()
|
|
@@ -200,32 +161,26 @@ var GreatCircleModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
200
161
|
value: function () {
|
|
201
162
|
var _initModels = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
202
163
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
203
|
-
while (1) {
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
case "end":
|
|
212
|
-
return _context.stop();
|
|
213
|
-
}
|
|
164
|
+
while (1) switch (_context.prev = _context.next) {
|
|
165
|
+
case 0:
|
|
166
|
+
this.updateTexture();
|
|
167
|
+
this.iconService.on('imageUpdate', this.updateTexture);
|
|
168
|
+
return _context.abrupt("return", this.buildModels());
|
|
169
|
+
case 3:
|
|
170
|
+
case "end":
|
|
171
|
+
return _context.stop();
|
|
214
172
|
}
|
|
215
173
|
}, _callee, this);
|
|
216
174
|
}));
|
|
217
|
-
|
|
218
175
|
function initModels() {
|
|
219
176
|
return _initModels.apply(this, arguments);
|
|
220
177
|
}
|
|
221
|
-
|
|
222
178
|
return initModels;
|
|
223
179
|
}()
|
|
224
180
|
}, {
|
|
225
181
|
key: "clearModels",
|
|
226
182
|
value: function clearModels() {
|
|
227
183
|
var _this$texture, _this$dataTexture;
|
|
228
|
-
|
|
229
184
|
(_this$texture = this.texture) === null || _this$texture === void 0 ? void 0 : _this$texture.destroy();
|
|
230
185
|
(_this$dataTexture = this.dataTexture) === null || _this$dataTexture === void 0 ? void 0 : _this$dataTexture.destroy();
|
|
231
186
|
this.iconService.off('imageUpdate', this.updateTexture);
|
|
@@ -236,43 +191,36 @@ var GreatCircleModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
236
191
|
var _buildModels = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
237
192
|
var model;
|
|
238
193
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
239
|
-
while (1) {
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
case 4:
|
|
258
|
-
case "end":
|
|
259
|
-
return _context2.stop();
|
|
260
|
-
}
|
|
194
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
195
|
+
case 0:
|
|
196
|
+
_context2.next = 2;
|
|
197
|
+
return this.layer.buildLayerModel({
|
|
198
|
+
moduleName: 'lineGreatCircle',
|
|
199
|
+
vertexShader: line_arc2d_vert,
|
|
200
|
+
fragmentShader: line_arc_frag,
|
|
201
|
+
triangulation: _triangulation.LineArcTriangulation,
|
|
202
|
+
depth: {
|
|
203
|
+
enable: false
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
case 2:
|
|
207
|
+
model = _context2.sent;
|
|
208
|
+
return _context2.abrupt("return", [model]);
|
|
209
|
+
case 4:
|
|
210
|
+
case "end":
|
|
211
|
+
return _context2.stop();
|
|
261
212
|
}
|
|
262
213
|
}, _callee2, this);
|
|
263
214
|
}));
|
|
264
|
-
|
|
265
215
|
function buildModels() {
|
|
266
216
|
return _buildModels.apply(this, arguments);
|
|
267
217
|
}
|
|
268
|
-
|
|
269
218
|
return buildModels;
|
|
270
219
|
}()
|
|
271
220
|
}, {
|
|
272
221
|
key: "registerBuiltinAttributes",
|
|
273
222
|
value: function registerBuiltinAttributes() {
|
|
274
223
|
var _this2 = this;
|
|
275
|
-
|
|
276
224
|
this.styleAttributeService.registerStyleAttribute({
|
|
277
225
|
name: 'size',
|
|
278
226
|
type: _l7Core.AttributeType.Attribute,
|
|
@@ -287,7 +235,7 @@ var GreatCircleModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
287
235
|
size: 1,
|
|
288
236
|
update: function update(feature) {
|
|
289
237
|
var _feature$size = feature.size,
|
|
290
|
-
|
|
238
|
+
size = _feature$size === void 0 ? 1 : _feature$size;
|
|
291
239
|
return Array.isArray(size) ? [size[0]] : [size];
|
|
292
240
|
}
|
|
293
241
|
}
|
|
@@ -323,16 +271,14 @@ var GreatCircleModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
323
271
|
size: 2,
|
|
324
272
|
update: function update(feature) {
|
|
325
273
|
var iconMap = _this2.iconService.getIconMap();
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
274
|
+
var texture = feature.texture;
|
|
275
|
+
// console.log('icon feature', feature)
|
|
329
276
|
var _ref3 = iconMap[texture] || {
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
277
|
+
x: 0,
|
|
278
|
+
y: 0
|
|
279
|
+
},
|
|
280
|
+
x = _ref3.x,
|
|
281
|
+
y = _ref3.y;
|
|
336
282
|
return [x, y];
|
|
337
283
|
}
|
|
338
284
|
}
|
|
@@ -341,5 +287,4 @@ var GreatCircleModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
341
287
|
}]);
|
|
342
288
|
return GreatCircleModel;
|
|
343
289
|
}(_BaseModel2.default);
|
|
344
|
-
|
|
345
290
|
exports.default = GreatCircleModel;
|
package/lib/line/models/half.js
CHANGED
|
@@ -1,84 +1,60 @@
|
|
|
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 _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
13
|
-
|
|
14
10
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
15
|
-
|
|
16
11
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
17
|
-
|
|
18
12
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
19
|
-
|
|
20
13
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
21
|
-
|
|
22
14
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
23
|
-
|
|
24
15
|
var _l7Core = require("@antv/l7-core");
|
|
25
|
-
|
|
26
16
|
var _l7Utils = require("@antv/l7-utils");
|
|
27
|
-
|
|
28
17
|
var _lodash = require("lodash");
|
|
29
|
-
|
|
30
18
|
var _BaseModel2 = _interopRequireDefault(require("../../core/BaseModel"));
|
|
31
|
-
|
|
32
19
|
var _triangulation = require("../../core/triangulation");
|
|
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
|
/* babel-plugin-inline-import '../shaders/half/line_half_frag.glsl' */
|
|
39
23
|
var line_half_frag = "#define COORDINATE_SYSTEM_LNGLAT 1.0 // mapbox\n#define COORDINATE_SYSTEM_LNGLAT_OFFSET 2.0 // mapbox offset\n#define COORDINATE_SYSTEM_VECTOR_TILE 3.0\n#define COORDINATE_SYSTEM_IDENTITY 4.0\n#define COORDINATE_SYSTEM_P20 5.0 // amap\n#define COORDINATE_SYSTEM_P20_OFFSET 6.0 // amap offset\n#define COORDINATE_SYSTEM_METER_OFFSET 7.0\n\n#define COORDINATE_SYSTEM_P20_2 8.0 // amap2.0\nuniform float u_CoordinateSystem;\nvarying vec4 v_color;\nuniform float u_arrow: 0.0;\nuniform float u_linearColor: 0;\nuniform vec4 u_sourceColor;\nuniform vec4 u_targetColor;\n\n#pragma include \"picking\"\n\nvarying mat4 styleMappingMat;\nvoid main() {\n float distanceAndIndex = styleMappingMat[0][3];\n float miter = styleMappingMat[0][2];\n\n float opacity = styleMappingMat[0][0];\n float d_distance_ratio = styleMappingMat[3].r; // \u5F53\u524D\u70B9\u4F4D\u8DDD\u79BB\u5360\u7EBF\u603B\u957F\u7684\u6BD4\u4F8B\n\n\n if(u_arrow > 0.0 && distanceAndIndex < 2.0) { // arrow\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20 || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) { \n if(cross(vec3(styleMappingMat[1].rg, 0.0), vec3(styleMappingMat[1].ba, 0.0)).z < 0.0) { // amap\n discard;\n }\n } else { // amap2 mapbox map\n if(cross(vec3(styleMappingMat[1].rg, 0.0), vec3(styleMappingMat[1].ba, 0.0)).z > 0.0) { \n discard;\n }\n }\n } else { // line body\n if(miter < 0.0) {\n discard;\n }\n }\n\n\n if(u_linearColor == 1.0) { // \u4F7F\u7528\u6E10\u53D8\u989C\u8272\n gl_FragColor = mix(u_sourceColor, u_targetColor, d_distance_ratio);\n } else { // \u4F7F\u7528 color \u65B9\u6CD5\u4F20\u5165\u7684\u989C\u8272\n gl_FragColor = v_color;\n }\n\n gl_FragColor.a *= opacity; // \u5168\u5C40\u900F\u660E\u5EA6\n gl_FragColor = filterColor(gl_FragColor);\n}\n";
|
|
40
|
-
|
|
41
24
|
/* babel-plugin-inline-import '../shaders/half/line_half_vert.glsl' */
|
|
42
25
|
var line_half_vert = "attribute float a_Miter;\nattribute vec4 a_Color;\nattribute vec2 a_Size;\nattribute vec3 a_Normal;\nattribute vec3 a_Position;\n\n// dash line\nattribute vec4 a_dirPoints;\nattribute vec3 a_DistanceAndIndex;\n\nuniform vec4 u_lineDir;\n\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\n\n#pragma include \"projection\"\n#pragma include \"picking\"\n\nvarying vec4 v_color;\n\nuniform float u_linearColor: 0;\nuniform float u_arrow: 0.0;\nuniform float u_arrowHeight: 3.0;\nuniform float u_arrowWidth: 2.0;\nuniform float u_tailWidth: 1.0;\n\nuniform float u_opacity: 1.0;\nvarying mat4 styleMappingMat; // \u7528\u4E8E\u5C06\u5728\u9876\u70B9\u7740\u8272\u5668\u4E2D\u8BA1\u7B97\u597D\u7684\u6837\u5F0F\u503C\u4F20\u9012\u7ED9\u7247\u5143\n\n#pragma include \"styleMapping\"\n#pragma include \"styleMappingCalOpacity\"\n\nvec2 calculateArrow(vec2 offset) {\n /*\n * \u5728\u652F\u6301\u7BAD\u5934\u7684\u65F6\u5019\uFF0C\u7B2C\u4E8C\u3001\u7B2C\u4E09\u7EC4\u9876\u70B9\u662F\u989D\u5916\u63D2\u5165\u7528\u4E8E\u6784\u5EFA\u9876\u70B9\u7684\n */\n float arrowFlag = -1.0;\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {\n // \u9AD8\u5FB7 2.0 \u7684\u65CB\u8F6C\u89D2\u5EA6\u4E0D\u540C\n arrowFlag = 1.0;\n }\n float pi = arrowFlag * 3.1415926/2.;\n if(a_Miter < 0.) {\n // \u6839\u636E\u7EBF\u7684\u4E24\u4FA7\u504F\u79FB\u4E0D\u540C\u3001\u65CB\u8F6C\u7684\u65B9\u5411\u76F8\u53CD\n pi = -pi;\n }\n highp float angle_sin = sin(pi);\n highp float angle_cos = cos(pi);\n // \u8BA1\u7B97\u5782\u76F4\u4E0E\u7EBF\u65B9\u5411\u7684\u65CB\u8F6C\u77E9\u9635\n mat2 rotation_matrix = mat2(angle_cos, -1.0 * angle_sin, angle_sin, angle_cos);\n float arrowWidth = u_arrowWidth;\n float arrowHeight = u_arrowHeight;\n\n vec2 arrowOffset = vec2(0.0);\n /*\n * a_DistanceAndIndex.y \u7528\u4E8E\u6807\u8BB0\u5F53\u524D\u9876\u70B9\u5C5E\u4E8E\u54EA\u4E00\u7EC4\uFF08\u4E24\u4E2A\u9876\u70B9\u4E00\u7EC4\uFF0C\u6784\u6210\u7EBF\u7684\u5176\u5B9E\u662F\u77E9\u5F62\uFF0C\u6700\u7B80\u9700\u8981\u56DB\u4E2A\u9876\u70B9\u3001\u4E24\u7EC4\u9876\u70B9\u6784\u6210\uFF09\n */\n if(a_DistanceAndIndex.y == 0.0) {\n // \u7BAD\u5934\u5C16\u90E8\n offset = vec2(0.0);\n } else if(a_DistanceAndIndex.y == 1.0) {\n // \u7BAD\u5934\u4E24\u4FA7\n arrowOffset = rotation_matrix*(offset * arrowHeight);\n offset += arrowOffset; // \u6CBF\u7EBF\u504F\u79FB\n offset = offset * arrowWidth; // \u5782\u76F4\u7EBF\u5411\u5916\u504F\u79FB\uFF08\u662F\u6784\u5EFA\u7BAD\u5934\u4E24\u4FA7\u7684\u9876\u70B9\uFF09\n } else if(a_DistanceAndIndex.y == 2.0 || a_DistanceAndIndex.y == 3.0 || a_DistanceAndIndex.y == 4.0) {\n // \u504F\u79FB\u5176\u4F59\u7684\u70B9\u4F4D\uFF08\u5C06\u957F\u5EA6\u8BA9\u4F4D\u7ED9\u7BAD\u5934\uFF09\n arrowOffset = rotation_matrix*(offset * arrowHeight) * arrowWidth;\n offset += arrowOffset;// \u6CBF\u7EBF\u504F\u79FB\n }\n\n return offset;\n}\n\nvoid main() {\n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\n styleMappingMat = mat4(\n 0.0, 0.0, 0.0, 0.0, // opacity - strokeOpacity - a_Miter - a_DistanceAndIndex\n 0.0, 0.0, 0.0, 0.0, // originX - originY - vectorX - vectorY\n 0.0, 0.0, 0.0, 0.0, // offsets[0] - offsets[1]\n 0.0, 0.0, 0.0, 0.0 // distance_ratio/distance/pixelLen/texV\n );\n styleMappingMat[0][3] = a_DistanceAndIndex.y;\n styleMappingMat[0][2] = a_Miter;\n\n float rowCount = u_cellTypeLayout[0][0]; // \u5F53\u524D\u7684\u6570\u636E\u7EB9\u7406\u6709\u51E0\u884C\n float columnCount = u_cellTypeLayout[0][1]; // \u5F53\u770B\u5230\u6570\u636E\u7EB9\u7406\u6709\u51E0\u5217\n float columnWidth = 1.0/columnCount; // \u5217\u5BBD\n float rowHeight = 1.0/rowCount; // \u884C\u9AD8\n float cellCount = calCellCount(); // opacity - strokeOpacity - strokeWidth - stroke - offsets\n float id = a_vertexId; // \u7B2Cn\u4E2A\u9876\u70B9\n float cellCurrentRow = floor(id * cellCount / columnCount) + 1.0; // \u8D77\u59CB\u70B9\u5728\u7B2C\u51E0\u884C\n float cellCurrentColumn = mod(id * cellCount, columnCount) + 1.0; // \u8D77\u59CB\u70B9\u5728\u7B2C\u51E0\u5217\n \n // cell \u56FA\u5B9A\u987A\u5E8F opacity -> strokeOpacity -> strokeWidth -> stroke ... \n // \u6309\u987A\u5E8F\u4ECE cell \u4E2D\u53D6\u503C\u3001\u82E5\u6CA1\u6709\u5219\u81EA\u52A8\u5F80\u4E0B\u53D6\u503C\n float textureOffset = 0.0; // \u5728 cell \u4E2D\u53D6\u503C\u7684\u504F\u79FB\u91CF\n\n vec2 opacityAndOffset = calOpacityAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);\n styleMappingMat[0][0] = opacityAndOffset.r;\n textureOffset = opacityAndOffset.g;\n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\n\n\n v_color = a_Color;\n\n vec3 size = a_Miter * setPickingSize(a_Size.x) * reverse_offset_normal(a_Normal);\n \n vec2 offset = project_pixel(size.xy);\n\n // styleMappingMat[1].rg = a_Position.xy + offset;\n\n vec2 copyOffset = vec2(offset.x, offset.y);\n\n float lineDistance = a_DistanceAndIndex.x;\n float total_Distance = a_DistanceAndIndex.z;\n float currentLinePointRatio = lineDistance / total_Distance;\n \n if(u_arrow > 0.0) {\n // \u8BA1\u7B97\u7BAD\u5934\n offset = calculateArrow(offset);\n\n if(a_DistanceAndIndex.y > 4.0) {\n offset *= mix(1.0, u_tailWidth, currentLinePointRatio);\n }\n }\n\n float lineOffsetWidth = length(offset + offset * sign(a_Miter)); // \u7EBF\u6A2A\u5411\u504F\u79FB\u7684\u8DDD\u79BB\uFF08\u5411\u4E24\u4FA7\u504F\u79FB\u7684\u548C\uFF09\n float linePixelSize = project_pixel(a_Size.x) * 2.0; // \u5B9A\u70B9\u4F4D\u7F6E\u504F\u79FB\uFF0C\u6309\u5730\u56FE\u7B49\u7EA7\u7F29\u653E\u540E\u7684\u8DDD\u79BB \u5355\u4FA7 * 2\n\n // \u8BBE\u7F6E\u6570\u636E\u96C6\u7684\u53C2\u6570\n styleMappingMat[3][0] = currentLinePointRatio; // \u5F53\u524D\u70B9\u4F4D\u8DDD\u79BB\u5360\u7EBF\u603B\u957F\u7684\u6BD4\u4F8B\n styleMappingMat[3][1] = lineDistance; // \u5F53\u524D\u9876\u70B9\u7684\u8DDD\u79BB\n\n vec4 project_pos = project_position(vec4(a_Position.xy, 0, 1.0));\n\n // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, a_Size.y, 1.0));\n\n float h = float(a_Position.z); // \u7EBF\u9876\u70B9\u7684\u9AD8\u5EA6 - \u517C\u5BB9\u4E0D\u5B58\u5728\u7B2C\u4E09\u4E2A\u6570\u503C\u7684\u60C5\u51B5 vertex height\n float lineHeight = a_Size.y; // size \u7B2C\u4E8C\u4E2A\u53C2\u6570\u4EE3\u8868\u7684\u9AD8\u5EA6 [linewidth, lineheight]\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n lineHeight *= 0.2; // \u4FDD\u6301\u548C amap/mapbox \u4E00\u81F4\u7684\u6548\u679C\n gl_Position = u_Mvp * (vec4(project_pos.xy + offset, lineHeight, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, lineHeight, 1.0));\n }\n \n if(u_arrow > 0.0 && a_DistanceAndIndex.y < 2.0) {\n vec2 startPoint = a_dirPoints.rg;\n vec2 endPoint = a_dirPoints.ba;\n vec4 t1 = project_position(vec4(startPoint, 0, 1.0));\n vec4 t2 = project_position(vec4(endPoint, 0, 1.0));\n // TODO\uFF1A \u540E\u7EED\u4F18\u5316\u53EF\u4EE5\u628A\u4F4D\u7F6E\u8BA1\u7B97\u653E\u5728 cpu \u4E2D\u5B8C\u6210\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n vec2 p1 = (u_Mvp * vec4(t1.xy, 0.0, 1.0)).xy;\n vec2 p2 = (u_Mvp * vec4(t2.xy, 0.0, 1.0)).xy;\n styleMappingMat[1].rg = normalize(p1 - p2);\n styleMappingMat[1].ba = normalize(gl_Position.xy - p2);\n } else {\n vec2 p1 = project_common_position_to_clipspace(vec4(t1.xy, 0.0, 1.0)).xy;\n vec2 p2 = project_common_position_to_clipspace(vec4(t2.xy, 0.0, 1.0)).xy;\n styleMappingMat[1].rg = normalize(p1 - p2);\n styleMappingMat[1].ba = normalize(gl_Position.xy - p2);\n }\n }\n\n setPickingColor(a_PickingColor);\n}\n";
|
|
43
|
-
|
|
44
26
|
var LineModel = /*#__PURE__*/function (_BaseModel) {
|
|
45
27
|
(0, _inherits2.default)(LineModel, _BaseModel);
|
|
46
|
-
|
|
47
28
|
var _super = _createSuper(LineModel);
|
|
48
|
-
|
|
49
29
|
function LineModel() {
|
|
50
30
|
(0, _classCallCheck2.default)(this, LineModel);
|
|
51
31
|
return _super.apply(this, arguments);
|
|
52
32
|
}
|
|
53
|
-
|
|
54
33
|
(0, _createClass2.default)(LineModel, [{
|
|
55
34
|
key: "getUninforms",
|
|
56
35
|
value: function getUninforms() {
|
|
57
36
|
var _ref = this.layer.getLayerConfig(),
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
37
|
+
_ref$opacity = _ref.opacity,
|
|
38
|
+
opacity = _ref$opacity === void 0 ? 1 : _ref$opacity,
|
|
39
|
+
sourceColor = _ref.sourceColor,
|
|
40
|
+
targetColor = _ref.targetColor,
|
|
41
|
+
_ref$arrow = _ref.arrow,
|
|
42
|
+
arrow = _ref$arrow === void 0 ? {
|
|
43
|
+
enable: false,
|
|
44
|
+
arrowWidth: 2,
|
|
45
|
+
arrowHeight: 3,
|
|
46
|
+
tailWidth: 1
|
|
47
|
+
} : _ref$arrow;
|
|
48
|
+
|
|
49
|
+
// 转化渐变色
|
|
71
50
|
var useLinearColor = 0; // 默认不生效
|
|
72
|
-
|
|
73
51
|
var sourceColorArr = [0, 0, 0, 0];
|
|
74
52
|
var targetColorArr = [0, 0, 0, 0];
|
|
75
|
-
|
|
76
53
|
if (sourceColor && targetColor) {
|
|
77
54
|
sourceColorArr = (0, _l7Utils.rgb2arr)(sourceColor);
|
|
78
55
|
targetColorArr = (0, _l7Utils.rgb2arr)(targetColor);
|
|
79
56
|
useLinearColor = 1;
|
|
80
57
|
}
|
|
81
|
-
|
|
82
58
|
if (this.dataTextureTest && this.dataTextureNeedUpdate({
|
|
83
59
|
opacity: opacity
|
|
84
60
|
})) {
|
|
@@ -86,12 +62,10 @@ var LineModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
86
62
|
opacity: opacity
|
|
87
63
|
});
|
|
88
64
|
var encodeData = this.layer.getEncodedData();
|
|
89
|
-
|
|
90
65
|
var _this$calDataFrame = this.calDataFrame(this.cellLength, encodeData, this.cellProperties),
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
66
|
+
data = _this$calDataFrame.data,
|
|
67
|
+
width = _this$calDataFrame.width,
|
|
68
|
+
height = _this$calDataFrame.height;
|
|
95
69
|
this.rowCount = height; // 当前数据纹理有多少行
|
|
96
70
|
|
|
97
71
|
this.dataTexture = this.cellLength > 0 && data.length > 0 ? this.createTexture2D({
|
|
@@ -110,7 +84,6 @@ var LineModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
110
84
|
height: 1
|
|
111
85
|
});
|
|
112
86
|
}
|
|
113
|
-
|
|
114
87
|
return {
|
|
115
88
|
u_dataTexture: this.dataTexture,
|
|
116
89
|
// 数据纹理 - 有数据映射的时候纹理中带数据,若没有任何数据映射时纹理是 [1]
|
|
@@ -132,30 +105,24 @@ var LineModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
132
105
|
value: function () {
|
|
133
106
|
var _initModels = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
134
107
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
135
|
-
while (1) {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
case "end":
|
|
142
|
-
return _context.stop();
|
|
143
|
-
}
|
|
108
|
+
while (1) switch (_context.prev = _context.next) {
|
|
109
|
+
case 0:
|
|
110
|
+
return _context.abrupt("return", this.buildModels());
|
|
111
|
+
case 1:
|
|
112
|
+
case "end":
|
|
113
|
+
return _context.stop();
|
|
144
114
|
}
|
|
145
115
|
}, _callee, this);
|
|
146
116
|
}));
|
|
147
|
-
|
|
148
117
|
function initModels() {
|
|
149
118
|
return _initModels.apply(this, arguments);
|
|
150
119
|
}
|
|
151
|
-
|
|
152
120
|
return initModels;
|
|
153
121
|
}()
|
|
154
122
|
}, {
|
|
155
123
|
key: "clearModels",
|
|
156
124
|
value: function clearModels() {
|
|
157
125
|
var _this$dataTexture;
|
|
158
|
-
|
|
159
126
|
(_this$dataTexture = this.dataTexture) === null || _this$dataTexture === void 0 ? void 0 : _this$dataTexture.destroy();
|
|
160
127
|
}
|
|
161
128
|
}, {
|
|
@@ -163,48 +130,40 @@ var LineModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
163
130
|
value: function () {
|
|
164
131
|
var _buildModels = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
165
132
|
var _ref2, _ref2$depth, depth, _this$getShaders, frag, vert, model;
|
|
166
|
-
|
|
167
133
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
168
|
-
while (1) {
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
case 7:
|
|
190
|
-
case "end":
|
|
191
|
-
return _context2.stop();
|
|
192
|
-
}
|
|
134
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
135
|
+
case 0:
|
|
136
|
+
_ref2 = this.layer.getLayerConfig(), _ref2$depth = _ref2.depth, depth = _ref2$depth === void 0 ? false : _ref2$depth;
|
|
137
|
+
_this$getShaders = this.getShaders(), frag = _this$getShaders.frag, vert = _this$getShaders.vert;
|
|
138
|
+
this.layer.triangulation = _triangulation.LineTriangulation;
|
|
139
|
+
_context2.next = 5;
|
|
140
|
+
return this.layer.buildLayerModel({
|
|
141
|
+
moduleName: 'lineHalf',
|
|
142
|
+
vertexShader: vert,
|
|
143
|
+
fragmentShader: frag,
|
|
144
|
+
triangulation: _triangulation.LineTriangulation,
|
|
145
|
+
depth: {
|
|
146
|
+
enable: depth
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
case 5:
|
|
150
|
+
model = _context2.sent;
|
|
151
|
+
return _context2.abrupt("return", [model]);
|
|
152
|
+
case 7:
|
|
153
|
+
case "end":
|
|
154
|
+
return _context2.stop();
|
|
193
155
|
}
|
|
194
156
|
}, _callee2, this);
|
|
195
157
|
}));
|
|
196
|
-
|
|
197
158
|
function buildModels() {
|
|
198
159
|
return _buildModels.apply(this, arguments);
|
|
199
160
|
}
|
|
200
|
-
|
|
201
161
|
return buildModels;
|
|
202
162
|
}()
|
|
203
163
|
/**
|
|
204
164
|
* 根据参数获取不同的 shader 代码
|
|
205
165
|
* @returns
|
|
206
166
|
*/
|
|
207
|
-
|
|
208
167
|
}, {
|
|
209
168
|
key: "getShaders",
|
|
210
169
|
value: function getShaders() {
|
|
@@ -267,12 +226,13 @@ var LineModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
267
226
|
size: 2,
|
|
268
227
|
update: function update(feature) {
|
|
269
228
|
var _feature$size = feature.size,
|
|
270
|
-
|
|
229
|
+
size = _feature$size === void 0 ? 1 : _feature$size;
|
|
271
230
|
return Array.isArray(size) ? [size[0], size[1]] : [size, 0];
|
|
272
231
|
}
|
|
273
232
|
}
|
|
274
|
-
});
|
|
233
|
+
});
|
|
275
234
|
|
|
235
|
+
// point layer size;
|
|
276
236
|
this.styleAttributeService.registerStyleAttribute({
|
|
277
237
|
name: 'normal',
|
|
278
238
|
type: _l7Core.AttributeType.Attribute,
|
|
@@ -311,5 +271,4 @@ var LineModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
311
271
|
}]);
|
|
312
272
|
return LineModel;
|
|
313
273
|
}(_BaseModel2.default);
|
|
314
|
-
|
|
315
274
|
exports.default = LineModel;
|
package/lib/line/models/index.js
CHANGED
|
@@ -1,30 +1,19 @@
|
|
|
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 _arc = _interopRequireDefault(require("./arc"));
|
|
11
|
-
|
|
12
9
|
var _arc_3d = _interopRequireDefault(require("./arc_3d"));
|
|
13
|
-
|
|
14
10
|
var _earthArc_3d = _interopRequireDefault(require("./earthArc_3d"));
|
|
15
|
-
|
|
16
11
|
var _great_circle = _interopRequireDefault(require("./great_circle"));
|
|
17
|
-
|
|
18
12
|
var _half = _interopRequireDefault(require("./half"));
|
|
19
|
-
|
|
20
13
|
var _line = _interopRequireDefault(require("./line"));
|
|
21
|
-
|
|
22
14
|
var _linearline = _interopRequireDefault(require("./linearline"));
|
|
23
|
-
|
|
24
15
|
var _simpleLine = _interopRequireDefault(require("./simpleLine"));
|
|
25
|
-
|
|
26
16
|
var _wall = _interopRequireDefault(require("./wall"));
|
|
27
|
-
|
|
28
17
|
var LineModels = {
|
|
29
18
|
arc: _arc.default,
|
|
30
19
|
arc3d: _arc_3d.default,
|