<?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 Help with Draw and InfoTemplate in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/help-with-draw-and-infotemplate/m-p/224809#M20907</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Currently I'm using an ArcGISDynamicMapServiceLayer along with an InfoTemplate assigned to it, so when I single click on any portion of my map, it returns the InfoTemplate that includes a few fields&amp;nbsp;from whichever parcel I clicked on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;var infoTemplate = new InfoTemplate("${PIN_DSP}","&amp;lt;b&amp;gt;${OWNER_NAME}&amp;lt;/b&amp;gt;");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var parcelsLayer = new ArcGISDynamicMapServiceLayer("http://172.27.8.54/okaloosagis/rest/services/PropertyApp/ParcelService/MapServer", {&lt;BR /&gt; "id": "Parcels",&lt;BR /&gt; "visible": true,&lt;BR /&gt; disableClientCaching: true,&lt;BR /&gt; useMapImage: true&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;parcelsLayer.setInfoTemplates({&lt;BR /&gt; 14: {infoTemplate: infoTemplate}&lt;BR /&gt; })&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was moving on to the next step, which would be using some sort of Draw feature to select more than one location at a time, and return the same information for every parcel the geometry included. Right now I have a rectangle drawing on screen using the Draw Toolbar option, but I'm trying to find some more information on taking this geometry and using it to return said data. Can anyone direct me to an example, or anything that might help me learn more? I'm pretty new at this, so reading the API Reference for both the InfoTemplates and Draw Toolbars didn't help me too much, but it could be that I don't fully understand it in the terminology they're using.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's my drawing routines, just for some more info.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;function initToolbar() {&lt;BR /&gt; tb = new Draw(map);&lt;BR /&gt; tb.on("draw-end", addSpatialInfoTemplate);&lt;/P&gt;&lt;P&gt;// event delegation so a click handler is not&lt;BR /&gt; // needed for each individual button&lt;BR /&gt; on(dom.byId("doExtent"), "click", function(evt) {&lt;BR /&gt; if ( evt.target.id === "doExtent" ) {&lt;BR /&gt; return;&lt;BR /&gt; }&lt;BR /&gt; map.disableMapNavigation();&lt;BR /&gt; tb.activate(Draw.EXTENT);&lt;BR /&gt; });&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;function addSpatialInfoTemplate(evt) {&lt;BR /&gt; //deactivate the toolbar and clear existing graphics &lt;BR /&gt; tb.deactivate(); &lt;BR /&gt; map.enableMapNavigation();&lt;BR /&gt; //trigger infoTemplate here&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 12 Feb 2019 18:28:32 GMT</pubDate>
    <dc:creator>KevinHanley2</dc:creator>
    <dc:date>2019-02-12T18:28:32Z</dc:date>
    <item>
      <title>Help with Draw and InfoTemplate</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/help-with-draw-and-infotemplate/m-p/224809#M20907</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Currently I'm using an ArcGISDynamicMapServiceLayer along with an InfoTemplate assigned to it, so when I single click on any portion of my map, it returns the InfoTemplate that includes a few fields&amp;nbsp;from whichever parcel I clicked on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;var infoTemplate = new InfoTemplate("${PIN_DSP}","&amp;lt;b&amp;gt;${OWNER_NAME}&amp;lt;/b&amp;gt;");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var parcelsLayer = new ArcGISDynamicMapServiceLayer("http://172.27.8.54/okaloosagis/rest/services/PropertyApp/ParcelService/MapServer", {&lt;BR /&gt; "id": "Parcels",&lt;BR /&gt; "visible": true,&lt;BR /&gt; disableClientCaching: true,&lt;BR /&gt; useMapImage: true&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;parcelsLayer.setInfoTemplates({&lt;BR /&gt; 14: {infoTemplate: infoTemplate}&lt;BR /&gt; })&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was moving on to the next step, which would be using some sort of Draw feature to select more than one location at a time, and return the same information for every parcel the geometry included. Right now I have a rectangle drawing on screen using the Draw Toolbar option, but I'm trying to find some more information on taking this geometry and using it to return said data. Can anyone direct me to an example, or anything that might help me learn more? I'm pretty new at this, so reading the API Reference for both the InfoTemplates and Draw Toolbars didn't help me too much, but it could be that I don't fully understand it in the terminology they're using.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's my drawing routines, just for some more info.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;function initToolbar() {&lt;BR /&gt; tb = new Draw(map);&lt;BR /&gt; tb.on("draw-end", addSpatialInfoTemplate);&lt;/P&gt;&lt;P&gt;// event delegation so a click handler is not&lt;BR /&gt; // needed for each individual button&lt;BR /&gt; on(dom.byId("doExtent"), "click", function(evt) {&lt;BR /&gt; if ( evt.target.id === "doExtent" ) {&lt;BR /&gt; return;&lt;BR /&gt; }&lt;BR /&gt; map.disableMapNavigation();&lt;BR /&gt; tb.activate(Draw.EXTENT);&lt;BR /&gt; });&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;function addSpatialInfoTemplate(evt) {&lt;BR /&gt; //deactivate the toolbar and clear existing graphics &lt;BR /&gt; tb.deactivate(); &lt;BR /&gt; map.enableMapNavigation();&lt;BR /&gt; //trigger infoTemplate here&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Feb 2019 18:28:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/help-with-draw-and-infotemplate/m-p/224809#M20907</guid>
      <dc:creator>KevinHanley2</dc:creator>
      <dc:date>2019-02-12T18:28:32Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Draw and InfoTemplate</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/help-with-draw-and-infotemplate/m-p/224810#M20908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kevin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;What you need to do is take the drawn geometry and use it as the geometry in a Query class that is executed on a QueryTask. The QueryTask will return the intersected results and then you can show a popup for those results.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Feb 2019 18:34:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/help-with-draw-and-infotemplate/m-p/224810#M20908</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2019-02-12T18:34:56Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Draw and InfoTemplate</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/help-with-draw-and-infotemplate/m-p/224811#M20909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you tell me if I'm on the right track? (Will post full code if needed). It seems to be drawing correctly, but the query is returning undefined and I'm not quite sure where I'm going wrong. I suspect query.geometry = evt.geometry is wrong, but I might be way off. &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;map.on("load", initToolbar);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;function initToolbar() {&lt;BR /&gt; tb = new Draw(map);&lt;BR /&gt; tb.on("draw-end", addGraphic);&lt;/P&gt;&lt;P&gt;// event delegation so a click handler is not&lt;BR /&gt; // needed for each individual button&lt;BR /&gt; on(dom.byId("doExtent"), "click", function(evt) {&lt;BR /&gt; if ( evt.target.id === "doExtent" ) {&lt;BR /&gt; return;&lt;BR /&gt; }&lt;BR /&gt; map.disableMapNavigation();&lt;BR /&gt; tb.activate(Draw.EXTENT);&lt;BR /&gt; });&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;var infoTemplate = new InfoTemplate("${PIN_DSP}","&amp;lt;b&amp;gt;${OWNER_NAME}&amp;lt;/b&amp;gt;");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;query = new Query();&lt;BR /&gt; query.returnGeometry = true;&lt;BR /&gt; query.outFields = ["PIN_DSP", "OWNER_NAME"];&lt;/P&gt;&lt;P&gt;queryTask = new esri.tasks.QueryTask("http://172.27.8.54/okaloosagis/rest/services/PropertyApp/ParcelService/MapServer/14");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;function addGraphic(evt) {&lt;BR /&gt; //deactivate the toolbar and clear existing graphics &lt;BR /&gt; tb.deactivate(); &lt;BR /&gt; map.enableMapNavigation();&lt;/P&gt;&lt;P&gt;var symbol;&lt;BR /&gt; if ( evt.geometry.type === "point" || evt.geometry.type === "multipoint") {&lt;BR /&gt; symbol = markerSymbol;&lt;BR /&gt; } else if ( evt.geometry.type === "line" || evt.geometry.type === "polyline") {&lt;BR /&gt; symbol = lineSymbol;&lt;BR /&gt; }&lt;BR /&gt; else {&lt;BR /&gt; symbol = fillSymbol;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;map.graphics.add(new Graphic(evt.geometry, symbol));&lt;BR /&gt; query.geometry = evt.geometry;&lt;BR /&gt; &lt;BR /&gt; queryTask.execute(query, function(fset) {&lt;BR /&gt; showFeatureSet(fset,evt);&lt;BR /&gt; })&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;function showFeatureSet(fset,evt) {&lt;BR /&gt; map.graphics.clear();&lt;BR /&gt; featureSet = fset;&lt;BR /&gt; var numFeatures = featureSet.features.length;&lt;BR /&gt; &lt;BR /&gt; var content = "";&lt;BR /&gt; for (var i=0; i&amp;lt;numFeatures; i++) {&lt;BR /&gt; var graphic = featureSet.features&lt;I&gt;;&lt;BR /&gt; content = content + graphic.attributes.FIELD_NAME;&lt;BR /&gt; }&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;map.infoWindow.setContent(content);&lt;BR /&gt; map.infoWindow.show(evt.screenPoint);&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&amp;lt;div id="doExtent"&amp;gt;&amp;lt;a&amp;gt;&amp;lt;i class="far fa-square"&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/div&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Feb 2019 20:48:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/help-with-draw-and-infotemplate/m-p/224811#M20909</guid>
      <dc:creator>KevinHanley2</dc:creator>
      <dc:date>2019-02-13T20:48:19Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Draw and InfoTemplate</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/help-with-draw-and-infotemplate/m-p/224812#M20910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kevin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; So on this line&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;query.geometry = evt.geometry;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;it is complaining that query is undefined?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;That line is correct.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Feb 2019 21:06:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/help-with-draw-and-infotemplate/m-p/224812#M20910</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2019-02-13T21:06:41Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Draw and InfoTemplate</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/help-with-draw-and-infotemplate/m-p/224813#M20911</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No, it isn't throwing any errors. I was just assuming that might be the issue since that was a line I didn't see in any of the live examples given in the API reference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's just returning undefined/undefined in the InfoWindow. (So clearly it is getting the number of returns correct, but not the actual data itself, which is curious).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Feb 2019 21:28:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/help-with-draw-and-infotemplate/m-p/224813#M20911</guid>
      <dc:creator>KevinHanley2</dc:creator>
      <dc:date>2019-02-13T21:28:36Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Draw and InfoTemplate</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/help-with-draw-and-infotemplate/m-p/224814#M20912</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK. So console.log some info inside your for loop to see if you are getting the features.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; i&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; i&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;numFeatures&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; i&lt;SPAN class="operator token"&gt;++&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
  &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; graphic &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; featureSet&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;features&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;i&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
  console&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;info&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;graphic&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
  content &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; content &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; graphic&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;attributes&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;FIELD_NAME&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
console&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;info&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;content&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 10:56:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/help-with-draw-and-infotemplate/m-p/224814#M20912</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-11T10:56:57Z</dc:date>
    </item>
  </channel>
</rss>

