Class requestorBing

A tile requestor for Microsoft Bing maps.

class

requestorBing

Hierarchy

Index

Constructor methods

Methods

Constructor methods

constructor(options?: { dataFormat?: string; timeoutMs?: number; maxAvailableZoomLevel?: number; }): requestorBing

Parameters

  • options?: { dataFormat?: string; timeoutMs?: number; maxAvailableZoomLevel?: number; } optional

Returns

requestorBing

Methods

public getBingKey(): string

Gets the Bing key associated with this requestor.

Returns

string

The Bing key for this requestor.

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 getEndpoint(): string

Gets the formatted endpoint uri for Bing maps, e.g. ecn.t{0}.tiles.virtualearth.net/tiles/{1}{2}{3}?g={4}&mkt={5}&shading=hill.

Returns

string

endpoint to Bing tile server as a formatted string

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 getGeneration(): string

Gets Bing tile generation

Returns

string

the tile generation as an integer

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 getMarket(): string

Gets the language code for which the tiles are rendered. The default code is 'en-US'.

Returns

string

The language code for which tiles are rendered.

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 getScheme(): string

Gets the protocol for the endpoint, either 'http' or 'https'.

Returns

string

The endpoint protocol.

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 setBingKey(key: string)

Sets Bing key which then calls Microsoft metadata service and automatically configures content endpoint.

Parameters

  • key: string

    Bing key.

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 setGeneration(g: string)

Sets Bing tile generation

Parameters

  • g: string
    • generation as an integer

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 setMarket(m: string)

Sets language code for which to render tiles. For example, 'en-US'.

Parameters

  • m: string

    Language code for which to render tiles.

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 setScheme(s: string)

Sets endpoint protocol to either 'http' or 'https'.

Parameters

  • s: string

    Protocol to use in endpoints.

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