Class: ZoomSearch maps.nyc.gov

nyc.leaf.ZoomSearch

new ZoomSearch(map, useSearchTypeMenuopt)

Class for providing a set of buttons to zoom and search.
Parameters:
Name Type Attributes Default Description
map L.Map The Leaflet map that will be controlled
useSearchTypeMenu boolean <optional>
false Use search types menu
Source:
Fires:

Extends

Methods

container() → {JQuery}

A method to return the map container HTML element wrapped in a JQuery
Overrides:
Source:
Returns:
The the map container HTML element wrapped in a JQuery
Type
JQuery

disambiguate(ambiguous)

Displays possible address matches
Parameters:
Name Type Description
ambiguous nyc.Locate.Ambiguous Possible locations resulting from a geocoder search to display to the user
Inherited From:
Source:

off(eventName, evtHdlr, hdlrScopeopt)

Remove a previously connected event handler
Parameters:
Name Type Attributes 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:
Source:

on(eventName, evtHdlr, hdlrScopeopt)

Connect a function to an event
Parameters:
Name Type Attributes 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:
Source:

one(eventName, evtHdlr, hdlrScopeopt)

Connect a function to an event for a single invocation
Parameters:
Name Type Attributes 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:
Source:

searching(show)

Set searching status to display to the user
Parameters:
Name Type Description
show boolean Show searching status
Inherited From:
Source:

setFeatures(featureTypeName, featureTypeTitle, placeholder, features)

Add searchable features
Parameters:
Name Type Description
featureTypeName string The name of the layer or feature type the features are from
featureTypeTitle string A title for the search type menu
placeholder string A placeholder for the search field
features Array.<Object> The features that to be searched
Inherited From:
Source:

trigger(eventName, dataopt)

Trigger a named event with event data
Parameters:
Name Type Attributes Description
eventName string The name of the event to trigger
data Object <optional>
The event data
Inherited From:
Source:

val(valopt) → {string}

Set or get the value of the search field
Parameters:
Name Type Attributes Description
val string <optional>
The value for the search field
Inherited From:
Source:
Returns:
The value of the search field
Type
string

zoom(event)

Handle the zoom event triggered by user interaction
Parameters:
Name Type Description
event The DOM event triggered by the zoom buttons
Overrides:
Source:

Events

disambiguated

The user has chosen a location from a list of possible locations
Type:
Inherited From:
Source:

geolocate

A geolcation determination is requested
Inherited From:
Source:

search

The value enterd in the search field
Type:
  • string
Inherited From:
Source: