<?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 Cluster Popup with click arrows in ArcGIS API for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/cluster-popup-with-click-arrows/m-p/210134#M4856</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;How do I use esri:WeightedClusterer to cluster graphics and get a popup like the image below (which is from an operational layer in the flex viewer)?&amp;nbsp; In my app, I don't get any popups for the cluster symbols, only for the flares.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]25032[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Aaron&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 05 Jun 2013 18:57:08 GMT</pubDate>
    <dc:creator>AaronPerry</dc:creator>
    <dc:date>2013-06-05T18:57:08Z</dc:date>
    <item>
      <title>Cluster Popup with click arrows</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/cluster-popup-with-click-arrows/m-p/210134#M4856</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;How do I use esri:WeightedClusterer to cluster graphics and get a popup like the image below (which is from an operational layer in the flex viewer)?&amp;nbsp; In my app, I don't get any popups for the cluster symbols, only for the flares.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]25032[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Aaron&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jun 2013 18:57:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/cluster-popup-with-click-arrows/m-p/210134#M4856</guid>
      <dc:creator>AaronPerry</dc:creator>
      <dc:date>2013-06-05T18:57:08Z</dc:date>
    </item>
    <item>
      <title>Re: Cluster Popup with click arrows</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/cluster-popup-with-click-arrows/m-p/210135#M4857</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I used this sample which is buried in What's New for the API making it, in my opinion, hard to find, but Google found it when I asked for "esri:infoWindowRenderer popup":&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="http://resources.arcgis.com/en/help/flex-api/samples/index.html#/Display_popups_programmatically/01nq0000008v000000/" rel="nofollow" target="_blank"&gt;http://resources.arcgis.com/en/help/flex-api/samples/index.html#/Display_popups_programmatically/01nq0000008v000000/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This sample showed me how to build and assign PopUpRenderer as the infoWindowRenderer for my widget's graphics layer.&amp;nbsp; I had been building an infoWindowRenderer for each individual graphic coming back from the query response using a VBox, but that didn't assign a popup to the cluster symbols.&amp;nbsp; By applying it to the layer, it appears to attach to any graphics including the cluster symbols.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;While I was implementing this, I learned to read in specific values from the config file and loop accordingly, so the popup title and fields are now configurable from the widget's config file.&amp;nbsp; This really helped me get a handle on how to use the config file in a loop.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is my init function. You can compare it to the sample above to see how it differs. The main difference is the loop for the PopUpFieldInfo items in the config and getting the title from config instead of explicitly building them in the init.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;nbsp;&amp;nbsp; // this function called when the widget's configuration is loaded &amp;nbsp;&amp;nbsp; private function init():void &amp;nbsp;&amp;nbsp; { &amp;nbsp;&amp;nbsp;&amp;nbsp; // build the layer to hold the graphics &amp;nbsp;&amp;nbsp;&amp;nbsp; graphicsLayer = new GraphicsLayer(); &amp;nbsp;&amp;nbsp;&amp;nbsp; graphicsLayer.visible = false; &amp;nbsp;&amp;nbsp;&amp;nbsp; graphicsLayer.renderer = new SimpleRenderer(mySymbol); &amp;nbsp;&amp;nbsp;&amp;nbsp; graphicsLayer.clusterer = clusterer; &amp;nbsp;&amp;nbsp;&amp;nbsp; map.addLayer(graphicsLayer); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // get pop-up fields from the config file &amp;nbsp;&amp;nbsp;&amp;nbsp; xmlPopupFields = configXML.popup.fields.field; &amp;nbsp;&amp;nbsp;&amp;nbsp; xmlPopupTitle = configXML.popup.title; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // array to hold popup fields for assignment to popUpFieldInfos &amp;nbsp;&amp;nbsp;&amp;nbsp; var popupFields:Array = [];&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // Create the pop-up field infos from each field in the config XML &amp;nbsp;&amp;nbsp;&amp;nbsp; for each (var field:Object in xmlPopupFields) &amp;nbsp;&amp;nbsp;&amp;nbsp; { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var popupFieldInfo:PopUpFieldInfo = new PopUpFieldInfo(); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; popupFieldInfo.fieldName = field.name; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; popupFieldInfo.label = field.alias; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; popupFieldInfo.visible = true; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; popupFields.push(popupFieldInfo); &amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // Create the pop-up info &amp;nbsp;&amp;nbsp;&amp;nbsp; var popUpInfo:PopUpInfo = new PopUpInfo(); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // Tell the pop-up info about the field name template &amp;nbsp;&amp;nbsp;&amp;nbsp; popUpInfo.title = "{" + xmlPopupTitle + "}"; &amp;nbsp;&amp;nbsp;&amp;nbsp; popUpInfo.popUpFieldInfos = popupFields; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // Create the class factory &amp;nbsp;&amp;nbsp;&amp;nbsp; var popUpRenderer:ClassFactory = new ClassFactory(PopUpRenderer); &amp;nbsp;&amp;nbsp;&amp;nbsp; // Set the "popUpInfo" key &amp;nbsp;&amp;nbsp;&amp;nbsp; popUpRenderer.properties = { "popUpInfo": popUpInfo }; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // Set the info window renderer to use the pop-up renderer &amp;nbsp;&amp;nbsp;&amp;nbsp; graphicsLayer.infoWindowRenderer = popUpRenderer; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // get counties starts the init chain of events &amp;nbsp;&amp;nbsp;&amp;nbsp; getCounties(); &amp;nbsp;&amp;nbsp; }&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hopefully this will help somebody else who is trying to do something similar.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Aaron&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Jun 2013 12:08:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/cluster-popup-with-click-arrows/m-p/210135#M4857</guid>
      <dc:creator>AaronPerry</dc:creator>
      <dc:date>2013-06-11T12:08:44Z</dc:date>
    </item>
  </channel>
</rss>

