ArcGIS Runtime SDK for iOS
100.15
|
A popup which displays a geo-element's information.
Instances of this class represent a popup which associates a geo-element with popup definition for the purpose of displaying in an AGSPopupsViewController
.
Instance Methods | |
(id< AGSCancelable >) | - evaluateExpressionsWithCompletion: |
(NSString *) | - formattedValueForField: |
(instancetype) | - initWithGeoElement: |
(instancetype) | - initWithGeoElement:popupDefinition: |
(nullable NSString *) | - stringForTemplatedString: |
Class Methods | |
(instancetype) | + popupWithGeoElement: |
(instancetype) | + popupWithGeoElement:popupDefinition: |
Properties | |
NSArray< AGSPopupElement * > * | evaluatedElements |
id< AGSGeoElement > | geoElement |
AGSPopupDefinition * | popupDefinition |
AGSSymbol * | symbol |
NSString * | title |
- (id<AGSCancelable>) evaluateExpressionsWithCompletion: | (void(^)(NSArray< AGSPopupExpressionEvaluation * > *__nullable results, NSError *__nullable error)) | completion |
Asynchronously evaluates all expressions available at AGSPopupDefinition::expressions
or at AGSExpressionPopupElement::popupExpression
. The expression can include Arcade FeatureSet functions, which need to be evaluated asynchronously. Also populates the AGSPopup::evaluatedElements
from the AGSPopupDefinition::elements
. During the evaluation, each AGSExpressionPopupElement
is replaced by the AGSPopupElement
returned by the Arcade expression and each placeholder is replaced by its value.
This method must be called before displaying the popup information in a UI so you can use synchronous methods formattedValueForField:
and stringForTemplatedString:
to get the formatted string representation. If there are no AGSPopupDefinition::expressions
and no popup elements of type AGSExpressionPopupElement
then the result array will be empty.
The AGSPopupExpression
may be used in the AGSPopupDefinition::fields
, AGSPopupDefinition.media
, AGSPopupDefinition.title
and AGSPopupDefinition.description
.
completion | Block that is invoked when the operation finishes. The results parameter is populated if the operation completed successfully, otherwise the error parameter is populated. |
- (NSString*) formattedValueForField: | (AGSPopupField *) | popupField |
A string you can use in a display for the popup's field value. The string will have the proper formatting based on the field type and AGSPopupField
configuration. Dates and times are returned in the local timezone. If AGSPopupDefinition::expressions
is not empty then the AGSPopupField
may be using expressions with Arcade FeatureSet functions. Use evaluateExpressionsWithCompletion:
to evaluate the Arcade expressions before trying to get the formatted string representation of the popup field's value, otherwise it may return an empty string.
If the field is part of an AGSCodedValueDomain
, the AGSCodedValue::name
is returned.
popupField | The field for which a properly formatted value is desired. |
- (instancetype) initWithGeoElement: | (id< AGSGeoElement >) | geoElement |
Creates a popup for the provided geo-element. This method creates a default AGSPopupDefinition
with default properties and default popup elements based on the given AGSGeoElement
.
geoElement | The geo-element for the popup, such as an AGSFeature or AGSGraphic . |
- (instancetype) initWithGeoElement: | (id< AGSGeoElement >) | geoElement | |
popupDefinition: | (nullable AGSPopupDefinition *) | popupDefinition | |
Creates a popup for the provided geo-element based on the popup definition.
geoElement | The geo-element for the popup, such as an AGSFeature or AGSGraphic . |
popupDefinition | The popup definition specifying how the geo-element should be represented in the popup. If you pass nil for the popupDefinition a default one will be created for you based on the geo-element's attributes or schema. |
+ (instancetype) popupWithGeoElement: | (id< AGSGeoElement >) | geoElement |
Creates a popup for the provided geo-element. This method creates a default AGSPopupDefinition
with default properties and default popup elements based on the given AGSGeoElement
.
geoElement | The geo-element for the popup, such as an AGSFeature or AGSGraphic . |
+ (instancetype) popupWithGeoElement: | (id< AGSGeoElement >) | geoElement | |
popupDefinition: | (nullable AGSPopupDefinition *) | popupDefinition | |
Creates a popup for the provided geo-element based on the popup definition.
geoElement | The geo-element for the popup, such as an AGSFeature or AGSGraphic . |
popupDefinition | The popup definition specifying how the geo-element should be represented in the popup. If you pass nil for the popupDefinition a default one will be created for you based on the geo-element's attributes or schema. |
- (nullable NSString*) stringForTemplatedString: | (NSString *) | templatedString |
Substitutes attribute templates in a string with actual values. If AGSPopupDefinition::expressions
is not empty then the AGSPopupField
may be using expressions with Arcade FeatureSet functions. Use evaluateExpressionsWithCompletion:
to evaluate the Arcade expressions before trying to get the string for templated string, otherwise it may return an empty string.
templatedString | The templated string. |
|
readnonatomiccopy |
An array of AGSPopupElement
objects evaluated asynchronously by evaluateExpressionsWithCompletion:
.
During the evaluation, each AGSExpressionPopupElement
is replaced by the AGSPopupElement
returned by the Arcade expression and each placeholder is replaced by its value. If the Arcade expression returns a list of attributes to be used by the popup element, these attributes will be used by formattedValueForField:
.
The array is empty while evaluateExpressionsWithCompletion:
has not been executed, and is cleared if evaluateExpressionsWithCompletion:
is executed more than once. After evaluation, the order of the popup elements in the array matches the order elements present in AGSPopupDefinition::elements
and shown in the popup window. If an AGSExpressionPopupElement
fails to be evaluated, then it will be skipped in the array. Use the array of AGSPopupExpressionEvaluation
returned from evaluateExpressionsWithCompletion:
to learn the cause of the error.
|
readnonatomicstrong |
The geo-element which this popup is associated with.
|
readnonatomicstrong |
A popup definition that dictates which information belonging to the geo-element should be displayed in the popup and how it should be formatted.
|
readnonatomicstrong |
The popup symbol.
|
readnonatomiccopy |
The text to display as the popup title.