<?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 displaying infotemplate on query in Developers Questions</title>
    <link>https://community.esri.com/t5/developers-questions/displaying-infotemplate-on-query/m-p/437737#M2929</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;how can i display an infotemplate while zooming to a point on a map after doing a query on a feature layer using a result stored in local storage&lt;/P&gt;&lt;P&gt;var terminal= localStorage.getItem('terminal');&lt;BR /&gt; var info= new InfoTemplate({title:"Name"});&lt;BR /&gt;&lt;SPAN&gt; var queryTask = new QueryTask("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fservices1.arcgis.com%2FKw7jGaBPiN3WUAmT%2FArcGIS%2Frest%2Fservices%2FID_Terminals1a%2FFeatureServer%2F0" rel="nofollow" target="_blank"&gt;https://services1.arcgis.com/Kw7jGaBPiN3WUAmT/ArcGIS/rest/services/ID_Terminals1a/FeatureServer/0&lt;/A&gt;&lt;SPAN&gt;",{mode:FeatureLayer.MODE_ONDEMAND,&lt;/SPAN&gt;&lt;BR /&gt; infoTemplate:info,&lt;BR /&gt; outFields:["Name"]&lt;BR /&gt; });&lt;BR /&gt; &lt;BR /&gt; var query = new Query();&lt;BR /&gt; query.returnGeometry = true;&lt;BR /&gt; query.outFields = ["*"];&lt;BR /&gt; query.where = "Name = '" + terminal + "'";&lt;BR /&gt; queryTask.execute(query, showResults);&lt;BR /&gt; &lt;BR /&gt; function showResults(results) {&lt;BR /&gt; var resultCount = results.features.length;&lt;BR /&gt; for (var i = 0; i &amp;lt; resultCount; i++) {&lt;BR /&gt; //Zoom to line extent&lt;BR /&gt; var geom = results.features&lt;I&gt;.geometry;&lt;BR /&gt; //geom.setInfoTemplate(info);&lt;BR /&gt; //Zoom to line extent&lt;BR /&gt; &lt;BR /&gt; map.centerAndZoom(geom, 19);&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; }&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;the query zooms to the point fetched from the local storage but does not display the infotemplate&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 19 Mar 2018 20:28:11 GMT</pubDate>
    <dc:creator>peterokello</dc:creator>
    <dc:date>2018-03-19T20:28:11Z</dc:date>
    <item>
      <title>displaying infotemplate on query</title>
      <link>https://community.esri.com/t5/developers-questions/displaying-infotemplate-on-query/m-p/437737#M2929</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;how can i display an infotemplate while zooming to a point on a map after doing a query on a feature layer using a result stored in local storage&lt;/P&gt;&lt;P&gt;var terminal= localStorage.getItem('terminal');&lt;BR /&gt; var info= new InfoTemplate({title:"Name"});&lt;BR /&gt;&lt;SPAN&gt; var queryTask = new QueryTask("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fservices1.arcgis.com%2FKw7jGaBPiN3WUAmT%2FArcGIS%2Frest%2Fservices%2FID_Terminals1a%2FFeatureServer%2F0" rel="nofollow" target="_blank"&gt;https://services1.arcgis.com/Kw7jGaBPiN3WUAmT/ArcGIS/rest/services/ID_Terminals1a/FeatureServer/0&lt;/A&gt;&lt;SPAN&gt;",{mode:FeatureLayer.MODE_ONDEMAND,&lt;/SPAN&gt;&lt;BR /&gt; infoTemplate:info,&lt;BR /&gt; outFields:["Name"]&lt;BR /&gt; });&lt;BR /&gt; &lt;BR /&gt; var query = new Query();&lt;BR /&gt; query.returnGeometry = true;&lt;BR /&gt; query.outFields = ["*"];&lt;BR /&gt; query.where = "Name = '" + terminal + "'";&lt;BR /&gt; queryTask.execute(query, showResults);&lt;BR /&gt; &lt;BR /&gt; function showResults(results) {&lt;BR /&gt; var resultCount = results.features.length;&lt;BR /&gt; for (var i = 0; i &amp;lt; resultCount; i++) {&lt;BR /&gt; //Zoom to line extent&lt;BR /&gt; var geom = results.features&lt;I&gt;.geometry;&lt;BR /&gt; //geom.setInfoTemplate(info);&lt;BR /&gt; //Zoom to line extent&lt;BR /&gt; &lt;BR /&gt; map.centerAndZoom(geom, 19);&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; }&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;the query zooms to the point fetched from the local storage but does not display the infotemplate&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Mar 2018 20:28:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/displaying-infotemplate-on-query/m-p/437737#M2929</guid>
      <dc:creator>peterokello</dc:creator>
      <dc:date>2018-03-19T20:28:11Z</dc:date>
    </item>
    <item>
      <title>Re: displaying infotemplate on query</title>
      <link>https://community.esri.com/t5/developers-questions/displaying-infotemplate-on-query/m-p/437738#M2930</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your question. I think this would be best asked in one of the developer spaces on GeoNet-&amp;nbsp;&lt;A href="https://community.esri.com/community/developers"&gt;https://community.esri.com/community/developers&lt;/A&gt;&amp;nbsp;Please choose the space that best fits the application and/or programming language you are using.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sincerely,&lt;BR /&gt;Tamara&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Mar 2018 00:02:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/displaying-infotemplate-on-query/m-p/437738#M2930</guid>
      <dc:creator>TamaraGrant1</dc:creator>
      <dc:date>2018-03-21T00:02:59Z</dc:date>
    </item>
    <item>
      <title>Re: displaying infotemplate on query</title>
      <link>https://community.esri.com/t5/developers-questions/displaying-infotemplate-on-query/m-p/437739#M2931</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please disregard my last comment, I see that you've already asked it in that location.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sincerely,&lt;BR /&gt;Tamara&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Mar 2018 00:04:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/displaying-infotemplate-on-query/m-p/437739#M2931</guid>
      <dc:creator>TamaraGrant1</dc:creator>
      <dc:date>2018-03-21T00:04:03Z</dc:date>
    </item>
    <item>
      <title>Re: displaying infotemplate on query</title>
      <link>https://community.esri.com/t5/developers-questions/displaying-infotemplate-on-query/m-p/437740#M2932</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Peter, Checking in. Were you able to resolve this problem?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Nov 2018 21:09:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/displaying-infotemplate-on-query/m-p/437740#M2932</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2018-11-26T21:09:01Z</dc:date>
    </item>
  </channel>
</rss>

