Home Reference Source
import {URLAPI} from 'guide4you/src/urlapi/URLAPI.js'
public class | source

URLAPI

The purpose of the URLAPI is two-fold:

1) to parse the page's search string, extract information like layers to be activated, the location, etc. and modify the map's state accordingly,

2) to read the map's state and generate a link that said layers to be activated, the location, etc.

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public

query_: *

Private Members
private

In this object all initial values are stored.

private
private

All getters by all parameters

private

All used keys by all parameters

private

Method Summary

Public Methods
public

addApiLayer(layer: VectorLayer, key: string)

Adds an layer which should be controlled with the URLAPI

public
public

Create query string from map and optional name of config file

public

makeURL(options: object): string

Create query string from map and optional name of config file

Public Constructors

public constructor(options: URLAPIOptions) source

Params:

NameTypeAttributeDescription
options URLAPIOptions

Public Members

public query_: * source

Private Members

private initialValues_: object source

In this object all initial values are stored. This is needed to create only the needed Parameters for an URL. All getters are called once after the map is ready for the first time to fill this.

private map_: G4UMap source

private parameterGetters_: function[] source

All getters by all parameters

private parameterKeys_: string[] source

All used keys by all parameters

private parameters_: URLParameter[] source

Public Methods

public addApiLayer(layer: VectorLayer, key: string) source

Adds an layer which should be controlled with the URLAPI

Params:

NameTypeAttributeDescription
layer VectorLayer

needs to have a {{QuerySource}}

key string

the key this layer should be controlled by

public getCurrentParameters(): * source

Return:

*

public makeHTMLSnippet(options: object): string source

Create query string from map and optional name of config file

Params:

NameTypeAttributeDescription
options object
  • optional
  • default: {}
options.baseURL string
  • optional

the base URL to use. Defaults to the current location.

Return:

string

Query string

public makeURL(options: object): string source

Create query string from map and optional name of config file

Params:

NameTypeAttributeDescription
options object
  • optional
  • default: {}
options.baseURL string
  • optional

the base URL to use. Defaults to the current location.

options.parameters object
  • optional
  • default: undefined

additional parameters to add to the url.

Return:

string

Query string