new Search( [options])
Parameters:
| Name | Type | Argument | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
Properties
|
Fires:
- event:select
- change:input
Extends
Members
-
_history
-
Current history
Methods
-
_getTitleTxt(f)
-
Returns title as text
Parameters:
Name Type Description fany feature to be displayed
Returns:
- Type
- string
-
autocomplete(s, cback)
-
Autocomplete function
Parameters:
Name Type Description sstring search string
cbackfunction a callback function that takes an array to display in the autocomplete field (for asynchronous search)
Returns:
an array of search solutions or false if the array is send with the cback argument (asnchronous)
- Type
- Array | false
-
clearHistory()
-
Remove previous history
-
collapse( [b])
-
Collapse the search
Parameters:
Name Type Argument Default Description bboolean <optional>
true -
equalFeatures(f1, f2)
-
Test if 2 features are equal
Parameters:
Name Type Description f1any f2any Returns:
- Type
- boolean
-
getHistory()
-
Get history table
-
getInputField()
-
Get the input field
Returns:
- Type
- Element
-
getTitle(f)
-
Returns the text to be displayed in the menu
Parameters:
Name Type Description fany feature to be displayed
Returns:
the text to be displayed in the index, default f.name
- Type
- string
-
restoreHistory()
-
Restore history (from the localstorage)
-
reverseGeocode(coord, cback)
-
Reverse geocode
Parameters:
Name Type Description coordol.coordinate cbackfunction | undefined a callback function, default trigger a select event
-
saveHistory()
-
Save history (in the localstorage)
-
search()
-
Force search to refresh
-
select(f, reverse, coord, options)
-
A line has been clicked in the menu > dispatch event
Parameters:
Name Type Description fany the feature, as passed in the autocomplete
reverseboolean true if reverse geocode
coordol.coordinate options* options passed to the event
-
setInput(value, search)
-
Set the input value in the form (for initialisation purpose)
Parameters:
Name Type Description valuestring searchboolean to start a search
-
setMap(map)
-
Remove the control from its current map and attach it to the new map. Subclasses may set up event handlers to get notified about changes to the map here.
Parameters:
Name Type Description mapol.Map Map.