Class requestorOpen

This is a generic tile requestor suitable for several third-party tile servers. These include open street map, map quest, cloudmade, Nokia, etc.

class

requestorOpen

Hierarchy

Index

Constructor methods

Methods

Constructor methods

constructor(endpoint: string, subdomains: Array<string>, options?: { dataFormat?: string; timeoutMs?: number; maxAvailableZoomLevel?: number; }): requestorOpen

Parameters

  • endpoint: string
  • subdomains: Array<string>
  • options?: { dataFormat?: string; timeoutMs?: number; maxAvailableZoomLevel?: number; } optional

Returns

requestorOpen

Methods

public getCacheEnabled(): boolean

Returns whether or not caching is enabled for vector-based requestors.

Returns

boolean

Whether or not caching is enabled.

public getDataFormat(): string

Gets format of data returned by REST service.

Returns

string

Data format returned by the REST service.

public getFormattedEndpoint(quad: quad, descriptor: any): string

Gets formatted endpoint using the supplied quadtile and a descriptor.

Parameters

  • quad: quad

    Quadtile for which to fetch the endpoint.

  • descriptor: any

Returns

string

The requested URI string.

public getIsRestImage(): boolean

Determines whether or not this requestor returns bitmap images.

Returns

boolean

Whether or not this requestor returns bitmap images.

public getKeyVals(): Array<{}>

??? Gets the additional

Returns

Array<{}>

public getLocalData(quad: quad, descriptor: any): string

Gets data locally if the requestor supports it.

Parameters

  • quad: quad

    Quadtile for which to fetch the endpoint.

  • descriptor: any

Returns

string

The requested JSON data.

public getMaxAvailableZoomLevel(): number

Gets maximum available zoom level content that can be retrieved from the endpoint this requestor consumes.

Returns

number

The maximum available zoom level for this requestor.

public getTimeoutMs(): number

Gets requestor timeout in miliseconds.

Returns

number

Requestor timeout in miliseconds.

public getUsesEndpoint(): boolean

Determines whether or not this requestor uses an endpoint rather than local data.

Returns

boolean

Whether or not this requestor gets data from an endpoint.

public hash(descriptor: any): string

Creates unique sha1 hash from this requestor and the supplied descriptor. This is useful in creating a unique key or folder for tile caching. This combined with a tile's quad-key can efficiently and uniquely identify a particular tile.

params

{descriptor} The descriptor for which to create the hash.

Parameters

  • descriptor: any

Returns

string

The generated sha1 hash.

public setCacheEnabled(flag: boolean)

Sets whether or not caching is enabled for vector-beased requestors.

Parameters

  • flag: boolean

public setDataFormat(df: string)

Sets format of data that should be returned by REST service.

Parameters

  • df: string

    Name of the data format the REST service should use.

public setIsRestImage(flag: boolean)

Sets whether this requestor should return bitmap images.

Parameters

  • flag: boolean

    Whether or not this requestor should return bitmap images.

public setKeyVals(options: Array<{}>)

Set any key/value pairs that are attached to the ajax call (such as username and password)

Parameters

  • options: Array<{}>

public setMaxAvailableZoomLevel(max: number)

Sets maximum available zoom level content that can be retrieved from the endpoint this requestor consumes. Note: This defaults to the projection's maximum available zoom level, which is 20 in spherical mercator.

Parameters

  • max: number

    The maximum available zoom level for this requestor.

public setTimeoutMs(ms: number)

Sets requestor timeout in miliseconds.

Parameters

  • ms: number

    Desired requestor timeout in miliseconds.

public setUsesEndpoint(flag: boolean)

Sets whether or not this requestor uses an endpoint rather than local data.

Parameters

  • flag: boolean