Class: ViewfinderModel

ViewfinderModel()

ViewfinderModel maintains state for the ViewfinderView and interfaces with location searching services.

Constructor

new ViewfinderModel()

Since:
  • 2.28.0
Source:

Extends

  • Backbone.Model

Members

defaults :Object

Type:
  • Object
Properties:
Name Type Description
error string is the current error string to be displayed in the UI.
focusIndex number is the index of the element in the list of predictions that shoudl be highlighted as focus.
predictions Array.<Prediction> a list of Predictions models that correspond to the user's search query.
query string the user's search query.
Since:
  • 2.28.0
Source:

Methods

autocompleteSearch(rawQuery)

Get autocompletion predictions from the GeocoderSearch model.
Parameters:
Name Type Description
rawQuery string is the user's search query with spaces.
Source:

decrementFocusIndex()

Decrement the focused index with a minimum value of 0. This corresponds to an ArrowUp key down event. Note: An ArrowUp key press while the current index is -1 will result in highlighting the first element in the list.
Source:

goToLocation(geocoding)

Navigate to the GeocodedLocation.
Parameters:
Name Type Description
geocoding GeocodedLocation is the location that corresponds to the the selected prediction.
Source:

incrementFocusIndex()

Increment the focused index with a maximum value of the last value in the list. This corresponds to an ArrowDown key down event.
Source:

initialize(mapModel)

Parameters:
Name Type Description
mapModel Map is the Map model that the ViewfinderModel is managing for the corresponding ViewfinderView.
Source:

resetFocusIndex()

Reset the focused index back to the initial value so that no element in the UI is highlighted.
Source:
Event handler for Backbone.View configuration that is called whenever the user clicks the search button or hits the Enter key.
Parameters:
Name Type Description
value string is the query string.
Source:

selectPrediction(prediction)

Select a prediction from the list of predictions and navigate there.
Parameters:
Name Type Description
prediction Prediction is the user-selected Prediction that needs to be geocoded and navigated to.
Source:

selectZoomPreset(preset)

Select a ZoomPresetModel from the list of presets and navigate there. This function hides all layers that are not to be visible according to the ZoomPresetModel configuration.
Parameters:
Name Type Description
preset ZoomPresetModel A user selected preset for which to enable layers and navigate.
Source: