---
title: "MapTouchEvent | 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 MapTouchEvent

`MapTouchEvent` is the event type for touch-related map events.

#### Hierarchy ([View Summary](https://docs.maptiler.com/sdk-js/api-reference/hierarchy/#Externals.MapTouchEvent))

-   [Event](https://docs.maptiler.com/sdk-js/api-reference/classes/Event/)
    -   MapTouchEvent
        -   [MapTouchEvent](https://docs.maptiler.com/sdk-js/api-reference/classes/MapTouchEvent/)

#### Implements

-   [MapLibreEvent](https://docs.maptiler.com/sdk-js/api-reference/types/MapLibreEvent/)<[TouchEvent](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.TouchEvent/)\>

##### Index

### Constructors[](#constructors)

[constructor](#constructor)

### Properties[](#properties)

[lngLat](#lnglat) [lngLats](#lnglats) [originalEvent](#originalevent) [point](#point) [points](#points) [target](#target) [type](#type)

### Accessors[](#accessors)

[defaultPrevented](#defaultprevented)

### Methods[](#methods)

[preventDefault](#preventdefault)

## Constructors[](#constructors-1)

### constructor[](#constructor)

-   new MapTouchEvent(  
        type: string,  
        map: [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/),  
        originalEvent: [TouchEvent](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.TouchEvent/),  
    ): MapTouchEvent[](#constructormaptouchevent)
    
    #### Parameters
    
    -   type: string
    -   map: [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/)
    -   originalEvent: [TouchEvent](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.TouchEvent/)
    
    #### Returns MapTouchEvent
    
    Overrides [Event](https://docs.maptiler.com/sdk-js/api-reference/classes/Event/).[constructor](https://docs.maptiler.com/sdk-js/api-reference/classes/Event/#constructor)
    

## Properties[](#properties-1)

### lngLat[](#lnglat)

lngLat: [LngLat](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.LngLat/)

The geographic location on the map of the center of the touch event points.

### lngLats[](#lnglats)

lngLats: [LngLat](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.LngLat/)\[\]

The geographical locations on the map corresponding to a [touch event's `touches`](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/touches) property.

### originalEvent[](#originalevent)

originalEvent: [TouchEvent](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.TouchEvent/)

The DOM event which caused the map event.

Implementation of MapLibreEvent.originalEvent

### point[](#point)

point: [Point](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Point/)

The pixel coordinates of the center of the touch event points, relative to the map and measured from the top left corner.

### points[](#points)

points: [Point](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Point/)\[\]

The array of pixel coordinates corresponding to a [touch event's `touches`](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/touches) property.

### target[](#target)

target: [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/)

The `Map` object that fired the event.

Implementation of MapLibreEvent.target

### type[](#type)

type: "touchcancel" | "touchmove" | "touchend" | "touchstart"

The event type.

Implementation of MapLibreEvent.type

Overrides [Event](https://docs.maptiler.com/sdk-js/api-reference/classes/Event/).[type](https://docs.maptiler.com/sdk-js/api-reference/classes/Event/#type)

## Accessors[](#accessors-1)

### defaultPrevented[](#defaultprevented)

-   get defaultPrevented(): boolean
    
    `true` if `preventDefault` has been called.
    
    #### Returns boolean
    

## Methods[](#methods-1)

### preventDefault[](#preventdefault)

-   preventDefault(): void[](#preventdefault-1)
    
    Prevents subsequent default processing of the event by the map.
    
    Calling this method will prevent the following default map behaviors:
    
    -   On `touchstart` events, the behavior of [DragPanHandler](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.DragPanHandler/)
    -   On `touchstart` events, the behavior of [TwoFingersTouchZoomRotateHandler](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.TwoFingersTouchZoomRotateHandler/)
    
    #### Returns void
