Air Quality

AirQualityMeterElement class

google.maps.airQuality.AirQualityMeterElement class

Displays air quality information for a given location.

Custom element:
<gmp-air-quality-meter location="lat,lng" requested-language="string"></gmp-air-quality-meter>

This class extends HTMLElement.

This class implements AirQualityMeterElementOptions.

Access by calling const {AirQualityMeterElement} = await google.maps.importLibrary("airQuality").
See Libraries in the Maps JavaScript API.

Constructor

AirQualityMeterElement

AirQualityMeterElement([options])

Parameters:

Properties

location

Default: null

The location to render the air quality meter for. Normalizes to a LatLngAltitude.

HTML attribute:

  • <gmp-air-quality-meter location="lat,lng"></gmp-air-quality-meter>
requestedLanguage

Type:  string optional

Default: null

An override for the language to request from the Air Quality API. See the list of supported languages.

HTML attribute:

  • <gmp-air-quality-meter requested-language="string"></gmp-air-quality-meter>

Methods

addEventListener

addEventListener(type, listener[, options])

Parameters:

  • typestring A case-sensitive string representing the event type to listen for.
  • listenerEventListener|EventListenerObject The object that receives a notification. This must be a function or an object with the handleEvent method
  • optionsboolean|AddEventListenerOptions optional See options. Custom events only support capture and passive.

Return Value:  void

Sets up a function that will be called whenever the specified event is delivered to the target. See addEventListener.

removeEventListener

removeEventListener(type, listener[, options])

Parameters:

Return Value:  void

Removes an event listener previously registered with addEventListener from the target. See removeEventListener.

Events

gmp-error

function()

Arguments:  None

Event fired when the AirQualityMeterElement has an error in loading.

gmp-load

function()

Arguments:  None

Event fired when the AirQualityMeterElement has finished loading.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-03-02 UTC.