(lnglat, selectGltf, config, object3Dlayer, scene)
| 153 | } |
| 154 | }, |
| 155 | addGITF (lnglat, selectGltf, config, object3Dlayer, scene) { |
| 156 | const urlDuck = `./3d/${selectGltf}/scene.gltf`; |
| 157 | const paramDuck = { |
| 158 | position: new AMap.LngLat(lnglat[0], lnglat[1]), // 必须 |
| 159 | scale: config.scale || 1, // 非必须,默认1 |
| 160 | height: config.height || 0, // 非必须,默认0 |
| 161 | scene: 0, // 非必须,默认0 |
| 162 | }; |
| 163 | const gltfObj = new AMap.GltfLoader(); |
| 164 | gltfObj.load(urlDuck, gltfDuck => { |
| 165 | gltfDuck.setOption(paramDuck); |
| 166 | gltfDuck.rotateX(config.rotateX || 90); |
| 167 | gltfDuck.rotateZ(config.rotateZ || 120); |
| 168 | object3Dlayer.add(gltfDuck); |
| 169 | scene.map.add(object3Dlayer) |
| 170 | }); |
| 171 | scene.panTo(lnglat) |
| 172 | scene.setPitch(50) |
| 173 | scene.setZoom(17) |
| 174 | }, |
| 175 | async updateAddress (address) { |
| 176 | await vm.searchGeo(address, this.option.radius, (result) => { |
| 177 | this.scene.panTo(result.center) |
nothing calls this directly
no outgoing calls
no test coverage detected