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

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

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

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

##### Index

### Constructors

[constructor](#constructor)

### Properties

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

### Accessors

[defaultPrevented](#defaultprevented)

### Methods

[preventDefault](#preventdefault)

## Constructors

### constructor[](#constructor)

-   new MapTouchEventMLGL(  
        type: string,  
        map: [MapMLGL](https://docs.maptiler.com/sdk-js/api-reference/classes/MapMLGL/),  
        originalEvent: [TouchEvent](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.TouchEvent/),  
    ): MapTouchEventMLGL[](#constructormaptoucheventmlgl)
    
    #### Parameters
    
    -   type: string
    -   map: [MapMLGL](https://docs.maptiler.com/sdk-js/api-reference/classes/MapMLGL/)
    -   originalEvent: [TouchEvent](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.TouchEvent/)
    
    #### Returns MapTouchEventMLGL
    
    Overrides [MapLibreEvent](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreEvent/).[constructor](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreEvent/#constructor)
    

## Properties

### lngLat[](#lnglat)

lngLat: [LngLat](https://docs.maptiler.com/sdk-js/api-reference/classes/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/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.

Overrides [MapLibreEvent](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreEvent/).[originalEvent](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreEvent/#originalevent)

### point[](#point)

point: [Point](https://docs.maptiler.com/sdk-js/api-reference/classes/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/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: [MapMLGL](https://docs.maptiler.com/sdk-js/api-reference/classes/MapMLGL/)

The `Map` object that fired the event.

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

### type[](#type)

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

The event type.

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

## Accessors

### defaultPrevented[](#defaultprevented)

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

## Methods

### 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/DragPanHandler/)
    -   On `touchstart` events, the behavior of [TwoFingersTouchZoomRotateHandler](https://docs.maptiler.com/sdk-js/api-reference/classes/TwoFingersTouchZoomRotateHandler/)
    
    #### Returns void
