---
title: "ImageSourceWarp | 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.

# Type Alias ImageSourceWarp

ImageSourceWarp: "auto" | "perspective" | "flat"

#### Experimental[](#experimental)

How an [ImageSource](https://docs.maptiler.com/sdk-js/api-reference/classes/ImageSourceMLGL/) warps its image onto its four coordinates, for the cases where the coordinates do not form a rectangle.

-   `perspective` maps the image as the perspective view of a plane, which is what georeferenced photography and any other image of a flat scene wants: straight lines in the image stay straight, and the image foreshortens towards its more distant edge.
-   `flat` interpolates the image between the four coordinates bilinearly, pinning it like a rubber sheet, which is what an image being reshaped by hand wants: every corner moves the image only near itself, and the result is stable no matter how far a corner is dragged. Straight lines in the image only stay straight while they run parallel to its edges, and there is no foreshortening, in the same sense as the CSS `transform-style: flat`.
-   `auto`, the default, is `perspective` while the coordinates plausibly describe a perspective view, and blends continuously towards `flat` as they stop doing so, which they do as a corner approaches the diagonal between its two neighbours.

Coordinates with no perspective view at all - a concave, self-crossing or collinear quad - are always warped flat, whichever of these is set.
