Request

new Cesium.Request(options)

Stores information for making a request. In general this does not need to be constructed directly.
参数名称 类型 描述信息
options object 可选 An object with the following properties:
参数名称 类型 默认值 描述信息
url string 可选 The url to request.
requestFunction Request.RequestCallback 可选 The function that makes the actual data request.
cancelFunction Request.CancelCallback 可选 The function that is called when the request is cancelled.
priorityFunction Request.PriorityCallback 可选 The function that is called to update the request's priority, which occurs once per frame.
priority number 0.0 可选 The initial priority of the request.
throttle boolean false 可选 Whether to throttle and prioritize the request. If false, the request will be sent immediately. If true, the request will be throttled and sent based on priority.
throttleByServer boolean false 可选 Whether to throttle the request by server.
type RequestType RequestType.OTHER 可选 The type of request.
serverKey string 可选 A key used to identify the server that a request is going to.

成员(属性)

The function that is called when the request is cancelled.
Priority is a unit-less value where lower values represent higher priority. For world-based objects, this is usually the distance from the camera. A request that does not have a priority function defaults to a priority of 0. If priorityFunction is defined, this value is updated every frame with the result of that call.
默认值: 0.0
The function that is called to update the request's priority, which occurs once per frame.
The function that makes the actual data request.
The current state of the request.

readonly throttle : boolean

Whether to throttle and prioritize the request. If false, the request will be sent immediately. If true, the request will be throttled and sent based on priority.
默认值: false

readonly throttleByServer : boolean

Whether to throttle the request by server. Browsers typically support about 6-8 parallel connections for HTTP/1 servers, and an unlimited amount of connections for HTTP/2 servers. Setting this value to true is preferable for requests going through HTTP/1 servers.
默认值: false
Type of request.
默认值: RequestType.OTHER
The URL to request.

方法

Duplicates a Request instance.
参数名称 类型 描述信息
result Request 可选 The object onto which to store the result.
返回值:
The modified result parameter or a new Resource instance if one was not provided.

定义的类型

Cesium.Request.CancelCallback()

The function that is called when the request is cancelled.

Cesium.Request.PriorityCallback()number

The function that is called to update the request's priority, which occurs once per frame.
返回值:
The updated priority value.

Cesium.Request.RequestCallback()Promise.<void>

The function that makes the actual data request.
返回值:
A promise for the requested data.