Class: SearchView

SearchView()

SearchView allows a user to search for a latitude and longitude in the map view, and find suggestions for places related to their search terms. This view requires a Google Maps API key in order to function properly, and must have the Geocoding API and Places API enabled.

Screenshot

Constructor

new SearchView()

Since:
  • 2.29.0
Source:

Extends

  • Backbone.View

Members

className

Source:

templateVars

Values meant to be used by the rendered HTML template.
Source:

type :string

The type of View this is
Type:
  • string
Source:

Methods

focusInput()

Helper function to focus input on the search query input and ensure that the cursor is at the end of the text (as opposed to the beginning which appears to be the default jQuery behavior).
Source:

getList() → {HTMLUListElement}

Getter function for the list of predictions.
Source:
Returns:
Returns the predictions unordered list HTML element.
Type
HTMLUListElement

getSearchInput() → {HTMLInputElement}

Getter function for the search query input.
Source:
Returns:
Returns the search input HTML element.
Type
HTMLInputElement

hidePredictionsList(event)

Hide the predictions list unless user is selecting a list item.
Parameters:
Name Type Description
event FocusEvent Mouse event corresponding to a change in focus.
Source:

keydown()

Event handler to prevent cursor from jumping to beginning of an input field (default behavior).
Source:

keyup()

Event handler for Backbone.View configuration that is called whenever the user types a key.
Source:

render()

Render the view by updating the HTML of the element. The new HTML is computed from an HTML template that is passed an object with relevant view state.
Source:

renderPredictionsList()

Render the Prediction sub-views.
Source:

renderSearchInput()

Render the SearchInputView.
Source:
Trigger the search on the ViewfinderModel.
Source:

setQuery()

Helper function to set the input field.
Source:

setupListeners()

Setup all event listeners on ViewfinderModel.
Source:

showPredictionsList()

Show the predictions list and potentially submit a search for new Predictions to display when there is a search query.
Source: