<abstract, protected> new Search(target)
Create an instance of Search
Parameters:
Name | Type | Description |
---|---|---|
target |
jQuery | Element | string | The target |
Fires:
Extends
Methods
-
append(elements)
-
A method to append elements to the container
Parameters:
Name Type Description elements
jQuery | Element | Array.<Element> | string The element to append
- Inherited From:
- Overrides:
- Source:
Returns:
The container
- Type
- jQuery
-
disambiguate(ambiguous)
-
Displays possible address matches
Parameters:
Name Type Description ambiguous
module:nyc/Locator~Locator.Ambiguous Possible locations resulting from a geocoder search to display to the user
-
<abstract> featureAsLocation(feature, options)
-
Parameters:
Name Type Description feature
Object The feature object
options
module:nyc/Search~Search.FeatureSearchOptions Describes how to convert feature
Returns:
The location
-
find(selector)
-
A method to return elements in the container
Parameters:
Name Type Description selector
string jQuery selector
- Inherited From:
- Overrides:
- Source:
Returns:
The element
- Type
- jQuery
-
getContainer()
-
A method to return a control container HTML element wrapped in a JQuery
- Inherited From:
- Overrides:
- Source:
Returns:
The the control container HTML element wrapped in a JQuery
- Type
- jQuery
-
off(eventName, evtHdlr [, hdlrScope])
-
Remove a previously connected event handler
Parameters:
Name Type Argument Description eventName
string The name of the event to which the handler will be connected
evtHdlr
function The event handler function
hdlrScope
Object <optional>
The scope in which to invoke the event handler
- Inherited From:
- Overrides:
- Source:
-
on(eventName, evtHdlr [, hdlrScope])
-
Connect a function to an event
Parameters:
Name Type Argument Description eventName
string The name of the event to which the handler will be connected
evtHdlr
function The event handler function
hdlrScope
Object <optional>
The scope in which to invoke the event handler
- Inherited From:
- Overrides:
- Source:
-
one(eventName, evtHdlr [, hdlrScope])
-
Connect a function to an event for a single invocation
Parameters:
Name Type Argument Description eventName
string The name of the event to which the handler will be connected
evtHdlr
function The event handler function
hdlrScope
Object <optional>
The scope in which to invoke the event handler
- Inherited From:
- Overrides:
- Source:
-
prepend(elements)
-
A method to prepend elements to the container
Parameters:
Name Type Description elements
jQuery | Element | Array.<Element> | string The element to append
- Inherited From:
- Overrides:
- Source:
Returns:
The container
- Type
- jQuery
-
removeFeatures(featureTypeName)
-
Remove searchable features
Parameters:
Name Type Description featureTypeName
string The featureTypeName used when the features were set
-
setFeatures(options)
-
Add searchable features
Parameters:
Name Type Description options
module:nyc/Search~Search.FeatureSearchOptions The options for creating a feature search
-
trigger(eventName [, data])
-
Trigger a named event with event data
Parameters:
Name Type Argument Description eventName
string The name of the event to trigger
data
Object <optional>
The event data
- Inherited From:
- Overrides:
- Source:
-
val( [val])
-
Set or get the value of the search field
Parameters:
Name Type Argument Description val
string <optional>
The value for the search field
Returns:
The value of the search field
- Type
- string
Type Definitions
-
FeatureSearchOptions
-
Object type to hold data about how to search features
Type:
- Object
- Source:
Properties:
Name Type Argument Default Description features
Array.<(Object|ol.Feature)> The features to be searched
layerName
string The name of the layer or feature type the features are from
nameField
string <optional>
"name" The name attribute field of the feature
displayField
string <optional>
The name attribute field of the feature
placeholder
string <optional>
A placeholder for the search field