热图
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
功能块显示为可叠加在地图上的图片:

如需详细了解如何在默认地图上叠加图块,请参阅叠加地图类型。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-03-11。
[null,null,["最后更新时间 (UTC):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"]]