diff --git a/ShadowEditor.Web/src/gis/render/TiledLayerRenderer.js b/ShadowEditor.Web/src/gis/render/TiledLayerRenderer.js index 380f2352..04e12594 100644 --- a/ShadowEditor.Web/src/gis/render/TiledLayerRenderer.js +++ b/ShadowEditor.Web/src/gis/render/TiledLayerRenderer.js @@ -28,10 +28,13 @@ TiledLayerRenderer.prototype.render = function (layer) { var alt = this.globe.alt; this.mesh.material.length = 0; + this.mesh.geometry.groups.length = 0; - this.creator.get(lon, lat, alt).forEach(n => { + this.creator.get(lon, lat, alt).forEach((n, i) => { if (n.material) { + n.material.group.materialIndex = i; this.mesh.material.push(n.material); + this.mesh.geometry.groups.push(n.material.group); } }); }; diff --git a/ShadowEditor.Web/src/gis/render/geometry/TiledGeometry.js b/ShadowEditor.Web/src/gis/render/geometry/TiledGeometry.js index 71582ac7..6bd5b580 100644 --- a/ShadowEditor.Web/src/gis/render/geometry/TiledGeometry.js +++ b/ShadowEditor.Web/src/gis/render/geometry/TiledGeometry.js @@ -4,16 +4,10 @@ import WGS84 from '../../core/WGS84'; * 瓦片几何体 */ function TiledGeometry() { - THREE.SphereBufferGeometry.call(this, WGS84.a, 16, 16); - - this.groups = [{ - start: 0, - count: 1440, - materialIndex: 0 - }]; + THREE.PlaneBufferGeometry.call(this, WGS84.a, WGS84.a); } -TiledGeometry.prototype = Object.create(THREE.SphereBufferGeometry.prototype); +TiledGeometry.prototype = Object.create(THREE.PlaneBufferGeometry.prototype); TiledGeometry.prototype.constructor = TiledGeometry; export default TiledGeometry; \ No newline at end of file diff --git a/ShadowEditor.Web/src/gis/render/material/TiledMaterial.js b/ShadowEditor.Web/src/gis/render/material/TiledMaterial.js index ce0abde0..0dd124d2 100644 --- a/ShadowEditor.Web/src/gis/render/material/TiledMaterial.js +++ b/ShadowEditor.Web/src/gis/render/material/TiledMaterial.js @@ -33,6 +33,8 @@ function TiledMaterial(x, y, z) { value: new THREE.TextureLoader().load((new BingTileSystem()).tileXYToUrl(x, y, z)) } }; + + this.group = { start: 0, count: 6, materialIndex: 0 }; } TiledMaterial.prototype = Object.create(THREE.ShaderMaterial.prototype);