ElevationElement class
google.maps.elevation
. ElevationElement
class
An HTML element that visually displays elevation data. Set the element's path
property to show a graph of elevation along the path. To use the Elevation Element, enable the Places UI Kit API
for your project in the Google Cloud console.
Custom element: <gmp-elevation unit-system="imperial"></gmp-elevation>
This class extends HTMLElement
.
This class implements ElevationElementOptions
.
Access by calling const {ElevationElement} = await google.maps.importLibrary("elevation")
.See Libraries in the Maps JavaScript API
.
Constructor
ElevationElement([options])
-
options
:ElevationElementOptions optional
Properties
Array
< LatLng
| LatLngLiteral
| LatLngAltitude
> optional
If only one point is provided, the widget will show the elevation number for that point.
UnitSystem
optional
-
<gmp-elevation unit-system="imperial"></gmp-elevation>
-
<gmp-elevation unit-system="metric"></gmp-elevation>
Methods
addEventListener(type, listener[, options])
-
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 supportcapture
andpassive
.
void
removeEventListener(type, listener[, options])
-
type
:string
A string which specifies the type of event for which to remove an event listener. -
listener
:EventListener | EventListenerObject
The event listener of the event handler to remove from the event target. -
options
:boolean| EventListenerOptions optional
See options .
void
ElevationElementOptions interface
google.maps.elevation
. ElevationElementOptions
interface
Options for ElevationElement
.
Properties |
|
---|---|
path
optional
|
Type:
Array
< LatLng
| LatLngLiteral
> optional
|
unitSystem
optional
|
Type:
UnitSystem
optional
|