new Search(target)
Create an instance of Search
Parameters:
Name | Type | Description |
---|---|---|
target |
jQuery | Element | string | The target |
- Source:
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
- Inherited From:
- Overrides:
- Source:
-
featureAsLocation(feature, options)
-
Parameters:
Name Type Description feature
ol.Feature The feature object
options
module:nyc/Search~Search.FeatureSearchOptions Describes how to convert feature
- Inherited From:
- Overrides:
- Source:
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
- Inherited From:
- Overrides:
- Source:
-
setFeatures(options)
-
Add searchable features
Parameters:
Name Type Description options
module:nyc/Search~Search.FeatureSearchOptions The options for creating a feature search
- Inherited From:
- Overrides:
- Source:
-
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
- Inherited From:
- Overrides:
- Source:
Returns:
The value of the search field
- Type
- string
Events
-
disambiguated
-
The user has chosen a location from a list of possible locations
Type: module:nyc/Locate~Locate.Result
- Inherited From:
- Overrides:
- Source:
-
search
-
The user has requested a search based on their text input
Type: string
- Inherited From:
- Overrides:
- Source: