---
title: "ElevationProfileControl | Elevation profile | JavaScript maps SDK"
description: "Documentation for Elevation Profile Control"
---

> For AI agents: a documentation index is available at [/llms.txt](https://docs.maptiler.com/llms.txt). Markdown versions of all pages are available by appending .md to any URL.

# Class ElevationProfileControl

#### Implements

-   IControl

-   Defined in [elevationprofilecontrol.ts:64](https://github.com/maptiler/maptiler-elevation-profile-control/blob/d743345a80a057304068c68d525af7f308519fb1/src/elevationprofilecontrol.ts#L64)

##### Index

### Constructors

[constructor](#constructor)

### Properties

[getDefaultPosition?](#getdefaultposition)

### Methods

[getContainer](#getcontainer) [hideProfile](#hideprofile) [onAdd](#onadd) [onRemove](#onremove) [setData](#setdata) [showProfile](#showprofile)

## Constructors

### constructor[](#constructor)

-   new ElevationProfileControl(  
        options?: [ElevationProfileControlOptions](https://docs.maptiler.com/sdk-js/modules/elevation-profile/api/types/ElevationProfileControlOptions/),  
    ): ElevationProfileControl[](#constructorelevationprofilecontrol)
    
    #### Parameters
    
    -   options: [ElevationProfileControlOptions](https://docs.maptiler.com/sdk-js/modules/elevation-profile/api/types/ElevationProfileControlOptions/) = {}
    
    #### Returns ElevationProfileControl
    
    -   Defined in [elevationprofilecontrol.ts:76](https://github.com/maptiler/maptiler-elevation-profile-control/blob/d743345a80a057304068c68d525af7f308519fb1/src/elevationprofilecontrol.ts#L76)
    

## Properties

### `Optional`getDefaultPosition[](#getdefaultposition)

getDefaultPosition?: () \=> ControlPosition

Optionally provide a default position for this control. If this method is implemented and Map#addControl is called without the `position` parameter, the value returned by getDefaultPosition will be used as the control's position.

#### Type Declaration

-   -   (): ControlPosition
    -   #### Returns ControlPosition
        
        a control position, one of the values valid in addControl.
        

Implementation of IControl.getDefaultPosition

-   Defined in [elevationprofilecontrol.ts:216](https://github.com/maptiler/maptiler-elevation-profile-control/blob/d743345a80a057304068c68d525af7f308519fb1/src/elevationprofilecontrol.ts#L216)

## Methods

### getContainer[](#getcontainer)

-   getContainer(): HTMLDivElement | undefined[](#getcontainer-1)
    
    #### Returns HTMLDivElement | undefined
    
    -   Defined in [elevationprofilecontrol.ts:82](https://github.com/maptiler/maptiler-elevation-profile-control/blob/d743345a80a057304068c68d525af7f308519fb1/src/elevationprofilecontrol.ts#L82)
    

### hideProfile[](#hideprofile)

-   hideProfile(): void[](#hideprofile-1)
    
    #### Returns void
    
    -   Defined in [elevationprofilecontrol.ts:196](https://github.com/maptiler/maptiler-elevation-profile-control/blob/d743345a80a057304068c68d525af7f308519fb1/src/elevationprofilecontrol.ts#L196)
    

### onAdd[](#onadd)

-   onAdd(map: Map): HTMLElement[](#onadd-1)
    
    Register a control on the map and give it a chance to register event listeners and resources. This method is called by Map#addControl internally.
    
    #### Parameters
    
    -   map: Map
        
        the Map this control will be added to
        
    
    #### Returns HTMLElement
    
    The control's container element. This should be created by the control and returned by onAdd without being attached to the DOM: the map will insert the control's element into the DOM as necessary.
    
    Implementation of IControl.onAdd
    
    -   Defined in [elevationprofilecontrol.ts:86](https://github.com/maptiler/maptiler-elevation-profile-control/blob/d743345a80a057304068c68d525af7f308519fb1/src/elevationprofilecontrol.ts#L86)
    

### onRemove[](#onremove)

-   onRemove(): void[](#onremove-1)
    
    Unregister a control on the map and give it a chance to detach event listeners and resources. This method is called by Map#removeControl internally.
    
    #### Returns void
    
    Implementation of IControl.onRemove
    
    -   Defined in [elevationprofilecontrol.ts:205](https://github.com/maptiler/maptiler-elevation-profile-control/blob/d743345a80a057304068c68d525af7f308519fb1/src/elevationprofilecontrol.ts#L205)
    

### setData[](#setdata)

-   setData(data: string | GeoJsonObject): Promise<void\>[](#setdata-1)
    
    #### Parameters
    
    -   data: string | GeoJsonObject
    
    #### Returns Promise<void\>
    
    -   Defined in [elevationprofilecontrol.ts:218](https://github.com/maptiler/maptiler-elevation-profile-control/blob/d743345a80a057304068c68d525af7f308519fb1/src/elevationprofilecontrol.ts#L218)
    

### showProfile[](#showprofile)

-   showProfile(): void[](#showprofile-1)
    
    #### Returns void
    
    -   Defined in [elevationprofilecontrol.ts:187](https://github.com/maptiler/maptiler-elevation-profile-control/blob/d743345a80a057304068c68d525af7f308519fb1/src/elevationprofilecontrol.ts#L187)
