<?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 setSelectionSymbol doesn't work first time... in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setselectionsymbol-doesn-t-work-first-time/m-p/712557#M66222</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Does anyone know why setSelectionSymbol doesn't work after the first select, but any subsequent select will result in the selection symbol working?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ken&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 23 Jul 2013 23:00:07 GMT</pubDate>
    <dc:creator>KenMorefield</dc:creator>
    <dc:date>2013-07-23T23:00:07Z</dc:date>
    <item>
      <title>setSelectionSymbol doesn't work first time...</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setselectionsymbol-doesn-t-work-first-time/m-p/712557#M66222</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Does anyone know why setSelectionSymbol doesn't work after the first select, but any subsequent select will result in the selection symbol working?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ken&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jul 2013 23:00:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setselectionsymbol-doesn-t-work-first-time/m-p/712557#M66222</guid>
      <dc:creator>KenMorefield</dc:creator>
      <dc:date>2013-07-23T23:00:07Z</dc:date>
    </item>
    <item>
      <title>Re: setSelectionSymbol doesn't work first time...</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setselectionsymbol-doesn-t-work-first-time/m-p/712558#M66223</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Nobody else has seen this problem?&amp;nbsp; Basically, I have two dijit.form.filteringselects that when the first select is chosen, it "filters" the second select.&amp;nbsp; Once the second select is chosen, the value is passed to a querytask which selects a feature and then the map is zoomed to that resulting feature.&amp;nbsp; The zooming works fine, but the selected feature does not show up (setSelectionSymbol) does not get set.&amp;nbsp; But if you go up and select a new value (kicking off the whole process again), then the setSelectionSymbol works... Any ideas?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Ken&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jul 2013 17:18:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setselectionsymbol-doesn-t-work-first-time/m-p/712558#M66223</guid>
      <dc:creator>KenMorefield</dc:creator>
      <dc:date>2013-07-25T17:18:41Z</dc:date>
    </item>
    <item>
      <title>Re: setSelectionSymbol doesn't work first time...</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setselectionsymbol-doesn-t-work-first-time/m-p/712559#M66224</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ken,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;While this certainly wont help you, I am having a similar problem.&amp;nbsp; Selection symbols for feature layers dont seem to work at all.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Perhaps there is a real problem here?&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Greg&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var eqOutFields = [equipmentLayerIdFieldName, equipmentLayerTitleFieldName];

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // prepare equipment layer
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var equipmentLayer = new esri.layers.FeatureLayer( gisMapControl.getEquipmentLayerUrl(), {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; id: "equipmentLayer",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; index: 20,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; infoTemplate: eqTemplate,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mode: esri.layers.FeatureLayer.MODE_ONDEMAND, // MODE_SNAPSHOT
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; opacity: 1.0,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outFields: eqOutFields
&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; // add equipment layer
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.addLayer(equipmentLayer);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; me.setEquipmentLayer(equipmentLayer);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log('Equipment layer added...');

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // set equipment layer selection symbol
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var eqSelectionSymbol = new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_CIRCLE, 12, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([0,0,0]), 1.0), new dojo.Color([0,0,0,0.35]));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; equipmentLayer.setSelectionSymbol(eqSelectionSymbol);&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 06:31:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setselectionsymbol-doesn-t-work-first-time/m-p/712559#M66224</guid>
      <dc:creator>GregKnight</dc:creator>
      <dc:date>2021-12-12T06:31:49Z</dc:date>
    </item>
    <item>
      <title>Re: setSelectionSymbol doesn't work first time...</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setselectionsymbol-doesn-t-work-first-time/m-p/712560#M66225</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ken and Greg&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am successfully using selection symbols with FeatureLayers and Pop windows.&amp;nbsp; At some point early in developing the code I would see weird issues come up but it seemed to me like it was attributed to my code and not the functionality of FeatureLayer selection symbol.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Below are a couple of functions that I use to return the selection symbol based on two "hypothetical" scenerios&amp;nbsp; .. selection and reselection (cyan and yellow):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp; this.GetFillSelectionSymbol = function (selectionType) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; selectionType = selectionType ? selectionType : "selection";
&amp;nbsp;&amp;nbsp;&amp;nbsp; var selectionColor = null;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (selectionType === "selection") {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //cyan
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; selectionColor = new dojo.Color([0, 255, 255, 1.0]);
&amp;nbsp;&amp;nbsp;&amp;nbsp; } else {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //yellow
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; selectionColor = new dojo.Color([255, 255, 0, 1.0]);
&amp;nbsp;&amp;nbsp;&amp;nbsp; }

&amp;nbsp;&amp;nbsp;&amp;nbsp; var fillSymbol = new esri.symbol.SimpleFillSymbol();
&amp;nbsp;&amp;nbsp;&amp;nbsp; fillSymbol.setStyle(esri.symbol.SimpleFillSymbol.STYLE_NULL);
&amp;nbsp;&amp;nbsp;&amp;nbsp; fillSymbol.setColor(selectionColor);
&amp;nbsp;&amp;nbsp;&amp;nbsp; fillSymbol.setOutline(new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, selectionColor, 4));
&amp;nbsp;&amp;nbsp;&amp;nbsp; return fillSymbol;
&amp;nbsp; }

&amp;nbsp; this.GetMarkerSelectionSymbol = function (selectionType, markerSize) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; markerSize = markerSize ? markerSize : 25;
&amp;nbsp;&amp;nbsp;&amp;nbsp; selectionType = selectionType ? selectionType : "selection";
&amp;nbsp;&amp;nbsp;&amp;nbsp; var markerSymbol = new esri.symbol.SimpleMarkerSymbol();
&amp;nbsp;&amp;nbsp;&amp;nbsp; markerSymbol.setStyle = esri.symbol.SimpleMarkerSymbol.STYLE_CIRCLE;
&amp;nbsp;&amp;nbsp;&amp;nbsp; markerSymbol.setSize(markerSize);
&amp;nbsp;&amp;nbsp;&amp;nbsp; markerSymbol.setOutline(null);

&amp;nbsp;&amp;nbsp;&amp;nbsp; if (selectionType === "selection") {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; markerSymbol.setColor(new dojo.Color([0, 255, 255, 0.5]));
&amp;nbsp;&amp;nbsp;&amp;nbsp; } else {

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; markerSymbol.setColor(new dojo.Color([255, 255, 0, 0.5]));
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; return markerSymbol;
&amp;nbsp; }

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 06:31:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setselectionsymbol-doesn-t-work-first-time/m-p/712560#M66225</guid>
      <dc:creator>DianaBenedict</dc:creator>
      <dc:date>2021-12-12T06:31:52Z</dc:date>
    </item>
    <item>
      <title>Re: setSelectionSymbol doesn't work first time...</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setselectionsymbol-doesn-t-work-first-time/m-p/712561#M66226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Diana.&amp;nbsp; I will give your code a look-see and hopefully Ill have better luck tomorrow.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Aug 2013 22:54:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setselectionsymbol-doesn-t-work-first-time/m-p/712561#M66226</guid>
      <dc:creator>GregKnight</dc:creator>
      <dc:date>2013-08-01T22:54:29Z</dc:date>
    </item>
    <item>
      <title>Re: setSelectionSymbol doesn't work first time...</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setselectionsymbol-doesn-t-work-first-time/m-p/712562#M66227</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This thread has been inactive for a while, but I'm experiencing the exact same problem.&amp;nbsp; setSelectionSymbol doesn't work for the first query, but then works fine in all subsequent queries.&amp;nbsp; I've experimented with different initial view extents, and there seems to be correlation, but I can't figure it out.&amp;nbsp; That is, if my initial extents is large area, like the entire state, a single, selected parcel will not show the symbol.&amp;nbsp; However, if I set my initial extents to be already zoomed into a parcel then query, it will render.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have read that rendering of features in feature layers have something to do with the scale level, but I can't be sure.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anybody have experience in resolving this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Steve&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Mar 2014 21:35:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setselectionsymbol-doesn-t-work-first-time/m-p/712562#M66227</guid>
      <dc:creator>MaudGillespie</dc:creator>
      <dc:date>2014-03-05T21:35:58Z</dc:date>
    </item>
    <item>
      <title>Re: setSelectionSymbol doesn't work first time...</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setselectionsymbol-doesn-t-work-first-time/m-p/712563#M66228</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The issue had a couple items associated with it.&amp;nbsp;&amp;nbsp; First off, the layer I was selecting features on was not visible at the scale of the map I was starting with, and I determined that if I zoomed into a scale that turned my layer on, it worked.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, a larger issue it uncovered is related to the generalization of features.&amp;nbsp; The shape of the selection varied based on the scale of the map, that is, if I was zoomed in closely when I started the selection process, the feature shape was more accurate.&amp;nbsp; If I started the operation zoomed out a bit further, the selection shape was generalized.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm working around this by first querying for the feature using a QueryTask, then zooming to the results geometry.&amp;nbsp; Then I perform a second operation to select the feature.&amp;nbsp; It works every time now.&amp;nbsp; Not sure this is a great solution but it works.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Steve&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Mar 2014 01:17:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setselectionsymbol-doesn-t-work-first-time/m-p/712563#M66228</guid>
      <dc:creator>SteveLettau</dc:creator>
      <dc:date>2014-03-07T01:17:38Z</dc:date>
    </item>
  </channel>
</rss>

