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.
getCountryReturns ccTLD code country currently set for the searching.
searchSearches 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.
getPOICategoriesPOI.
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.

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.

search

search: function(address,
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 (areaName0, areaName1, areaName2)
  • 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 50)

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

Parameters

address{String} Address to search in the format “(city|code)[,street [number][;(code|adm1[,adm2[,adm3]])]”, which means that there is a city or zip code at the beginning, after that there is street with the number and after semicolon there are zip code or three administrative areas (from highest to lowest level) separated by commas.  Letters are case-insensitive.
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; city.foundLength is a distance from the point in meters)
  • the name of the street/road or international road designation (street.name, road.name, internationalRoad.name; 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 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.

getPOICategories

getPOICategories: function(callback)

POI.  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.  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 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.
getCountry: function()
Returns ccTLD code country currently set for the searching.
search: function(address,
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)
POI.
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