Class: FeatureInfoView

FeatureInfoView()

An info-box / panel that shows more details about a specific geo-spatial feature that is highlighted or in focus in a Map View, as specified by a given Feature model. The format and content of the info-box varies based on which template is configured in the parent MapAsset model, but at a minimum a link is included that opens the associated LayerInfoView. Unless otherwise configured, the title of the panel will use the value of the feature's 'name', 'title', 'id', 'identifier', or 'assetId' property, if it has one (case insensitive).

Screenshot

Constructor

new FeatureInfoView()

Since:
  • 2.18.0
Source:

Extends

  • Backbone.View

Members

className :string

The HTML classes to use for this view's element
Type:
  • string
Source:

classes :Object

Classes that are used to identify the HTML elements that comprise this view.
Type:
  • Object
Properties:
Name Type Description
open string The class to add to the outermost HTML element for this view when the layer details view is open/expanded (not hidden)
toggle string The element in the template that acts as a toggle to close/hide the info view
layerDetailsButton string The layer details button is added to the view when the selected feature is associated with a layer (a MapAsset like a 3D tileset). When clicked, it opens the LayerDetailsView for that layer.
contentContainer string The iframe that holds the content rendered by the FeatureInfoView#ContentTemplate
title string The label/title at the very top of the Feature panel, next to the close button.
Source:

contentTemplates :Array.<ContentTemplate>

The list of available templates that format information about the Feature. The last template in the list is the default template. It will be used when a matching template is not found or one is not specified.
Type:
Since:
  • 2.19.0
Source:

isOpen :Boolean

Whether or not the layer details view is open
Type:
  • Boolean
Source:

model :Feature

The model that this view uses
Type:
Source:

template :Underscore.template

The primary HTML template for this view
Type:
  • Underscore.template
Source:

type :string

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

Methods

changeModel(newModel)

Stops listening to the previously set model, replaces it with a new Feature model, re-sets the listeners and re-renders the content in this view based on the new model.
Parameters:
Name Type Description
newModel Feature The new Feature model to display content for
Source:

close()

Hide the feature info box from view
Source:

events() → {Object}

Creates an object that gives the events this view will listen to and the associated function to call. Each entry in the object has the format 'event selector': 'function'.
Source:
Returns:
Type
Object

getContent() → {Promise|null}

Get the inner HTML content to insert into the iFrame. The content will vary based on the feature and if there is a template set on the parent Map Asset model.
Since:
  • 2.19.0
Source:
Returns:
Returns a promise that resolves to the content HTML when ready, otherwise null
Type
Promise | null

getFeatureTitle() → {string}

Create a title for the feature info box
Since:
  • 2.19.0
Source:
Returns:
The title for the feature info box
Type
string

initialize(optionsopt)

Executed when a new FeatureInfoView is created
Parameters:
Name Type Attributes Description
options Object <optional>
A literal object with options to pass to the view
Source:

open()

Shows the feature info box
Source:

render() → {FeatureInfoView}

Renders this view
Source:
Returns:
Returns the rendered view element
Type
FeatureInfoView

showLayerDetails()

Show details about the layer that contains this feature. The function does this by setting the associated layer model's 'selected' attribute to true. The parent Map view has a listener set to show the Layer Details view when this attribute is changed.
Source:

update()

Update the content that's displayed in a feature info box, based on the information in the Feature model. Open the panel if there is a Feature model, or close it if there is no model or the model has only default values.
Source:

updateContent()

Updates the view with information from the current Feature model
Source:

updateIFrameHeight(heightopt, limitopt)

Update the height of the iFrame to match the height of the content within it.
Parameters:
Name Type Attributes Default Description
height number <optional>
The height to set the iFrame to. If no height is provided, then the height of the content within the iFrame will be used.
limit boolean <optional>
true Whether or not to limit the height of the iFrame to the height of the window, minus 275px.
Since:
  • 2.27.0
Source:

zoomToFeature()

Trigger an event from the parent Map model that tells the Map Widget to zoom to the full extent of this feature in the map. Also make sure that the Map Asset layer is visible in the map.
Source: