# MapGIS Client for JavaScript API

Common Cesium-Plugin MapboxGL-Plugin Leaflet-Plugin OpenLayers-Plugin Video-Plugin
API文档

#### # new Promise()

Trusted Promise constructor. A Promise created from this constructor is a trusted when.js promise. Any other duck-typed promise is considered untrusted.

### 方法

#### # always(onFulfilledOrRejectedopt, nullable, onProgressopt, nullable)

Register a callback that will be called when a promise is fulfilled or rejected. Optionally also register a progress handler. Shortcut for .then(onFulfilledOrRejected, onFulfilledOrRejected, onProgress)

#### 参数:

名称 | 类型 | 描述
--- | --- | ---
`onFulfilledOrRejected` | function |
`onProgress` | function |

返回值:
类型: Promise

#### # otherwise(onRejectednullable)

Register a rejection handler. Shortcut for .then(undefined, onRejected)

#### 参数:

名称 | 类型 | 描述
--- | --- | ---
`onRejected` | function |

返回值:
类型: Promise

#### # spread(onFulfilled)

Assumes that this promise will fulfill with an array, and arranges for the onFulfilled to be called with the array as its argument list i.e. onFulfilled.spread(undefined, array).

#### 参数:

名称 | 类型 | 描述
--- | --- | ---
`onFulfilled` | function | function to receive spread arguments

返回值:
类型: Promise

#### # yield(value)

Shortcut for .then(function() { return value; })

#### 参数:

名称 | 类型 | 描述
--- | --- | ---
`value` | * |

返回值:

a promise that:

- is fulfilled if value is not a promise, or
- if value is a promise, will fulfill with its value, or reject with its reason.

类型: Promise
构造函数
成员变量
方法
事件