@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
|
@@ -1,219 +1,310 @@
|
|
|
1
|
-
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
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);
|
|
1
|
+
"use strict";
|
|
21
2
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
-
var
|
|
32
|
-
|
|
33
|
-
var
|
|
34
|
-
|
|
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 _l7Core = require("@antv/l7-core");
|
|
25
|
+
|
|
26
|
+
var _l7Utils = require("@antv/l7-utils");
|
|
27
|
+
|
|
28
|
+
var _lodash = require("lodash");
|
|
29
|
+
|
|
30
|
+
var _BaseModel2 = _interopRequireDefault(require("../../core/BaseModel"));
|
|
31
|
+
|
|
32
|
+
var _triangulation = require("../../core/triangulation");
|
|
33
|
+
|
|
34
|
+
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
|
+
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
|
+
/* babel-plugin-inline-import '../shaders/line_arc_great_circle_frag.glsl' */
|
|
39
|
+
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_aimate: [ 0, 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_aimate.x == Animate) {\n animateSpeed = u_time / u_aimate.y;\n float alpha =1.0 - fract( mod(1.0- v_distance_ratio, u_aimate.z)* (1.0/ u_aimate.z) + u_time / u_aimate.y);\n alpha = (alpha + u_aimate.w -1.0) / u_aimate.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_aimate.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}";
|
|
40
|
+
|
|
41
|
+
/* babel-plugin-inline-import '../shaders/line_arc_great_circle_vert.glsl' */
|
|
42
|
+
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_aimate: [ 0, 2., 1.0, 0.2 ];\nvarying vec4 v_color;\n// varying vec2 v_normal;\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_aimate.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";
|
|
35
43
|
var lineStyleObj = {
|
|
36
|
-
solid: 0,
|
|
37
|
-
dash: 1
|
|
44
|
+
solid: 0.0,
|
|
45
|
+
dash: 1.0
|
|
38
46
|
};
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
+
|
|
48
|
+
var GreatCircleModel = /*#__PURE__*/function (_BaseModel) {
|
|
49
|
+
(0, _inherits2.default)(GreatCircleModel, _BaseModel);
|
|
50
|
+
|
|
51
|
+
var _super = _createSuper(GreatCircleModel);
|
|
52
|
+
|
|
53
|
+
function GreatCircleModel() {
|
|
54
|
+
var _this;
|
|
55
|
+
|
|
56
|
+
(0, _classCallCheck2.default)(this, GreatCircleModel);
|
|
57
|
+
|
|
58
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
59
|
+
args[_key] = arguments[_key];
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
63
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "updateTexture", function () {
|
|
64
|
+
var createTexture2D = _this.rendererService.createTexture2D;
|
|
65
|
+
|
|
66
|
+
if (_this.texture) {
|
|
67
|
+
_this.texture.update({
|
|
68
|
+
data: _this.iconService.getCanvas()
|
|
47
69
|
});
|
|
48
|
-
|
|
70
|
+
|
|
71
|
+
_this.layer.render();
|
|
72
|
+
|
|
49
73
|
return;
|
|
50
74
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
75
|
+
|
|
76
|
+
_this.texture = createTexture2D({
|
|
77
|
+
data: _this.iconService.getCanvas(),
|
|
78
|
+
mag: _l7Core.gl.NEAREST,
|
|
79
|
+
min: _l7Core.gl.NEAREST,
|
|
55
80
|
premultiplyAlpha: false,
|
|
56
81
|
width: 1024,
|
|
57
|
-
height:
|
|
82
|
+
height: _this.iconService.canvasHeight || 128
|
|
58
83
|
});
|
|
59
|
-
};
|
|
84
|
+
});
|
|
85
|
+
return _this;
|
|
60
86
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
87
|
+
|
|
88
|
+
(0, _createClass2.default)(GreatCircleModel, [{
|
|
89
|
+
key: "getUninforms",
|
|
90
|
+
value: function getUninforms() {
|
|
91
|
+
var _ref = this.layer.getLayerConfig(),
|
|
92
|
+
_ref$opacity = _ref.opacity,
|
|
93
|
+
opacity = _ref$opacity === void 0 ? 1 : _ref$opacity,
|
|
94
|
+
sourceColor = _ref.sourceColor,
|
|
95
|
+
targetColor = _ref.targetColor,
|
|
96
|
+
_ref$textureBlend = _ref.textureBlend,
|
|
97
|
+
textureBlend = _ref$textureBlend === void 0 ? 'normal' : _ref$textureBlend,
|
|
98
|
+
_ref$lineType = _ref.lineType,
|
|
99
|
+
lineType = _ref$lineType === void 0 ? 'solid' : _ref$lineType,
|
|
100
|
+
_ref$dashArray = _ref.dashArray,
|
|
101
|
+
dashArray = _ref$dashArray === void 0 ? [10, 5] : _ref$dashArray,
|
|
102
|
+
_ref$lineTexture = _ref.lineTexture,
|
|
103
|
+
lineTexture = _ref$lineTexture === void 0 ? false : _ref$lineTexture,
|
|
104
|
+
_ref$iconStep = _ref.iconStep,
|
|
105
|
+
iconStep = _ref$iconStep === void 0 ? 100 : _ref$iconStep,
|
|
106
|
+
_ref$segmentNumber = _ref.segmentNumber,
|
|
107
|
+
segmentNumber = _ref$segmentNumber === void 0 ? 30 : _ref$segmentNumber;
|
|
108
|
+
|
|
109
|
+
if (dashArray.length === 2) {
|
|
110
|
+
dashArray.push(0, 0);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
if (this.rendererService.getDirty()) {
|
|
114
|
+
this.texture.bind();
|
|
115
|
+
} // 转化渐变色
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
var useLinearColor = 0; // 默认不生效
|
|
119
|
+
|
|
120
|
+
var sourceColorArr = [0, 0, 0, 0];
|
|
121
|
+
var targetColorArr = [0, 0, 0, 0];
|
|
122
|
+
|
|
123
|
+
if (sourceColor && targetColor) {
|
|
124
|
+
sourceColorArr = (0, _l7Utils.rgb2arr)(sourceColor);
|
|
125
|
+
targetColorArr = (0, _l7Utils.rgb2arr)(targetColor);
|
|
126
|
+
useLinearColor = 1;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
if (this.dataTextureTest && this.dataTextureNeedUpdate({
|
|
130
|
+
opacity: opacity
|
|
131
|
+
})) {
|
|
132
|
+
this.judgeStyleAttributes({
|
|
133
|
+
opacity: opacity
|
|
134
|
+
});
|
|
135
|
+
var encodeData = this.layer.getEncodedData();
|
|
136
|
+
|
|
137
|
+
var _this$calDataFrame = this.calDataFrame(this.cellLength, encodeData, this.cellProperties),
|
|
138
|
+
data = _this$calDataFrame.data,
|
|
139
|
+
width = _this$calDataFrame.width,
|
|
140
|
+
height = _this$calDataFrame.height;
|
|
141
|
+
|
|
142
|
+
this.rowCount = height; // 当前数据纹理有多少行
|
|
143
|
+
|
|
144
|
+
this.dataTexture = this.cellLength > 0 && data.length > 0 ? this.createTexture2D({
|
|
145
|
+
flipY: true,
|
|
146
|
+
data: data,
|
|
147
|
+
format: _l7Core.gl.LUMINANCE,
|
|
148
|
+
type: _l7Core.gl.FLOAT,
|
|
149
|
+
width: width,
|
|
150
|
+
height: height
|
|
151
|
+
}) : this.createTexture2D({
|
|
152
|
+
flipY: true,
|
|
153
|
+
data: [1],
|
|
154
|
+
format: _l7Core.gl.LUMINANCE,
|
|
155
|
+
type: _l7Core.gl.FLOAT,
|
|
156
|
+
width: 1,
|
|
157
|
+
height: 1
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
return {
|
|
162
|
+
u_dataTexture: this.dataTexture,
|
|
163
|
+
// 数据纹理 - 有数据映射的时候纹理中带数据,若没有任何数据映射时纹理是 [1]
|
|
164
|
+
u_cellTypeLayout: this.getCellTypeLayout(),
|
|
165
|
+
u_opacity: (0, _lodash.isNumber)(opacity) ? opacity : 1.0,
|
|
166
|
+
u_textureBlend: textureBlend === 'normal' ? 0.0 : 1.0,
|
|
167
|
+
segmentNumber: segmentNumber,
|
|
168
|
+
u_line_type: lineStyleObj[lineType] || 0.0,
|
|
169
|
+
u_dash_array: dashArray,
|
|
170
|
+
// 纹理支持参数
|
|
171
|
+
u_texture: this.texture,
|
|
172
|
+
// 贴图
|
|
173
|
+
u_line_texture: lineTexture ? 1.0 : 0.0,
|
|
174
|
+
// 传入线的标识
|
|
175
|
+
u_icon_step: iconStep,
|
|
176
|
+
u_textSize: [1024, this.iconService.canvasHeight || 128],
|
|
177
|
+
// 渐变色支持参数
|
|
178
|
+
u_linearColor: useLinearColor,
|
|
179
|
+
u_sourceColor: sourceColorArr,
|
|
180
|
+
u_targetColor: targetColorArr
|
|
181
|
+
};
|
|
75
182
|
}
|
|
76
|
-
|
|
77
|
-
|
|
183
|
+
}, {
|
|
184
|
+
key: "getAnimateUniforms",
|
|
185
|
+
value: function getAnimateUniforms() {
|
|
186
|
+
var _ref2 = this.layer.getLayerConfig(),
|
|
187
|
+
animateOption = _ref2.animateOption;
|
|
188
|
+
|
|
189
|
+
return {
|
|
190
|
+
u_aimate: this.animateOption2Array(animateOption),
|
|
191
|
+
u_time: this.layer.getLayerAnimateTime()
|
|
192
|
+
};
|
|
78
193
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
useLinearColor = 1;
|
|
194
|
+
}, {
|
|
195
|
+
key: "initModels",
|
|
196
|
+
value: function initModels(callbackModel) {
|
|
197
|
+
this.updateTexture();
|
|
198
|
+
this.iconService.on('imageUpdate', this.updateTexture);
|
|
199
|
+
this.buildModels(callbackModel);
|
|
86
200
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
format: import_l7_core.gl.LUMINANCE,
|
|
96
|
-
type: import_l7_core.gl.FLOAT,
|
|
97
|
-
width,
|
|
98
|
-
height
|
|
99
|
-
}) : this.createTexture2D({
|
|
100
|
-
flipY: true,
|
|
101
|
-
data: [1],
|
|
102
|
-
format: import_l7_core.gl.LUMINANCE,
|
|
103
|
-
type: import_l7_core.gl.FLOAT,
|
|
104
|
-
width: 1,
|
|
105
|
-
height: 1
|
|
106
|
-
});
|
|
201
|
+
}, {
|
|
202
|
+
key: "clearModels",
|
|
203
|
+
value: function clearModels() {
|
|
204
|
+
var _this$texture, _this$dataTexture;
|
|
205
|
+
|
|
206
|
+
(_this$texture = this.texture) === null || _this$texture === void 0 ? void 0 : _this$texture.destroy();
|
|
207
|
+
(_this$dataTexture = this.dataTexture) === null || _this$dataTexture === void 0 ? void 0 : _this$dataTexture.destroy();
|
|
208
|
+
this.iconService.off('imageUpdate', this.updateTexture);
|
|
107
209
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
}
|
|
125
|
-
getAnimateUniforms() {
|
|
126
|
-
const { animateOption } = this.layer.getLayerConfig();
|
|
127
|
-
return {
|
|
128
|
-
u_aimate: this.animateOption2Array(animateOption),
|
|
129
|
-
u_time: this.layer.getLayerAnimateTime()
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
initModels(callbackModel) {
|
|
133
|
-
this.updateTexture();
|
|
134
|
-
this.iconService.on("imageUpdate", this.updateTexture);
|
|
135
|
-
this.buildModels(callbackModel);
|
|
136
|
-
}
|
|
137
|
-
clearModels() {
|
|
138
|
-
var _a, _b;
|
|
139
|
-
(_a = this.texture) == null ? void 0 : _a.destroy();
|
|
140
|
-
(_b = this.dataTexture) == null ? void 0 : _b.destroy();
|
|
141
|
-
this.iconService.off("imageUpdate", this.updateTexture);
|
|
142
|
-
}
|
|
143
|
-
buildModels(callbackModel) {
|
|
144
|
-
const {
|
|
145
|
-
mask = false,
|
|
146
|
-
maskInside = true
|
|
147
|
-
} = this.layer.getLayerConfig();
|
|
148
|
-
this.layer.buildLayerModel({
|
|
149
|
-
moduleName: "lineGreatCircle",
|
|
150
|
-
vertexShader: import_line_arc_great_circle_vert.default,
|
|
151
|
-
fragmentShader: import_line_arc_great_circle_frag.default,
|
|
152
|
-
triangulation: import_triangulation.LineArcTriangulation,
|
|
153
|
-
depth: { enable: false },
|
|
154
|
-
blend: this.getBlend(),
|
|
155
|
-
stencil: (0, import_l7_utils.getMask)(mask, maskInside)
|
|
156
|
-
}).then((model) => {
|
|
157
|
-
callbackModel([model]);
|
|
158
|
-
}).catch((err) => {
|
|
159
|
-
console.warn(err);
|
|
160
|
-
callbackModel([]);
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
registerBuiltinAttributes() {
|
|
164
|
-
this.styleAttributeService.registerStyleAttribute({
|
|
165
|
-
name: "size",
|
|
166
|
-
type: import_l7_core.AttributeType.Attribute,
|
|
167
|
-
descriptor: {
|
|
168
|
-
name: "a_Size",
|
|
169
|
-
buffer: {
|
|
170
|
-
usage: import_l7_core.gl.DYNAMIC_DRAW,
|
|
171
|
-
data: [],
|
|
172
|
-
type: import_l7_core.gl.FLOAT
|
|
210
|
+
}, {
|
|
211
|
+
key: "buildModels",
|
|
212
|
+
value: function buildModels(callbackModel) {
|
|
213
|
+
var _ref3 = this.layer.getLayerConfig(),
|
|
214
|
+
_ref3$mask = _ref3.mask,
|
|
215
|
+
mask = _ref3$mask === void 0 ? false : _ref3$mask,
|
|
216
|
+
_ref3$maskInside = _ref3.maskInside,
|
|
217
|
+
maskInside = _ref3$maskInside === void 0 ? true : _ref3$maskInside;
|
|
218
|
+
|
|
219
|
+
this.layer.buildLayerModel({
|
|
220
|
+
moduleName: 'lineGreatCircle',
|
|
221
|
+
vertexShader: line_arc2d_vert,
|
|
222
|
+
fragmentShader: line_arc_frag,
|
|
223
|
+
triangulation: _triangulation.LineArcTriangulation,
|
|
224
|
+
depth: {
|
|
225
|
+
enable: false
|
|
173
226
|
},
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
227
|
+
blend: this.getBlend(),
|
|
228
|
+
stencil: (0, _l7Utils.getMask)(mask, maskInside)
|
|
229
|
+
}).then(function (model) {
|
|
230
|
+
callbackModel([model]);
|
|
231
|
+
}).catch(function (err) {
|
|
232
|
+
console.warn(err);
|
|
233
|
+
callbackModel([]);
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
}, {
|
|
237
|
+
key: "registerBuiltinAttributes",
|
|
238
|
+
value: function registerBuiltinAttributes() {
|
|
239
|
+
var _this2 = this;
|
|
240
|
+
|
|
241
|
+
this.styleAttributeService.registerStyleAttribute({
|
|
242
|
+
name: 'size',
|
|
243
|
+
type: _l7Core.AttributeType.Attribute,
|
|
244
|
+
descriptor: {
|
|
245
|
+
name: 'a_Size',
|
|
246
|
+
buffer: {
|
|
247
|
+
// give the WebGL driver a hint that this buffer may change
|
|
248
|
+
usage: _l7Core.gl.DYNAMIC_DRAW,
|
|
249
|
+
data: [],
|
|
250
|
+
type: _l7Core.gl.FLOAT
|
|
251
|
+
},
|
|
252
|
+
size: 1,
|
|
253
|
+
update: function update(feature, featureIdx, vertex, attributeIdx) {
|
|
254
|
+
var _feature$size = feature.size,
|
|
255
|
+
size = _feature$size === void 0 ? 1 : _feature$size;
|
|
256
|
+
return Array.isArray(size) ? [size[0]] : [size];
|
|
257
|
+
}
|
|
178
258
|
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
259
|
+
});
|
|
260
|
+
this.styleAttributeService.registerStyleAttribute({
|
|
261
|
+
name: 'instance',
|
|
262
|
+
// 弧线起始点信息
|
|
263
|
+
type: _l7Core.AttributeType.Attribute,
|
|
264
|
+
descriptor: {
|
|
265
|
+
name: 'a_Instance',
|
|
266
|
+
buffer: {
|
|
267
|
+
usage: _l7Core.gl.STATIC_DRAW,
|
|
268
|
+
data: [],
|
|
269
|
+
type: _l7Core.gl.FLOAT
|
|
270
|
+
},
|
|
271
|
+
size: 4,
|
|
272
|
+
update: function update(feature, featureIdx, vertex, attributeIdx) {
|
|
273
|
+
return [vertex[3], vertex[4], vertex[5], vertex[6]];
|
|
274
|
+
}
|
|
194
275
|
}
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
276
|
+
});
|
|
277
|
+
this.styleAttributeService.registerStyleAttribute({
|
|
278
|
+
name: 'uv',
|
|
279
|
+
type: _l7Core.AttributeType.Attribute,
|
|
280
|
+
descriptor: {
|
|
281
|
+
name: 'a_iconMapUV',
|
|
282
|
+
buffer: {
|
|
283
|
+
// give the WebGL driver a hint that this buffer may change
|
|
284
|
+
usage: _l7Core.gl.DYNAMIC_DRAW,
|
|
285
|
+
data: [],
|
|
286
|
+
type: _l7Core.gl.FLOAT
|
|
287
|
+
},
|
|
288
|
+
size: 2,
|
|
289
|
+
update: function update(feature, featureIdx, vertex, attributeIdx) {
|
|
290
|
+
var iconMap = _this2.iconService.getIconMap();
|
|
291
|
+
|
|
292
|
+
var texture = feature.texture; // console.log('icon feature', feature)
|
|
293
|
+
|
|
294
|
+
var _ref4 = iconMap[texture] || {
|
|
295
|
+
x: 0,
|
|
296
|
+
y: 0
|
|
297
|
+
},
|
|
298
|
+
x = _ref4.x,
|
|
299
|
+
y = _ref4.y;
|
|
300
|
+
|
|
301
|
+
return [x, y];
|
|
302
|
+
}
|
|
213
303
|
}
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
}]);
|
|
307
|
+
return GreatCircleModel;
|
|
308
|
+
}(_BaseModel2.default);
|
|
309
|
+
|
|
310
|
+
exports.default = GreatCircleModel;
|