ym.Util

Overview

Help methods of the Map API.

Methods

clearTimer(index) from v3

Removes an observer from the timer queue.

Parameter

Name Description Data type Default value
index   int  

Return

void

domTemplate(target, options) from v3

Creates a template function from a string.

Parameters

Name Description Data type Default value
target   string  
options [optional] object  

Return

function

each(array, iterator, context) from v3

Iterates over an array.

Parameters

Name Description Data type Default value
array   array  
iterator   function  
context [optional]    

Return

void

filter(array, iterator, context) from v3

Iterates over an array considering a filter.

Parameters

Name Description Data type Default value
array   array  
iterator   function  
context [optional]    

Return

array

formatAddressLine(addressObj, options) from v3

Converts an address object into a string.

Parameters

Name Description Data type Default value
addressObj   ym.util.AddressFormat or
 ym.util.AddressCompatibilityFormat
 or ym.util.GeoJSONFormat
 
options
Name Description Data type Default value
altText [optional] string null
prependCountry [optional] bool false
avoidZip [optional] bool false
[optional]
object  

Return

string

formatNumber(number, digits) from v3

Rounds a number to a given precision.

Parameters

Name Description Data type Default value
number   double  
digits [optional] int  

Return

int

getUrlParams(forceLoad) from v3

Loads the parameters of a URL.

Parameter

Name Description Data type Default value
forceLoad [optional] bool  

Return

object

humanMetricDistance(distance, forceDecimalFormat, exponent) from v3

Returns the metric distance of an integer.

Parameters

Name Description Data type Default value
distance      
forceDecimalFormat      
exponent      

Return

string

humanNumberFormat(number, exponent, zeroFix) from v3

Represents a number in German number format.

Parameters

Name Description Data type Default value
number   string oder Zahl  
exponent [optional] int 0
zeroFix [optional] bool false

Return

string

ltrim(s) from v3

Removes spaces at the beginning of a string.

Parameter

Name Description Data type Default value
s   string  

Return

string

map(array, iterator, context) from v3

Iterates over an array and maps every element by the iterator.

Parameters

Name Description Data type Default value
array   array  
iterator   function  
context [optional]    

Return

array

mixin(class, mixin) from v3

Adds a method to a class.

Parameters

Name Description Data type Default value
class   class  
mixin   object  

Return

class

nextId() from v3

Creates a unique ID for the session.

Return

int

parseHTML(htmlStr, parent) from v3

Creates a DOM element which can optionally be appended to a parent element.

Parameters

Name Description Data type Default value
htmlStr   string  
parent [optional] HTMLElement  

Return

HTMLElement

replaceUrl(data) from v3

Replaces the URL query of the current page URL.

Parameter

Name Description Data type Default value
data   object  

Return

void

rtrim(s) from v3

Removes spaces from the end of a string.

Parameter

Name Description Data type Default value
s   string  

Return

string

serialize(data, noUrlEncode) from v3

Creates a URL query from an object.

Parameters

Name Description Data type Default value
data   object  
noUrlEncode [optional] bool false

Return

string

stringTemplate(target, options) from v3

Creates a template function from a string.

Parameters

Name Description Data type Default value
target   string  
options [optional] object null

Return

function

timer(options, context) from v3

Parameters

Name Description Data type Default value
options   object  
context   object  

Return

int

trim(s) from v3

Removes the spaces at the beginning and end of a string.

Parameter

Name Description Data type Default value
s   string  

Return

string

trimPrecision(number, digits) from v3

Brings a double value to a certain precision.

Parameters

Name Description Data type Default value
number   double  
digits   int  

Return

double

unserialize(str) from v3

Creates an object from a URL query.

Parameter

Name Description Data type Default value
str   string  

Return

object