<?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: Ordering index of markers displayed from search results in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/ordering-index-of-markers-displayed-from-search/m-p/1138168#M76138</link>
    <description>&lt;P&gt;Hi Undral,&lt;/P&gt;&lt;P&gt;Thank you! I will try that and report back.&lt;/P&gt;&lt;P&gt;Ben&lt;/P&gt;</description>
    <pubDate>Thu, 27 Jan 2022 22:37:18 GMT</pubDate>
    <dc:creator>Fox71</dc:creator>
    <dc:date>2022-01-27T22:37:18Z</dc:date>
    <item>
      <title>Ordering index of markers displayed from search results</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/ordering-index-of-markers-displayed-from-search/m-p/1137543#M76102</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;Using the search, if I get a result that is in the same position as a previous result, the icon of the new result is stacked below the icon of the first results and is not visible. Is there a way to make sure the latest result stacks on the top of previous results?&lt;/P&gt;&lt;P&gt;I also have markers that are displayed with toggle buttons. When some are already toggled on the map, the markers from a search result stack up below the toggled makers. Is there a way to make sure search results always stack on the top of any other markers on the map?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;Ben&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jan 2022 18:54:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/ordering-index-of-markers-displayed-from-search/m-p/1137543#M76102</guid>
      <dc:creator>Fox71</dc:creator>
      <dc:date>2022-01-26T18:54:43Z</dc:date>
    </item>
    <item>
      <title>Re: Ordering index of markers displayed from search results</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/ordering-index-of-markers-displayed-from-search/m-p/1137611#M76105</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/549740"&gt;@Fox71&lt;/a&gt;,&amp;nbsp;do you have a simplified app that reproduces this issue? I cannot figure out how to get overlapping icons from a Search widget results with the out of the box widget:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=widgets-search-3d" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=widgets-search-3d&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jan 2022 20:48:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/ordering-index-of-markers-displayed-from-search/m-p/1137611#M76105</guid>
      <dc:creator>Noah-Sager</dc:creator>
      <dc:date>2022-01-26T20:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: Ordering index of markers displayed from search results</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/ordering-index-of-markers-displayed-from-search/m-p/1137636#M76111</link>
      <description>&lt;P&gt;Noah,&lt;/P&gt;&lt;P&gt;Sorry for the delay, I had to move my test on a new page. You can look at&amp;nbsp;&lt;A href="https://www.usu.edu/test/map/" target="_blank"&gt;https://www.usu.edu/test/map/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;For the test, search for "huntsman hall" (building). Then search for "school of accountancy". That marker has the same coordinates and shows up behind the other one.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jan 2022 21:40:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/ordering-index-of-markers-displayed-from-search/m-p/1137636#M76111</guid>
      <dc:creator>Fox71</dc:creator>
      <dc:date>2022-01-26T21:40:08Z</dc:date>
    </item>
    <item>
      <title>Re: Ordering index of markers displayed from search results</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/ordering-index-of-markers-displayed-from-search/m-p/1137962#M76131</link>
      <description>&lt;P&gt;Hi there,&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I looked your test app. I'd suggest adding your search results to a different layer and order the features in that layer by their ObjectIds in descending order to ensure that the latest feature is always displayed over other features. You can order the features by setting &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#orderBy" target="_self"&gt;orderBy&lt;/A&gt; property on the layer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created this simple codepen app to show how this would work:&amp;nbsp;&lt;A href="https://codepen.io/U_B_U/pen/XWzbJbq" target="_blank"&gt;https://codepen.io/U_B_U/pen/XWzbJbq&lt;/A&gt;&lt;/P&gt;&lt;P&gt;In this app, I am creating a client-side FeatureLayer as shown below. Notice that I am setting the orderBy parameter to order features by their ObjectIds in descending order.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;let searchLayer;
view.whenLayerView(jsonLayer).then(() =&amp;gt;{
  searchLayer = new FeatureLayer({
    source: [], 
    copyright: "USU",
    popupTemplate: jsonLayertemplate,
    fields: jsonLayer.fields,
    renderer: jsonLayerRenderer,
    orderBy: {
      field: "OBJECTID",
      order: "descending"
    },
    objectIdField: "OBJECTID",
    geometryType: "point", 
  });
  map.add(searchLayer);
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then when the search is completed, you add the search result to this layer as shown below.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;searchWidget.on('select-result',function(event){
  layer = event.result.feature.layer;
  const adds = {
    addFeatures: [event.result.feature]
  };
  searchLayer.applyEdits(adds);
});
          &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I noticed that UniqueValueRenderer you are assigning to your GeoJSONLayer is incomplete. You need to make sure all unique values are included in the renderer. Otherwise, orderBy won't work properly. For example, I had to add &lt;STRONG&gt;general&lt;/STRONG&gt; type in the renderer like the following:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{
  value: "general",
  symbol: {
    type: "picture-marker",
    url: 'https://webdev.usu.edu/map2/images/icons/interest.png',
    width: '32px',
    height: '37px'
  }
},
{
  value: "general building",
  symbol: {
    type: "picture-marker",
    url: 'https://webdev.usu.edu/map2/images/icons/interest.png',
    width: '32px',
    height: '37px'
  }
},&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 17:41:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/ordering-index-of-markers-displayed-from-search/m-p/1137962#M76131</guid>
      <dc:creator>UndralBatsukh</dc:creator>
      <dc:date>2022-01-27T17:41:21Z</dc:date>
    </item>
    <item>
      <title>Re: Ordering index of markers displayed from search results</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/ordering-index-of-markers-displayed-from-search/m-p/1138168#M76138</link>
      <description>&lt;P&gt;Hi Undral,&lt;/P&gt;&lt;P&gt;Thank you! I will try that and report back.&lt;/P&gt;&lt;P&gt;Ben&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 22:37:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/ordering-index-of-markers-displayed-from-search/m-p/1138168#M76138</guid>
      <dc:creator>Fox71</dc:creator>
      <dc:date>2022-01-27T22:37:18Z</dc:date>
    </item>
    <item>
      <title>Re: Ordering index of markers displayed from search results</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/ordering-index-of-markers-displayed-from-search/m-p/1138211#M76146</link>
      <description>&lt;P&gt;Undral,&lt;/P&gt;&lt;P&gt;Fist, many thanks to you for taking the time to build that example, really! I am very new to GIS and not an expert in JS, so there is some struggle....&lt;/P&gt;&lt;P&gt;I was able to get it to work. Following your example, I tried to apply the same concept to a bunch of toggle filters. They also don't stack up correctly in the order they are triggered.&lt;BR /&gt;Something I noticed too is that if I click a marker displayed from a search results and if that marker is over a maker triggered from the toggle tools, the opening popup is from that triggered marker. I wonder if the layers needs reorder based on the last user action (search or toggle button).&lt;/P&gt;&lt;P&gt;I rebuilt an example with your update and a couple toggle buttons at &lt;A href="https://codepen.io/Fox71/pen/podJEVL?editors=1000" target="_blank"&gt;https://codepen.io/Fox71/pen/podJEVL?editors=1000&lt;/A&gt;. A good test is to trigger the restroom toggle and search for "HH" in the search.&lt;/P&gt;&lt;P&gt;I actually tried to use the searchLayer for the toggle buttons by adding an expression. While it can take an expression, I don't think the geometryType (point) works since the toggle buttons can return many points. Just my assumption. Let me know what you think if you can.&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;P&gt;Ben&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jan 2022 00:49:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/ordering-index-of-markers-displayed-from-search/m-p/1138211#M76146</guid>
      <dc:creator>Fox71</dc:creator>
      <dc:date>2022-01-28T00:49:36Z</dc:date>
    </item>
    <item>
      <title>Re: Ordering index of markers displayed from search results</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/ordering-index-of-markers-displayed-from-search/m-p/1138456#M76153</link>
      <description>&lt;P&gt;Hi there,&amp;nbsp;&lt;/P&gt;&lt;P&gt;The popup order is decided&amp;nbsp;&lt;SPAN&gt;by response time of layers. This is the behavior at this time. We have an enhancement to show popup results in the render order. I will update you&amp;nbsp;once&amp;nbsp;this is installed. I&amp;nbsp;don't have any info when this will be installed.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jan 2022 18:02:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/ordering-index-of-markers-displayed-from-search/m-p/1138456#M76153</guid>
      <dc:creator>UndralBatsukh</dc:creator>
      <dc:date>2022-01-28T18:02:25Z</dc:date>
    </item>
    <item>
      <title>Re: Ordering index of markers displayed from search results</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/ordering-index-of-markers-displayed-from-search/m-p/1138474#M76154</link>
      <description>&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jan 2022 18:43:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/ordering-index-of-markers-displayed-from-search/m-p/1138474#M76154</guid>
      <dc:creator>Fox71</dc:creator>
      <dc:date>2022-01-28T18:43:34Z</dc:date>
    </item>
    <item>
      <title>Re: Ordering index of markers displayed from search results</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/ordering-index-of-markers-displayed-from-search/m-p/1139174#M76182</link>
      <description>&lt;P&gt;I noticed a warning with the code in the console log: "feature-layer:spatial-reference-not-found"&lt;/P&gt;&lt;P&gt;I assume this is regarding that search layer. Is there anything I need to do to suppress this warning?&lt;/P&gt;&lt;P&gt;As a reference, the sample code is still posted at&amp;nbsp;&lt;A href="https://codepen.io/U_B_U/pen/XWzbJbq?editors=1010" target="_blank" rel="noopener"&gt;https://codepen.io/U_B_U/pen/XWzbJbq?editors=1010&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Ben&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jan 2022 22:56:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/ordering-index-of-markers-displayed-from-search/m-p/1139174#M76182</guid>
      <dc:creator>Fox71</dc:creator>
      <dc:date>2022-01-31T22:56:51Z</dc:date>
    </item>
    <item>
      <title>Re: Ordering index of markers displayed from search results</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/ordering-index-of-markers-displayed-from-search/m-p/1139840#M76221</link>
      <description>&lt;P&gt;I updated the codepen. You need to set the spatialReference of the FeatureLayer when initializing it.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Feb 2022 15:00:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/ordering-index-of-markers-displayed-from-search/m-p/1139840#M76221</guid>
      <dc:creator>UndralBatsukh</dc:creator>
      <dc:date>2022-02-02T15:00:51Z</dc:date>
    </item>
  </channel>
</rss>

