<?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: Cluster Layer from data and the single Popup?  Solution in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cluster-layer-from-data-and-the-single-popup/m-p/70448#M6246</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;**Edited**..&amp;nbsp; I re-read this and it kind of walked from single popup into an AMD issue.&amp;nbsp; The reason..&amp;nbsp; I could not get my legacy style code to create the popup info correctly but the newer examples all worked (I'm running jsapi 3.6 locally).&amp;nbsp; So.. off I went to figure out why it was different, and realized I had to use the AMD style of js.&amp;nbsp; Or at least that would work.. while my attempt didnt.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I was reading more about AMD and how the newer scripting will be using much more of it, &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/en/javascript/jshelp/inside_dojo_amd.html"&gt;https://developers.arcgis.com/en/javascript/jshelp/inside_dojo_amd.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This Thread:&amp;nbsp; &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/91611-Legacy-code-vs-AMD-code?highlight=AMD"&gt;http://forums.arcgis.com/threads/91611-Legacy-code-vs-AMD-code?highlight=AMD&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;has a few links for you as well.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I also found some tutorials on it, and made a simple page which will allow you to see some of the behaviors of 'publish' and 'subscribe'.&amp;nbsp;&amp;nbsp;&amp;nbsp; I am including it as a .zip file for anyone who can use it.&amp;nbsp; Watch the console tab in FireBug if you are running FireFox and you can see the interplay between the different subscribers and publishers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This was the thing I was looking for.&amp;nbsp; I can now use this to take responses from a database query, and 'publish' them where a 'subscriber' inside my map.js script will see the publication through its subscription and feed the data to the ClusterLayer.js.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 24 Oct 2013 08:59:54 GMT</pubDate>
    <dc:creator>AndrewDavis</dc:creator>
    <dc:date>2013-10-24T08:59:54Z</dc:date>
    <item>
      <title>Cluster Layer from data and the single Popup?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cluster-layer-from-data-and-the-single-popup/m-p/70444#M6242</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hey there..&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; I am working with the esri ClusterLayer.js and have gotten to the point here I can feed it a large JSON and then have it render successfully on my webmap.&amp;nbsp; I have been reading many of the different threads (a really good one: &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/68422-ESRI-point-clustering-example-using-featurelayer-or-querytask-as-input" rel="nofollow noopener noreferrer" target="_blank"&gt;http://forums.arcgis.com/threads/68422-ESRI-point-clustering-example-using-featurelayer-or-querytask-as-input&lt;/A&gt;&lt;SPAN&gt;)&amp;nbsp; and they are all of a help but I am confused about how to render the individual infoWindow or popup for the singles.&amp;nbsp; The best I have been able to get is the "clusterID" and then the value to show in the "singletemplate"..&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; I am calling it thusly..&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Using the code from the examples..&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;

 var aDocs= [{
&amp;nbsp;&amp;nbsp; "place": "a happy place",
&amp;nbsp;&amp;nbsp; "label": "a happy label",
&amp;nbsp;&amp;nbsp; "coords": "33.540744, -117.782432�?�
 },{
&amp;nbsp;&amp;nbsp; "place": "another nearby happy place",
&amp;nbsp;&amp;nbsp; "label": "a happy label",
&amp;nbsp;&amp;nbsp; "coords": "33.540744, -117.782432" 
 }];

 function addClusters(aDocs){
&amp;nbsp;&amp;nbsp; try{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (var key in aDocs){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log(aDocs [key];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var myObj = aDocs [key];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var coordPair = [];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for(var prop in myObj){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (myObj.hasOwnProperty(prop)){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(prop === �??coords�??){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; coordPair = myObj[prop].split(�??,�??);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myObj[�??y�?�] = parseFloat(coordPair[0]);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myObj[�??x�?�] = parseFloat(coordPair[1]);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; clusterLayer = new extras.ClusterLayer({


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; �??data�?�: aDocs,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; �??distance�?�: 100,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; �??id�?�:�?�clusters�?�,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; �??labelColor�?�: �??#fff�?�,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; �??labelOffset�?�: 10,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; �??resolution�?�: map.extent.getWidth() / map.width,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; �??singleColor�?�: �??#888�?�,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; �??singleTemplate�?�: infoTemplate
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });
&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; catch(e){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log(e);
&amp;nbsp;&amp;nbsp; }
 }
 &lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does anyone know how to get setup the template? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've been able to put over 2,000 points on the map and everything looks nice but the infoTemplate is eluding me..&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Andy...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:42:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cluster-layer-from-data-and-the-single-popup/m-p/70444#M6242</guid>
      <dc:creator>AndrewDavis</dc:creator>
      <dc:date>2021-12-10T22:42:19Z</dc:date>
    </item>
    <item>
      <title>Re: Cluster Layer from data and the single Popup?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cluster-layer-from-data-and-the-single-popup/m-p/70445#M6243</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In your code you use:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
"singleTemplate": infoTemplate
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;but I can't see where you've defined infoTemplate in the code snippet. Can you include a link to your live site, or otherwise show more code?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What about putting a breakpoint on that line and verifying that infoTemplate exists?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you look at the sample at &lt;/SPAN&gt;&lt;A href="http://developers.arcgis.com/en/javascript/samples/layers_point_clustering" rel="nofollow noopener noreferrer" target="_blank"&gt;http://developers.arcgis.com/en/javascript/samples/layers_point_clustering&lt;/A&gt;&lt;SPAN&gt; and step through the code, you can see that they first define the info window, then use it as you have done:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
var popupTemplate = PopupTemplate({
....
});


clusterLayer = new ClusterLayer({
 �?�
 "singleTemplate": popupTemplate
});
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;so you're on the right track - you may be missing the infoTemplate definition.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Steve&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:42:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cluster-layer-from-data-and-the-single-popup/m-p/70445#M6243</guid>
      <dc:creator>StephenLead</dc:creator>
      <dc:date>2021-12-10T22:42:21Z</dc:date>
    </item>
    <item>
      <title>Re: Cluster Layer from data and the single Popup?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cluster-layer-from-data-and-the-single-popup/m-p/70446#M6244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;In your code you use:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
"singleTemplate": infoTemplate
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;but I can't see where you've defined infoTemplate in the code snippet. Can you include a link to your live site, or otherwise show more code?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;What about putting a breakpoint on that line and verifying that infoTemplate exists?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;If you look at the sample at &lt;A href="http://developers.arcgis.com/en/javascript/samples/layers_point_clustering" rel="nofollow noopener noreferrer" target="_blank"&gt;http://developers.arcgis.com/en/javascript/samples/layers_point_clustering&lt;/A&gt; and step through the code, you can see that they first define the info window, then use it as you have done:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
var popupTemplate = PopupTemplate({
....
});


clusterLayer = new ClusterLayer({
 �?�
 "singleTemplate": popupTemplate
});
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;so you're on the right track - you may be missing the infoTemplate definition.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Steve&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Steve, Thanks for the reply.&amp;nbsp; I am able to add the example points and see the example single popup on my home machine&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am working on getting the data from my own collection of objects to work with the popup.&amp;nbsp; My scripts are not written with the AMD notation, and I am missing something in translation from the examples to my work.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I will post the code after I get it organized on my home machine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Andy..&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:42:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cluster-layer-from-data-and-the-single-popup/m-p/70446#M6244</guid>
      <dc:creator>AndrewDavis</dc:creator>
      <dc:date>2021-12-10T22:42:24Z</dc:date>
    </item>
    <item>
      <title>Re: Cluster Layer from data and the single Popup?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cluster-layer-from-data-and-the-single-popup/m-p/70447#M6245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Still trying to figure this out.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to be able to feed a set of values in from a database query (non&amp;nbsp; esri query) which comes back in a Collection of Objects&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Attached&amp;nbsp; is the code for an example I am trying to unwind and then use.&amp;nbsp;&amp;nbsp; I can&amp;nbsp; get the click event with a listener connected to the button&amp;nbsp; inside the&amp;nbsp; script.&amp;nbsp; My issue seems to be that I am unable to call the&amp;nbsp; "addClusters"&amp;nbsp; function with myData from outside of the script I have&amp;nbsp; attached here&amp;nbsp; without this listener. I have this working in javascript&amp;nbsp; without the AMD but am getting hung up on the&amp;nbsp;&amp;nbsp; "myData =&amp;nbsp; arrayUtils.map" line in non-AMD code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have been looking at Subscibers and Publishers for trying to capture&amp;nbsp; the change in status from my database query that would be looking out of&amp;nbsp; the grouped functionality for a database response with no&amp;nbsp; luck.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If anyone has advice regarding how to push a database response in I&amp;nbsp; would love the input. attached is my example that I have changed&amp;nbsp; to take input from a collection of objects and is listening for the&amp;nbsp; button click.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Andy&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Oct 2013 15:01:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cluster-layer-from-data-and-the-single-popup/m-p/70447#M6245</guid>
      <dc:creator>AndrewDavis</dc:creator>
      <dc:date>2013-10-15T15:01:43Z</dc:date>
    </item>
    <item>
      <title>Re: Cluster Layer from data and the single Popup?  Solution</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cluster-layer-from-data-and-the-single-popup/m-p/70448#M6246</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;**Edited**..&amp;nbsp; I re-read this and it kind of walked from single popup into an AMD issue.&amp;nbsp; The reason..&amp;nbsp; I could not get my legacy style code to create the popup info correctly but the newer examples all worked (I'm running jsapi 3.6 locally).&amp;nbsp; So.. off I went to figure out why it was different, and realized I had to use the AMD style of js.&amp;nbsp; Or at least that would work.. while my attempt didnt.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I was reading more about AMD and how the newer scripting will be using much more of it, &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/en/javascript/jshelp/inside_dojo_amd.html"&gt;https://developers.arcgis.com/en/javascript/jshelp/inside_dojo_amd.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This Thread:&amp;nbsp; &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/91611-Legacy-code-vs-AMD-code?highlight=AMD"&gt;http://forums.arcgis.com/threads/91611-Legacy-code-vs-AMD-code?highlight=AMD&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;has a few links for you as well.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I also found some tutorials on it, and made a simple page which will allow you to see some of the behaviors of 'publish' and 'subscribe'.&amp;nbsp;&amp;nbsp;&amp;nbsp; I am including it as a .zip file for anyone who can use it.&amp;nbsp; Watch the console tab in FireBug if you are running FireFox and you can see the interplay between the different subscribers and publishers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This was the thing I was looking for.&amp;nbsp; I can now use this to take responses from a database query, and 'publish' them where a 'subscriber' inside my map.js script will see the publication through its subscription and feed the data to the ClusterLayer.js.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Oct 2013 08:59:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cluster-layer-from-data-and-the-single-popup/m-p/70448#M6246</guid>
      <dc:creator>AndrewDavis</dc:creator>
      <dc:date>2013-10-24T08:59:54Z</dc:date>
    </item>
  </channel>
</rss>

