<?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: Launch webmap popup programmatically in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/launch-webmap-popup-programmatically/m-p/315833#M29036</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you advise on how to do this? Is this not possible with the Javascript API? I've found that you can do it with Silverlight...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 25 Jul 2015 02:49:36 GMT</pubDate>
    <dc:creator>DanBrellis</dc:creator>
    <dc:date>2015-07-25T02:49:36Z</dc:date>
    <item>
      <title>Launch webmap popup programmatically</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/launch-webmap-popup-programmatically/m-p/315821#M29024</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: zconlen&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;My application consumes a webmap, which is where the popups are designed and configured. A feature of the app is for a user to select an asset from a combo box and the map will zoom to that feature on the map, highlight it and open the popup for that feature. I have the zoom to working, but struggling to get the popup to behave as desired. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm calling the show method of infoWindow, like &lt;/SPAN&gt;&lt;PRE class="plain" name="code"&gt;map.infoWindow.show(screenPoint);&amp;nbsp; &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The results vary. If no feature has been identified previously, I get an empty unformated popup. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]24297[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If a feature has previously been selected, I get the formatted popup, at the correct location, but showing the information for the previous manual identify. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]24299[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As you can see, in the second scenario, the wrong feature is highlighted, and the information in the popup corresponds to that wrong feature (the pipe to the west), not the manhole which the popup is supposed to be showing. It is positioned correctly though.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It seems that the popup displays information for the "selected" feature. So, perhaps I need to first select the desired feature, but not sure how.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Obviously, I want to avoid trying to programmatically re-create the popup and the highlighting that is used by default in the webmap. Must be an easier way. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the function which is supposed to handle this. Results are from a query task, which will return one feature only:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;//Zoom to user selected feature, highlight it and display popup function zoomExtent(results) { &amp;nbsp; var featureSet = results; &amp;nbsp; var features = featureSet.features; &amp;nbsp; var extent = esri.graphicsExtent(features);&amp;nbsp; &amp;nbsp; //result may be either a line or a point feature. If line feature, the above extent variable is fine. If a point &amp;nbsp; //feature, that extent is undefined, so we need to create a valid extent &amp;nbsp; if (!extent) {&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; var point = features[0]; &amp;nbsp;&amp;nbsp;&amp;nbsp; extent = new esri.geometry.Extent(point.geometry.x - 100, point.geometry.y - 100, point.geometry.x + 100, point.geometry.y + 100, new esri.SpatialReference({ wkid:3857}));&amp;nbsp;&amp;nbsp; &amp;nbsp; }&amp;nbsp; &amp;nbsp; //zoom to extent &amp;nbsp; map.setExtent(extent); &amp;nbsp; //get location to use for positioning popup &amp;nbsp; var screenPoint = map.toScreen(extent.getCenter()); &amp;nbsp; map.infoWindow.show(screenPoint);&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;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 May 2013 15:17:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/launch-webmap-popup-programmatically/m-p/315821#M29024</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2013-05-14T15:17:46Z</dc:date>
    </item>
    <item>
      <title>Re: Launch webmap popup programmatically</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/launch-webmap-popup-programmatically/m-p/315822#M29025</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: Kelly&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Before showing the info window try adding the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
map.infoWindow.setFeatures(features);

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:01:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/launch-webmap-popup-programmatically/m-p/315822#M29025</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-11T15:01:27Z</dc:date>
    </item>
    <item>
      <title>Re: Launch webmap popup programmatically</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/launch-webmap-popup-programmatically/m-p/315823#M29026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Kelly, thanks for reply. That's better, but not quite right. I'm now getting the highlighting behavior as desired, and the popup is no longer displaying info from the previous click, but there is no content. Here is screenshot:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]24310[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I know there is a setContent method, but assuming I should not need to use this as the title and content should be read from the feature. Any thoughts?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 May 2013 20:16:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/launch-webmap-popup-programmatically/m-p/315823#M29026</guid>
      <dc:creator>ZorbaConlen</dc:creator>
      <dc:date>2013-05-14T20:16:02Z</dc:date>
    </item>
    <item>
      <title>Re: Launch webmap popup programmatically</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/launch-webmap-popup-programmatically/m-p/315824#M29027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: Kelly&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How are you figuring out which features to zoom to? Are you using a query task? Or using the feature layer query method?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 May 2013 21:45:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/launch-webmap-popup-programmatically/m-p/315824#M29027</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2013-05-14T21:45:57Z</dc:date>
    </item>
    <item>
      <title>Re: Launch webmap popup programmatically</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/launch-webmap-popup-programmatically/m-p/315825#M29028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm using a query task. The query task parameters are like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var query = new esri.tasks.Query();
query.outFields = ["ASSETNUMBER","Description","DateDiscovered","Severity","incidentID"];
query.returnGeometry = true;
query.where&amp;nbsp; = "ASSETNUMBER = '" + selItem + "'"
queryTask.execute(query,zoomExtent);&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:01:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/launch-webmap-popup-programmatically/m-p/315825#M29028</guid>
      <dc:creator>ZorbaConlen</dc:creator>
      <dc:date>2021-12-11T15:01:30Z</dc:date>
    </item>
    <item>
      <title>Re: Launch webmap popup programmatically</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/launch-webmap-popup-programmatically/m-p/315826#M29029</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: Kelly&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So the issue is that you are performing a query and the graphics that are returned don't have an info template defined. You could define an info template and assign it to the resulting features. Alternatively you may be able to query the layer in your web map instead. Is your web map publicly available? If so can you post the web map id?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 May 2013 22:04:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/launch-webmap-popup-programmatically/m-p/315826#M29029</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2013-05-14T22:04:37Z</dc:date>
    </item>
    <item>
      <title>Re: Launch webmap popup programmatically</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/launch-webmap-popup-programmatically/m-p/315827#M29030</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;No, the webmap is internal only, so I can't share the id with you. I checked out the api reference for infoTemplate. This looks fairly straight forward. Looks like I would define the template and then use infoWindow.setContent(template)....&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a sample for querying the layer in the webmap?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There is one potential hitch in the giddyup. I'm customizing the infoWindow to show an image gallery of attachments. It works by connecting to the onSelectionChanged event of the infoWindow - &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;dojo.connect(map.infoWindow, "onSelectionChange", displayAttachments);&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;displayAttachments is the function which modifieds the info window interface....&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That's not working either, for the programmatically launched popup.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 May 2013 22:18:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/launch-webmap-popup-programmatically/m-p/315827#M29030</guid>
      <dc:creator>ZorbaConlen</dc:creator>
      <dc:date>2013-05-14T22:18:22Z</dc:date>
    </item>
    <item>
      <title>Re: Launch webmap popup programmatically</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/launch-webmap-popup-programmatically/m-p/315828#M29031</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: Kelly&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;&lt;BR /&gt;That's not working either, for the programmatically launched popup.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is to be expected because the programmatically launched popup is not the popup for the feature in the web map. It is a popup for the feature returned by the query so it has the same geometry but not the popup information. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You may want to try getting the layer you want to search from the map the using the FeatureLayer select method to find the feature of interest and display the popup. Here's a link to a sample that shows how to select features using a feature layer. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/jssamples/fl_selection.html"&gt;http://help.arcgis.com/en/webapi/javascript/arcgis/jssamples/fl_selection.html&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 May 2013 22:24:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/launch-webmap-popup-programmatically/m-p/315828#M29031</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2013-05-14T22:24:32Z</dc:date>
    </item>
    <item>
      <title>Re: Launch webmap popup programmatically</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/launch-webmap-popup-programmatically/m-p/315829#M29032</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ok, looks like I have a couple options. I'll investigate these. Thanks for your help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 May 2013 13:36:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/launch-webmap-popup-programmatically/m-p/315829#M29032</guid>
      <dc:creator>ZorbaConlen</dc:creator>
      <dc:date>2013-05-15T13:36:15Z</dc:date>
    </item>
    <item>
      <title>Re: Launch webmap popup programmatically</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/launch-webmap-popup-programmatically/m-p/315830#M29033</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: WestonSF&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Did you find a solution to this? I'm facing the same issue. Is there a way of getting the infoTemplate from the ArcGIS Online map?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jul 2013 00:27:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/launch-webmap-popup-programmatically/m-p/315830#M29033</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2013-07-04T00:27:42Z</dc:date>
    </item>
    <item>
      <title>Re: Launch webmap popup programmatically</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/launch-webmap-popup-programmatically/m-p/315831#M29034</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Shaun,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The only solution I found was to recreate the webmap popup info template. Seems like there should be an easier way but apparently not. It goes something like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;//Use html to mimic look and feel of default webmap popup
var infoTemplate = new esri.InfoTemplate("test", "&amp;lt;div id='searchPopup'&amp;gt;&amp;lt;strong&amp;gt;${LAYER}: ${ASSETNUMBER}&amp;lt;/strong&amp;gt;&amp;lt;hr&amp;gt;&amp;lt;table cellpadding='5'&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;lt;font color='grey'&amp;gt;Description&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt; &amp;lt;td&amp;gt;${Description}&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;lt;font color='grey'&amp;gt;Date Discovered &amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;${DateDiscovered:DateFormat(selector: 'date', fullYear: true)}&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;lt;font color='grey'&amp;gt;Severity &amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;${Severity}&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&amp;lt;br&amp;gt;&amp;lt;/div&amp;gt;");
//call defineInfoTemplate func, to apply above infoTemplate to features
defineInfoTemplate(features, infoTemplate);
//set infowindow features to full array
map.infoWindow.setFeatures(features);
//text for title bar indicating how many features....
map.infoWindow.setTitle('(1 of ' + features.length + ')');
// center and zoom map
map.centerAndZoom(extent.getCenter(),18);
var screenPoint = map.toScreen(extent.getCenter()); 
map.infoWindow.show(screenPoint);&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The defineInfoTemplate function just loops through the features returned from the query task and applys the template to each.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope that helps.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:01:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/launch-webmap-popup-programmatically/m-p/315831#M29034</guid>
      <dc:creator>ZorbaConlen</dc:creator>
      <dc:date>2021-12-11T15:01:33Z</dc:date>
    </item>
    <item>
      <title>Re: Launch webmap popup programmatically</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/launch-webmap-popup-programmatically/m-p/315832#M29035</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: WestonSF&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Oh yup cheers that's pretty much what I did too.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jul 2013 07:26:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/launch-webmap-popup-programmatically/m-p/315832#M29035</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2013-07-09T07:26:34Z</dc:date>
    </item>
    <item>
      <title>Re: Launch webmap popup programmatically</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/launch-webmap-popup-programmatically/m-p/315833#M29036</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you advise on how to do this? Is this not possible with the Javascript API? I've found that you can do it with Silverlight...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Jul 2015 02:49:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/launch-webmap-popup-programmatically/m-p/315833#M29036</guid>
      <dc:creator>DanBrellis</dc:creator>
      <dc:date>2015-07-25T02:49:36Z</dc:date>
    </item>
  </channel>
</rss>

