Constructor
new ViewfinderCardView()
- Since:
- Source:
Extends
Members
className
- Source:
templateVars
Values meant to be used by the rendered HTML template.
- Source:
type :string
The type of View this is
Type:
- Source:
Methods
events()
The events this view will listen to and the associated function to call.
- Source:
Dispatch a primary button click to the registered handler for the
action type. Closes any open visualization overlay first.
Parameters:
| Name |
Type |
Description |
e |
MouseEvent
|
The click event from a `.button-primary` element. |
- Source:
initialize(options)
Initialize the view with the given options.
Parameters:
| Name |
Type |
Description |
options |
object
|
The view options.
Properties
| Name |
Type |
Attributes |
Description |
preset |
ViewfinderCardModel
|
|
The metadata associated
with this viewfinder card. |
selectCallback |
function
|
<optional>
|
Called when "View Layers" is
clicked. Should zoom to the card location and toggle layers. |
ctaCallback |
function
|
<optional>
|
Called with (url) when
"Explore in App" is clicked. Should open the visualization overlay. |
closeVisualizationCallback |
function
|
<optional>
|
Called before
any button action to dismiss any currently open overlay. |
onActivate |
function
|
<optional>
|
Called when this card is
activated, so sibling cards can reset their active state. |
|
- 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:
resetActiveState()
Remove the active state from this card and all its buttons.
- Source:
selectLayers(eopt)
Zoom to the card's location and toggle the relevant layers. Closes
any open visualization overlay first. When the clicked button carries
a `data-button-index` attribute it is a 'map'-type button; the
corresponding action object is forwarded to `selectCallback` so the
model can use its specific coordinates and layerIds.
Parameters:
| Name |
Type |
Attributes |
Description |
e |
MouseEvent
|
<optional>
|
The click event, if triggered from the DOM. |
- Source:
setActive(buttonEl)
Mark this card as active and highlight the specific clicked button.
Parameters:
| Name |
Type |
Description |
buttonEl |
HTMLElement
|
The button element that was activated. |
- Source: