Air Quality
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 .
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
HTML attribute:
<gmp-air-quality-meter requested-language="string"></gmp-air-quality-meter>
Methods
addEventListener
addEventListener(type, listener[, options])
Parameters:
type: string A case-sensitive string representing the event type to listen for.
listener: EventListener |EventListenerObject The object that receives a notification. This must be a function or an object with the handleEvent method
options: boolean|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])
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.
Need to tell us more?
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-03-02 UTC."],[],[]]