new alk.service.SearchSingleSearchService(opt_options)
This constructor creates a Service object to perform searches on the ALK Single Search Service.
Option | Type | Description |
---|---|---|
apiKey |
string |
This option contains the ALK ApiKey that gives you permission to extract data from ALK Servers. |
codes |
Array.<string> | string |
This option specifies the FIPS codes for counties in the search. |
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. |
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. |
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. |
maxResults |
number | string |
This option specifies the max number of results to return. It must be between 1 and 100, inclusive. |
countryType |
string |
This option specifies the country type abbreviation the countries parameter is using. |
countries |
Array.<string> | string |
This option specifies the countries for the search. They must be in the form specified by the countryType parameter. |
states |
Array.<string> | string |
This option specifies the states with which to restrict the
search. Their values must come from the "Abbrev" attribute of
states returned from the |
excludeSearchTypes |
Array.<string> | string |
This option specifies the search types to exclude when analysing
the query of the search. Their values must come from the
|
poiCategories |
Array.<string> | string |
This options specifies the Points of Interest categories with
which to restrict the search. Their values must come from the
|
coords |
Array.<string> | string |
This options specifies the coordinates with which to restrict the search. The projection must be EPSG:4356. |
Extends
Methods
-
get(opts_or_callback, responseCallback)
-
This method performs a call to the Search Single Search Service.
Name Type Description opts_or_callback
alkx.SearchSingleSearchServiceOptions | null | function This parameter contains any options to override or extend the options set in the construction of this object for the call.
Attribute Type Description apiKey
string This option contains the ALK ApiKey that gives you permission to extract data from ALK Servers.
codes
Array.<string> | string This option specifies the FIPS codes for counties in the search.
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.
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.
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.
maxResults
number | string This option specifies the max number of results to return. It must be between 1 and 100, inclusive.
countryType
string This option specifies the country type abbreviation the countries parameter is using.
countries
Array.<string> | string This option specifies the countries for the search. They must be in the form specified by the countryType parameter.
states
Array.<string> | string This option specifies the states with which to restrict the search. Their values must come from the "Abbrev" attribute of states returned from the
alk.service.StatesSingleSearchService
.excludeSearchTypes
Array.<string> | string This option specifies the search types to exclude when analysing the query of the search. Their values must come from the
alk.service.SearchTypesSingleSearchService
.poiCategories
Array.<string> | string This options specifies the Points of Interest categories with which to restrict the search. Their values must come from the
alk.service.POICategoriesSingleSearchService
.coords
Array.<string> | string This options specifies the coordinates with which to restrict the search. The projection must be EPSG:4356.
responseCallback
function The response handler.
-
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}
-
This call processes the response before it is given to the callback.
This particular method enhances the response from the ALK/PCM service and modifies it accordingly.
The response returned from Search Single Search Service returns a JSON object containing a single
alkx.SingleSearchResult
.Name Type Description options
Object The options that were given with the call combined with the base options used for the
alk.service.SearchSingleSearchService
.obj
Object The JSON response from the
alk.service.SearchSingleSearchService
.Returns:
Containing the searchSingleSearchServiceOptions and if a successful call also contains a JSON object containing the points of interest requested.