2017-10-12 93 views
2

目前我已經加載了埃菲爾鐵塔的obj文件,並使用threejs渲染它,但是我怎麼能把這個建築物放在地圖上它的位置在現實世界中。我使用mapgox-gl-js來處理地圖問題,因爲它在3d地圖上很方便。 result如何把threejs建在地圖盒上它的真實位置

style: { 
    "version": 8, 
    "sources": { 
     "satellite": { 
     "type": "raster", 
     "url": "mapbox://mapbox.satellite", 
     "tileSize": 256 
     }, 
     "canvas": { 
     type: 'canvas', 
     canvas: 'idOfMyHTMLCanvas', 
     // animate: true, 
     coordinates: [ 
      [-74.02204952394804, 40.706782422418456], 
      [-73.99115047610259, 40.706782422418456], 
      [-73.99115047610259, 40.72021689994298], 
      [-74.02204952394804, 40.72021689994298] 
     ], 
     contextType: 'webgl' 
     } 
    }, 
    "layers": [{ 
     "id": "satellite", 
     "type": "raster", 
     "source": "satellite" 
    }, { 
     "id": "video", 
     "type": "raster", 
     "source": "canvas" 
    }] 
} 

感謝您的任何幫助。

回答

3

您可能想要查看Threebox,它旨在將Three.js場景圖與Mapbox GL JS地圖同步。