lookupHeatmapTile method

Future<HttpBody> lookupHeatmapTile(
  1. String mapType,
  2. int zoom,
  3. int x,
  4. int y, {
  5. String? $fields,
})

Returns a byte array containing the data of the tile PNG image.

Request parameters:

mapType - Required. The type of the pollen heatmap. Defines the combination of pollen type and index that the map will graphically represent. Possible string values are:

  • "MAP_TYPE_UNSPECIFIED" : Unspecified map type.
  • "TREE_UPI" : The heatmap type will represent a tree index graphical map.
  • "GRASS_UPI" : The heatmap type will represent a grass index graphical map.
  • "WEED_UPI" : The heatmap type will represent a weed index graphically map.

zoom - Required. The map's zoom level. Defines how large or small the contents of a map appear in a map view. * Zoom level 0 is the entire world in a single tile. * Zoom level 1 is the entire world in 4 tiles. * Zoom level 2 is the entire world in 16 tiles. * Zoom level 16 is the entire world in 65,536 tiles. Allowed values: 0-16

x - Required. Defines the east-west point in the requested tile.

y - Required. Defines the north-south point in the requested tile.

$fields - Selector specifying which fields to include in a partial response.

Completes with a HttpBody.

Completes with a commons.ApiRequestError if the API endpoint returned an error.

If the used http.Client completes with an error when making a REST call, this method will complete with the same error.

Implementation

async.Future<HttpBody> lookupHeatmapTile(
  core.String mapType,
  core.int zoom,
  core.int x,
  core.int y, {
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'v1/mapTypes/' +
      commons.escapeVariable('$mapType') +
      '/heatmapTiles/' +
      commons.escapeVariable('$zoom') +
      '/' +
      commons.escapeVariable('$x') +
      '/' +
      commons.escapeVariable('$y');

  final response_ = await _requester.request(
    url_,
    'GET',
    queryParams: queryParams_,
  );
  return HttpBody.fromJson(response_ as core.Map<core.String, core.dynamic>);
}