lookupHeatmapTile method

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

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

Request parameters:

mapType - Required. The type of the air quality heatmap. Defines the pollutant that the map will graphically represent. Allowed values: - UAQI_RED_GREEN (UAQI, red-green palette) - UAQI_INDIGO_PERSIAN (UAQI, indigo-persian palette) - PM25_INDIGO_PERSIAN - GBR_DEFRA - DEU_UBA - CAN_EC - FRA_ATMO - US_AQI Possible string values are:

  • "MAP_TYPE_UNSPECIFIED" : The default value. The server ignores it if it is passed as a parameter.
  • "UAQI_RED_GREEN" : Universal Air Quality Index red-green palette.
  • "UAQI_INDIGO_PERSIAN" : Universal Air Quality Index indigo-persian palette.
  • "PM25_INDIGO_PERSIAN" : PM2.5 index indigo-persian palette.
  • "GBR_DEFRA" : Daily Air Quality Index (UK) color palette.
  • "DEU_UBA" : German Local Air Quality Index color palette.
  • "CAN_EC" : Canadian Air Quality Health Index color palette.
  • "FRA_ATMO" : France Air Quality Index color palette.
  • "US_AQI" : US Air Quality Index color palette.

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>);
}