ym.Util
Overview
Help methods of the Map API.
Methods
clearTimer(index)
Removes an observer from the timer queue.
Parameter | Description | Data type | Default value |
---|---|---|---|
index | int |
- Return: void
domTemplate(target, options)
Creates a template function from a string.
Parameter | Description | Data type | Default value |
---|---|---|---|
target | string | ||
options | [optional] | object |
- Return: function
each(array, iterator, context)
Iterates over an array.
Parameter | Description | Data type | Default value |
---|---|---|---|
array | array | ||
iterator | function | ||
context | [optional] |
- Return: void
filter(array, iterator, context)
Iterates over an array considering a filter.
Parameter | Description | Data type | Default value |
---|---|---|---|
array | array | ||
iterator | function | ||
context | [optional] |
- Return: array
formatAddressLine(addressObj, options)
Converts an address object into a string.
Parameter | Description | Data type | Default value |
---|---|---|---|
addressObj | ym.util.AddressFormat or ym.util.AddressCompatibilityFormat or ym.util.GeoJSONFormat | ||
options | [optional] | object |
- Return: string
formatNumber(number, digits)
Rounds a number to a given precision.
Parameter | Description | Data type | Default value |
---|---|---|---|
number | double | ||
digits | [optional] | int |
- Return: int
getUrlParams(forceLoad)
Loads the parameters of a URL.
Parameter | Description | Data type | Default value |
---|---|---|---|
forceLoad | [optional] | bool |
- Return: object
humanMetricDistance(distance, forceDecimalFormat, exponent)
Returns the metric distance of an integer.
Parameter | Description | Data type | Default value |
---|---|---|---|
distance | |||
forceDecimalFormat | |||
exponent |
- Return: string
humanNumberFormat(number, exponent, zeroFix)
Represents a number in German number format.
Parameter | Description | Data type | Default value |
---|---|---|---|
number | string or number | ||
exponent | [optional] | int | 0 |
zeroFix | [optional] | bool | false |
- Return: string
ltrim(s)
Removes spaces at the beginning of a string.
Parameter | Description | Data type | Default value |
---|---|---|---|
s | string |
- Return: string
map(array, iterator, context)
Iterates over an array and maps every element by the iterator.
Parameter | Description | Data type | Default value |
---|---|---|---|
array | array | ||
iterator | function | ||
context | [optional] |
- Return: array
mixin(class, mixin)
Adds a method to a class.
Parameter | Description | Data type | Default value |
---|---|---|---|
class | class | ||
mixin | object |
- Return: class
nextId()
Creates a unique ID for the session.
- Return: int
parseHTML(htmlStr, parent)
Creates a DOM element which can optionally be appended to a parent element.
Parameter | Description | Data type | Default value |
---|---|---|---|
htmlStr | string | ||
parent | [optional] | HTMLElement |
- Return: HTMLElement
replaceUrl(data)
Replaces the URL query of the current page URL.
Parameter | Description | Data type | Default value |
---|---|---|---|
data | object |
- Return: void
rtrim(s)
Removes spaces from the end of a string.
Parameter | Description | Data type | Default value |
---|---|---|---|
s | string |
- Return: string
serialize(data, noUrlEncode)
Creates a URL query from an object.
Parameter | Description | Data type | Default value |
---|---|---|---|
data | object | ||
noUrlEncode | [optional] | bool | false |
- Return: string
stringTemplate(target, options)
Creates a template function from a string.
Parameter | Description | Data type | Default value |
---|---|---|---|
target | string | ||
options | [optional] | object | null |
- Return: function
timer(options, context)
Parameter | Description | Data type | Default value |
---|---|---|---|
options | object | ||
context | object |
- Return: int
trim(s)
Removes the spaces at the beginning and end of a string.
Parameter | Description | Data type | Default value |
---|---|---|---|
s | string |
- Return: string
trimPrecision(number, digits)
Brings a double value to a certain precision.
Parameter | Description | Data type | Default value |
---|---|---|---|
number | double | ||
digits | int |
- Return: double
unserialize(str)
Creates an object from a URL query.
Parameter | Description | Data type | Default value |
---|---|---|---|
str | string |
- Return: object