Class: WeatherImageTileService

alk.service.WeatherImageTileService

An instance of this class, given the parameters and defaults, generates a URL for the ALK Weather Image Tile service.

new alk.service.WeatherImageTileService(opt_options)

This constructor creates a Service object with which to access the ALK Weather Image Tile Service. It is used primarily to create URLs based on the given options.

Option Type Description
apiKey string

This option contains the ALK ApiKey that gives you permission to extract data from ALK Servers.

dataset alk.val.Dataset | number | string

The option contains the Dataset parameter for the Service. This option specifies an area dataset that may be pertinent to the request.

format alk.val.Format | number

This option tells the Service in which format to deliver its image data.

height number | string

This option tells the service the height in which to return image data or tiles. The value is in pixels.

imgOption alk.val.ImgOption | number | string

This option tells the service which way to deliver the image data. Available values are 'Background', 'Foreground', and 'Both'.

imgSrc alk.val.ImgSrc | number | string

This option tells the service from where to get its image data. The available names, such as 'Sat1' and 'Sat2', have specific designations with ALK. Please see {TODO: Need Reference Here} for a current description.

region alk.val.Region | number | string

This option tells the service in which region the retrieved data is to pertain. Some ALK Services switch underlying services due to this option. For instance, traffic data for North America and Europe may come from different underlying services.

srs alk.val.SRS | number | string

This option tells the service the particular projection that is used any GIS data given to the service.

style alk.val.Style | number | string

This option tells the service the style of map that is requested. ALK has a number of different map styles, such as alk.val.Style.Night, and alk.val.Style.Terrain.

hostURL string

This option contains the the host and port URL for the particular service. This option is not set by the user, but is automatically generated from the particular service being used.

path string

This option is the path part of the URL for the particular service. This option is not set by the user, but is automatically generated from the particular service being used.

width number | string

This option tells the service the width in which to return image data or tiles. The value is in pixels.

timeOffset string

This option tells the service the offset in time in which to return image weather data or tiles.

TODO: Format?

Extends

Methods

get(opts_or_callback, responseCallback){*|undefined} inherited

This method performs a request to this configured service using the supplied options, options set on the constructor, and defaults. The response is handled asynchronously by a callback.

This method calls on possibly sub-classed methods:

  • getServiceOptions to combine and extend call options with the base options
  • processResponse to process the response before handing it off to the responseCallback.

NOTE

The primary function of a service is to generate a URL. Although this call exists on this object, this get call may not be used by certain components, such as alk.source.XYZSource. That is because the tile source will just use getURL call to get the URL, which may be a template with {x}, {y}, {z}, and make the get XHR requests on its own. Therefore, the intercept points, such as processResponse will not be engaged for those calls.

Name Type Description
opts_or_callback Object | function

This parameter contains any options that override options that are set on this object for this particular request.

responseCallback function

This parameter is the function that handles the response.

getAttribution(opts_or_callback, responseCallback){*|undefined} inherited

This method performs a request to this configured service using the supplied options, options set on the constructor, and defaults to get the service's attribution, should it have one. This call results in Object, which may be a parsed JSON response.

Name Type Description
opts_or_callback Object | function

This parameter contains any options that override options that are set on this object for this particular request.

responseCallback function

This parameter is the function that handles the response.

getServiceOptions(options){Object} inherited

This method returns the base options that was used to create this Service object and override them with the given options;

Name Type Description
options Object
Returns:
The combined options.

getURL(opt_options){string} inherited

Returns the URL for the service based on the given options, options set on the constructor, and defaults.

Name Type Description
options Object

These options override any relevant options that are set on the object at its construction.

processResponse(options, obj){Object} inherited

This method processes the response from the server before it gives it to the callback. The default is to pass through.

NOTE

This intercept point will only be called if the request was initiated with the get call.

Name Type Description
options Object

The call options combined with the base options used for the call.

obj Object

The object received from the server.