<?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: How to format or modify the suggestResults in esri arcGIS in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-format-or-modify-the-suggestresults-in-esri/m-p/1128479#M75663</link>
    <description>&lt;P&gt;You can do this with a custom source where you override the "getSuggestions()" method.&lt;/P&gt;&lt;P&gt;&lt;A href="https://codepen.io/odoe/pen/oNGGZpY?editors=1000" target="_blank"&gt;https://codepen.io/odoe/pen/oNGGZpY?editors=1000&lt;/A&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;return results.data.features.map((feature) =&amp;gt; {
    return {
        key: "name",
        // HTML in return text
        text: `&amp;lt;span class="my-suggest"&amp;gt;&amp;lt;i&amp;gt;${feature.properties.label}&amp;lt;/i&amp;gt;&amp;lt;/span&amp;gt;`,
        sourceIndex: params.sourceIndex
    };
});&lt;/LI-CODE&gt;</description>
    <pubDate>Wed, 22 Dec 2021 21:44:41 GMT</pubDate>
    <dc:creator>ReneRubalcava</dc:creator>
    <dc:date>2021-12-22T21:44:41Z</dc:date>
    <item>
      <title>How to format or modify the suggestResults in esri arcGIS</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-format-or-modify-the-suggestresults-in-esri/m-p/1128272#M75657</link>
      <description>&lt;P&gt;I have a question regarding in esri arcGIS search widget. How to modify the search suggestionResult? this is the current design for the suggestResult&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="altair_0-1640177526991.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/30216i3CCC8F70D862C645/image-size/medium?v=v2&amp;amp;px=400" role="button" title="altair_0-1640177526991.png" alt="altair_0-1640177526991.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;what i mean in modifying the suggestResult is, add html file&lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;const customSearchSource = new SearchSource({&lt;BR /&gt;placeholder: "example: 8 Boulevard du Port",&lt;BR /&gt;// Provide a getSuggestions method&lt;BR /&gt;// to provide suggestions to the Search widget&lt;BR /&gt;getSuggestions: (params) =&amp;gt; {&lt;BR /&gt;// You can request data from a&lt;BR /&gt;// third-party source to find some&lt;BR /&gt;// suggestions with provided suggestTerm&lt;BR /&gt;// the user types in the Search widget&lt;BR /&gt;return esriRequest(url + "search/", {&lt;BR /&gt;query: {&lt;BR /&gt;q: params.suggestTerm.replace(/ /g, "+"),&lt;BR /&gt;limit: 6,&lt;BR /&gt;lat: view.center.latitude,&lt;BR /&gt;lon: view.center.longitude&lt;BR /&gt;},&lt;BR /&gt;responseType: "json"&lt;BR /&gt;}).then((results) =&amp;gt; {&lt;BR /&gt;// Return Suggestion results to display&lt;BR /&gt;// in the Search widget&lt;BR /&gt;return results.data.features.map((feature) =&amp;gt; {&lt;BR /&gt;return {&lt;BR /&gt;key: "name",&lt;BR /&gt;text: feature.properties.label,&lt;BR /&gt;sourceIndex: params.sourceIndex&lt;BR /&gt;};&lt;BR /&gt;});&lt;BR /&gt;});&lt;BR /&gt;},&lt;BR /&gt;// Provide a getResults method to find&lt;BR /&gt;// results from the suggestions&lt;BR /&gt;getResults: (params) =&amp;gt; {&lt;BR /&gt;// If the Search widget passes the current location,&lt;BR /&gt;// you can use this in your own custom source&lt;BR /&gt;const operation = params.location ? "reverse/" : "search/";&lt;BR /&gt;let query = {};&lt;BR /&gt;// You can perform a different query if a location&lt;BR /&gt;// is provided&lt;BR /&gt;if (params.location) {&lt;BR /&gt;query.lat = params.location.latitude;&lt;BR /&gt;query.lon = params.location.longitude;&lt;BR /&gt;} else {&lt;BR /&gt;query.q = params.suggestResult.text.replace(/ /g, "+");&lt;BR /&gt;query.limit = 6;&lt;BR /&gt;}&lt;BR /&gt;return esriRequest(url + operation, {&lt;BR /&gt;query: query,&lt;BR /&gt;responseType: "json"&lt;BR /&gt;}).then((results) =&amp;gt; {&lt;BR /&gt;// Parse the results of your custom search&lt;BR /&gt;const searchResults = results.data.features.map((feature) =&amp;gt; {&lt;BR /&gt;// Create a Graphic the Search widget can display&lt;BR /&gt;const graphic = new Graphic({&lt;BR /&gt;geometry: new Point({&lt;BR /&gt;x: feature.geometry.coordinates[0],&lt;BR /&gt;y: feature.geometry.coordinates[1]&lt;BR /&gt;}),&lt;BR /&gt;attributes: feature.properties&lt;BR /&gt;});&lt;BR /&gt;// Optionally, you can provide an extent for&lt;BR /&gt;// a point result, so the view can zoom to it&lt;BR /&gt;const buffer = geometryEngine.geodesicBuffer(graphic.geometry, 100, "meters");&lt;BR /&gt;// Return a Search Result&lt;BR /&gt;const searchResult = {&lt;BR /&gt;extent: buffer.extent,&lt;BR /&gt;feature: graphic,&lt;BR /&gt;name: feature.properties.label&lt;BR /&gt;};&lt;BR /&gt;return searchResult;&lt;BR /&gt;});&lt;BR /&gt;&lt;BR /&gt;// Return an array of Search Results&lt;BR /&gt;return searchResults;&lt;BR /&gt;});&lt;BR /&gt;}&lt;BR /&gt;});&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=widgets-search-customsource" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=widgets-search-customsource&lt;/A&gt;&lt;/P&gt;&lt;P&gt;resource:&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/widgets-search-customsource/" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/javascript/latest/sample-code/widgets-search-customsource/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Dec 2021 12:52:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-format-or-modify-the-suggestresults-in-esri/m-p/1128272#M75657</guid>
      <dc:creator>altair</dc:creator>
      <dc:date>2021-12-22T12:52:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to format or modify the suggestResults in esri arcGIS</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-format-or-modify-the-suggestresults-in-esri/m-p/1128479#M75663</link>
      <description>&lt;P&gt;You can do this with a custom source where you override the "getSuggestions()" method.&lt;/P&gt;&lt;P&gt;&lt;A href="https://codepen.io/odoe/pen/oNGGZpY?editors=1000" target="_blank"&gt;https://codepen.io/odoe/pen/oNGGZpY?editors=1000&lt;/A&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;return results.data.features.map((feature) =&amp;gt; {
    return {
        key: "name",
        // HTML in return text
        text: `&amp;lt;span class="my-suggest"&amp;gt;&amp;lt;i&amp;gt;${feature.properties.label}&amp;lt;/i&amp;gt;&amp;lt;/span&amp;gt;`,
        sourceIndex: params.sourceIndex
    };
});&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 22 Dec 2021 21:44:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-format-or-modify-the-suggestresults-in-esri/m-p/1128479#M75663</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2021-12-22T21:44:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to format or modify the suggestResults in esri arcGIS</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-format-or-modify-the-suggestresults-in-esri/m-p/1128490#M75664</link>
      <description>&lt;P&gt;How about multiple line? I just want to display in resultSuggestion is not just the label, but the whole detail&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Dec 2021 22:50:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-format-or-modify-the-suggestresults-in-esri/m-p/1128490#M75664</guid>
      <dc:creator>altair</dc:creator>
      <dc:date>2021-12-22T22:50:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to format or modify the suggestResults in esri arcGIS</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-format-or-modify-the-suggestresults-in-esri/m-p/1128497#M75665</link>
      <description>&lt;P&gt;If you need multiple lines, you can add a "&amp;lt;br&amp;gt;" or "&amp;lt;p&amp;gt;" tags.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Dec 2021 22:45:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-format-or-modify-the-suggestresults-in-esri/m-p/1128497#M75665</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2021-12-22T22:45:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to format or modify the suggestResults in esri arcGIS</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-format-or-modify-the-suggestresults-in-esri/m-p/1128503#M75666</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;`&amp;lt;span class="my-suggest"&amp;gt;&amp;lt;i&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;${&lt;/SPAN&gt;&lt;SPAN&gt;feature&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;name&lt;/SPAN&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;/i&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;` +&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;`+ ${feature.details} + ` it works in result suggestion but it affects the functionality when pointing in map&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 22 Dec 2021 23:01:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-format-or-modify-the-suggestresults-in-esri/m-p/1128503#M75666</guid>
      <dc:creator>altair</dc:creator>
      <dc:date>2021-12-22T23:01:53Z</dc:date>
    </item>
  </channel>
</rss>

