<?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 Camera FOV Serialisation in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/camera-fov-serialisation/m-p/378338#M35106</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The &lt;STRONG&gt;toJSON&lt;/STRONG&gt; method on the &lt;STRONG&gt;ersi/Camera&lt;/STRONG&gt; Object does not serialise the &lt;STRONG&gt;fov&lt;/STRONG&gt; property of the camera.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know I can just access the value from the object directly but I did experct the toJSON return to contain this value. Also the correspoding functionality in fromJSON.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this an oversight or by design?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 18 Oct 2020 23:29:11 GMT</pubDate>
    <dc:creator>JethroLeevers</dc:creator>
    <dc:date>2020-10-18T23:29:11Z</dc:date>
    <item>
      <title>Camera FOV Serialisation</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/camera-fov-serialisation/m-p/378338#M35106</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The &lt;STRONG&gt;toJSON&lt;/STRONG&gt; method on the &lt;STRONG&gt;ersi/Camera&lt;/STRONG&gt; Object does not serialise the &lt;STRONG&gt;fov&lt;/STRONG&gt; property of the camera.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know I can just access the value from the object directly but I did experct the toJSON return to contain this value. Also the correspoding functionality in fromJSON.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this an oversight or by design?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 18 Oct 2020 23:29:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/camera-fov-serialisation/m-p/378338#M35106</guid>
      <dc:creator>JethroLeevers</dc:creator>
      <dc:date>2020-10-18T23:29:11Z</dc:date>
    </item>
    <item>
      <title>Re: Camera FOV Serialisation</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/camera-fov-serialisation/m-p/378339#M35107</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jethro, thanks for your feedback, that's a good point, I'm currently discussing with my colleagues about adding the property to the `toJSON` method. Initially there was no platform support for this property, so we didn't serialize it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do you use the serialization in your application? do you want to&amp;nbsp;save webscenes to the&amp;nbsp;ArcGIS platform with different fields of view?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Oct 2020 08:26:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/camera-fov-serialisation/m-p/378339#M35107</guid>
      <dc:creator>RalucaNicola1</dc:creator>
      <dc:date>2020-10-20T08:26:27Z</dc:date>
    </item>
    <item>
      <title>Re: Camera FOV Serialisation</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/camera-fov-serialisation/m-p/378340#M35108</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, i currently serialise the viewpoint and use it in a similar way to the bookmarks in 2D.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It would be nice if the fov animated with the goTo function aswell.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Oct 2020 04:27:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/camera-fov-serialisation/m-p/378340#M35108</guid>
      <dc:creator>JethroLeevers</dc:creator>
      <dc:date>2020-10-21T04:27:00Z</dc:date>
    </item>
    <item>
      <title>Re: Camera FOV Serialisation</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/camera-fov-serialisation/m-p/1409655#M84314</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;visualisations with the HFoVs often 90 and 53.5. I have tried with the following script for Viewpoint 2. I can adjust tilt and position but not fov. I have read through the above thread but not sure how to implement the changes I need to the following script. Many thanks in advance.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="c"&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;</description>
      <pubDate>Mon, 15 Apr 2024 09:22:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/camera-fov-serialisation/m-p/1409655#M84314</guid>
      <dc:creator>Mark_Wilson</dc:creator>
      <dc:date>2024-04-15T09:22:19Z</dc:date>
    </item>
  </channel>
</rss>

