---
title: "MapboxImageLayer"
description: "Static image overlay layer that georeferenced an image to the map using its four corner coordinates."
canonical_url: "https://mapbox.mhaibaraai.cn/en/docs/layers/image"
---
# MapboxImageLayer

> Static image overlay layer that georeferenced an image to the map using its four corner coordinates.

## Introduction

`MapboxImageLayer` overlays a static image onto the map using four corner coordinates (top-left / top-right / bottom-right / bottom-left). Common use cases include radar imagery, scanned maps, and historical map overlays. Internally implemented as an `image` source with a `raster` layer.

## Usage

Overlay a radar image onto a specific geographic area:

```vue [ImageLayerExample.vue]
<script setup lang="ts">
// 四角经纬度：左上 / 右上 / 右下 / 左下
const coordinates: [[number, number], [number, number], [number, number], [number, number]] = [
  [-80.425, 46.437],
  [-71.516, 46.437],
  [-71.516, 37.936],
  [-80.425, 37.936]
]
</script>

<template>
  <div class="h-115 w-full overflow-hidden rounded-(--ui-radius) border border-default">
    <MapboxMap :options="{ style: 'mapbox://styles/mapbox/light-v11', center: [-75.79, 42.1], zoom: 4 }">
      <MapboxImageLayer
        url="https://docs.mapbox.com/mapbox-gl-js/assets/radar.gif"
        :coordinates="coordinates"
        :opacity="0.85"
      />
    </MapboxMap>
  </div>
</template>
```

## API

### Props

```ts
/**
 * Props for the MapboxImageLayer component
 */
interface MapboxImageLayerProps {
  /**
   * 图片地址
   */
  url: string;
  /**
   * 四角经纬度：左上/右上/右下/左下
   */
  coordinates: [[number, number], [number, number], [number, number], [number, number]];
  /**
   * 图层 id；省略时自动生成
   */
  layerId?: string | undefined;
  /**
   * 不透明度
   * @default "1"
   */
  opacity?: number | undefined;
  /**
   * 插入到该图层之前
   */
  beforeId?: string | undefined;
}
```

## Changelog

See commit history for [src/runtime/components/layers/ImageLayer.vue](https://github.com/mhaibaraai/movk-mapbox/commits/main/src/runtime/components/layers/ImageLayer.vue).


## Sitemap

See the full [sitemap](https://mapbox.mhaibaraai.cn/sitemap.md) for all pages.
