-
Name Type Description optionsOptions
Name Type Description callbackSuggestionsFunctionfunction Callback function when suggestions changed.
callbackFunctionfunction Callback function when selecting autocomplete element.
onInputFunctionfunction | undefined Callback function when on input event.
autocompleteIdstring <div id="xxxx">element ID where create add autocomplete functionality.elementElement Element
placeholderstring Input placeholder. If not specified default is
Address.pAutocomhnrtboolean Apply a tolerance in house number ranges. Cercalia suggest search prioritize address that contains the house numbers searched. This parameters lets you apply a tolerance in the house numbers ranges available in the database (+/-50 numbers in general, and +/- 500 in USA), in order to avoid some gaps in this database. Values:
false: don’t apply. Default value
true: applylabelstring Label text for placeholder
closeSuggestionsIfInputIsEmptyboolean Close suggestions if input is empty. Default
false.maxCandidatesnumber Max candidates to show. Default
5.searchInsideCountrystring | null Autocomplete search inside a country (3 characters ISO code), for exemple:
ESP. Default value null (all countries).searchInsideRegionstring | null Autocomplete search inside a region (Country ISO code + Region code), for exemple:
ESPMADor several regions, for example:ESPCAT,ESPMAD,ESPVAL. Please, contact with Nexus if you need to know region codes.searchInsideProvincestring | null Autocomplete search inside a province (Country ISO code + Province code), for exemple:
ESP08(Barcelona),ESP17(Girona) or several provinces, for example:ESP08,ESP17. Please, contact with Nexus if you need to know province codes.searchInsideMunicipalitystring | null Autocomplete search inside a municipality (Country ISO code + Province code), for exemple:
ESP410917(Sevilla),ESP502973(Zaragoza) or several municipality, for example:ESP08,ESP17. Please, contact with Nexus if you need to know municipality codes.searchInsideLocalitystring | null Autocomplete search inside a locality for exemple:
ESP17240205565747(Barcelona),ESP17240205565484(Badalona) or several localities, for example:ESP17240205565747,ESP17240205565484. Please, contact with Nexus if you need to know locality codes.searchClosestHouseNumberboolean Search closest real house number in suggest. Default:
false.searchFilterEntitystring Set filter by municipality / region / subregion / country (by entity code). You can mix that entities. Examples:
ESP170792,ESPCAT,ES08
SolrItemESP,ESP08,ESP17,PRT,AND.searchPriorityEntitystring | Array.<string> Set priority municipality / region / subregion / country (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 priority. 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
Examples:
['ESP170792', 'AND', 'ESP,FRA'].
['ESPCAT', 'ESPMAD', 'PRT,AND,FRA'].searchPreferredEntitystring | Array.<string> Set preferred municipality / region / subregion / country (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
Examples:poiCategoriesstring Set POI categories. If not specified Cercalia will return default POI categories. Categories. For example:
['C012', 'D00CAM', 'C027', 'C016']['ESP170792', 'AND', 'ESP,FRA'].
['ESPCAT', 'ESPMAD', 'PRT,AND,FRA'].floatingLabelboolean Floating label for input UI element. Default
false.langstring | Array.<string> Set preferred lang to return suggestions. Default
null.searchCoordinateReferencemodule:cercaliagl/LonLat~LonLat Radius for geographic search. Default
undefined.searchInsideRadiusnumber Filter results by proximity to a point. Default
null.
Extends
- module:cercaliagl/service/Service~Service
Methods
-
Close autocomplete div.
-
Get autocomplete DOM element reference. This should be
<div />element.Returns:
Autocomplete element.
-
getGeocoding(){module:cercaliagl/service/Autocomplete~GeEntitySuggest|null|undefined}
-
Get Geocoding JSON server response. It returns
nullif address is not selected.Returns:
JSON server response.
-
Returns:
Return if suggestions list is visible
-
Current input value
Returns:
Input value
-
Assign a callback function after selecting a candidate from the suggest list
Name Type Description callbackFnfunction Callback Function.
-
Assign a callback function after suggestions changed
Name Type Description callbackSuggestionsFunctionfunction Callback Function.
-
setCloseSuggestionsIfInputIsEmpty(closeSuggestionsIfInputIsEmpty)
-
Set close suggestions if input is empty
Name Type Description closeSuggestionsIfInputIsEmptyboolean Close suggestions if input is empty
-
Set input function
Name Type Description onInputFunctionfunction Function
-
Set POI categories. If not specified Cercalia will return default POI categories.
Name Type Description categoriesstring | Array.<string> | null Categories. For example:
['C012', 'D00CAM', 'C027', 'C016'] -
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.
searchInsideRadiusoption must be provided. UsesetSearchCoordinateReferencemethod.Name Type Description lonLatmodule:cercaliagl/LonLat~LonLat | null Coordinate reference.
nullvalue deactive behaviour. -
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,ctName Type Description typestring | Array.<string> | null Type or array of types. For example:
['ct','pois','st']. -
Search inside a country. For example:
'ESP,FRA,GBR'or['ESP','FRA','GBR']Name Type Description countriesIdstring | Array.<string> | null Country or array of countries id.
-
Search inside a locality. For example:
ESP17240205544993(Vallecas),ESP17240205545872(La Barceloneta), etc..Name Type Description localityIdstring | Array.<string> | null Locality or array of localities id.
-
Search inside a municipality. For example:
ESP280796(Madrid),ESP080193(Barcelona), etc..Name Type Description municipalityIdstring | Array.<string> | null Municipality id or array of municipality id.
-
Search inside a region. For example:
ESP17(Girona),ESP08(Barcelona) etc..Name Type Description provinceIdstring | Array.<string> | null Region or array of regions id.
-
Set radius for geographic search. Complementary option for option
searchCoordinateReference.Name Type Description radiusnumber | null Radius
-
Search inside a region. For example:
ESPMAD(Comunidad de Madrid),ESPCAT(Catalunya), etc..Name Type Description regionsIdstring | Array.<string> | null Region or array of regions id.
-
Change value of autocomplete and optionally open suggestions.
Name Type Description textstring Text
openSuggestionsboolean (defaults to false) Open suggest after change input value. Default
false