Constructor
new FeatureInfoView()
- Since:
- Source:
Extends
Members
className :string
The HTML classes to use for this view's element
Type:
- Source:
classes :object
Classes that are used to identify the HTML elements that comprise this view.
Type:
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:
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:
- Source:
isOpen :boolean
Whether or not the layer details view is open
Type:
- Source:
The model that this view uses
Type:
- Source:
template :Underscore.template
The primary HTML template for this view
Type:
- Source:
type :string
The type of View this is
Type:
- 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()
- Source:
getContent() → {Promise}
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:
- Source:
Returns:
Returns a promise that resolves to the content HTML
when ready, otherwise null
-
Type
-
Promise
getFeatureTitle() → {string}
Create a title for the feature info box
- Since:
- 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:
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()
Update the height of the iFrame to match the height of the content
within it.
- Since:
- 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: