GeoElement
. This class defines how the geoelement will be displayed
and behave in a pop-up. Pop-up definitions contain information such as:
- Which attributes of the geoelement should the pop-up display, whether it is editable, how to format numbers and dates, etc.
- Whether the pop-up should show attachments for the geoelement.
- What media, such as charts and images, should be displayed for the geoelement.
- Since:
- 100.0.0
- See Also:
-
Constructor Summary
ConstructorDescriptionCreates a new, empty pop-up definition.PopupDefinition
(GeoElement geoElement) Creates a new popup definition from aGeoElement
.PopupDefinition
(PopupSource popupSource) Creates a new popup definition from a popup source. -
Method Summary
Modifier and TypeMethodDescriptionGets a string that appears in the body of the pop-up as a description.Gets a mutable list ofPopupElement
that represent an ordered list of pop-up elements.Gets a list of PopupExpression objects defining the various Arcade expressions on the pop-up.Gets a list ofPopupField
objects defining how each field participates in the pop-up window.getMedia()
Gets a list of PopupMedia objects that define images and charts displayed in the pop-up.Gets the related features definition for this pop-up definition.getTitle()
Gets a string that appears at the top of the pop-up as a title.boolean
Checks if the pop-up allows the geoelement to be deleted.boolean
Checks if the pop-up allows the associatedGeoElement
's attributes to be edited.boolean
Checks if the pop-up allows the associated geoelement's geometry to be edited.boolean
Checks if attachments should be loaded for feature layers that have attachments.boolean
Checks if the pop-up should display the edit summary of the associated geoelement.void
setAllowDelete
(boolean allowDelete) Sets whether or not the pop-up allows the geoelement to be deleted.void
setAllowEdit
(boolean allowEdit) Sets whether or not the pop-up allows the associated geoelement's attributes to be edited.void
setAllowEditGeometry
(boolean allowEditGeometry) Sets whether or not the pop-up allows the associated geoelement's geometry to be edited.void
setDescription
(String description) Sets a string that appears in the body of the pop-up as a description.void
setRelatedFeaturesDefinition
(PopupRelatedFeaturesDefinition popupRelatedFeaturesDefinition) Sets the related features definition for this pop-up definition.void
setShowAttachments
(boolean showAttachments) Sets whether or not attachments should be loaded for feature layers that have attachments.void
setShowEditSummary
(boolean showEditSummary) Sets whether the pop-up should display the edit summary of the associated geoelement.void
Sets a string that appears at the top of the pop-up as a title.
-
Constructor Details
-
PopupDefinition
public PopupDefinition()Creates a new, empty pop-up definition. Use this object to define the look and feel of pop-up windows when users click or query a feature.- Since:
- 100.0.0
-
PopupDefinition
Creates a new popup definition from aGeoElement
.This creates a new popup definition with default properties and default popup elements based on the geoelement fields. Use this object to define the look and feel of pop-up windows when users click or query a feature.
- Parameters:
geoElement
- the geoelement for the popup, such as aFeature
orGraphic
- Throws:
IllegalArgumentException
- if the geoElement is null- Since:
- 100.0.0
- See Also:
-
PopupDefinition
Creates a new popup definition from a popup source.This creates a new popup definition with default properties and default popup elements based on the popup source fields. Use this object to define the look and feel of pop-up windows when users click or query a feature.
- Parameters:
popupSource
- the PopupSource on which to base the pop-up- Throws:
IllegalArgumentException
- if popupSource is null- Since:
- 100.0.0
-
-
Method Details
-
getDescription
Gets a string that appears in the body of the pop-up as a description.- Returns:
- the description string
- Since:
- 100.0.0
- See Also:
-
setDescription
Sets a string that appears in the body of the pop-up as a description.The description can contain a literal value, or a placeholder for value from the geoelement's attribute. The placeholder needs to be of the form
{field_name}
where field_name is a key in the geoelement's attributes- Parameters:
description
- the description string- Since:
- 100.0.0
- See Also:
-
getTitle
Gets a string that appears at the top of the pop-up as a title.- Returns:
- the title string
- Since:
- 100.0.0
- See Also:
-
setTitle
Sets a string that appears at the top of the pop-up as a title.The title can contain a literal value, or a placeholder for value from the geo element's attribute. The placeholder needs to be of the form
{field_name}
where field_name is a key in the geoelement's attributes.- Parameters:
title
- the title string- Since:
- 100.0.0
- See Also:
-
isShowAttachments
public boolean isShowAttachments()Checks if attachments should be loaded for feature layers that have attachments.- Returns:
- true if attachments should be shown; otherwise false
- Since:
- 100.0.0
- See Also:
-
setShowAttachments
public void setShowAttachments(boolean showAttachments) Sets whether or not attachments should be loaded for feature layers that have attachments.- Parameters:
showAttachments
- a boolean indicating whether attachments should be shown- Since:
- 100.0.0
- See Also:
-
isShowEditSummary
public boolean isShowEditSummary()Checks if the pop-up should display the edit summary of the associated geoelement.- Returns:
- true if edit summary will be displayed
- Since:
- 100.6.0
- See Also:
-
setShowEditSummary
public void setShowEditSummary(boolean showEditSummary) Sets whether the pop-up should display the edit summary of the associated geoelement.- Parameters:
showEditSummary
- true if edit summary should be displayed; false otherwise- Since:
- 100.6.0
- See Also:
-
getFields
Gets a list ofPopupField
objects defining how each field participates in the pop-up window.The order of the list is the order that fields are shown in the pop-up window.
- Returns:
- a list of PopupField objects
- Since:
- 100.0.0
-
getMedia
Gets a list of PopupMedia objects that define images and charts displayed in the pop-up.The order of the list is the order that media are shown in the pop-up window.
- Returns:
- a list of PopupMedia objects
- Since:
- 100.0.0
-
getExpressions
Gets a list of PopupExpression objects defining the various Arcade expressions on the pop-up.- Returns:
- a list of PopupExpression objects
- Since:
- 100.3.0
-
isAllowEdit
public boolean isAllowEdit()Checks if the pop-up allows the associatedGeoElement
's attributes to be edited.- Returns:
- true if editing the geoelement's attributes is allowed
- Since:
- 100.0.0
- See Also:
-
setAllowEdit
public void setAllowEdit(boolean allowEdit) Sets whether or not the pop-up allows the associated geoelement's attributes to be edited.- Parameters:
allowEdit
- true to allow editing the geoelement's attributes- Since:
- 100.0.0
- See Also:
-
isAllowEditGeometry
public boolean isAllowEditGeometry()Checks if the pop-up allows the associated geoelement's geometry to be edited.- Returns:
- true if editing the geoelement's geometry is allowed
- Since:
- 100.0.0
- See Also:
-
setAllowEditGeometry
public void setAllowEditGeometry(boolean allowEditGeometry) Sets whether or not the pop-up allows the associated geoelement's geometry to be edited.- Parameters:
allowEditGeometry
- true to allow editing the geoelement's geometry- Since:
- 100.0.0
- See Also:
-
isAllowDelete
public boolean isAllowDelete()Checks if the pop-up allows the geoelement to be deleted.- Returns:
- true if deleting the geoelement is allowed
- Since:
- 100.0.0
- See Also:
-
setAllowDelete
public void setAllowDelete(boolean allowDelete) Sets whether or not the pop-up allows the geoelement to be deleted.- Parameters:
allowDelete
- true to allow deleting the geoelement- Since:
- 100.0.0
- See Also:
-
getRelatedFeaturesDefinition
Gets the related features definition for this pop-up definition.- Returns:
- the pop-up related features definition
- Since:
- 100.1.0
- See Also:
-
setRelatedFeaturesDefinition
public void setRelatedFeaturesDefinition(PopupRelatedFeaturesDefinition popupRelatedFeaturesDefinition) Sets the related features definition for this pop-up definition.A definition that dictates whether related features should be displayed in the pop-up and how they should be sorted.
- Parameters:
popupRelatedFeaturesDefinition
- the pop-up related features definition to set, can be null- Since:
- 100.1.0
- See Also:
-
getElements
Gets a mutable list ofPopupElement
that represent an ordered list of pop-up elements.The order of the
List
is the order that elements are shown in the pop-up window.For backward compatibility with a webmap or webscene created by clients that don't support the popup elements, a few popup elements are created to match the legacy popup style when reading a popup definition without popup elements:
- a
TextPopupElement
ifPopupDefinition.getDescription()
is not empty - a
FieldsPopupElement
ifPopupDefinition.getDescription()
is empty - a
MediaPopupElement
ifPopupDefinition.getMedia()
is not empty - an
AttachmentsPopupElement
ifPopupDefinition.isShowAttachments()
is true
- Returns:
- a mutable list of
PopupElement
that represent an ordered list of pop-up elements - Since:
- 100.14.0
- a
-