热图
通过
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):2024-08-16。
[null,null,["最后更新时间 (UTC):2024-08-16。"],[[["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"]]