---
title: "MapboxLottieMarker"
description: "Renders a Lottie vector animation at a marker position via lottie-web, accepting inline animationData or a remote path."
canonical_url: "https://mapbox.mhaibaraai.cn/en/docs/core/lottie-marker"
---
# MapboxLottieMarker

> Renders a Lottie vector animation at a marker position via lottie-web, accepting inline animationData or a remote path.

## Introduction

`MapboxLottieMarker` renders a Lottie vector animation at a marker position using lottie-web (built on [MapboxMarker](https://mapbox.mhaibaraai.cn/docs/core/marker)'s DOM element, not icon-frame driven). The animation source is either `animationData` (inline JSON) or `path` (remote URL) — pick one. Position is bound via `v-model:lnglat`.

## Usage

Pass inline `animationData` and use `width` / `height` to control the size:

```vue [LottieMarkerExample.vue]
<script setup lang="ts">
import type { LngLatLike } from 'mapbox-gl'
import animationData from '~/assets/lottie/marker-pulse.json'

const position = ref<LngLatLike>([116.397, 39.908])
</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: [116.397, 39.908], zoom: 12 }">
      <MapboxLottieMarker
        v-model:lnglat="position"
        :animation-data="animationData"
        :width="80"
        :height="80"
      />
    </MapboxMap>
  </div>
</template>
```

## API

### Props

```ts
/**
 * Props for the MapboxLottieMarker component
 */
interface MapboxLottieMarkerProps {
  lnglat: mapboxgl.LngLatLike;
  /**
   * lottie 动画数据（JSON 对象）；与 path 二选一
   */
  animationData?: object | undefined;
  /**
   * lottie 动画 URL；与 animationData 二选一
   */
  path?: string | undefined;
  /**
   * 是否循环
   * @default "true"
   */
  loop?: boolean | undefined;
  /**
   * 是否自动播放
   * @default "true"
   */
  autoplay?: boolean | undefined;
  /**
   * 播放速度倍率
   * @default "1"
   */
  speed?: number | undefined;
  /**
   * 容器宽（像素）
   * @default "64"
   */
  width?: number | undefined;
  /**
   * 容器高（像素）
   * @default "64"
   */
  height?: number | undefined;
}
```

### Emits

```ts
/**
 * Emitted events for the MapboxLottieMarker component
 */
interface MapboxLottieMarkerEmits {
  update:lnglat: (payload: [value: mapboxgl.LngLatLike]) => void;
}
```

## Changelog

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

---

- [lottie-web](https://github.com/airbnb/lottie-web)


## Sitemap

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