---
title: "Hash | JavaScript maps SDK"
description: "Documentation for MapTiler SDK"
---

> 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 Hash

Adds the map's position to its page's location hash. Passed as an option to the map object.

##### Index

### Constructors[](#constructors)

[constructor](#constructor)

### Methods[](#methods)

[addTo](#addto) [getHashString](#gethashstring) [remove](#remove)

## Constructors[](#constructors-1)

### constructor[](#constructor)

-   new Hash(hashName?: string | null): Hash[](#constructorhash)
    
    #### Parameters
    
    -   `Optional`hashName: string | null
    
    #### Returns Hash
    

## Methods[](#methods-1)

### addTo[](#addto)

-   addTo(map: [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/)): this[](#addto-1)
    
    Map element to listen for coordinate changes
    
    #### Parameters
    
    -   map: [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/)
        
        The map object
        
    
    #### Returns this
    

### getHashString[](#gethashstring)

-   getHashString(mapFeedback?: boolean): string[](#gethashstring-1)
    
    #### Parameters
    
    -   `Optional`mapFeedback: boolean
    
    #### Returns string
    

### remove[](#remove)

-   remove(): this[](#remove-1)
    
    Removes hash
    
    #### Returns this
