-
new NavBar()
-
Extends
Methods
-
Clear all navbar autocomplete inputs.
-
Returns
cercalia
Map objectReturns:
Cercalia map.
-
Get class name.
Returns:
Class name.
-
Get control HTML Element
Returns:
HTML Element
-
Get control id.
Returns:
Id.
-
Returns
mapboxgl
Map object -
Get control name. Null if control has not defined name.
Returns:
Class name.
-
getNavBarAutocompleteService(){module:cercaliagl/service/Autocomplete~Autocomplete}
-
Get autocomplete search address service object. More details:
module:cercaliagl/service/Autocomplete~Autocomplete
.Returns:
Autocomplete service.
-
Hide control.
-
Show button form UI element. Buttons available to show/hide are for widgets: search address, calculate route, search POIs. You can access this values via constants. Show
buttonName
parameter description.Name Type Description buttonName
string Button to hide on NavBar control. Possible values:
cercaliagl.control.NavBar.Buttons.ADDRESS
cercaliagl.control.NavBar.Buttons.POIS
cercaliagl.control.NavBar.Buttons.ROUTING
-
Reset menu to initial state.
-
Set custom callback function for address search. Set
null
to disable custom function and use default. This is useful if user wants to override default behaviour. Unique parameter received isGeEntity
.Example usage:
navBarControl.setAutocompleteAddressCallback(function(data) { const country = data.country.value; const municipality = data.municipality.value; const coordX = parseFloat(data.coord.x); const coordY = parseFloat(data.coord.y); console.log(country, municipality, coordY + ',' + coordX); });
Name Type Description fn
function | null Callback function.
null
to use default API behaviour. -
Set custom callback function for coordinates search, same behaviour as customAutocompleteAdressCallback. Set
null
to disable custom function and use default.Name Type Description fn
function | null Callback function.
null
to use default API behaviour. -
Show control.
-
Show button form UI element. Buttons available to show/hide are for widgets: search address, calculate route, search POIs. You can access this values via constants. Show
buttonName
parameter description.Name Type Description buttonName
string Button to show on NavBar control. Possible values:
cercaliagl.control.NavBar.Buttons.ADDRESS
cercaliagl.control.NavBar.Buttons.POIS
cercaliagl.control.NavBar.Buttons.ROUTING