@maptalks/vt 0.103.5 → 0.104.0
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/dist/maptalks.vt.d.ts +1 -1
- package/dist/maptalks.vt.es.js +7 -6
- package/dist/maptalks.vt.es.js.map +1 -1
- package/dist/maptalks.vt.js +241 -240
- package/dist/maptalks.vt.js.map +1 -1
- package/package.json +2 -2
package/dist/maptalks.vt.d.ts
CHANGED
package/dist/maptalks.vt.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @maptalks/vt v0.
|
|
2
|
+
* @maptalks/vt v0.104.0
|
|
3
3
|
* LICENSE : undefined
|
|
4
4
|
* (c) 2016-2025 maptalks.org
|
|
5
5
|
*/
|
|
@@ -12738,7 +12738,8 @@ class On extends pn {
|
|
|
12738
12738
|
const l = this.getSymbol(s), h = {
|
|
12739
12739
|
tileResolution: i.properties.tileResolution,
|
|
12740
12740
|
tileRatio: i.properties.tileRatio,
|
|
12741
|
-
tileExtent: i.properties.tileExtent
|
|
12741
|
+
tileExtent: i.properties.tileExtent,
|
|
12742
|
+
fogFactor: this.layer.options.fogFactor || 0
|
|
12742
12743
|
};
|
|
12743
12744
|
this.setLineUniforms(l, h), Ie(h, "lineColor", l, "lineColor", "#fff", Oe(this.colorCache)),
|
|
12744
12745
|
Ie(h, "linePatterGapColor", l, "linePatterGapColor", [ 0, 0, 0, 0 ], Oe(this.colorCache)),
|
|
@@ -12922,7 +12923,7 @@ class On extends pn {
|
|
|
12922
12923
|
}
|
|
12923
12924
|
}), this.shader = new r.MeshShader({
|
|
12924
12925
|
vert: In,
|
|
12925
|
-
frag: "#define SHADER_NAME LINE\n#define DEVICE_PIXEL_RATIO 1.0\nprecision highp float;\n#if defined(HAS_SHADOWING) && !defined(HAS_BLOOM)\n#include <vsm_shadow_frag>\n#endif\nuniform lowp float blendSrcIsOne;\nuniform lowp float lineBlur;\nuniform float isRenderingTerrain;\n#ifdef HAS_COLOR\nvarying vec4 vColor;\n#else\nuniform lowp vec4 lineColor;\n#endif\n#include <highlight_frag>\n#ifdef HAS_STROKE_COLOR\nvarying vec4 vStrokeColor;\n#else\nuniform lowp vec4 lineStrokeColor;\n#endif\n#ifdef HAS_OPACITY\nvarying float vOpacity;\n#else\nuniform lowp float lineOpacity;\n#endif\nuniform float layerOpacity;\n#ifdef HAS_PATTERN\nuniform sampler2D linePatternFile;\nuniform vec2 atlasSize;\nuniform float flipY;\n#ifdef HAS_PATTERN_ANIM\nvarying float vLinePatternAnimSpeed;\n#else\nuniform float linePatternAnimSpeed;\n#endif\n#ifdef HAS_PATTERN_GAP\nvarying float vLinePatternGap;\n#else\nuniform float linePatternGap;\n#endif\nuniform vec4 linePatterGapColor;\nvarying vec4 vTexInfo;\nvec2 c(vec2 d) {\n vec2 e = mod(d, 1.);\n vec2 f = vTexInfo.xy;\n vec2 h = vTexInfo.zw;\n return (f + e * h) / atlasSize;\n}\n#endif\nvarying vec2 vNormal;\nvarying vec2 vWidth;\nvarying float vGammaScale;\n#ifndef ENABLE_TILE_STENCIL\nvarying vec2 vPosition;\n#endif\nuniform float tileExtent;\n#ifdef HAS_DASHARRAY\n#ifdef HAS_DASHARRAY_ATTR\nvarying vec4 vDasharray;\n#else\nuniform vec4 lineDasharray;\n#endif\n#ifdef HAS_DASHARRAY_COLOR\nvarying vec4 vDashColor;\n#else\nuniform vec4 lineDashColor;\n#endif\n#endif\n#if defined(HAS_PATTERN) || defined(HAS_DASHARRAY) || defined(HAS_GRADIENT) || defined(HAS_TRAIL)\nvarying highp float vLinesofar;\n#endif\n#ifdef HAS_TRAIL\nuniform float trailSpeed;\nuniform float trailLength;\nuniform float trailCircle;\n#endif\n#if defined(HAS_TRAIL) || defined(HAS_PATTERN)\nuniform float currentTime;\n#endif\nfloat i(float j, float k) {\n float l = k / 2.;\n float m = abs(j - l);\n float n = (.1 + 1. / DEVICE_PIXEL_RATIO) * vGammaScale;\n return clamp(min(m + n, l - m) / n, .0, 1.);\n}\nvarying vec3 vVertex;\nuniform vec3 cameraPosition;\nuniform float cameraToCenterDistance;\nvoid main() {\n \n#ifndef ENABLE_TILE_STENCIL\nfloat o = sign(tileExtent - min(tileExtent, abs(vPosition.x))) * sign(1. + sign(vPosition.x)) * sign(tileExtent - min(tileExtent, abs(vPosition.y))) * sign(1. + sign(vPosition.y));\n if(o == .0) {\n discard;\n }\n#endif\n#if defined(HAS_PATTERN) || defined(HAS_DASHARRAY) || defined(HAS_GRADIENT) || defined(HAS_TRAIL)\nfloat u = vLinesofar;\n#endif\nfloat v = length(vNormal) * vWidth.s;\n#ifdef HAS_PATTERN\nvec2 h = vTexInfo.zw;\n float A = sign(h.x * h.y);\n float B = mix(lineBlur, .0, A);\n#else\nfloat B = lineBlur;\n#endif\nfloat n = (B + 1. / DEVICE_PIXEL_RATIO) * vGammaScale;\n float C = clamp(min(v - (vWidth.t - n), vWidth.s - v) / n, .0, 1.);\n#ifdef HAS_COLOR\nvec4 D = vColor / 255.;\n#else\nvec4 D = lineColor;\n#endif\n#ifdef HAS_PATTERN\nif(A == 1.) {\n \n#ifdef HAS_PATTERN_GAP\nfloat E = vLinePatternGap;\n#else\nfloat E = linePatternGap;\n#endif\n#ifdef HAS_PATTERN_ANIM\nfloat F = vLinePatternAnimSpeed;\n#else\nfloat F = linePatternAnimSpeed;\n#endif\nfloat G = h.x * vWidth.s * 2. / h.y;\n float H = G * (1. + E);\n u += mod(currentTime * -F * .2, H);\n float I = mod(u / H, 1.);\n float J = mod((flipY * vNormal.y + 1.) / 2., 1.);\n vec4 K = texture2D(linePatternFile, c(vec2(I * (1. + E), J)));\n float L = clamp(sign(1. / (1. + E) - I) + .000001, .0, 1.);\n K = mix(linePatterGapColor, K, L);\n D *= K;\n }\n#endif\n#ifdef HAS_DASHARRAY\n#ifdef HAS_DASHARRAY_ATTR\nvec4 M = vDasharray;\n#else\nvec4 M = lineDasharray;\n#endif\n#ifdef HAS_DASHARRAY_COLOR\nvec4 N = vDashColor;\n#else\nvec4 N = lineDashColor;\n#endif\nfloat k = M[0] + M[1] + M[2] + M[3];\n float j = mod(u, k);\n float O = max(sign(M[0] - j), .0);\n float P = j - M[0] - M[1];\n float Q = max(sign(P), .0) * max(sign(M[2] - P), .0);\n float R = O + Q;\n float S = i(j, M[0]);\n float T = i(P, M[2]);\n float U = S * O + T * Q;\n D = D * (1. - U) + N * U;\n#endif\n#ifdef HAS_STROKE_COLOR\nvec4 V = vStrokeColor / 255.;\n#else\nvec4 V = lineStrokeColor;\n#endif\nV = mix(D, V, sign(vWidth.t));\n D = V * C + max(sign(vWidth.t - v), .0) * D * (1. - C);\n#ifdef HAS_TRAIL\nfloat W = mod(u - currentTime * trailSpeed * .1, trailCircle);\n float X = W < trailLength ? mix(.0, 1., W / trailLength) : .0;\n D *= X;\n#endif\n#ifdef HAS_OPACITY\nfloat Y = vOpacity;\n#else\nfloat Y = lineOpacity;\n#endif\ngl_FragColor = D * Y * layerOpacity;\n#if defined(HAS_SHADOWING) && !defined(HAS_BLOOM)\nfloat Z = shadow_computeShadow();\n gl_FragColor.rgb = shadow_blend(gl_FragColor.rgb, Z);\n#endif\nfloat ba;\n if(isRenderingTerrain == 1.) {\n ba = 1.;\n } else {\n ba = clamp(cameraToCenterDistance * 1.5 / distance(vVertex, cameraPosition), .0, 1.);\n }\n gl_FragColor *= ba;\n gl_FragColor = highlight_blendColor(gl_FragColor);\n}",
|
|
12926
|
+
frag: "#define SHADER_NAME LINE\n#define DEVICE_PIXEL_RATIO 1.0\nprecision highp float;\n#if defined(HAS_SHADOWING) && !defined(HAS_BLOOM)\n#include <vsm_shadow_frag>\n#endif\nuniform lowp float blendSrcIsOne;\nuniform lowp float lineBlur;\nuniform float isRenderingTerrain;\n#ifdef HAS_COLOR\nvarying vec4 vColor;\n#else\nuniform lowp vec4 lineColor;\n#endif\n#include <highlight_frag>\n#ifdef HAS_STROKE_COLOR\nvarying vec4 vStrokeColor;\n#else\nuniform lowp vec4 lineStrokeColor;\n#endif\n#ifdef HAS_OPACITY\nvarying float vOpacity;\n#else\nuniform lowp float lineOpacity;\n#endif\nuniform float layerOpacity;\n#ifdef HAS_PATTERN\nuniform sampler2D linePatternFile;\nuniform vec2 atlasSize;\nuniform float flipY;\n#ifdef HAS_PATTERN_ANIM\nvarying float vLinePatternAnimSpeed;\n#else\nuniform float linePatternAnimSpeed;\n#endif\n#ifdef HAS_PATTERN_GAP\nvarying float vLinePatternGap;\n#else\nuniform float linePatternGap;\n#endif\nuniform vec4 linePatterGapColor;\nvarying vec4 vTexInfo;\nvec2 c(vec2 d) {\n vec2 e = mod(d, 1.);\n vec2 f = vTexInfo.xy;\n vec2 h = vTexInfo.zw;\n return (f + e * h) / atlasSize;\n}\n#endif\nvarying vec2 vNormal;\nvarying vec2 vWidth;\nvarying float vGammaScale;\n#ifndef ENABLE_TILE_STENCIL\nvarying vec2 vPosition;\n#endif\nuniform float tileExtent;\n#ifdef HAS_DASHARRAY\n#ifdef HAS_DASHARRAY_ATTR\nvarying vec4 vDasharray;\n#else\nuniform vec4 lineDasharray;\n#endif\n#ifdef HAS_DASHARRAY_COLOR\nvarying vec4 vDashColor;\n#else\nuniform vec4 lineDashColor;\n#endif\n#endif\n#if defined(HAS_PATTERN) || defined(HAS_DASHARRAY) || defined(HAS_GRADIENT) || defined(HAS_TRAIL)\nvarying highp float vLinesofar;\n#endif\n#ifdef HAS_TRAIL\nuniform float trailSpeed;\nuniform float trailLength;\nuniform float trailCircle;\n#endif\n#if defined(HAS_TRAIL) || defined(HAS_PATTERN)\nuniform float currentTime;\n#endif\nfloat i(float j, float k) {\n float l = k / 2.;\n float m = abs(j - l);\n float n = (.1 + 1. / DEVICE_PIXEL_RATIO) * vGammaScale;\n return clamp(min(m + n, l - m) / n, .0, 1.);\n}\nvarying vec3 vVertex;\nuniform vec3 cameraPosition;\nuniform float cameraToCenterDistance;\nuniform float fogFactor;\nvoid main() {\n \n#ifndef ENABLE_TILE_STENCIL\nfloat o = sign(tileExtent - min(tileExtent, abs(vPosition.x))) * sign(1. + sign(vPosition.x)) * sign(tileExtent - min(tileExtent, abs(vPosition.y))) * sign(1. + sign(vPosition.y));\n if(o == .0) {\n discard;\n }\n#endif\n#if defined(HAS_PATTERN) || defined(HAS_DASHARRAY) || defined(HAS_GRADIENT) || defined(HAS_TRAIL)\nfloat u = vLinesofar;\n#endif\nfloat v = length(vNormal) * vWidth.s;\n#ifdef HAS_PATTERN\nvec2 h = vTexInfo.zw;\n float A = sign(h.x * h.y);\n float B = mix(lineBlur, .0, A);\n#else\nfloat B = lineBlur;\n#endif\nfloat n = (B + 1. / DEVICE_PIXEL_RATIO) * vGammaScale;\n float C = clamp(min(v - (vWidth.t - n), vWidth.s - v) / n, .0, 1.);\n#ifdef HAS_COLOR\nvec4 D = vColor / 255.;\n#else\nvec4 D = lineColor;\n#endif\n#ifdef HAS_PATTERN\nif(A == 1.) {\n \n#ifdef HAS_PATTERN_GAP\nfloat E = vLinePatternGap;\n#else\nfloat E = linePatternGap;\n#endif\n#ifdef HAS_PATTERN_ANIM\nfloat F = vLinePatternAnimSpeed;\n#else\nfloat F = linePatternAnimSpeed;\n#endif\nfloat G = h.x * vWidth.s * 2. / h.y;\n float H = G * (1. + E);\n u += mod(currentTime * -F * .2, H);\n float I = mod(u / H, 1.);\n float J = mod((flipY * vNormal.y + 1.) / 2., 1.);\n vec4 K = texture2D(linePatternFile, c(vec2(I * (1. + E), J)));\n float L = clamp(sign(1. / (1. + E) - I) + .000001, .0, 1.);\n K = mix(linePatterGapColor, K, L);\n D *= K;\n }\n#endif\n#ifdef HAS_DASHARRAY\n#ifdef HAS_DASHARRAY_ATTR\nvec4 M = vDasharray;\n#else\nvec4 M = lineDasharray;\n#endif\n#ifdef HAS_DASHARRAY_COLOR\nvec4 N = vDashColor;\n#else\nvec4 N = lineDashColor;\n#endif\nfloat k = M[0] + M[1] + M[2] + M[3];\n float j = mod(u, k);\n float O = max(sign(M[0] - j), .0);\n float P = j - M[0] - M[1];\n float Q = max(sign(P), .0) * max(sign(M[2] - P), .0);\n float R = O + Q;\n float S = i(j, M[0]);\n float T = i(P, M[2]);\n float U = S * O + T * Q;\n D = D * (1. - U) + N * U;\n#endif\n#ifdef HAS_STROKE_COLOR\nvec4 V = vStrokeColor / 255.;\n#else\nvec4 V = lineStrokeColor;\n#endif\nV = mix(D, V, sign(vWidth.t));\n D = V * C + max(sign(vWidth.t - v), .0) * D * (1. - C);\n#ifdef HAS_TRAIL\nfloat W = mod(u - currentTime * trailSpeed * .1, trailCircle);\n float X = W < trailLength ? mix(.0, 1., W / trailLength) : .0;\n D *= X;\n#endif\n#ifdef HAS_OPACITY\nfloat Y = vOpacity;\n#else\nfloat Y = lineOpacity;\n#endif\ngl_FragColor = D * Y * layerOpacity;\n#if defined(HAS_SHADOWING) && !defined(HAS_BLOOM)\nfloat Z = shadow_computeShadow();\n gl_FragColor.rgb = shadow_blend(gl_FragColor.rgb, Z);\n#endif\nfloat ba;\n if(isRenderingTerrain == 1.) {\n ba = 1.;\n } else {\n ba = clamp(cameraToCenterDistance * 1.5 / distance(vVertex, cameraPosition), .0, 1.);\n }\n gl_FragColor *= ba;\n gl_FragColor = highlight_blendColor(gl_FragColor);\n if(fogFactor > .0) {\n vec3 bb = vec3(vVertex[0] - cameraPosition[0], vVertex[1] - cameraPosition[1], vVertex[2] - cameraPosition[2]);\n float bc = length(bb);\n float bd = clamp(1. - (bc * 1.2) / fogFactor, .0, 1.);\n gl_FragColor *= bd;\n }\n}",
|
|
12926
12927
|
uniforms: t,
|
|
12927
12928
|
defines: n,
|
|
12928
12929
|
extraCommandProps: this.getExtraCommandProps(e)
|
|
@@ -16927,7 +16928,7 @@ const {PackUtil: Bs} = L(), Gs = [], js = [], Ws = [], Xs = [], Ys = [], qs = [
|
|
|
16927
16928
|
constructor(e, t, n, i, s, o) {
|
|
16928
16929
|
super(e, t, n, i, s, o), this._ready = !1, this.scene.sortFunction = this.sortByCommandKey;
|
|
16929
16930
|
const a = i.fetchOptions || {};
|
|
16930
|
-
a.referrer = window && window.location.href, this._gltfManager = new r.GLTFManager(e, {
|
|
16931
|
+
a.referrer = window && window.location.href, this._gltfManager = e.gltfManager = e.gltfManager || new r.GLTFManager(e, {
|
|
16931
16932
|
fetchOptions: a,
|
|
16932
16933
|
urlModifier: e => {
|
|
16933
16934
|
const n = t.getURLModifier();
|
|
@@ -17128,7 +17129,7 @@ const {PackUtil: Bs} = L(), Gs = [], js = [], Ws = [], Xs = [], Ys = [], qs = [
|
|
|
17128
17129
|
o.multiply(I, I, e);
|
|
17129
17130
|
}
|
|
17130
17131
|
d("instance_vectorA", t, I, 0), d("instance_vectorB", t, I, 1), d("instance_vectorC", t, I, 2),
|
|
17131
|
-
e.aPickingId[t] = t;
|
|
17132
|
+
e.aPickingId[t] = u[t];
|
|
17132
17133
|
}
|
|
17133
17134
|
return s.set(w, M, P, C), w;
|
|
17134
17135
|
}
|
|
@@ -19822,5 +19823,5 @@ if (i.transcoders) {
|
|
|
19822
19823
|
|
|
19823
19824
|
export { yl as ExtrudePolygonLayer, Cn as FillPainter, fo as FillPlugin, Al as FilterUtil, To as GLTFPhongPlugin, wo as GLTFStandardPlugin, Io as GeoJSONVectorTileLayer, So as HeatmapPlugin, Ar as IconPainter, mo as IconPlugin, go as LineGradientPlugin, On as LinePainter, po as LinePlugin, ra as LineStringLayer, bo as LitPlugin, Po as MapboxVectorTileLayer, _s as NativeLinePainter, xo as NativeLinePlugin, ms as NativePointPainter, bl as PackUtil, Rs as PhongPainter, _o as PhongPlugin, na as PointLayer, aa as PolygonLayer, wl as SYMBOLS_NEED_REBUILD_IN_VECTOR, Tl as SYMBOLS_NEED_REBUILD_IN_VT, us as TextPainter, yo as TextPlugin, Ao as TubePlugin, gt as Vector3DLayer, lt as VectorTileLayer, $e as VectorTileLayerRenderer, Mo as WaterPlugin, Ds as WireframePainter, vo as WireframePlugin };
|
|
19824
19825
|
|
|
19825
|
-
"undefined" != typeof console && console.log("@maptalks/vt v0.
|
|
19826
|
+
"undefined" != typeof console && console.log("@maptalks/vt v0.104.0");
|
|
19826
19827
|
//# sourceMappingURL=maptalks.vt.es.js.map
|