Skip to content

KBE3D / KBCore / Cesium / Request

类: Request

Stores information for making a request. In general this does not need to be constructed directly.

参数

An object with the following properties:

参数

The url to request.

参数

The function that makes the actual data request.

参数

The function that is called when the request is cancelled.

参数

The function that is called to update the request's priority, which occurs once per frame.

参数

The initial priority of the request.

参数

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.

参数

Whether to throttle the request by server.

参数

The type of request.

参数

A key used to identify the server that a request is going to.

属性

url

url: string

The URL to request.


requestFunction

requestFunction: RequestCallback

The function that makes the actual data request.


cancelFunction

cancelFunction: CancelCallback

The function that is called when the request is cancelled.


priorityFunction

priorityFunction: PriorityCallback

The function that is called to update the request's priority, which occurs once per frame.


priority

priority: number

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.


throttle

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.


throttleByServer

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 <code>true</code> is preferable for requests going through HTTP/1 servers.


type

readonly type: RequestType

Type of request.


state

readonly state: RequestState

The current state of the request.

方法

clone()

clone(result?: Request): Request

Duplicates a Request instance.

参数

result?

Request

The object onto which to store the result.

返回

Request

The modified result parameter or a new Resource instance if one was not provided.

构造函数

构造函数

new Request(options?: { url?: string; requestFunction?: RequestCallback; cancelFunction?: CancelCallback; priorityFunction?: PriorityCallback; priority?: number; throttle?: boolean; throttleByServer?: boolean; type?: RequestType; serverKey?: string; }): Request

参数

options?
url?

string

requestFunction?

RequestCallback

cancelFunction?

CancelCallback

priorityFunction?

PriorityCallback

priority?

number

throttle?

boolean

throttleByServer?

boolean

type?

RequestType

serverKey?

string

返回

Request

KBE3D @3.0.0 Copyright © 2024-present KBE3D