From a74b7b08041625e5a5e005a0150c193214b89e4c Mon Sep 17 00:00:00 2001 From: Garrett Johnson Date: Wed, 27 May 2026 19:59:46 +0900 Subject: [PATCH] Fix WMTS case --- src/three/plugins/images/GeneratedSurfacePlugin.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/three/plugins/images/GeneratedSurfacePlugin.js b/src/three/plugins/images/GeneratedSurfacePlugin.js index 1724a4d5a..38896bc31 100644 --- a/src/three/plugins/images/GeneratedSurfacePlugin.js +++ b/src/three/plugins/images/GeneratedSurfacePlugin.js @@ -317,6 +317,7 @@ export class GeneratedSurfacePlugin { const geometry = new PlaneGeometry( 1, 1, lonVerts + 2, latVerts + 2 ); const [ minU, minV, maxU, maxV ] = tiling.getTileBounds( x, y, level, true, true ); + const uvRange = tiling.getTileContentUVBounds( x, y, level ); // adjust the geometry to position it at the region const { position, normal, uv } = geometry.attributes; @@ -389,8 +390,8 @@ export class GeneratedSurfacePlugin { } // derive UV from the final (potentially adjusted) lat/lon so the overlay samples correctly - const u = MathUtils.mapLinear( projection.convertLongitudeToNormalized( lon ), minU, maxU, 0, 1 ); - const v = MathUtils.mapLinear( projection.convertLatitudeToNormalized( lat ), minV, maxV, 0, 1 ); + const u = MathUtils.mapLinear( projection.convertLongitudeToNormalized( lon ), minU, maxU, uvRange[ 0 ], uvRange[ 2 ] ); + const v = MathUtils.mapLinear( projection.convertLatitudeToNormalized( lat ), minV, maxV, uvRange[ 1 ], uvRange[ 3 ] ); // update the geometry position.setXYZ( i, _pos.x, _pos.y, _pos.z );