layout: default title: PopupWidget parent: Core Classes —
dymaptic.GeoBlazor.Core
dymaptic.GeoBlazor.Core.Components.Widgets
PopupWidget Class
The Popup widget allows users to view content from feature attributes. Popups enhance web applications by providing
users with a simple way to interact with and view attributes in a layer. They play an important role in relaying
information to the user, which improves the storytelling capabilities of the application.
ArcGIS Maps SDK for JavaScript
public class PopupWidget : dymaptic.GeoBlazor.Core.Components.Widgets.Widget
Inheritance System.Object 🡒 Microsoft.AspNetCore.Components.ComponentBase 🡒 MapComponent 🡒 Widget 🡒 PopupWidget
Remarks
All Views contain a default popup. This popup can display generic content, which is set in its title and content
properties. When content is set directly on the Popup instance it is not tied to a specific feature or layer.
In most cases this module will not need to be loaded into your application because the view contains a default
instance of popup.
Properties
PopupWidget.Actions Property
Defines actions that may be executed by clicking the icon or image symbolizing them in the popup. By default, every
popup has a zoom-to action styled with a magnifying glass icon. When this icon is clicked, the view zooms in four
LODs and centers on the selected feature.
public System.Collections.Generic.List<dymaptic.GeoBlazor.Core.Components.ActionBase>? Actions { get; set; }
Property Value
System.Collections.Generic.List<ActionBase>
PopupWidget.Alignment Property
Position of the popup in relation to the selected feature. The default behavior is to display above the feature and
adjust if not enough room. If needing to explicitly control where the popup displays in relation to the feature,
choose an option besides auto.
public System.Nullable<dymaptic.GeoBlazor.Core.Components.Widgets.PopupAlignment> Alignment { get; set; }
Property Value
System.Nullable<PopupAlignment>
PopupWidget.AutoCloseEnabled Property
This closes the popup when the View camera or Viewpoint changes.
public System.Nullable<bool> AutoCloseEnabled { get; set; }
Property Value
System.Nullable<System.Boolean>
PopupWidget.AutoOpenEnabled Property
This property indicates to the Popup that it needs to allow or disallow the click event propagation. Use
view.popup.autoOpenEnabled = false; when needing to stop the click event propagation.
DefaultValue: true
public System.Nullable<bool> AutoOpenEnabled { get; set; }
Property Value
System.Nullable<System.Boolean>
PopupWidget.Collapsed Property
Indicates whether the popup displays its content. If true, only the header displays.
public System.Nullable<bool> Collapsed { get; set; }
Property Value
System.Nullable<System.Boolean>
PopupWidget.CollapseEnabled Property
Indicates whether to enable collapse functionality for the popup.
DefaultValue: true
public System.Nullable<bool> CollapseEnabled { get; set; }
Property Value
System.Nullable<System.Boolean>
PopupWidget.DefaultPopupTemplateEnabled Property
Enables automatic creation of a popup template for layers that have popups enabled but no popupTemplate defined.
Automatic popup templates are supported for layers that support the createPopupTemplate method. (Supported for
FeatureLayer, GeoJSONLayer, OGCFeatureLayer, SceneLayer, CSVLayer, PointCloudLayer, StreamLayer, and ImageryLayer).
public System.Nullable<bool> DefaultPopupTemplateEnabled { get; set; }
Property Value
System.Nullable<System.Boolean>
PopupWidget.DockEnabled Property
Indicates whether the placement of the popup is docked to the side of the view.
Docking the popup allows for a better user experience, particularly when opening popups in apps on mobile devices.
When a popup is “dockEnabled” it means the popup no longer points to the selected feature or the location assigned
to it. Rather it is attached to a side, the top, or the bottom of the view.
See DockOptions to override default options related to docking the popup.
public System.Nullable<bool> DockEnabled { get; set; }
Property Value
System.Nullable<System.Boolean>
PopupWidget.DockOptions Property
Docking the popup allows for a better user experience, particularly when opening popups in apps on mobile devices.
When a popup is “dockEnabled” it means the popup no longer points to the selected feature or the location assigned
to it. Rather it is placed in one of the corners of the view or to the top or bottom of it. This property allows
the developer to set various options for docking the popup.
public dymaptic.GeoBlazor.Core.Components.Widgets.PopupDockOptions? DockOptions { get; set; }
Property Value
PopupWidget.Features Property
An array of features associated with the popup. Each graphic in this array must have a valid PopupTemplate set.
They may share the same PopupTemplate or have unique PopupTemplates depending on their attributes. The content and
title of the popup is set based on the content and title properties of each graphic’s respective PopupTemplate.
When more than one graphic exists in this array, the current content of the Popup is set based on the value of the
selected feature.
This value is null if no features are associated with the popup.
public System.Collections.Generic.List<dymaptic.GeoBlazor.Core.Components.Layers.Graphic> Features { get; set; }
Property Value
System.Collections.Generic.List<Graphic>
PopupWidget.HeadingLevel Property
Indicates the heading level to use for the title of the popup. By default, the title is rendered as a level 2
heading (e.g. <h2>Popup title</h2>). Depending on the widget’s placement in your app, you may need to adjust this
heading for proper semantics. This is important for meeting accessibility standards.
DefaultValue:2
public System.Nullable<int> HeadingLevel { get; set; }
Property Value
PopupWidget.HighlightEnabled Property
Highlight the selected popup feature using the highlightOptions set on the MapView or the highlightOptions set on
the SceneView.
public System.Nullable<bool> HighlightEnabled { get; set; }
Property Value
System.Nullable<System.Boolean>
PopupWidget.Label Property
The widget’s default label.
public string? Label { get; set; }
Property Value
PopupWidget.Location Property
Point used to position the popup. This is automatically set when viewing the popup by selecting a feature. If using
the Popup to display content not related to features in the map, such as the results from a task, then you must set
this property before making the popup visible to the user.
public dymaptic.GeoBlazor.Core.Components.Geometries.Point? Location { get; set; }
Property Value
PopupWidget.MaxInlineActions Property
Defines the maximum icons displayed at one time in the action area.
DefaultValue: 3
public System.Nullable<int> MaxInlineActions { get; set; }
Property Value
PopupWidget.SpinnerEnabled Property
Indicates whether to display a spinner at the popup location prior to its display when it has pending promises.
public System.Nullable<bool> SpinnerEnabled { get; set; }
Property Value
System.Nullable<System.Boolean>
PopupWidget.StringContent Property
The html string content of the popup. When set directly on the Popup, this content is static and cannot use fields
to set content templates. To set a template for the content based on field or attribute names, see
Content.
public string? StringContent { get; set; }
Property Value
PopupWidget.Title Property
The title of the popup. This can be set generically on the popup no matter the features that are selected. If the
selected feature has a PopupTemplate, then the title set in the corresponding template is used here.
public string? Title { get; set; }
Property Value
PopupWidget.VisibleElements Property
The visible elements that are displayed within the widget. This property provides the ability to turn individual
elements of the widget’s display on/off.
public dymaptic.GeoBlazor.Core.Components.Widgets.PopupVisibleElements? VisibleElements { get; set; }
Property Value
PopupWidget.WidgetContent Property
The widget content of the popup. When set directly on the Popup, this content is static and cannot use fields to
set content templates. To set a template for the content based on field or attribute names, see
Content.
public dymaptic.GeoBlazor.Core.Components.Widgets.Widget? WidgetContent { get; set; }
Property Value
PopupWidget.WidgetType Property
The type of widget
public override string WidgetType { get; }
Property Value
Methods
PopupWidget.Clear() Method
Removes promises, features, content, title and location from the Popup.
public System.Threading.Tasks.Task Clear();
Returns
PopupWidget.Close() Method
Closes the popup by setting its visible property to false. Users can alternatively close the popup by directly
setting the visible property to false.
public System.Threading.Tasks.Task Close();
Returns
PopupWidget.FetchFeatures() Method
Use this method to return feature(s) at a given screen location. These features are fetched from all of the
LayerViews in the view. In order to use this, a layer must already have an associated PopupTemplate and have its
popupEnabled. These features can then be used within a custom Popup or Feature widget experience.
public System.Threading.Tasks.Task<dymaptic.GeoBlazor.Core.Components.Layers.Graphic[]> FetchFeatures();
Returns
System.Threading.Tasks.Task<Graphic[]>
PopupWidget.GetFeatureCount() Method
The number of selected features available to the popup.
public System.Threading.Tasks.Task<int> GetFeatureCount();
Returns
System.Threading.Tasks.Task<System.Int32>
PopupWidget.GetSelectedFeature() Method
The selected feature accessed by the popup. The content of the Popup is determined based on the PopupTemplate
assigned to this feature.
public System.Threading.Tasks.Task<dymaptic.GeoBlazor.Core.Components.Layers.Graphic?> GetSelectedFeature();
Returns
System.Threading.Tasks.Task<Graphic>
PopupWidget.GetSelectedFeatureIndex() Method
Index of the feature that is selected. When features are set, the first index is automatically selected.
public System.Threading.Tasks.Task<int> GetSelectedFeatureIndex();
Returns
System.Threading.Tasks.Task<System.Int32>
PopupWidget.GetVisibility() Method
Index of the feature that is selected. When features are set, the first index is automatically selected.
public System.Threading.Tasks.Task<bool> GetVisibility();
Returns
System.Threading.Tasks.Task<System.Boolean>
PopupWidget.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
PopupWidget.Open() Method
Opens the popup at the given location with content defined either explicitly with content or driven from the
PopupTemplate of input features. This method sets the popup’s visible property to true. Users can alternatively
open the popup by directly setting the visible property to true.
public System.Threading.Tasks.Task Open();
Returns
PopupWidget.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.
PopupWidget.SetContent(string) Method
Sets the string content of the popup.
public System.Threading.Tasks.Task SetContent(string stringContent);
Parameters
stringContent
System.String
Returns
PopupWidget.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.