翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。
マップに 3D 機能を表示する方法
Amazon Location Service では、標高データを 3 次元表面として表示Terrain3Dしたり、高さとボリュームを持つ都市構造を表示したりするなど、マップBuildings3Dに 3 次元特徴を追加できます。
3 次元地形の詳細を含むマップを作成する
この例では、 Terrain3Dパラメータを使用してマップを作成する方法を示します。
- index.html
-
<!DOCTYPE html> <html lang="en"> <head> <title>3D Terrain</title> <meta charset='utf-8'> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel='stylesheet' href='https://unpkg.com/maplibre-gl@5.x/dist/maplibre-gl.css' /> <script src='https://unpkg.com/maplibre-gl@5.x/dist/maplibre-gl.js'></script> </head> <body style="margin: 0; padding: 0;"> <div id="map" style="width: 100%; height: 100vh;"></div> <script> const apiKey = "Add Your Api Key"; const mapStyle = "Standard"; const awsRegion = "us-east-1"; const map = new maplibregl.Map({ container: 'map', style: `https://maps.geo.${awsRegion}.amazonaws.com/v2/styles/${mapStyle}/descriptor?terrain=Terrain3D&key=${apiKey}`, center: [7.6583, 45.9763], zoom: 12, pitch: 60, // Tilt angle (0-85 degrees) validateStyle: false, // Disable style validation for faster map load }); </script> </body> </html> - style.css
-
body { margin: 0; padding: 0; } #map { width: 100%; height: 100vh; }
3 次元建物の詳細を含むマップを作成する
この例では、 Buildings3Dパラメータを使用してマップを作成する方法を示します。
- index.html
-
<!DOCTYPE html> <html lang="en"> <head> <title>3D Buildings</title> <meta charset='utf-8'> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel='stylesheet' href='https://unpkg.com/maplibre-gl@5.x/dist/maplibre-gl.css' /> <script src='https://unpkg.com/maplibre-gl@5.x/dist/maplibre-gl.js'></script> </head> <body style="margin: 0; padding: 0;"> <div id="map" style="width: 100%; height: 100vh;"></div> <script> const apiKey = "Add Your Api Key"; const mapStyle = "Standard"; const awsRegion = "us-east-1"; const map = new maplibregl.Map({ container: 'map', style: `https://maps.geo.${awsRegion}.amazonaws.com/v2/styles/${mapStyle}/descriptor?buildings=Buildings3D&key=${apiKey}`, center: [7.6583, 45.9763], zoom: 12, pitch: 60, // Tilt angle (0-85 degrees) validateStyle: false, // Disable style validation for faster map load }); </script> </body> </html> - style.css
-
body { margin: 0; padding: 0; } #map { width: 100%; height: 100vh; }
マップにトランジットの詳細を表示する
静的マップ