---
title: "Control | Geosplats sdk"
description: "Documentation for MapTiler GeoSplats SDK"
---

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

# Interface Control

Interface for creating custom map controls.

interface Control {  
    [onAdd](#onadd-1)(map: [Map](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Map/)): HTMLElement;  
    [onRemove](#onremove-1)(map: [Map](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Map/)): void;  
}

##### Index

### Methods[](#methods)

[onAdd](#onadd) [onRemove](#onremove)

## Methods[](#methods-1)

### onAdd[](#onadd)

-   onAdd(map: [Map](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Map/)): HTMLElement[](#onadd-1)
    
    Method called when the control is added to the map.
    
    #### Parameters
    
    -   map: [Map](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Map/)
        
        The map instance the control is being added to.
        
    
    #### Returns HTMLElement
    
    The HTMLElement representing the control.
    

### onRemove[](#onremove)

-   onRemove(map: [Map](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Map/)): void[](#onremove-1)
    
    Method called when the control is removed from the map.
    
    #### Parameters
    
    -   map: [Map](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Map/)
        
        The map instance the control is being removed from.
        
    
    #### Returns void
