Class: ViewfinderView

ViewfinderView()

ViewfinderView allows a user to search for a latitude and longitude in the map view, and find suggestions for places related to their search terms.

Screenshot

Constructor

new ViewfinderView()

Since:
  • 2.28.0
Source:

Extends

  • Backbone.View

Members

className :string

The HTML class to use for this view's outermost element.
Type:
  • string
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

applyActiveActionFromUrl()

Apply active action restore state from URL for schema 1.
Since:
  • 2.38.0
Source:

findRenderedAction(actionId) → {object|null}

Find a rendered card view that contains the given action id.
Parameters:
Name Type Description
actionId string The action id to resolve.
Since:
  • 2.38.0
Source:
Returns:
The matching rendered view and action, if found.
Type
object | null

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).
Since:
  • 2.29.0
Source:

getSearch() → {JQuery}

Get the SearchView element.
Source:
Returns:
The SearchView element.
Type
JQuery

getViewfinderCards() → {JQuery}

Get the ViewfinderCardsView element. Renamed from getZoomPresets when zoom presets were deprecated in favor of viewfinder cards in 2.37.0.
Since:
  • 2.29.0
Source:
Returns:
The ViewfinderCardsView element.
Type
JQuery

getViewfinderCardsPanel(category) → {JQuery}

Get the ViewfinderCardsView panel for a given category, if it exists.
Parameters:
Name Type Description
category ViewfinderCardCategory The category of viewfinder cards to get the panel for.
Since:
  • 2.35.0
Source:
Returns:
The ViewfinderCardsView panel element, or an empty jQuery object if it doesn't exist.
Type
JQuery

getViewfinderCardsPlacement(category) → {string|object}

Determine where to place a ViewfinderCardsView for a given category, based on the order of categories in the collection. Renamed from getZoomPresetsPlacement when zoom presets were deprecated in favor of viewfinder cards in 2.37.0.
Parameters:
Name Type Description
category ViewfinderCardCategory The category of viewfinder cards to determine placement for.
Since:
  • 2.35.0
Source:
Returns:
"prepend" to add to the beginning of the list, "append" to add to the end of the list, or { after: JQueryElement } to add after a specific existing element.
Type
string | object

initialize(options)

Initialize the ViewfinderView.
Parameters:
Name Type Description
options object The options for the view.
Properties
Name Type Description
model Map The map model to use for this view.
Source:

openCategoryPanel(categoryCid)

Expand the given category section if it has a panel view.
Parameters:
Name Type Description
categoryCid string The category CID.
Since:
  • 2.38.0
Source:

removeViewfinderCardsCategory(category)

Remove the ViewfinderCardsView panel for a given category, if it exists.
Parameters:
Name Type Description
category ViewfinderCardCategory The category of viewfinder cards to remove the panel for.
Since:
  • 2.35.0
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:

renderSearchView()

Render child SearchView and append to DOM.
Source:

renderViewfinderCardsView(category)

Render child ViewfinderCardsListView and append to DOM. Extended from renderZoomPresetsView when zoom presets were deprecated in favor of generalized viewfinder cards in 2.37.0. Adds piping for visualization panel as well.
Parameters:
Name Type Description
category ViewfinderCardCategory The category of viewfinder cards to render.
Since:
  • 2.29.0
Source:

restoreActiveAction(actionId) → {boolean}

Restore a previously active viewfinder action by id.
Parameters:
Name Type Description
actionId string The action id from URL restore state.
Since:
  • 2.38.0
Source:
Returns:
True if action was restored.
Type
boolean

syncActiveActionToUrl(_card, action)

Sync the active action id to the URL restore state.
Parameters:
Name Type Description
_card ViewfinderCardModel The card model that owns the action.
action object The activated action object.
Since:
  • 2.38.0
Source:

syncVisualizationStateToUrl(payload)

Synchronize incoming iframe URL state to namespaced parent URL params.
Parameters:
Name Type Description
payload object State message forwarded from VisualizationPanelView.
Properties
Name Type Description
action object Active iframe action definition.
url string URL sent by the embedded visualization.
Since:
  • 2.38.0
Source: