new cercalia.service.Autocomplete(options)
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Options
|
Extends
Methods
-
close()
src/cercalia/service/autocomplete.js, line 476 -
Close autocomplete div.
-
Returns:
Get Class name of object
-
getElement(){PolymerCercaliaElement.Autocomplete}
src/cercalia/service/autocomplete.js, line 926 -
Returns:
Autocomplete element.
-
Returns:
Return a JSON object with the last information.
-
Returns:
Unique Id.
-
setCallbackFunction(callbackFn)
src/cercalia/service/autocomplete.js, line 228 -
Assign a callback function after selecting a candidate from the suggest list
Name Type Description callbackFn
function Callback Function.
-
setLang(lang)
src/cercalia/service/autocomplete.js, line 385 -
Set Lang
Name Type Description lang
string | Array.<string> | null Lang. For example:
['GER', 'ARA']
-
setPoiCategories(categories)
src/cercalia/service/autocomplete.js, line 373 -
Set POI categories. If not specified Cercalia will return default POI categories.
Name Type Description categories
string | Array.<string> | null Categories. For example:
['C012', 'D00CAM', 'C027', 'C016']
-
setSearchCoordinateReference(lonLat)
src/cercalia/service/autocomplete.js, line 355 -
Filter results by proximity to a point (coordinate). It is a restrictive filter (only returns candidates within the radius), prioritizing results based on proximity to the search point.
searchInsideRadius
option must be provided. UsesetSearchCoordinateReference
method.Name Type Description lonLat
cercalia.LonLat | null Coordinate reference.
null
value deactive behaviour. -
setSearchFilterEntity(entityId)
src/cercalia/service/autocomplete.js, line 310 -
Set filter by municipality / region / subregion (by entity code). You can mix that entities. Parameter examples:
ESP170792,ESPCAT,ES08
or *[ESP170792, ESPCAT, ES08
]
ESP,ESP08,ESP17,PRT,AND
.Name Type Description entityId
string | Array.<string> Entity id.
-
setSearchFilterType(type)
src/cercalia/service/autocomplete.js, line 394 -
Search within type specified. Possible values are:
st
(streets),ct
(locality),p
(pois),all|null
. It is possible specify more than one value. Example :st,ct
Name Type Description type
string | Array.<string> | null Type or array of types. For example:
['ct','pois','st']
. -
setSearchInsideCountry(countriesId)
src/cercalia/service/autocomplete.js, line 247 -
Search inside a country. For example:
'ESP,FRA,GBR'
or['ESP','FRA','GBR']
Name Type Description countriesId
string | Array.<string> | null Country or array of countries id.
-
setSearchInsideLocality(localityId)
src/cercalia/service/autocomplete.js, line 295 -
Search inside a locality. For example:
ESP17240205544993
(Vallecas),ESP17240205545872
(La Barceloneta), etc..Name Type Description localityId
string | Array.<string> | null Locality or array of localities id.
-
setSearchInsideMunicipality(municipalityId)
src/cercalia/service/autocomplete.js, line 283 -
Search inside a municipality. For example:
ESP280796
(Madrid),ESP080193
(Barcelona), etc..Name Type Description municipalityId
string | Array.<string> | null Municipality id or array of municipality id.
-
setSearchInsideProvince(provinceId)
src/cercalia/service/autocomplete.js, line 271 -
Search inside a region. For example:
ESP17
(Girona),ESP08
(Barcelona) etc..Name Type Description provinceId
string | Array.<string> | null Region or array of regions id.
-
setSearchInsideRadius(radius)
src/cercalia/service/autocomplete.js, line 364 -
Set radius for geographic search. Complementary option for option
searchCoordinateReference
.Name Type Description radius
number | null Radius
-
setSearchInsideRegion(regionsId)
src/cercalia/service/autocomplete.js, line 259 -
Search inside a region. For example:
ESPMAD
(Comunidad de Madrid),ESPCAT
(Catalunya), etc..Name Type Description regionsId
string | Array.<string> | null Region or array of regions id.
-
setSearchPreferredEntity(entities)
src/cercalia/service/autocomplete.js, line 345 -
Set preferred municipality / region / subregion / country (by entity code). Not compatible with "searchPriorityEntity". This filter, use a soft prioritizaton of the results that are in the specified regions above the other candidates, but does not eliminate the results from other regions or countries. This filter can be combined with the
rsc
filter for maximum results filter beyond the preferred. Example:ESPVAL
. In case you need to prioritize candidates in the list of preferred regions, the regions may be separated by parameters according to priority level: first element: maximum priority, second element: second level priority, etc.['ESP170792', 'AND', 'ESP,FRA']
.
['ESPCAT', 'ESPMAD', 'PRT,AND,FRA']
.Name Type Description entities
string | Array.<string> | null Entities.
-
setSearchPriorityEntity(entities)
src/cercalia/service/autocomplete.js, line 330 -
Set preferred municipality / region / subregion (by entity code). This filter, prioritizes the results that are in the specified regions above the other candidates, but does not eliminate the results from other regions or countries. This filter can be combined with the "csr" filter for maximum results filter beyond the preferred. Example:
ESPVAL
. In case you need to prioritize candidates in the list of preferred regions, the regions may be separated by parameters according to priority level: first element: maximum priority, second element: second level priority, etc
Parameter examples:
['ESP170792', 'AND', 'ESP,FRA']
.
['ESPCAT', 'ESPMAD', 'PRT,AND,FRA']
.Name Type Description entities
string | Array.<string> | undefined Entities.
-
setValue(text, opt_openSuggestions)
src/cercalia/service/autocomplete.js, line 936 -
Change value of autocomplete and optionally open suggestions or search coordinate.
Name Type Description text
string Text
openSuggestions
boolean Open suggest after change input value or search introduced coordinate.
-
submit()
src/cercalia/service/autocomplete.js, line 448 -
Force submit as press key enter event. That could be useful to search for coordinates