<?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: Using fov with Camera settings in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-fov-with-camera-settings/m-p/1413503#M84394</link>
    <description>&lt;P&gt;Thanks yes this work around worked well Andreas!&lt;/P&gt;</description>
    <pubDate>Mon, 22 Apr 2024 13:57:39 GMT</pubDate>
    <dc:creator>Mark_Wilson</dc:creator>
    <dc:date>2024-04-22T13:57:39Z</dc:date>
    <item>
      <title>Using fov with Camera settings</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-fov-with-camera-settings/m-p/1411443#M84367</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi I am interested in being able to adjust the fov of the camera when moving between viewpoints for a landscape and visual assessment project which requires specific&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;visualisation outputs&amp;nbsp; with the HFoVs at 90 and 53.5. The outputs will be used to create viewpoint photomontages.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have tried with the following script for Viewpoint 2. I can adjust tilt and position but not fov. I understand that&amp;nbsp; goTo does not work with the fov setting but does work with heading and tilt. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Many thanks in advance.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;html lang="en"&amp;gt;
  &amp;lt;head&amp;gt;
    &amp;lt;meta charset="utf-8" /&amp;gt;
    &amp;lt;meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" /&amp;gt;
    &amp;lt;!--
     ArcGIS Maps SDK for JavaScript, https://js.arcgis.com
     --&amp;gt;
&amp;lt;title&amp;gt;SceneView - goTo() | Sample | ArcGIS Maps SDK for JavaScript 4.29&amp;lt;/title&amp;gt;

    &amp;lt;link rel="stylesheet" href="https://js.arcgis.com/4.29/esri/themes/light/main.css" /&amp;gt;
    &amp;lt;script src="https://js.arcgis.com/4.29/"&amp;gt;&amp;lt;/script&amp;gt;

    &amp;lt;style&amp;gt;
      html,
      body,
      #viewDiv {
        padding: 0;
        margin: 0;
        height: 100%;
        width: 100%;
      }

      #optionsDiv {
        position: absolute;
        bottom: 17px;
        width: 100%;
        padding: 20px 0;
        z-index: 1;
        text-align: center;
      }

      button {
        background: white;
        padding: 7px;
        border: 1px solid #005e95;
        font-size: 0.9em;
        margin: 5px;
        color: #005e95;
      }

      button:hover {
        background: #005e95;
        color: white;
        cursor: pointer;
      }
    &amp;lt;/style&amp;gt;

    &amp;lt;script&amp;gt;
      require([ "esri/config","esri/Map", "esri/views/SceneView","esri/WebScene","esri/widgets/Legend"
              ], function(esriConfig, Map, SceneView, WebScene,Legend)  {
        
        esriConfig.apiKey = "***APIKey****";
        
        /**const map = new Map({
          basemap: "dark-gray-vector"
        });
        **/

        /*********************************************************************
         * Create a new WebScene referencing a WebScene ID from ArcGIS Online
         * or an on-premise portal.
         *********************************************************************/
        const scene = new WebScene({
          portalItem: {
            // autocasts as new PortalItem()
            id: "***ID Here***"
          }
        });

        /*********************************************************************
         * Reference the WebScene in a SceneView instance.
         *********************************************************************/
        
        const view = new SceneView({
          map: scene,
          container: "viewDiv"
       
          });

        view.ui
        

        /*****************************************************************
         *
         * Add event listeners to go to a target point using animation options
         *
         *****************************************************************/

        // The target point is a new camera obtained by shifting the current camera to the new VP not resolved this issue as fov not updating

        function shiftCamera(position) {
          const camera = view.camera.clone();
          camera.position.tilt.fov;
          return camera;
        }

        function catchAbortError(error) {
          if (error.name != "AbortError") {
            console.error(error);
          }
        }


        // Define your own function for the easing option
        function customEasing(t) {
          return 1 - Math.abs(Math.sin(-1.7 + t * 4.5 * Math.PI)) * Math.pow(0.5, t * 10);
        }

        document.getElementById("defaultVP1").addEventListener("click", () =&amp;gt; {
          view
            
            .goTo(
              {
                position: {
                 x: -3.484,
                  y: 51.563,
                  z: 130,
                
                  spatialReference: {
                    wkid: 4326
                  }
                },
                heading: 260,
                tilt: 90,
                fov: 90
            
              },
              {
                speedFactor: 0.6,
                easing: "linear"
              }
            )
            .catch(catchAbortError);
        });

        document.getElementById("gotoVP2_90deg").addEventListener("click", () =&amp;gt; {
          view
            .goTo(
              {
                position: {
                  x: -3.489667,
                  y: 51.557520,
                  z: 88.5,
                  spatialReference: {
                    wkid: 4326
                  }
                },
                heading: 280,
                tilt: 92,
                fov:90
              },
              {
                speedFactor: 0.6,
                easing: "linear"
              }
            )
            .catch(catchAbortError);
        });

        document.getElementById("gotoVP2_53.5deg").addEventListener("click", () =&amp;gt; {
          view
            .goTo(
              {
                position: {
                  x: -3.489667,
                  y: 51.557520,
                  z: 88.5,
                  spatialReference: {
                    wkid: 4326
                  }
                },
                heading: 280,
                tilt: 92,
                fov: 53.5
              },
              {
                speedFactor: 0.6,
                easing: "linear"
              }
            )
            .catch(catchAbortError);
        });
        
        });
    &amp;lt;/script&amp;gt;
  &amp;lt;/head&amp;gt;

  &amp;lt;body&amp;gt;
    &amp;lt;div id="optionsDiv"&amp;gt;
      &amp;lt;button id="defaultVP1"&amp;gt;Default to VP1&amp;lt;/button&amp;gt;
      &amp;lt;button id="gotoVP2_90deg"&amp;gt;Go to VP2 (90deg)&amp;lt;/button&amp;gt;
      &amp;lt;button id="gotoVP2_53.5deg"&amp;gt;Go to VP2 (53.5deg)&amp;lt;/button&amp;gt;
      

    &amp;lt;/div&amp;gt;
    &amp;lt;div id="viewDiv"&amp;gt;&amp;lt;/div&amp;gt;
  &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2024 09:00:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-fov-with-camera-settings/m-p/1411443#M84367</guid>
      <dc:creator>Mark_Wilson</dc:creator>
      <dc:date>2024-04-18T09:00:30Z</dc:date>
    </item>
    <item>
      <title>Re: Using fov with Camera settings</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-fov-with-camera-settings/m-p/1412277#M84380</link>
      <description>&lt;P&gt;Suggested workaround: apply new fov before view.goTo()&lt;/P&gt;&lt;P&gt;(ℹ Camera needs to be cloned to apply modifications:&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera&lt;/A&gt;)&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;document.getElementById("gotoVP2_53.5deg").addEventListener("click", () =&amp;gt; {
  
  const cameraCloned = view.camera.clone();
  cameraCloned.fov = 53.3;
  view.camera = cameraCloned;
  
  view.goTo(
  ...&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;this will instantly (without animation) change camera fov to the new desired setting&lt;/LI&gt;&lt;LI&gt;then the camera will transition smoothly to the new viewpoint&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately there is no way atm to smoothly transition between fovs. This is something we consider to improve in a future release.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this workaround acceptable for you?&lt;/P&gt;</description>
      <pubDate>Fri, 19 Apr 2024 14:31:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-fov-with-camera-settings/m-p/1412277#M84380</guid>
      <dc:creator>AndreasUlmer</dc:creator>
      <dc:date>2024-04-19T14:31:11Z</dc:date>
    </item>
    <item>
      <title>Re: Using fov with Camera settings</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-fov-with-camera-settings/m-p/1413377#M84389</link>
      <description>&lt;P&gt;Many thanks for looking at this Andreas and your useful advice. I'll have a go at implementing your suggestion.&lt;/P&gt;&lt;P&gt;Do you know when the use of the fov function with goTo will be available please ?&lt;/P&gt;</description>
      <pubDate>Mon, 22 Apr 2024 08:09:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-fov-with-camera-settings/m-p/1413377#M84389</guid>
      <dc:creator>Mark_Wilson</dc:creator>
      <dc:date>2024-04-22T08:09:33Z</dc:date>
    </item>
    <item>
      <title>Re: Using fov with Camera settings</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-fov-with-camera-settings/m-p/1413500#M84393</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;P&gt;Many thanks for looking at this Andreas and your useful advice. I'll have a go at implementing your suggestion.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;HR /&gt;&lt;P&gt;Great! Let us know if this works for you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;Do you know when the use of the fov function with goTo will be available please ?&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Added issue to our roadmap, but can't give a concrete date when this will be tackled I'm afraid.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Apr 2024 13:52:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-fov-with-camera-settings/m-p/1413500#M84393</guid>
      <dc:creator>AndreasUlmer</dc:creator>
      <dc:date>2024-04-22T13:52:45Z</dc:date>
    </item>
    <item>
      <title>Re: Using fov with Camera settings</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-fov-with-camera-settings/m-p/1413503#M84394</link>
      <description>&lt;P&gt;Thanks yes this work around worked well Andreas!&lt;/P&gt;</description>
      <pubDate>Mon, 22 Apr 2024 13:57:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-fov-with-camera-settings/m-p/1413503#M84394</guid>
      <dc:creator>Mark_Wilson</dc:creator>
      <dc:date>2024-04-22T13:57:39Z</dc:date>
    </item>
  </channel>
</rss>

