<?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: looking for a Right popup sample in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/looking-for-a-right-popup-sample/m-p/412577#M38012</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;The process would be something like this:&lt;BR /&gt;&lt;BR /&gt;&lt;OL&gt;&lt;BR /&gt;&lt;LI&gt;Create a new popup / infoWindow for your app as shown in all the examples&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;For each layer that needs a popup, create an infoTemplate and then specify it during the layer creation&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;Create on onClick event listeners (dojo.connec in legacy Dojo)&amp;nbsp; for each layer which contains a query on the layer&lt;/LI&gt;&lt;BR /&gt;&lt;/OL&gt;&lt;BR /&gt;Here's some cobbled together legacy code (v3.3 of the API) as a guide:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt; var usgsTemplate = new esri.InfoTemplate();
 usgsTemplate.setContent('&amp;lt;table cellspacing=\"5\" style=\"font-size:90%\"&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td style=\"text-align:top\"&amp;gt;&amp;lt;b&amp;gt;Gage Location:&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td style=\"vertical-align:top\"&amp;gt;${NAME}&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td style=\"vertical-align:top\"&amp;gt;&amp;lt;b&amp;gt;Latest Graph:&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td style=\"vertical-align:top\"&amp;gt;&amp;lt;a href=\"${url}\" target=\"_blank\"&amp;gt;Click to View&amp;lt;\a&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;');
 usgsTemplate.setTitle('USGS Stream Gage');

 var floodplainTemplate = new esri.InfoTemplate();
 floodplainTemplate.setContent(setFloodplainPopupContent);
 floodplainTemplate.setTitle('100-Year Floodplain');

 popup = new esri.dijit.Popup({
&amp;nbsp; fillSymbol: new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,0,0]), 2), new dojo.Color([255,255,0,0.25]))
 }, dojo.create("div"));

 // Create the map
 map = new esri.Map("map", {
&amp;nbsp; extent:initExtent,
&amp;nbsp; minScale: 4750000,
&amp;nbsp; basemap: 'streets',
&amp;nbsp; infoWindow:popup,
&amp;nbsp; outFields: ["*"]
 });

 theUsgsLayer = new esri.layers.FeatureLayer(SERVERPATH + "/hydrography/swmStreamGages/MapServer/0", {
&amp;nbsp; id: 'usgsGageLayer',
&amp;nbsp; mode: esri.layers.FeatureLayer.MODE_ONDEMAND,
&amp;nbsp; infoTemplate:usgsTemplate,
&amp;nbsp; outFields: ["*"],
&amp;nbsp; visible: true
 });

 theFloodplainLayer = new esri.layers.FeatureLayer(SERVERPATH + "/environmental/femaFloodPlain/MapServer/0", {
&amp;nbsp; id: 'femaFloodplainLayer', 
&amp;nbsp; mode: esri.layers.FeatureLayer.MODE_ONDEMAND,
&amp;nbsp; infoTemplate:floodplainTemplate,
&amp;nbsp; outFields: ["*"],
&amp;nbsp; opacity:0.35,
&amp;nbsp; visible: false
 });

.
. //Later on in the init() function...
.
.
 //Listener event for feature selection and the popup info widow 
 dojo.connect(theUsgsLayer,"onClick",function(evt){
&amp;nbsp; //Listener event for feature selection and the popup info widow
&amp;nbsp; var query = new esri.tasks.Query();
&amp;nbsp; query.geometry = pointToExtent(map,evt.mapPoint,15);

&amp;nbsp; var deferred = theUsgsLayer.selectFeatures(query,esri.layers.FeatureLayer.SELECTION_NEW);
&amp;nbsp; map.infoWindow.resize(350,300);&amp;nbsp; 
&amp;nbsp; map.infoWindow.setFeatures([deferred]);
&amp;nbsp; map.infoWindow.show(evt.mapPoint);
 });

 //Listener event for feature selection and the popup info widow 
 dojo.connect(theFloodplainLayer,"onClick",function(evt){
&amp;nbsp; //Listener event for feature selection and the popup info widow
&amp;nbsp; var query = new esri.tasks.Query();
&amp;nbsp; query.geometry = pointToExtent(map,evt.mapPoint,15);

&amp;nbsp; var deferred = theFloodplainLayer.selectFeatures(query,esri.layers.FeatureLayer.SELECTION_NEW); 
&amp;nbsp; map.infoWindow.resize(200,175);
&amp;nbsp; map.infoWindow.setFeatures([evt.graphic]);
&amp;nbsp; map.infoWindow.show(evt.mapPoint);
 });
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;Hope that points you in the right direction. You can also search the forum for identifyTask an popup/infoWindow and you might find some other examples.&lt;BR /&gt;&lt;BR /&gt;Good luck!&lt;BR /&gt;Steve&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you Steve!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 18:43:25 GMT</pubDate>
    <dc:creator>GyeyoungChoi</dc:creator>
    <dc:date>2021-12-11T18:43:25Z</dc:date>
    <item>
      <title>looking for a Right popup sample</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/looking-for-a-right-popup-sample/m-p/412575#M38010</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I was looking for a sample for popup function.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;However all the samples have only clickable from one layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I would like to have multiple layers to be able to click and show popup window.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there any sample that I can get the idea of it?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Sep 2013 20:06:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/looking-for-a-right-popup-sample/m-p/412575#M38010</guid>
      <dc:creator>GyeyoungChoi</dc:creator>
      <dc:date>2013-09-04T20:06:06Z</dc:date>
    </item>
    <item>
      <title>Re: looking for a Right popup sample</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/looking-for-a-right-popup-sample/m-p/412576#M38011</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The process would be something like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;OL&gt;&lt;BR /&gt;&lt;LI&gt;Create a new popup / infoWindow for your app as shown in all the examples&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;For each layer that needs a popup, create an infoTemplate and then specify it during the layer creation&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;Create on onClick event listeners (dojo.connec in legacy Dojo)&amp;nbsp; for each layer which contains a query on the layer&lt;/LI&gt;&lt;BR /&gt;&lt;/OL&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's some cobbled together legacy code (v3.3 of the API) as a guide:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt; var usgsTemplate = new esri.InfoTemplate();
 usgsTemplate.setContent('&amp;lt;table cellspacing=\"5\" style=\"font-size:90%\"&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td style=\"text-align:top\"&amp;gt;&amp;lt;b&amp;gt;Gage Location:&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td style=\"vertical-align:top\"&amp;gt;${NAME}&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td style=\"vertical-align:top\"&amp;gt;&amp;lt;b&amp;gt;Latest Graph:&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td style=\"vertical-align:top\"&amp;gt;&amp;lt;a href=\"${url}\" target=\"_blank\"&amp;gt;Click to View&amp;lt;\a&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;');
 usgsTemplate.setTitle('USGS Stream Gage');

 var floodplainTemplate = new esri.InfoTemplate();
 floodplainTemplate.setContent(setFloodplainPopupContent);
 floodplainTemplate.setTitle('100-Year Floodplain');

 popup = new esri.dijit.Popup({
&amp;nbsp; fillSymbol: new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,0,0]), 2), new dojo.Color([255,255,0,0.25]))
 }, dojo.create("div"));

 // Create the map
 map = new esri.Map("map", {
&amp;nbsp; extent:initExtent,
&amp;nbsp; minScale: 4750000,
&amp;nbsp; basemap: 'streets',
&amp;nbsp; infoWindow:popup,
&amp;nbsp; outFields: ["*"]
 });

 theUsgsLayer = new esri.layers.FeatureLayer(SERVERPATH + "/hydrography/swmStreamGages/MapServer/0", {
&amp;nbsp; id: 'usgsGageLayer',
&amp;nbsp; mode: esri.layers.FeatureLayer.MODE_ONDEMAND,
&amp;nbsp; infoTemplate:usgsTemplate,
&amp;nbsp; outFields: ["*"],
&amp;nbsp; visible: true
 });

 theFloodplainLayer = new esri.layers.FeatureLayer(SERVERPATH + "/environmental/femaFloodPlain/MapServer/0", {
&amp;nbsp; id: 'femaFloodplainLayer', 
&amp;nbsp; mode: esri.layers.FeatureLayer.MODE_ONDEMAND,
&amp;nbsp; infoTemplate:floodplainTemplate,
&amp;nbsp; outFields: ["*"],
&amp;nbsp; opacity:0.35,
&amp;nbsp; visible: false
 });

.
. //Later on in the init() function...
.
.
 //Listener event for feature selection and the popup info widow 
 dojo.connect(theUsgsLayer,"onClick",function(evt){
&amp;nbsp; //Listener event for feature selection and the popup info widow
&amp;nbsp; var query = new esri.tasks.Query();
&amp;nbsp; query.geometry = pointToExtent(map,evt.mapPoint,15);

&amp;nbsp; var deferred = theUsgsLayer.selectFeatures(query,esri.layers.FeatureLayer.SELECTION_NEW);
&amp;nbsp; map.infoWindow.resize(350,300);&amp;nbsp; 
&amp;nbsp; map.infoWindow.setFeatures([deferred]);
&amp;nbsp; map.infoWindow.show(evt.mapPoint);
 });

 //Listener event for feature selection and the popup info widow 
 dojo.connect(theFloodplainLayer,"onClick",function(evt){
&amp;nbsp; //Listener event for feature selection and the popup info widow
&amp;nbsp; var query = new esri.tasks.Query();
&amp;nbsp; query.geometry = pointToExtent(map,evt.mapPoint,15);

&amp;nbsp; var deferred = theFloodplainLayer.selectFeatures(query,esri.layers.FeatureLayer.SELECTION_NEW); 
&amp;nbsp; map.infoWindow.resize(200,175);
&amp;nbsp; map.infoWindow.setFeatures([evt.graphic]);
&amp;nbsp; map.infoWindow.show(evt.mapPoint);
 });
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope that points you in the right direction. You can also search the forum for identifyTask an popup/infoWindow and you might find some other examples.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Good luck!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Steve&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:43:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/looking-for-a-right-popup-sample/m-p/412576#M38011</guid>
      <dc:creator>SteveCole</dc:creator>
      <dc:date>2021-12-11T18:43:23Z</dc:date>
    </item>
    <item>
      <title>Re: looking for a Right popup sample</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/looking-for-a-right-popup-sample/m-p/412577#M38012</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;The process would be something like this:&lt;BR /&gt;&lt;BR /&gt;&lt;OL&gt;&lt;BR /&gt;&lt;LI&gt;Create a new popup / infoWindow for your app as shown in all the examples&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;For each layer that needs a popup, create an infoTemplate and then specify it during the layer creation&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;Create on onClick event listeners (dojo.connec in legacy Dojo)&amp;nbsp; for each layer which contains a query on the layer&lt;/LI&gt;&lt;BR /&gt;&lt;/OL&gt;&lt;BR /&gt;Here's some cobbled together legacy code (v3.3 of the API) as a guide:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt; var usgsTemplate = new esri.InfoTemplate();
 usgsTemplate.setContent('&amp;lt;table cellspacing=\"5\" style=\"font-size:90%\"&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td style=\"text-align:top\"&amp;gt;&amp;lt;b&amp;gt;Gage Location:&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td style=\"vertical-align:top\"&amp;gt;${NAME}&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td style=\"vertical-align:top\"&amp;gt;&amp;lt;b&amp;gt;Latest Graph:&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td style=\"vertical-align:top\"&amp;gt;&amp;lt;a href=\"${url}\" target=\"_blank\"&amp;gt;Click to View&amp;lt;\a&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;');
 usgsTemplate.setTitle('USGS Stream Gage');

 var floodplainTemplate = new esri.InfoTemplate();
 floodplainTemplate.setContent(setFloodplainPopupContent);
 floodplainTemplate.setTitle('100-Year Floodplain');

 popup = new esri.dijit.Popup({
&amp;nbsp; fillSymbol: new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,0,0]), 2), new dojo.Color([255,255,0,0.25]))
 }, dojo.create("div"));

 // Create the map
 map = new esri.Map("map", {
&amp;nbsp; extent:initExtent,
&amp;nbsp; minScale: 4750000,
&amp;nbsp; basemap: 'streets',
&amp;nbsp; infoWindow:popup,
&amp;nbsp; outFields: ["*"]
 });

 theUsgsLayer = new esri.layers.FeatureLayer(SERVERPATH + "/hydrography/swmStreamGages/MapServer/0", {
&amp;nbsp; id: 'usgsGageLayer',
&amp;nbsp; mode: esri.layers.FeatureLayer.MODE_ONDEMAND,
&amp;nbsp; infoTemplate:usgsTemplate,
&amp;nbsp; outFields: ["*"],
&amp;nbsp; visible: true
 });

 theFloodplainLayer = new esri.layers.FeatureLayer(SERVERPATH + "/environmental/femaFloodPlain/MapServer/0", {
&amp;nbsp; id: 'femaFloodplainLayer', 
&amp;nbsp; mode: esri.layers.FeatureLayer.MODE_ONDEMAND,
&amp;nbsp; infoTemplate:floodplainTemplate,
&amp;nbsp; outFields: ["*"],
&amp;nbsp; opacity:0.35,
&amp;nbsp; visible: false
 });

.
. //Later on in the init() function...
.
.
 //Listener event for feature selection and the popup info widow 
 dojo.connect(theUsgsLayer,"onClick",function(evt){
&amp;nbsp; //Listener event for feature selection and the popup info widow
&amp;nbsp; var query = new esri.tasks.Query();
&amp;nbsp; query.geometry = pointToExtent(map,evt.mapPoint,15);

&amp;nbsp; var deferred = theUsgsLayer.selectFeatures(query,esri.layers.FeatureLayer.SELECTION_NEW);
&amp;nbsp; map.infoWindow.resize(350,300);&amp;nbsp; 
&amp;nbsp; map.infoWindow.setFeatures([deferred]);
&amp;nbsp; map.infoWindow.show(evt.mapPoint);
 });

 //Listener event for feature selection and the popup info widow 
 dojo.connect(theFloodplainLayer,"onClick",function(evt){
&amp;nbsp; //Listener event for feature selection and the popup info widow
&amp;nbsp; var query = new esri.tasks.Query();
&amp;nbsp; query.geometry = pointToExtent(map,evt.mapPoint,15);

&amp;nbsp; var deferred = theFloodplainLayer.selectFeatures(query,esri.layers.FeatureLayer.SELECTION_NEW); 
&amp;nbsp; map.infoWindow.resize(200,175);
&amp;nbsp; map.infoWindow.setFeatures([evt.graphic]);
&amp;nbsp; map.infoWindow.show(evt.mapPoint);
 });
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;Hope that points you in the right direction. You can also search the forum for identifyTask an popup/infoWindow and you might find some other examples.&lt;BR /&gt;&lt;BR /&gt;Good luck!&lt;BR /&gt;Steve&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you Steve!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:43:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/looking-for-a-right-popup-sample/m-p/412577#M38012</guid>
      <dc:creator>GyeyoungChoi</dc:creator>
      <dc:date>2021-12-11T18:43:25Z</dc:date>
    </item>
    <item>
      <title>Re: looking for a Right popup sample</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/looking-for-a-right-popup-sample/m-p/412578#M38013</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;For another way to do this, take a look at this &lt;/SPAN&gt;&lt;A href="http://gis.stackexchange.com/questions/12407/how-to-identify-layers-from-multiple-arcgis-server-instances"&gt;post&lt;/A&gt;&lt;SPAN&gt; showing how to use a DeferredList with multiple services.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Sep 2013 12:55:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/looking-for-a-right-popup-sample/m-p/412578#M38013</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2013-09-09T12:55:20Z</dc:date>
    </item>
  </channel>
</rss>

