ชิ้นส่วนภูมิประเทศ
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
นักพัฒนาแอปในเขตเศรษฐกิจยุโรป (EEA)
ไทล์ภูมิประเทศคือไทล์รูปภาพที่มีการทำแผนที่ภาพเนินเขา
และเส้นชั้นความสูง ซึ่งรวมถึงลักษณะทางธรรมชาติ เช่น พืชพรรณ
การรับไทล์ภูมิประเทศ
คุณจะเริ่มส่งคำขอไทล์ภูมิประเทศได้หลังจากได้รับโทเค็นเซสชัน
เนื่องจากโทเค็นเซสชันมีผลกับเซสชันทั้งหมด คุณจึงไม่จำเป็นต้องระบุ
ตัวเลือกแผนที่พร้อมคำขอไทล์
ตัวอย่างโค้ดต่อไปนี้แสดงคำขอโทเค็นเซสชันทั่วไปสำหรับไทล์ภูมิประเทศ
curl -X POST -d '{
"mapType": "terrain",
"language": "en-US",
"region": "US",
"layerTypes": ["layerRoadmap"]
}' \
-H 'Content-Type: application/json' \
"https://tile.googleapis.com/v1/createSession?key=YOUR_API_KEY"
คุณจะได้รับไทล์ภูมิประเทศโดยส่งคำขอ HTTPS GET ดังที่แสดงในตัวอย่างต่อไปนี้
curl "https://tile.googleapis.com/v1/2dtiles/z/x/y?session=YOUR_SESSION_TOKEN&key=YOUR_API_KEY"
ตัวอย่างคำขอไทล์
ลองดูตัวอย่างต่อไปนี้ ซึ่งขอไทล์ภูมิประเทศรายการเดียวที่มีระดับการซูม
เป็น 10 โดยมีพิกัด x และ y เป็น (192, 401)
curl "https://tile.googleapis.com/v1/2dtiles/10/192/401?session=YOUR_SESSION_TOKEN&key=YOUR_API_KEY" --output /tmp/example_tile.png
ในตัวอย่างนี้ไม่มีข้อความตอบกลับจากเซิร์ฟเวอร์ แต่จะดาวน์โหลดไทล์
ลงในไฟล์ในเครื่องแทน

ดูข้อมูลเกี่ยวกับส่วนหัวของข้อความตอบกลับได้ที่
การดึงข้อมูลล่วงหน้า การแคช หรือการจัดเก็บเนื้อหา
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-29 UTC
[null,null,["อัปเดตล่าสุด 2025-08-29 UTC"],[[["\u003cp\u003eTerrain tiles are image tiles that visually represent geographical features like hills, contours, and vegetation.\u003c/p\u003e\n"],["\u003cp\u003eTo request terrain tiles, you first need to obtain a session token using your API key and specifying map parameters.\u003c/p\u003e\n"],["\u003cp\u003eYou can then retrieve individual terrain tiles using an HTTPS GET request, providing the session token, API key, and desired tile coordinates (zoom level, x, and y).\u003c/p\u003e\n"],["\u003cp\u003eTerrain tiles are downloaded directly as image files without a server response message, allowing easy integration into mapping applications.\u003c/p\u003e\n"]]],["Terrain tiles, which include hillshade mapping, contour lines, and natural features, are accessed by first obtaining a session token via a POST request specifying the map type, language, region, and layer types. Subsequently, tiles are retrieved with HTTPS GET requests, providing the zoom level (z), x and y coordinates, and the session token. An example demonstrates requesting a tile at zoom level 10, with coordinates (192, 401). The tile data downloads to a local file, without a server response message.\n"],null,["# Terrain tiles\n\n**European Economic Area (EEA) developers** If your billing address is in the European Economic Area, effective on 8 July 2025, the [Google\n| Maps Platform EEA Terms of Service](https://cloud.google.com/terms/maps-platform/eea) will apply to your use of the Services. [Learn more](/maps/comms/eea/faq). In addition, certain content from the Map Tiles API will no longer be returned. [Learn more](/maps/comms/eea/map-tiles).\n\nTerrain tiles are image tiles that contain hillshade mapping\nand contour lines. They include natural features such as vegetation.\n\nGetting terrain tiles\n---------------------\n\nYou can begin making terrain tile requests after you get a session token.\nBecause a session token applies to the entire session, you don't have to specify\nthe map options with your tile requests.\n\nThe following code sample demonstrates a typical session token request for\nterrain tiles. \n\n```json\ncurl -X POST -d '{\n \"mapType\": \"terrain\",\n \"language\": \"en-US\",\n \"region\": \"US\",\n \"layerTypes\": [\"layerRoadmap\"]\n}' \\\n-H 'Content-Type: application/json' \\\n\"https://tile.googleapis.com/v1/createSession?key=YOUR_API_KEY\"\n```\n\nYou get terrain tiles by making an HTTPS GET request, as shown in the following\nexample. \n\n```json\ncurl \"https://tile.googleapis.com/v1/2dtiles/\u003cvar class=\"apiparam\" translate=\"no\"\u003ez\u003c/var\u003e/\u003cvar class=\"apiparam\" translate=\"no\"\u003ex\u003c/var\u003e/\u003cvar class=\"apiparam\" translate=\"no\"\u003ey\u003c/var\u003e?session=\u003cvar class=\"apiparam\" translate=\"no\"\u003eYOUR_SESSION_TOKEN\u003c/var\u003e&key=YOUR_API_KEY\"\n```\n\nExample tile request\n--------------------\n\nConsider the following example, which requests a single terrain tile with zoom\nlevel 10, with x and y coordinates of (192, 401). \n\n```json\ncurl \"https://tile.googleapis.com/v1/2dtiles/10/192/401?session=\u003cvar class=\"apiparam\" translate=\"no\"\u003eYOUR_SESSION_TOKEN\u003c/var\u003e&key=YOUR_API_KEY\" --output /tmp/example_tile.png\n```\n\nThere is no response message from the server in this example. Instead, the tile\njust downloads to a local file.\n\nFor information about response message headers, see\n[Pre-Fetching, Caching, or Storage of Content](/maps/documentation/tile/policies#pre-fetching,-caching,-or-storage-of-content)."]]