熱視圖
heatmapTiles 端點會透過圖塊疊加層提供與花粉相關的熱視圖。圖塊疊加層是可顯示在 Google 地圖上方的圖塊圖片集合。每個圖塊的圖片大小為 256 x 256 像素。
圖塊疊加層是由一組圖塊組成的格狀圖,每個圖塊都會指派 (X
,Y
) 座標。座標為 (0,0) 的圖塊一律位於地圖的西北角。X
值會從西到東遞增,Y
值則從北到南遞增。
zoom level
會決定地圖內容在地圖檢視畫面中顯示的大小。圖塊格線大小取決於以縮放等級以指數方式縮放 X
和 Y
座標。
gridSizeX = XzoomLevel
gridSizeY = YzoomLevel
舉例來說,縮放等級為 2 時,世界地圖會使用 4 x 4 矩陣表示,總共 16 個圖塊。
下圖顯示整個世界的 TREE_UPI
熱力圖,已劃分為可在縮放等級 2 存取的圖塊。

詳情請參閱「地圖與圖塊座標」。
您可以使用
heatmapTiles 端點,透過傳送 HTTP GET 要求至下列位置,要求目前的花粉熱力圖圖塊:
https://pollen.googleapis.com/v1/mapTypes/TYPE/heatmapTiles/Z/X/Y?key=YOUR_API_KEY
關於熱圖端點
如要成功提出要求,下列所有參數都是必要的:
KEY
:應用程式的 API 金鑰。這個金鑰可用於識別您的應用程式,以便進行配額管理。瞭解如何取得金鑰。
TYPE
:要傳回的熱圖類型。請參閱「允許的值」。
Z
:縮放等級,用於決定地圖內容在地圖檢視畫面中顯示的大小。有效值為 0 至 16,其中值為 0 時會在單一圖塊中顯示整個世界。
X
、Y
:相對於東北角 (0,0) 的圖塊座標。X
值會從西到東遞增,Y
值則從北到南遞增。座標必須適用於指定的縮放等級。舉例來說,如果您將縮放等級設為 2,並要求位於座標 (10,10) 的圖塊,API 就會傳回錯誤。
熱圖要求範例
上圖顯示縮放等級為 2 的 TREE_UPI
熱圖,以及每個圖塊的座標。以下範例使用 heatmapTiles
端點,要求座標為 (2,1) 的圖塊:
https://pollen.googleapis.com/v1/mapTypes/TREE_UPI/heatmapTiles/2/2/1?key=YOUR_API_KEY
圖塊會顯示為可疊加在地圖上的圖片:

如要進一步瞭解如何在預設地圖上疊加圖塊,請參閱「疊加地圖類型」。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-03-11 (世界標準時間)。
[null,null,["上次更新時間:2025-03-11 (世界標準時間)。"],[[["The heatmapTiles endpoint delivers pollen heatmaps as tile overlays, which are collections of 256x256 pixel image tiles displayed on top of Google Maps."],["Tile coordinates (X,Y) determine the grid position, with (0,0) at the northwest corner and increasing values eastward for X and southward for Y."],["Zoom level (Z) controls map content size and grid dimensions, ranging from 0 (entire world) to 16, influencing tile coordinates validity."],["To request heatmap tiles, use the heatmapTiles endpoint with required parameters: API key, heatmap type, zoom level, and tile coordinates (X,Y)."],["You can overlay these pollen heatmap tiles onto existing maps for visualization, enhancing applications with pollen information."]]],["The `heatmapTiles` endpoint provides pollen heatmaps as image tiles (256x256 pixels) overlaid on Google Maps. Tiles are arranged in a grid with (X,Y) coordinates, starting from (0,0) in the northwest. The zoom level (0-16) dictates map detail, scaling the grid exponentially (gridSizeX = X^zoomLevel). A request to the endpoint requires an API key, heatmap `TYPE`, `Z` zoom level, and `X`, `Y` tile coordinates. The format for a request is: `https://pollen.googleapis.com/v1/mapTypes/TYPE/heatmapTiles/Z/X/Y?key=YOUR_API_KEY`\n"]]