layout: default title: PopupTemplate parent: Core Classes —
dymaptic.GeoBlazor.Core
dymaptic.GeoBlazor.Core.Components.Popups
PopupTemplate Class
A PopupTemplate formats and defines the content of a Popup for a specific Layer or Graphic. The user can also use
the PopupTemplate to access values from feature attributes and values returned from Arcade expressions when a
feature in the view is selected.
ArcGIS Maps SDK for JavaScript
public class PopupTemplate : dymaptic.GeoBlazor.Core.Components.MapComponent
Inheritance System.Object 🡒 Microsoft.AspNetCore.Components.ComponentBase 🡒 MapComponent 🡒 PopupTemplate
Constructors
PopupTemplate() Constructor
Parameterless constructor for using as a razor component
public PopupTemplate();
PopupTemplate(string, string, IEnumerable, IReadOnlyList, IReadOnlyList, IReadOnlyList, Nullable, Nullable, IReadOnlyList) Constructor
Constructs a new PopupTemplate in code with parameters
public PopupTemplate(string? title=null, string? stringContent=null, System.Collections.Generic.IEnumerable<string>? outFields=null, System.Collections.Generic.IReadOnlyList<dymaptic.GeoBlazor.Core.Components.Popups.FieldInfo>? fieldInfos=null, System.Collections.Generic.IReadOnlyList<dymaptic.GeoBlazor.Core.Components.Popups.PopupContent>? contents=null, System.Collections.Generic.IReadOnlyList<dymaptic.GeoBlazor.Core.Components.Popups.ExpressionInfo>? expressionInfos=null, System.Nullable<bool> overwriteActions=null, System.Nullable<bool> returnGeometry=null, System.Collections.Generic.IReadOnlyList<dymaptic.GeoBlazor.Core.Components.ActionBase>? actions=null);
Parameters
title
System.String
The title of the popup
stringContent
System.String
Use this parameter if the content is a simple string
outFields
System.Collections.Generic.IEnumerable<System.String>
An array of field names used in the PopupTemplate.
fieldInfos
System.Collections.Generic.IReadOnlyList<FieldInfo>
An array of FieldInfo that defines how fields in the dataset or values from Arcade expressions participate in a
popup.
contents
System.Collections.Generic.IReadOnlyList<PopupContent>
Pass advanced PopupContent parameters
expressionInfos
System.Collections.Generic.IReadOnlyList<ExpressionInfo>
An array of objects or ExpressionInfo[] that reference Arcade expressions following the specification defined by
the Arcade Popup Profile.
overwriteActions
System.Nullable<System.Boolean>
Indicates whether actions should replace existing popup actions.
returnGeometry
System.Nullable<System.Boolean>
Indicates whether to include the feature’s geometry for use by the template.
actions
System.Collections.Generic.IReadOnlyList<ActionBase>
Defines actions that may be executed by clicking the icon or image symbolizing them in the popup
Properties
PopupTemplate.Actions Property
Defines actions that may be executed by clicking the icon or image symbolizing them in the popup
public System.Collections.Generic.List<dymaptic.GeoBlazor.Core.Components.ActionBase>? Actions { get; set; }
Property Value
System.Collections.Generic.List<ActionBase>
PopupTemplate.Content Property
The template for defining and formatting a popup’s content, provided as a collection of PopupContent
s.
public System.Collections.Generic.List<dymaptic.GeoBlazor.Core.Components.Popups.PopupContent> Content { get; set; }
Property Value
System.Collections.Generic.List<PopupContent>
Remarks
Either Content or StringContent should be defined, but not both.
PopupTemplate.ContentFunction Property
Defines a delegate function which will generate the PopupContents for the template.
public System.Func<dymaptic.GeoBlazor.Core.Components.Layers.Graphic,System.Threading.Tasks.ValueTask<dymaptic.GeoBlazor.Core.Components.Popups.PopupContent[]?>>? ContentFunction { get; set; }
Property Value
System.Func<Graphic,System.Threading.Tasks.ValueTask<PopupContent[]>>
PopupTemplate.DotNetPopupTemplateReference Property
Object reference for callbacks from JavaScript.
public Microsoft.JSInterop.DotNetObjectReference<dymaptic.GeoBlazor.Core.Components.Popups.PopupTemplate> DotNetPopupTemplateReference { get; }
Property Value
Microsoft.JSInterop.DotNetObjectReference<PopupTemplate>
PopupTemplate.ExpressionInfos Property
An array of objects or ExpressionInfo[] that reference Arcade expressions following the specification defined by
the Arcade Popup Profile.
public System.Collections.Generic.List<dymaptic.GeoBlazor.Core.Components.Popups.ExpressionInfo>? ExpressionInfos { get; set; }
Property Value
System.Collections.Generic.List<ExpressionInfo>
PopupTemplate.FieldInfos Property
An array of FieldInfo that defines how fields in the dataset or values from Arcade expressions participate in a
popup. If no FieldInfo are specified, nothing will display since the popup will only display the fields that are
defined by this array. Each FieldInfo contains properties for a single field or expression. This property can be
set directly within the PopupTemplate or within the fields content element. If this is not set within the fields
content element, it will default to whatever is specified directly within the PopupTemplate.fieldInfos. The image
on the left is a result of using the first example snippet below, whereas the image on the right is a result of the
second snippet.
public System.Collections.Generic.List<dymaptic.GeoBlazor.Core.Components.Popups.FieldInfo>? FieldInfos { get; set; }
Property Value
System.Collections.Generic.List<FieldInfo>
Remarks
Use this fieldInfos property to specify any formatting options for numbers displayed in chart or text elements.
PopupTemplate.OutFields Property
An array of field names used in the PopupTemplate. Use this property to indicate what fields are required to fully
render the PopupTemplate. This is important if setting content via a function since any fields needed for
successful rendering should be specified here.
Generally speaking, it is good practice to always set this property when instantiating a new popup template.
To fetch the values from all fields, use [“*”].
public System.Collections.Generic.IEnumerable<string>? OutFields { get; set; }
Property Value
System.Collections.Generic.IEnumerable<System.String>
Remarks
This will not fetch fields from related tables. If related features are needed, set this using FieldInfo.
PopupTemplate.OverwriteActions Property
Indicates whether actions should replace existing popup actions.
public System.Nullable<bool> OverwriteActions { get; set; }
Property Value
System.Nullable<System.Boolean>
PopupTemplate.ReturnGeometry Property
Indicates whether to include the feature’s geometry for use by the template. This property should be set to true if
needing to access the popup’s selected feature’s geometry. Access the geometry via the returned graphic from the
popup’s selectedFeatureWidget. This is needed since the geometry is not automatically queried and returned in the
popup’s selected feature.
If the feature layer does not specify its outFields and the template’s outFields isn’t set, the returned popup’s
geometry is only returned if returnGeometry is set to true. This also applies when working with WebMaps.
public System.Nullable<bool> ReturnGeometry { get; set; }
Property Value
System.Nullable<System.Boolean>
PopupTemplate.StringContent Property
The template for defining and formatting a popup’s content, provided as a simple string.
public string? StringContent { get; set; }
Property Value
Remarks
Either Content or StringContent should be defined, but not both.
PopupTemplate.Title Property
The template for defining how to format the title used in a popup.
public string? Title { get; set; }
Property Value
Methods
PopupTemplate.OnContentFunction(Graphic) Method
JS-invokable method that triggers a custom ContentFunction for building the popup content.
Should not be called by consuming code.
public System.Threading.Tasks.Task<dymaptic.GeoBlazor.Core.Components.Popups.PopupContent[]?> OnContentFunction(dymaptic.GeoBlazor.Core.Components.Layers.Graphic graphic);
Parameters
graphic
Graphic
Returns
System.Threading.Tasks.Task<PopupContent[]>
PopupTemplate.OnTriggerAction(string) Method
JS-invokable method for triggering actions.
public System.Threading.Tasks.Task OnTriggerAction(string actionId);
Parameters
actionId
System.String
The action ID.
Returns
PopupTemplate.RegisterChildComponent(MapComponent) Method
Called from dymaptic.GeoBlazor.Core.Components.MapComponent.OnInitializedAsync to “Register” the current component with it’s parent.
public override System.Threading.Tasks.Task RegisterChildComponent(dymaptic.GeoBlazor.Core.Components.MapComponent child);
Parameters
child
MapComponent
The calling, child component to register
Returns
Exceptions
InvalidChildElementException
Throws if the current child is not a valid sub-component to the parent.
Remarks
This method is an implementation detail and should not be called directly by consumers. In future versions, this may be changed to an internal method. If you see no other way to register a child component, please open an issue on GitHub.
PopupTemplate.UnregisterChildComponent(MapComponent) Method
Undoes the “Registration” of a child with its parent.
public override System.Threading.Tasks.Task UnregisterChildComponent(dymaptic.GeoBlazor.Core.Components.MapComponent child);
Parameters
child
MapComponent
The child to unregister
Returns
Remarks
This method is an implementation detail and should not be called directly by consumers. In future versions, this may be changed to an internal method.