---
title: "MapboxSnow"
description: "为地图添加降雪效果，options 透传 mapbox snow 规格。"
seo_title: "MapboxSnow Component"
seo_description: "Add a snow effect via setSnow, forwarding a Mapbox snow specification."
canonical_url: "https://mapbox.mhaibaraai.cn/docs/environment/snow"
---
# MapboxSnow

> 为地图添加降雪效果，options 透传 mapbox snow 规格。

## 简介

`MapboxSnow` 调用 `setSnow` 为地图添加降雪效果，`options` 透传 mapbox snow 规格（`density`/`intensity`/`color` 等），省略用默认雪效。

> \[\!NOTE\]
> 
> setSnow
> 
>  为 mapbox 实验性 API，需 v3 样式（如 
> 
> standard
> 
> ），未来版本可能变更。

## 用法

倾斜视角下叠加降雪：

```vue [SnowExample.vue]
<template>
  <div class="h-115 w-full overflow-hidden rounded-(--ui-radius) border border-default">
    <MapboxMap
      :options="{
        style: 'mapbox://styles/mapbox/standard',
        center: [116.391, 39.908],
        zoom: 16,
        pitch: 60
      }"
    >
      <MapboxSnow :options="{ density: 0.85, intensity: 1, color: '#ffffff' }" />
    </MapboxMap>
  </div>
</template>
```

## API

### Props

```ts
/**
 * Props for the MapboxSnow component
 */
interface MapboxSnowProps {
  /**
   * 降雪效果选项；缺省 {} 使用默认雪效
   */
  options?: mapboxgl.SnowSpecification | undefined;
}
```

## Changelog

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


## Sitemap

See the full [sitemap](/sitemap.md) for all pages.
