<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Custom Popup in Swift Maps SDK Questions</title>
    <link>https://community.esri.com/t5/swift-maps-sdk-questions/custom-popup/m-p/1252183#M25</link>
    <description>&lt;P&gt;Ok, I'm getting somewhere now. &amp;nbsp;However, there is still the 'Fields' Disclosure group. &amp;nbsp;If I could just get the 'Fields' group to collapse I would be set. &amp;nbsp;I set the isExpanded state variable to false but it is still expanded.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Thu, 26 Jan 2023 23:22:17 GMT</pubDate>
    <dc:creator>DuanePfeiffer</dc:creator>
    <dc:date>2023-01-26T23:22:17Z</dc:date>
    <item>
      <title>Custom Popup</title>
      <link>https://community.esri.com/t5/swift-maps-sdk-questions/custom-popup/m-p/1252137#M19</link>
      <description>&lt;P&gt;Trying to figure out how to create a custom popup when user taps on a feature in the map. &amp;nbsp;In my v 100.x code, I created a PopupDefinition object and set its title and customDescription (html). &amp;nbsp;V200.x has no customDescription. &amp;nbsp;It appears that I could build a list of fields?, but it is read-only. &amp;nbsp;Some guidance would go a long way here please.&lt;/P&gt;&lt;P&gt;EDIT: To clarify, I want to limit the fields that are shown in the popup as well as add text that is not in the field data.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2023 22:30:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/swift-maps-sdk-questions/custom-popup/m-p/1252137#M19</guid>
      <dc:creator>DuanePfeiffer</dc:creator>
      <dc:date>2023-01-26T22:30:52Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Popup</title>
      <link>https://community.esri.com/t5/swift-maps-sdk-questions/custom-popup/m-p/1252165#M21</link>
      <description>&lt;P&gt;Thank you for your question! &amp;nbsp;The easiest way to display popups is to define them in your web map and consume them in your application. &amp;nbsp;The Swift Toolkit has a `PopupView` which does exactly that. &amp;nbsp;You can find it &lt;A href="https://github.com/Esri/arcgis-maps-sdk-swift-toolkit/tree/main/Documentation/Popup" target="_self"&gt;here&lt;/A&gt;. It uses the array of `PopupElement`s defined in the `PopupDefinition` (loaded from the web map) to display the feature information. &amp;nbsp;There is a popup example in the Toolkit's Example app that shows how it's used.&lt;/P&gt;&lt;P&gt;If you are not using a web map, you will need to create the `PopupElements` you need and add them to the `PopupDefinition`'s `element` &lt;A href="https://developers.arcgis.com/swift/api-reference/documentation/arcgis/popupdefinition/elements" target="_self"&gt;property&lt;/A&gt;. &amp;nbsp;The following are the possible element types:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;TextPopupElement - displays text (including HTML strings)&lt;/LI&gt;&lt;LI&gt;FieldsPopupElement - displays a list of field data&lt;/LI&gt;&lt;LI&gt;AttachmentsPopupElement - displays feature attachments&lt;/LI&gt;&lt;LI&gt;MediaPopupElememt - displays images and charts&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;There is one additional type, `ArcadePopupElement`, that is not displayed, but when evaluated creates one or more elements of the other types.&lt;/P&gt;&lt;P&gt;The `TextPopupElement` will take an HTML (or regular) string, and display it in the same way the the v100.x `customDescription` did.&lt;/P&gt;&lt;P&gt;Once you have the elements defined in the popup definition you can create a popup and use that with the Popup Toolkit component. You can also use the Popup view Toolkit code as a guide if you want to build your own popup view.&lt;/P&gt;&lt;P&gt;Feel free to reach out if you need more information.&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2023 22:44:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/swift-maps-sdk-questions/custom-popup/m-p/1252165#M21</guid>
      <dc:creator>MarkDostal</dc:creator>
      <dc:date>2023-01-26T22:44:39Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Popup</title>
      <link>https://community.esri.com/t5/swift-maps-sdk-questions/custom-popup/m-p/1252175#M24</link>
      <description>&lt;P&gt;|&amp;nbsp;EDIT: To clarify, I want to limit the fields that are shown in the popup as well as add text that is not in the field data.&lt;/P&gt;&lt;P&gt;You can use the `FieldsPopupElement` to display your list of fields. &amp;nbsp;It has one initializer, _public convenience init(fields: [PopupField] = [])_ that takes the list of fields to display.&lt;/P&gt;&lt;P&gt;You would create the fields popup element (and a TextPopupElement if desired) and add them to the PopupDefinition.&lt;/P&gt;&lt;P&gt;One important thing to note if you are writing your own popup view: you *must* call `Popup.evaluateExpressions` prior to displaying the popup. &amp;nbsp;This call does all the variable substitutions needed along with evaluating all Arcade expressions. &amp;nbsp;The `Popup.evaluatedElements` property will contain the list of elements for display.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2023 23:08:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/swift-maps-sdk-questions/custom-popup/m-p/1252175#M24</guid>
      <dc:creator>MarkDostal</dc:creator>
      <dc:date>2023-01-26T23:08:09Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Popup</title>
      <link>https://community.esri.com/t5/swift-maps-sdk-questions/custom-popup/m-p/1252183#M25</link>
      <description>&lt;P&gt;Ok, I'm getting somewhere now. &amp;nbsp;However, there is still the 'Fields' Disclosure group. &amp;nbsp;If I could just get the 'Fields' group to collapse I would be set. &amp;nbsp;I set the isExpanded state variable to false but it is still expanded.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2023 23:22:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/swift-maps-sdk-questions/custom-popup/m-p/1252183#M25</guid>
      <dc:creator>DuanePfeiffer</dc:creator>
      <dc:date>2023-01-26T23:22:17Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Popup</title>
      <link>https://community.esri.com/t5/swift-maps-sdk-questions/custom-popup/m-p/1252428#M28</link>
      <description>&lt;P&gt;When/where are you setting the `isExpanded` variable to false? &amp;nbsp;SwiftUI should take care of that automatically when you click on the default chevron in the Disclosure Group header. &amp;nbsp;Here's the code from the Toolkit for the FieldsPopupElement.&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/arcgis-maps-sdk-swift-toolkit/blob/fb8b3e439537fe7bf38e4325e4ac781f9f61ea0a/Sources/ArcGISToolkit/Components/Popups/FieldsPopupElementView.swift#L34" target="_blank"&gt;https://github.com/Esri/arcgis-maps-sdk-swift-toolkit/blob/fb8b3e439537fe7bf38e4325e4ac781f9f61ea0a/Sources/ArcGISToolkit/Components/Popups/FieldsPopupElementView.swift#L34&lt;/A&gt;&lt;/P&gt;&lt;P&gt;If you still can't get it to work, sending a code snippet would be helpful in trying to debug it with you.&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2023 17:13:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/swift-maps-sdk-questions/custom-popup/m-p/1252428#M28</guid>
      <dc:creator>MarkDostal</dc:creator>
      <dc:date>2023-01-27T17:13:56Z</dc:date>
    </item>
  </channel>
</rss>

