<?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: Render Map on a Zip code in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/render-map-on-a-zip-code/m-p/196751#M18232</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;1.&amp;nbsp; You can use &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/en/javascript/jsapi/query-amd.html" rel="nofollow noopener noreferrer" target="_blank"&gt;Query&lt;/A&gt;&lt;SPAN&gt; and the &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/en/javascript/jsapi/featurelayer-amd.html" rel="nofollow noopener noreferrer" target="_blank"&gt;FeatureLayer&lt;/A&gt;&lt;SPAN&gt; selectFeatures method.&amp;nbsp; Ex:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var query = new Query();
query.where = "ZipCode = '" + dom.byId("btnSubmit");&amp;nbsp;&amp;nbsp;&amp;nbsp; 
query.outFields = ['ZipCode'];
query.returnGeometry = true;
query.outSpatialReference = map.spatialReference;
zipCodeLayer.on('selection-complete', zoomCountry);
zipCodeLayer.selectFeatures(query, FeatureLayer.SELECTION_NEW, zoomToZip);&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You will also want to render the selected feature.&amp;nbsp; Ex:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var selectSymbol = new SimpleFillSymbol(SimpleFillSymbol.STYLE_SOLID, new&amp;nbsp; SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color([255,200,0]), 2), new Color([255,255,0,0.40]));

var zipCodeLayer = new FeatureLayer("http://server/arcgis/rest/services/ZipCodes/MapServer/0", {
&amp;nbsp; mode: FeatureLayer.MODE_SELECTION,
&amp;nbsp; outFields: ["*"]
});

zipCodeLayer.setSelectionSymbol(selectSymbol);&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 09:50:10 GMT</pubDate>
    <dc:creator>JakeSkinner</dc:creator>
    <dc:date>2021-12-11T09:50:10Z</dc:date>
    <item>
      <title>Render Map on a Zip code</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/render-map-on-a-zip-code/m-p/196750#M18231</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am using 3.8 Arc GIS JS api, and also new to this map world.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1. I have to render the map based on the zip code. If I enter any US zip code in a text box and hit submit button, then the map should render that location. So is there any method in Map which can help us on this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2. When setting data in InfoTemplate then I have to show some text based on the condition, but looks like it is not able to store the fields value in javascript variable. Please suggest something on this. Below is the code I am trying.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;var valCrewOnSite = ${CrewOnSite};&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; if( valCrewOnSite == "Yes") {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; crewOnSiteStatus = "&amp;lt;tr&amp;gt;&amp;lt;td align=left width=95&amp;gt;Status:&amp;lt;/td&amp;gt;&amp;lt;td align=right&amp;gt;Restoration in progress&amp;lt;/td&amp;gt;&amp;lt;tr&amp;gt;";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Appreciating any help!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Vikas&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jan 2014 09:48:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/render-map-on-a-zip-code/m-p/196750#M18231</guid>
      <dc:creator>VikasNeekhra</dc:creator>
      <dc:date>2014-01-09T09:48:42Z</dc:date>
    </item>
    <item>
      <title>Re: Render Map on a Zip code</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/render-map-on-a-zip-code/m-p/196751#M18232</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;1.&amp;nbsp; You can use &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/en/javascript/jsapi/query-amd.html" rel="nofollow noopener noreferrer" target="_blank"&gt;Query&lt;/A&gt;&lt;SPAN&gt; and the &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/en/javascript/jsapi/featurelayer-amd.html" rel="nofollow noopener noreferrer" target="_blank"&gt;FeatureLayer&lt;/A&gt;&lt;SPAN&gt; selectFeatures method.&amp;nbsp; Ex:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var query = new Query();
query.where = "ZipCode = '" + dom.byId("btnSubmit");&amp;nbsp;&amp;nbsp;&amp;nbsp; 
query.outFields = ['ZipCode'];
query.returnGeometry = true;
query.outSpatialReference = map.spatialReference;
zipCodeLayer.on('selection-complete', zoomCountry);
zipCodeLayer.selectFeatures(query, FeatureLayer.SELECTION_NEW, zoomToZip);&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You will also want to render the selected feature.&amp;nbsp; Ex:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var selectSymbol = new SimpleFillSymbol(SimpleFillSymbol.STYLE_SOLID, new&amp;nbsp; SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color([255,200,0]), 2), new Color([255,255,0,0.40]));

var zipCodeLayer = new FeatureLayer("http://server/arcgis/rest/services/ZipCodes/MapServer/0", {
&amp;nbsp; mode: FeatureLayer.MODE_SELECTION,
&amp;nbsp; outFields: ["*"]
});

zipCodeLayer.setSelectionSymbol(selectSymbol);&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:50:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/render-map-on-a-zip-code/m-p/196751#M18232</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2021-12-11T09:50:10Z</dc:date>
    </item>
    <item>
      <title>Re: Render Map on a Zip code</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/render-map-on-a-zip-code/m-p/196752#M18233</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What would be the best way to re-render a subset or selection of features that are already displayed on the map? Right now, I have something similar to this example, where the whole layer is rendered:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://developers.arcgis.com/en/javascript/jssamples/renderer_function.html"&gt;https://developers.arcgis.com/en/javascript/jssamples/renderer_function.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, he data fields used to set the renderer are dynamic, so I have a function that runs every few seconds to re-render the entire layer. It would be ideal to only render the features that actually changed values. Any suggestions?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jan 2014 16:11:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/render-map-on-a-zip-code/m-p/196752#M18233</guid>
      <dc:creator>JosephSaltenberger</dc:creator>
      <dc:date>2014-01-09T16:11:18Z</dc:date>
    </item>
    <item>
      <title>Re: Render Map on a Zip code</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/render-map-on-a-zip-code/m-p/196753#M18234</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Jake for looking into it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I just have to move the map based on the zip code and dont have to highlight or show symbol on that. If we can set some extent on Map, but how find the extend for a particular zip code?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;dojo.connect(dojo.byId("btnSubmit"),"onclick", function() {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; var queryTask = new esri.tasks.QueryTask(&amp;lt;SERVICE_URL&amp;gt;);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; var query = new Query();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; query.where = "ZipCode = '" + dojo.byId("txtZipCode").value;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; query.outFields = ['ZipCode'];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; query.returnGeometry = true;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; query.outSpatialReference = map.spatialReference;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; querytask.execute(query)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; });&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jan 2014 09:57:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/render-map-on-a-zip-code/m-p/196753#M18234</guid>
      <dc:creator>VikasNeekhra</dc:creator>
      <dc:date>2014-01-10T09:57:06Z</dc:date>
    </item>
    <item>
      <title>Re: Render Map on a Zip code</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/render-map-on-a-zip-code/m-p/196754#M18235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;A href="https://developers.arcgis.com/en/javascript/jsapi/querytask-amd.html#execute"&gt;Executing a QueryTask&lt;/A&gt;&lt;SPAN&gt; will return a FeatureSet. You can use "&lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/en/javascript/jsapi/esri.graphicsutils-amd.html#graphicsextent"&gt;graphicsUtils&lt;/A&gt;&lt;A href="https://developers.arcgis.com/en/javascript/jsapi/esri.graphicsutils-amd.html#graphicsextent"&gt;.graphicsExtent&lt;/A&gt;&lt;SPAN&gt;" to get the extent of the FeatureSet&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jan 2014 12:02:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/render-map-on-a-zip-code/m-p/196754#M18235</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2014-01-10T12:02:15Z</dc:date>
    </item>
    <item>
      <title>Re: Render Map on a Zip code</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/render-map-on-a-zip-code/m-p/196755#M18236</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The Query Task has a &lt;/SPAN&gt;&lt;STRONG&gt;complete&lt;/STRONG&gt;&lt;SPAN&gt; event, which returns a featureSet.&amp;nbsp; You can set the extent to the featureSet using the &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/en/javascript/jsapi/namespace_esri-amd.html" rel="nofollow noopener noreferrer" target="_blank"&gt;graphicsUtils.graphicsExtent&lt;/A&gt;&lt;SPAN&gt; method:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;queryTask.on("complete", function(featureSet){
&amp;nbsp;&amp;nbsp;&amp;nbsp; var featureExtent = graphicsUtils.graphicsExtent(featureSet.features);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; map.setExtent(featureExtent);
}&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:50:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/render-map-on-a-zip-code/m-p/196755#M18236</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2021-12-11T09:50:13Z</dc:date>
    </item>
    <item>
      <title>Re: Render Map on a Zip code</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/render-map-on-a-zip-code/m-p/196756#M18237</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What Ken said &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jan 2014 12:10:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/render-map-on-a-zip-code/m-p/196756#M18237</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2014-01-10T12:10:42Z</dc:date>
    </item>
    <item>
      <title>Re: Render Map on a Zip code</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/render-map-on-a-zip-code/m-p/196757#M18238</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;maybe i'm missing something, but wouldn't it be a lot easier to use our World &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/en/javascript/jssamples/locator_address.html"&gt;Geocoding&lt;/A&gt;&lt;SPAN&gt; Service for this?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jan 2014 20:39:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/render-map-on-a-zip-code/m-p/196757#M18238</guid>
      <dc:creator>JohnGravois</dc:creator>
      <dc:date>2014-01-10T20:39:26Z</dc:date>
    </item>
  </channel>
</rss>

