<?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 Popup for graphics layer with external data. in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-for-graphics-layer-with-external-data/m-p/449969#M41550</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm plotting points on my basemap by pulling data into a JsonRestStore and then looping over each item in the store and adding a simplemarkersymbol onto the graphics layer. I want to display a simple info window when a symbol is clicked. Currently I'm not even populating the info window attributes from the store. I'm just setting them statically. I'm using the onItem event of the jsonreststore to run ShowCrimeResult which is converts the X,Y coordinates in my store to actual coordinates and adds them to the graphics layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
&amp;nbsp; var queryCrimes = function (city) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; var spillmanStore = new dojox.data.JsonRestStore({
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; target:"/SpillmanService/SpillmanService.svc/GetIncidentsByCity",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; allowNoTrailingSlash:true
&amp;nbsp;&amp;nbsp;&amp;nbsp; });

&amp;nbsp;&amp;nbsp;&amp;nbsp; var showCrimeResult = function (item, request) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var xcoord = parseFloat(spillmanStore.getValue(item, "X"));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var ycoord = parseFloat(spillmanStore.getValue(item, "Y"));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var pt = new esri.geometry.Point(xcoord, ycoord, myMap.spatialReference);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myMap.graphics.add(new esri.Graphic(

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; esri.geometry.geographicToWebMercator(pt),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new esri.symbol.SimpleMarkerSymbol(),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { 'title': 'Test Title', 'content': 'Here is some content' }, // attributes
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new esri.InfoTemplate('${title}', '${content}')
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ));
&amp;nbsp;&amp;nbsp;&amp;nbsp; };

&amp;nbsp;&amp;nbsp;&amp;nbsp; spillmanStore.fetch({query:{CITY:city}, queryOptions:{cache:true}, onItem:showCrimeResult});

&amp;nbsp; }&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However I can't get an infowindow to display when clicking on the graphics objects that are added to the map. The graphics display when I run the query but they are non-interactive. Do I need to connect to the onclick event of myMap.graphics?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 12 Mar 2012 15:48:34 GMT</pubDate>
    <dc:creator>RyanMuller</dc:creator>
    <dc:date>2012-03-12T15:48:34Z</dc:date>
    <item>
      <title>Popup for graphics layer with external data.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-for-graphics-layer-with-external-data/m-p/449969#M41550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm plotting points on my basemap by pulling data into a JsonRestStore and then looping over each item in the store and adding a simplemarkersymbol onto the graphics layer. I want to display a simple info window when a symbol is clicked. Currently I'm not even populating the info window attributes from the store. I'm just setting them statically. I'm using the onItem event of the jsonreststore to run ShowCrimeResult which is converts the X,Y coordinates in my store to actual coordinates and adds them to the graphics layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
&amp;nbsp; var queryCrimes = function (city) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; var spillmanStore = new dojox.data.JsonRestStore({
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; target:"/SpillmanService/SpillmanService.svc/GetIncidentsByCity",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; allowNoTrailingSlash:true
&amp;nbsp;&amp;nbsp;&amp;nbsp; });

&amp;nbsp;&amp;nbsp;&amp;nbsp; var showCrimeResult = function (item, request) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var xcoord = parseFloat(spillmanStore.getValue(item, "X"));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var ycoord = parseFloat(spillmanStore.getValue(item, "Y"));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var pt = new esri.geometry.Point(xcoord, ycoord, myMap.spatialReference);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myMap.graphics.add(new esri.Graphic(

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; esri.geometry.geographicToWebMercator(pt),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new esri.symbol.SimpleMarkerSymbol(),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { 'title': 'Test Title', 'content': 'Here is some content' }, // attributes
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new esri.InfoTemplate('${title}', '${content}')
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ));
&amp;nbsp;&amp;nbsp;&amp;nbsp; };

&amp;nbsp;&amp;nbsp;&amp;nbsp; spillmanStore.fetch({query:{CITY:city}, queryOptions:{cache:true}, onItem:showCrimeResult});

&amp;nbsp; }&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However I can't get an infowindow to display when clicking on the graphics objects that are added to the map. The graphics display when I run the query but they are non-interactive. Do I need to connect to the onclick event of myMap.graphics?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Mar 2012 15:48:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-for-graphics-layer-with-external-data/m-p/449969#M41550</guid>
      <dc:creator>RyanMuller</dc:creator>
      <dc:date>2012-03-12T15:48:34Z</dc:date>
    </item>
  </channel>
</rss>

