EMAPI.Finder

The class responsible for searching informations on the map, current address points.

Summary
EMAPI.FinderThe class responsible for searching informations on the map, current address points.
Functions
EMAPI.FinderThe constructor of a new instance of EMAPI.Finder objects.
destroyDestroys object of EMAPI.Finder class.
setCountrySets the context of the country where data searching is.
setLanguageSets the language context of the results which were returned by the search and geocode function.
getCountryReturns ccTLD code country currently set for the searching.
getLanguageReturns context of the currently choosen searching language.
geocodeSearches address points consistent with the specified address.
getCoordinatesGets the location on the map of one of the address points searched using the <search> function.
degeocodeSearches the geographic information for points with the given coordinates.
getObjectCategoriesReturns in the form of substitution function for all the customer’s parameters.
getPOICategoriesReturns in the form of substitution function for all the POI parameters.
searchObjectsSearches for customer static objects .
searchPOIFinds POI objects.

Functions

EMAPI.Finder

The constructor of a new instance of EMAPI.Finder objects.

Parameters

obj{Object} EMAPI.Map object class representing the map which is searched.
options{Object} An object with additional parameters of class instance.

destroy

destroy: function()

Destroys object of EMAPI.Finder class.

setCountry

setCountry: function(country)

Sets the context of the country where data searching is.

Parameters

country{String} ccTLD country code required.

setLanguage

setLanguage: function (language)

Sets the language context of the results which were returned by the search and geocode function.

Parameters

language{String} 3-letters shortcut language, np.  POL, ENG, GER, FRE.  Empty value causes automatic selection of the results language.

getCountry

getCountry: function()

Returns ccTLD code country currently set for the searching.  Set to the default top-level domain code for the domain which the script is run.

Result

{String} ccTLD country code.

getLanguage

getLanguage: function ()

Returns context of the currently choosen searching language.

Result

{String} Context of the currently choosen searching language.  Empty value(default value) causes automatic selection of the results language.

geocode

geocode: function (country,
city,
zip,
street,
streetnumber,
callback)

Searches address points consistent with the specified address.  Data transmitted to the substitution in the second parameter containing a list of matching feature address points (geocodeInfoArray) included:

  • city (city)
  • zip code (zip)
  • street (street)
  • street number (streetNumber)
  • administrative areas adm1, adm2, amd3 (areaName1, areaName2, areaName3)
  • geographic coordinates searched midpoint and the rectangle’s surrounded searched object, ia. city, or street (middlePoint.longitude, middlePoint.latitude, topLeft.longitude, topLeft.latitude, bottomRight.longitude, bottomRight.latitude)
  • error code (result: 0 = ok, 1 = no results, 2 = to many results, returned first 20)

If any of the components present in the output section address, that means it has been rejected during the search.

Parameters

country{String} Full country name .
city{String} City name.
zip{String} zip code.
street{String} Street.
streetnumber{String} Street number.
callback{Function} Function for searching results.

getCoordinates

getCoordinates: function(index,
callback)

Gets the location on the map of one of the address points searched using the <search> function.  The data is transmitted to the substitution in the second parameter functions contain an element of the structure passed in accordance with the <search> function, but returns the corresponding error code (result: 0 = ok, 1 = invalid index position in the list of results).

Parameters

index{Integer} Position of the desired item from the list of search results (value from the range 0-[number of results reduced by 1]).
callback{Function} Function for searching results.

degeocode

degeocode: function(points,
zoom,
callback)

Searches the geographic information for points with the given coordinates.  Data transmitted to the substitution function as an array of address information degeocodeInfoArray included:

  • name of the country and two administrative areas from the highest level (parameters areaName0, areaName1, areaName2)
  • zip-code (zip)
  • city(city.name)
  • the name of the street/road or international road designation (street.name, road.name, internationalRoad.name)
  • ograniczenia prędkości (tablica SpeedLimits, pole speedLimit)
  • restrykcje drogowe (tablica LogisticInformation, pola code i value oznaczające odpowiednio kod znaku drogowego i wartość restrykcji, np. code=”B-18” i value=”12.00” oznacza restrykcję rzeczywistej masy pojazdu do 12t)

Fields foundLength include the distance in meters object found from that point) In addition error code is passed (result: 0 = ok, 1 = no data).

Parameters

points{Array(EMAPI.LonLat)} Points for degeocoding.
zoom{Integer} Zoom of degeocoding information (value from the scope 0-17).
callback{Function} Function for searching results.

getObjectCategories

getObjectCategories: function(callback)

Returns in the form of substitution function for all the customer’s parameters.  Data transmitted to the substitution functions include an array of included categories:

  • category id(id)
  • category name (categoryName)
  • number of object with section by category (pointCount, lineCount, areaCount)
  • ist of subcategories included id (id), name (name), visual parameters of objects (borderColor, borderOpacity, borderWidth, fillColor, fillOpacity, iconURL, height, width) and zoom range visibility (zoomMin, zoomMax).

Parameters

callback{Function} Service of parameters of category.

getPOICategories

getPOICategories: function(callback)

Returns in the form of substitution function for all the POI parameters.  Data transmitted to the substitution functions include an array of included categories:

  • category ID (id)
  • category name (categoryName)
  • number of objects, with section by category (pointCount, lineCount, areaCount)
  • list of subcategories included id (id), name (name), visual parameters of objects (borderColor, borderOpacity, borderWidth, fillColor, fillOpacity, iconURL, height, width) and zoom range visibility (zoomMin, zoomMax).

Parameters

callback{Function} Service of parameters of category.

searchObjects

searchObjects: function(categoryNames,
searchText,
lonLat,
objectCount,
queryRadius,
objectIDs,
callback)

Searches for customer static objects . Data transmitted to the substitution in the second parameter function containing a list of found object (searchObjectArray) included:

  • ID (id)
  • subcategory ID(subcategoryId)
  • city (city)
  • country (country)
  • zip code (zip)
  • street(street)
  • description (description)
  • the geographical coordinates of sophisticated object (lon, lat) (middlePoint.longitude, middlePoint.latitude, topLeft.longitude, topLeft.latitude, bottomRight.longitude, bottomRight.latitude))
  • error code (result: 0 = ok, 1 = no results, 2 = to many results, returned the first 50)

Includes all the parameters passed to the function (conjunction of conditions).

Parameters

categoryIds{String} A list of subcategories, which is search to be (subcategory names separated by semicolons).
searchText{String} Keyword specifying the objects sought.  The size of letters doesn’t matter.
lonLat{EMAPI.LonLat} EMAPI.LonLat representing the coordinates of the central point, which is searched.
objectCount{Integer} The maximum number of expected results (mustn’t be bigger than 50).
queryRadius{Integer} The maximum search radius (in meters).
objectIDs{String} The list of specific IDs requested objects (IDs separated by semicolons).
callback{Function} The service of searching results.

searchPOI

searchPOI: function(categoryNames,
searchText,
lonLat,
objectCount,
queryRadius,
objectIDs,
callback)

Finds POI objects. ata transmitted to the substitution in the second parameter function containing a list of found object (searchObjectArray) included:

  • ID (id)
  • subcategory ID (subcategoryId)
  • City (city)
  • Country (country)
  • zip code (zip)
  • street (street)
  • description (description)
  • the geographical coordinates of sophisticated object (lon, lat) (middlePoint.longitude, middlePoint.latitude, topLeft.longitude, topLeft.latitude, bottomRight.longitude, bottomRight.latitude)
  • error code (result: 0 = ok, 1 = no results, 2 = to many results, returned the first 50)

Includes all the parameters passed to the function (conjunction of conditions).

Parameters

categoryIds{String} A list of subcategories, which is search to be (subcategory names separated by semicolons).
searchText{String} Keyword specifying the objects sought.  The size of letters doesn’t matter.
lonLat{EMAPI.LonLat} EMAPI.LonLat object representing the coordinates of the central point, which is searched.
objectCount{Integer} The maximum number of expected results (mustn’t be bigger than 50).
queryRadius{Integer} The maximum search radius (in meters).
objectIDs{String} The list of specific IDs requested objects (IDs separated by semicolons).
callback{Function} The service of searching results.
destroy: function()
Destroys object of EMAPI.Finder class.
setCountry: function(country)
Sets the context of the country where data searching is.
setLanguage: function (language)
Sets the language context of the results which were returned by the search and geocode function.
getCountry: function()
Returns ccTLD code country currently set for the searching.
getLanguage: function ()
Returns context of the currently choosen searching language.
geocode: function (country,
city,
zip,
street,
streetnumber,
callback)
Searches address points consistent with the specified address.
getCoordinates: function(index,
callback)
Gets the location on the map of one of the address points searched using the search function.
degeocode: function(points,
zoom,
callback)
Searches the geographic information for points with the given coordinates.
getObjectCategories: function(callback)
Returns in the form of substitution function for all the customer’s parameters.
getPOICategories: function(callback)
Returns in the form of substitution function for all the POI parameters.
searchObjects: function(categoryNames,
searchText,
lonLat,
objectCount,
queryRadius,
objectIDs,
callback)
Searches for customer static objects .
searchPOI: function(categoryNames,
searchText,
lonLat,
objectCount,
queryRadius,
objectIDs,
callback)
Finds POI objects.
EMAPI.Map instances are interactive maps embedded in web applications.
A class representing the geographic coordinates in the form of latitude and longitude.
Close