<abstract> new Search(target)
Abstract class for zoom and search controls
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 elementsjQuery | 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 ambiguousmodule:nyc/Locator~Locator.Ambiguous Possible locations resulting from a geocoder search to display to the user
-
<abstract> featureAsLocation(feature, options)
-
Parameters:
Name Type Description featureObject The feature object
optionsmodule: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 selectorstring 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 eventNamestring The name of the event to which the handler will be connected
evtHdlrfunction The event handler function
hdlrScopeObject <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 eventNamestring The name of the event to which the handler will be connected
evtHdlrfunction The event handler function
hdlrScopeObject <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 eventNamestring The name of the event to which the handler will be connected
evtHdlrfunction The event handler function
hdlrScopeObject <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 elementsjQuery | 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 featureTypeNamestring The featureTypeName used when the features were set
-
setFeatures(options)
-
Add searchable features
Parameters:
Name Type Description optionsmodule: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 eventNamestring The name of the event to trigger
dataObject <optional>
The event data
- Inherited From:
- Overrides:
- Source:
-
triggerSearch( [input])
-
Parameters:
Name Type Argument Description inputstring <optional>
The search input
-
val( [val])
-
Set or get the value of the search field
Parameters:
Name Type Argument Description valstring <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 featuresArray.<(Object|ol.Feature)> The features to be searched
layerNamestring The name of the layer or feature type the features are from
nameFieldstring <optional>
"name" The name attribute field of the feature
displayFieldstring <optional>
The name attribute field of the feature
placeholderstring <optional>
A placeholder for the search field