<?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 Troubles with searchWidget.on() in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/troubles-with-searchwidget-on/m-p/1240303#M79620</link>
    <description>&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Hello everyone, I am new to using widgets and when using search with several layers and when performing a specific zoom in each one of these (layers of points and polygons) it happens that the zoom is carried out at the same scale (scale: 500000) without distinguishing&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class=""&gt;&lt;SPAN class=""&gt;neither the point nor the polygon;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN&gt;Due to this, when doing the search for the place (points layer) everything goes well, however when doing the search for the country (polygonal layer) the zoom is performed as if it were the points layer and I cannot see the entire searched country.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;  const searchWidget = new Search({
    view: view,
    allPlaceholder: "Offices",
    includeDefaultSources: false,
    sources: [
      {
        layer: offices,
        searchFields: ["InS_ID"],
        displayField: "InS_ID",
        exactMatch: false,
        outFields: ["*"],
        name: "Offices",
        placeholder: "example: INS#739",
        zoomScale: 500000
      },
      {
        layer: warehouses,
        searchFields: ["InS_ID"],
        displayField: "InS_ID",
        exactMatch: false,
        outFields: ["*"],
        name: "Warehouses",
        placeholder: "example: INS#277",
        zoomScale: 500000
      },      
      {
        layer: Countries,
        searchFields: ["COUNTRYAFF"],
        displayField: "COUNTRYAFF",
        exactMatch: false,
        outFields: ["*"],
        name: "Countries",
        placeholder: "example: Colombia",
        zoomScale: 1800000
      },
      {
        name: "ArcGIS World Geocoding Service",
        placeholder: "example: Nuuk, GRL",
        apiKey: "AAPK0ff1435fcfc94370a5e13e33f38bb0d2bXmccuDrhStP1yGMkJLIiSMsyUnJVE8JxEgkin0sIr1r7WrTL3dUxvR3i6LPjVd7",
        singleLineFieldName: "SingleLine",
        url: "https://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer"
      }
    ]
  });

  searchWidget.on("select-result",
  function(){
      view.goTo({
        scale: zoomScale
      });
  });&lt;/LI-CODE&gt;</description>
    <pubDate>Mon, 12 Dec 2022 19:25:38 GMT</pubDate>
    <dc:creator>PauloCésarBecerraPachas</dc:creator>
    <dc:date>2022-12-12T19:25:38Z</dc:date>
    <item>
      <title>Troubles with searchWidget.on()</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/troubles-with-searchwidget-on/m-p/1240303#M79620</link>
      <description>&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Hello everyone, I am new to using widgets and when using search with several layers and when performing a specific zoom in each one of these (layers of points and polygons) it happens that the zoom is carried out at the same scale (scale: 500000) without distinguishing&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class=""&gt;&lt;SPAN class=""&gt;neither the point nor the polygon;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN&gt;Due to this, when doing the search for the place (points layer) everything goes well, however when doing the search for the country (polygonal layer) the zoom is performed as if it were the points layer and I cannot see the entire searched country.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;  const searchWidget = new Search({
    view: view,
    allPlaceholder: "Offices",
    includeDefaultSources: false,
    sources: [
      {
        layer: offices,
        searchFields: ["InS_ID"],
        displayField: "InS_ID",
        exactMatch: false,
        outFields: ["*"],
        name: "Offices",
        placeholder: "example: INS#739",
        zoomScale: 500000
      },
      {
        layer: warehouses,
        searchFields: ["InS_ID"],
        displayField: "InS_ID",
        exactMatch: false,
        outFields: ["*"],
        name: "Warehouses",
        placeholder: "example: INS#277",
        zoomScale: 500000
      },      
      {
        layer: Countries,
        searchFields: ["COUNTRYAFF"],
        displayField: "COUNTRYAFF",
        exactMatch: false,
        outFields: ["*"],
        name: "Countries",
        placeholder: "example: Colombia",
        zoomScale: 1800000
      },
      {
        name: "ArcGIS World Geocoding Service",
        placeholder: "example: Nuuk, GRL",
        apiKey: "AAPK0ff1435fcfc94370a5e13e33f38bb0d2bXmccuDrhStP1yGMkJLIiSMsyUnJVE8JxEgkin0sIr1r7WrTL3dUxvR3i6LPjVd7",
        singleLineFieldName: "SingleLine",
        url: "https://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer"
      }
    ]
  });

  searchWidget.on("select-result",
  function(){
      view.goTo({
        scale: zoomScale
      });
  });&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 12 Dec 2022 19:25:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/troubles-with-searchwidget-on/m-p/1240303#M79620</guid>
      <dc:creator>PauloCésarBecerraPachas</dc:creator>
      <dc:date>2022-12-12T19:25:38Z</dc:date>
    </item>
  </channel>
</rss>

