<?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 Search with goToOverride - which variables are available to override? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-with-gotooverride-which-variables-are/m-p/1235791#M79470</link>
    <description>&lt;P&gt;I'm stuck for a while on how to override the default go-to-option in the search widget.&lt;/P&gt;&lt;P&gt;I have to override the default go-to-option, as it results in polygons stuck to the frame of the screen. I managed to write a custom function, which creates a small buffer around the default-extent, see line 209 to 236in my sample. This would work, except that this way, first the default go-to is invoked and only after that has finished, my function is invoked.&lt;/P&gt;&lt;P&gt;then I tried to pass my function as callback and failed (probably because I'm not experienced).&lt;/P&gt;&lt;P&gt;Finally I discovered the goToOverride-property&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#goToOverride" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#goToOverride&lt;/A&gt;. I tried to integrate it as step one statically, see line 168 to 188, but the only paramter it accepts is "options.target.scale = 1500000;" (or any other number for scale). it doesn't accept neither center nor extent - it doesnot throw an error, it just doesnt do anything.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My aim is to combine my soon to be function starting at line 209 and the goToOverride-Option in a second step. For now, I'd be happy to just figure out, which variables I can pass to the goToOverride-Option. Could you help me with the latter?&lt;/P&gt;&lt;P&gt;minimal sample:&amp;nbsp;&lt;A href="https://codepen.io/nwp_nadja_bernhard/pen/ZERjWmw" target="_blank"&gt;https://codepen.io/nwp_nadja_bernhard/pen/ZERjWmw&lt;/A&gt;&lt;BR /&gt;search terms: Naturpark Gantrisch (or just: parc)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and a basic question to goToOverride: why do I need to set the scale at options.target.scale as in this example: &lt;A href="https://community.esri.com/t5/arcgis-api-for-javascript-questions/detect-location-by-clicking-a-button/m-p/358862" target="_blank"&gt;https://community.esri.com/t5/arcgis-api-for-javascript-questions/detect-location-by-clicking-a-button/m-p/358862&amp;nbsp;&lt;/A&gt;&amp;gt;&amp;gt; solution at line 113. Why not use "target" instead of "options" as input, and change the parameters there (I tried it, didn't work):&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#GoToTarget2D" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#GoToTarget2D&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 29 Nov 2022 08:55:55 GMT</pubDate>
    <dc:creator>nadja</dc:creator>
    <dc:date>2022-11-29T08:55:55Z</dc:date>
    <item>
      <title>Search with goToOverride - which variables are available to override?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-with-gotooverride-which-variables-are/m-p/1235791#M79470</link>
      <description>&lt;P&gt;I'm stuck for a while on how to override the default go-to-option in the search widget.&lt;/P&gt;&lt;P&gt;I have to override the default go-to-option, as it results in polygons stuck to the frame of the screen. I managed to write a custom function, which creates a small buffer around the default-extent, see line 209 to 236in my sample. This would work, except that this way, first the default go-to is invoked and only after that has finished, my function is invoked.&lt;/P&gt;&lt;P&gt;then I tried to pass my function as callback and failed (probably because I'm not experienced).&lt;/P&gt;&lt;P&gt;Finally I discovered the goToOverride-property&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#goToOverride" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#goToOverride&lt;/A&gt;. I tried to integrate it as step one statically, see line 168 to 188, but the only paramter it accepts is "options.target.scale = 1500000;" (or any other number for scale). it doesn't accept neither center nor extent - it doesnot throw an error, it just doesnt do anything.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My aim is to combine my soon to be function starting at line 209 and the goToOverride-Option in a second step. For now, I'd be happy to just figure out, which variables I can pass to the goToOverride-Option. Could you help me with the latter?&lt;/P&gt;&lt;P&gt;minimal sample:&amp;nbsp;&lt;A href="https://codepen.io/nwp_nadja_bernhard/pen/ZERjWmw" target="_blank"&gt;https://codepen.io/nwp_nadja_bernhard/pen/ZERjWmw&lt;/A&gt;&lt;BR /&gt;search terms: Naturpark Gantrisch (or just: parc)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and a basic question to goToOverride: why do I need to set the scale at options.target.scale as in this example: &lt;A href="https://community.esri.com/t5/arcgis-api-for-javascript-questions/detect-location-by-clicking-a-button/m-p/358862" target="_blank"&gt;https://community.esri.com/t5/arcgis-api-for-javascript-questions/detect-location-by-clicking-a-button/m-p/358862&amp;nbsp;&lt;/A&gt;&amp;gt;&amp;gt; solution at line 113. Why not use "target" instead of "options" as input, and change the parameters there (I tried it, didn't work):&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#GoToTarget2D" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#GoToTarget2D&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2022 08:55:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-with-gotooverride-which-variables-are/m-p/1235791#M79470</guid>
      <dc:creator>nadja</dc:creator>
      <dc:date>2022-11-29T08:55:55Z</dc:date>
    </item>
    <item>
      <title>Re: Search with goToOverride - which variables are available to override?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-with-gotooverride-which-variables-are/m-p/1315978#M81872</link>
      <description>&lt;P&gt;I'm using the search widget to search for parcel polygons.&amp;nbsp; The search widget works great but I wanted it to zoom out slightly.&amp;nbsp; I found the goToOverride function in the documentation but didn't see a good example of how to use it.&amp;nbsp; Thanks to this post, I was able to get this working, see my example below.&amp;nbsp; I was able to reference the selected graphic and expand its extent.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;const searchWidget = new Search({&lt;BR /&gt;view: view,&lt;BR /&gt;popupEnabled: false,&lt;BR /&gt;//&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#goToOverride" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#goToOverride&lt;/A&gt;&lt;BR /&gt;goToOverride: function (view, options) {&lt;BR /&gt;//console.info(options);&lt;BR /&gt;options.target.target.geometry.extent.expand(2.0);&lt;BR /&gt;return view.goTo(options.target);&lt;BR /&gt;},&lt;BR /&gt;sources: [&lt;BR /&gt;{&lt;/P&gt;</description>
      <pubDate>Mon, 07 Aug 2023 11:02:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-with-gotooverride-which-variables-are/m-p/1315978#M81872</guid>
      <dc:creator>AnnaWilliams</dc:creator>
      <dc:date>2023-08-07T11:02:53Z</dc:date>
    </item>
  </channel>
</rss>

