<?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: Display Popup for Features within a Polygon in Swift Maps SDK Questions</title>
    <link>https://community.esri.com/t5/swift-maps-sdk-questions/display-popup-for-features-within-a-polygon/m-p/1417610#M261</link>
    <description>&lt;P&gt;Can you clarify more on what you want achieve? By saying&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;SPAN&gt;I have a use case where I want to display a popup for features that are located within a polygon.&lt;/SPAN&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Is the goal to show popups only for features inside a polygon?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Popups can be constructed from a feature and a popup definition, with this initializer &lt;A href="https://developers.arcgis.com/swift/api-reference/documentation/arcgis/popup/init(geoelement:definition:)-4dvrn" target="_self"&gt;&lt;EM&gt;.init(geoElement:definition:)&lt;/EM&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The popup definition can be found on a feature layer, if it is defined when it is created in Pro or Online.&lt;/P&gt;&lt;P&gt;To query the features within a polygon, you can use&amp;nbsp;&lt;A href="https://developers.arcgis.com/swift/api-reference/documentation/arcgis/queryparameters" target="_self"&gt;&lt;EM&gt;QueryParameters&lt;/EM&gt;&lt;/A&gt; with the geometry property.&lt;/P&gt;&lt;P&gt;So (presumably) the workflow can be&lt;/P&gt;&lt;P&gt;- Query all the layers (visible and invisible) to get all features within a polygon&lt;/P&gt;&lt;P&gt;- Get popup definitions from each layer&lt;/P&gt;&lt;P&gt;- Display whichever feature's popups you want&lt;/P&gt;</description>
    <pubDate>Wed, 01 May 2024 15:50:10 GMT</pubDate>
    <dc:creator>Ting</dc:creator>
    <dc:date>2024-05-01T15:50:10Z</dc:date>
    <item>
      <title>Display Popup for Features within a Polygon</title>
      <link>https://community.esri.com/t5/swift-maps-sdk-questions/display-popup-for-features-within-a-polygon/m-p/1417502#M260</link>
      <description>&lt;P&gt;The only way to access the popups for a feature (that I am aware of) is using the identify method, which will only accept a screen point.&amp;nbsp; I have a use case where I want to display a popup for features that are located within a polygon.&amp;nbsp; The only way I can think of doing this is querying each feature layer, then using the centroid of the results to do an identify on the same feature layer.&amp;nbsp; Is there a better way to do this?&lt;/P&gt;&lt;P&gt;Also it appears that identify only works on visible layers.&amp;nbsp; In this case, the layers would not be visible.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 May 2024 14:21:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/swift-maps-sdk-questions/display-popup-for-features-within-a-polygon/m-p/1417502#M260</guid>
      <dc:creator>Justin_Greco</dc:creator>
      <dc:date>2024-05-01T14:21:00Z</dc:date>
    </item>
    <item>
      <title>Re: Display Popup for Features within a Polygon</title>
      <link>https://community.esri.com/t5/swift-maps-sdk-questions/display-popup-for-features-within-a-polygon/m-p/1417610#M261</link>
      <description>&lt;P&gt;Can you clarify more on what you want achieve? By saying&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;SPAN&gt;I have a use case where I want to display a popup for features that are located within a polygon.&lt;/SPAN&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Is the goal to show popups only for features inside a polygon?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Popups can be constructed from a feature and a popup definition, with this initializer &lt;A href="https://developers.arcgis.com/swift/api-reference/documentation/arcgis/popup/init(geoelement:definition:)-4dvrn" target="_self"&gt;&lt;EM&gt;.init(geoElement:definition:)&lt;/EM&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The popup definition can be found on a feature layer, if it is defined when it is created in Pro or Online.&lt;/P&gt;&lt;P&gt;To query the features within a polygon, you can use&amp;nbsp;&lt;A href="https://developers.arcgis.com/swift/api-reference/documentation/arcgis/queryparameters" target="_self"&gt;&lt;EM&gt;QueryParameters&lt;/EM&gt;&lt;/A&gt; with the geometry property.&lt;/P&gt;&lt;P&gt;So (presumably) the workflow can be&lt;/P&gt;&lt;P&gt;- Query all the layers (visible and invisible) to get all features within a polygon&lt;/P&gt;&lt;P&gt;- Get popup definitions from each layer&lt;/P&gt;&lt;P&gt;- Display whichever feature's popups you want&lt;/P&gt;</description>
      <pubDate>Wed, 01 May 2024 15:50:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/swift-maps-sdk-questions/display-popup-for-features-within-a-polygon/m-p/1417610#M261</guid>
      <dc:creator>Ting</dc:creator>
      <dc:date>2024-05-01T15:50:10Z</dc:date>
    </item>
    <item>
      <title>Re: Display Popup for Features within a Polygon</title>
      <link>https://community.esri.com/t5/swift-maps-sdk-questions/display-popup-for-features-within-a-polygon/m-p/1417638#M262</link>
      <description>&lt;P&gt;Thank you, I just need to construct the popup.&lt;/P&gt;</description>
      <pubDate>Wed, 01 May 2024 16:46:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/swift-maps-sdk-questions/display-popup-for-features-within-a-polygon/m-p/1417638#M262</guid>
      <dc:creator>Justin_Greco</dc:creator>
      <dc:date>2024-05-01T16:46:31Z</dc:date>
    </item>
  </channel>
</rss>

